{"type": "func", "start": 5372616032, "end": 5372616686, "name": "GJSmartTemplate::smartObjectToType", "pseudocode": "// \n// GJSmartTemplate::smartObjectToType from 0x1403b9d60 to 0x1403b9fee (654 bytes)\n// \n// 13 xrefs:\n// > EditorUI::addObjectsToSmartTemplate @ 0x1401b5a0c\n// > EditorUI::createSmartObjectsFromTemplate @ 0x1401b69ae\n// > EditorUI::createSmartObjectsFromTemplate @ 0x1401b6b26\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba286\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba296\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2a5\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2b4\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2c3\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2d2\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2e0\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2ef\n// > GJSmartTemplate::keyFromNeighbors @ 0x1403ba30b\n// > <???> @ 0x140923d98\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:31:26 +0000\n// \n\n__int64 __fastcall GJSmartTemplate::smartObjectToType(_DWORD *a1, float *a2)\n{\n  unsigned int v4; // ebx\n  int v5; // ecx\n  int v6; // ecx\n  float v7; // xmm0_4\n  bool v8; // dl\n\n  v4 = 48;\n  if ( a1 )\n  {\n    v5 = a1[259] - 2895;\n    if ( v5 )\n    {\n      v6 = v5 - 1;\n      if ( v6 )\n      {\n        if ( v6 == 1 )\n        {\n          v7 = fabs(COERCE_FLOAT(COERCE_UNSIGNED_INT64((*(double (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 360LL))(a1))));\n          v8 = v7 == 90.0 || v7 == 270.0;\n          switch ( a1[273] )\n          {\n            case 0:\n            case 7:\n              v4 = 54;\n              if ( v8 )\n                v4 = 69;\n              break;\n            case 1:\n            case 5:\n              v4 = 8 * v8 + 65;\n              break;\n            case 2:\n            case 4:\n              v4 = 56;\n              if ( v8 )\n                v4 = 71;\n              break;\n            case 3:\n            case 6:\n              v4 = 8 * v8 + 67;\n              break;\n            default:\n              break;\n          }\n        }\n      }\n      else\n      {\n        switch ( a1[273] )\n        {\n          case 0:\n          case 7:\n            v4 = 50;\n            break;\n          case 1:\n          case 5:\n            v4 = 52;\n            break;\n          case 2:\n          case 4:\n            v4 = 51;\n            break;\n          case 3:\n          case 6:\n            v4 = 53;\n            break;\n          default:\n            break;\n        }\n      }\n    }\n    else\n    {\n      v4 = 49;\n    }\n  }\n  if ( !cocos2d::CCPoint::equals((cocos2d::CCPoint *)a2, (const struct cocos2d::CCPoint *)&unk_14090AD10) )\n  {\n    switch ( v4 )\n    {\n      case '6':\n      case 'A':\n        if ( *a2 > *(float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 200LL))(a1) )\n        {\n          if ( v4 == 54 )\n          {\n            v4 = 55;\n          }\n          else if ( v4 == 65 )\n          {\n            v4 = 66;\n          }\n        }\n        break;\n      case '8':\n      case 'C':\n        if ( *(float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 200LL))(a1) > *a2 )\n        {\n          if ( v4 == 56 )\n          {\n            v4 = 57;\n          }\n          else if ( v4 == 67 )\n          {\n            v4 = 68;\n          }\n        }\n        break;\n      case 'E':\n      case 'G':\n        if ( *(float *)((*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 200LL))(a1) + 4) > a2[1] )\n        {\n          if ( v4 == 69 )\n          {\n            v4 = 70;\n          }\n          else if ( v4 == 71 )\n          {\n            v4 = 72;\n          }\n        }\n        break;\n      case 'I':\n      case 'K':\n        if ( a2[1] > *(float *)((*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 200LL))(a1) + 4) )\n        {\n          if ( v4 == 73 )\n          {\n            v4 = 74;\n          }\n          else if ( v4 == 75 )\n          {\n            v4 = 76;\n          }\n        }\n        break;\n      default:\n        return v4;\n    }\n  }\n  return v4;\n}", "assembly": "; \n; GJSmartTemplate::smartObjectToType from 0x1403b9d60 to 0x1403b9fee (654 bytes)\n; \n; 13 xrefs:\n; > EditorUI::addObjectsToSmartTemplate @ 0x1401b5a0c\n; > EditorUI::createSmartObjectsFromTemplate @ 0x1401b69ae\n; > EditorUI::createSmartObjectsFromTemplate @ 0x1401b6b26\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba286\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba296\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2a5\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2b4\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2c3\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2d2\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2e0\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba2ef\n; > GJSmartTemplate::keyFromNeighbors @ 0x1403ba30b\n; > <???> @ 0x140923d98\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:31:26 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1403b9d60\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1403b9d65\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1403b9d6a\npush    rdi                                                            ; +0xf, 0x1403b9d6f\nsub     rsp, 20h                                                       ; +0x10, 0x1403b9d70\nlea     rbp, cs:140000000h                                             ; +0x14, 0x1403b9d74\nmov     rsi, rdx                                                       ; +0x1b, 0x1403b9d7b\nmov     rdi, rcx                                                       ; +0x1e, 0x1403b9d7e\nmov     ebx, 30h ; '0'                                                 ; +0x21, 0x1403b9d81\ntest    rcx, rcx                                                       ; +0x26, 0x1403b9d86\njz      def_1403B9DF8; jumptable 00000001403B9DF8 default case         ; +0x29, 0x1403b9d89\nmov     ecx, [rcx+40Ch]                                                ; +0x2f, 0x1403b9d8f\nsub     ecx, 0B4Fh                                                     ; +0x35, 0x1403b9d95\njz      loc_1403B9E68                                                  ; +0x3b, 0x1403b9d9b\nsub     ecx, 1                                                         ; +0x41, 0x1403b9da1\njz      loc_1403B9E34                                                  ; +0x44, 0x1403b9da4\ncmp     ecx, 1                                                         ; +0x4a, 0x1403b9daa\njnz     def_1403B9DF8; jumptable 00000001403B9DF8 default case         ; +0x4d, 0x1403b9dad\nmov     rax, [rdi]                                                     ; +0x53, 0x1403b9db3\nmov     rcx, rdi                                                       ; +0x56, 0x1403b9db6\ncall    qword ptr [rax+168h]                                           ; +0x59, 0x1403b9db9\nandps   xmm0, cs:xmmword_140836C90                                     ; +0x5f, 0x1403b9dbf\nucomiss xmm0, cs:flt_140835780                                         ; +0x66, 0x1403b9dc6\njp      short loc_1403B9DD1                                            ; +0x6d, 0x1403b9dcd\njz      short loc_1403B9DDC                                            ; +0x6f, 0x1403b9dcf\nucomiss xmm0, cs:dword_14083597C                                       ; +0x71, 0x1403b9dd1\njp      short loc_1403B9DE0                                            ; +0x78, 0x1403b9dd8\njnz     short loc_1403B9DE0                                            ; +0x7a, 0x1403b9dda\nmov     dl, 1                                                          ; +0x7c, 0x1403b9ddc\njmp     short loc_1403B9DE2                                            ; +0x7e, 0x1403b9dde\nxor     dl, dl                                                         ; +0x80, 0x1403b9de0\nmovsxd  rax, dword ptr [rdi+444h]                                      ; +0x82, 0x1403b9de2\ncmp     eax, 7; switch 8 cases                                         ; +0x89, 0x1403b9de9\nja      short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0x8c, 0x1403b9dec\nmov     ecx, ss:(jpt_1403B9DF8 - 140000000h)[rbp+rax*4]                ; +0x8e, 0x1403b9dee\nadd     rcx, rbp                                                       ; +0x95, 0x1403b9df5\njmp     rcx; switch jump                                               ; +0x98, 0x1403b9df8\ntest    dl, dl; jumptable 00000001403B9DF8 cases 0,7                   ; +0x9a, 0x1403b9dfa\nmov     ebx, 36h ; '6'                                                 ; +0x9c, 0x1403b9dfc\nmov     eax, 45h ; 'E'                                                 ; +0xa1, 0x1403b9e01\ncmovnz  ebx, eax                                                       ; +0xa6, 0x1403b9e06\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xa9, 0x1403b9e09\ntest    dl, dl; jumptable 00000001403B9DF8 cases 2,4                   ; +0xab, 0x1403b9e0b\nmov     ebx, 38h ; '8'                                                 ; +0xad, 0x1403b9e0d\nmov     eax, 47h ; 'G'                                                 ; +0xb2, 0x1403b9e12\ncmovnz  ebx, eax                                                       ; +0xb7, 0x1403b9e17\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xba, 0x1403b9e1a\nmovzx   eax, dl; jumptable 00000001403B9DF8 cases 1,5                  ; +0xbc, 0x1403b9e1c\nlea     ebx, ds:41h[rax*8]                                             ; +0xbf, 0x1403b9e1f\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xc6, 0x1403b9e26\nmovzx   eax, dl; jumptable 00000001403B9DF8 cases 3,6                  ; +0xc8, 0x1403b9e28\nlea     ebx, ds:43h[rax*8]                                             ; +0xcb, 0x1403b9e2b\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xd2, 0x1403b9e32\nmovsxd  rax, dword ptr [rdi+444h]                                      ; +0xd4, 0x1403b9e34\ncmp     eax, 7; switch 8 cases                                         ; +0xdb, 0x1403b9e3b\nja      short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xde, 0x1403b9e3e\nmov     ecx, ss:(jpt_1403B9E4A - 140000000h)[rbp+rax*4]                ; +0xe0, 0x1403b9e40\nadd     rcx, rbp                                                       ; +0xe7, 0x1403b9e47\njmp     rcx; switch jump                                               ; +0xea, 0x1403b9e4a\nmov     ebx, 32h ; '2'; jumptable 00000001403B9E4A cases 0,7           ; +0xec, 0x1403b9e4c\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xf1, 0x1403b9e51\nmov     ebx, 33h ; '3'; jumptable 00000001403B9E4A cases 2,4           ; +0xf3, 0x1403b9e53\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xf8, 0x1403b9e58\nmov     ebx, 34h ; '4'; jumptable 00000001403B9E4A cases 1,5           ; +0xfa, 0x1403b9e5a\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0xff, 0x1403b9e5f\nmov     ebx, 35h ; '5'; jumptable 00000001403B9E4A cases 3,6           ; +0x101, 0x1403b9e61\njmp     short def_1403B9DF8; jumptable 00000001403B9DF8 default case   ; +0x106, 0x1403b9e66\nmov     ebx, 31h ; '1'                                                 ; +0x108, 0x1403b9e68\nlea     rdx, unk_14090AD10; jumptable 00000001403B9DF8 default case    ; +0x10d, 0x1403b9e6d\nmov     rcx, rsi                                                       ; +0x114, 0x1403b9e74\ncall    cs:?equals@CCPoint@cocos2d@@QEBA_NAEBV12@@Z; cocos2d::CCPoint::equals(cocos2d::CCPoint const &) ; +0x117, 0x1403b9e77\ntest    al, al                                                         ; +0x11d, 0x1403b9e7d\njnz     def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x11f, 0x1403b9e7f\nlea     eax, [rbx-36h]; switch 22 cases                                ; +0x125, 0x1403b9e85\ncmp     eax, 15h                                                       ; +0x128, 0x1403b9e88\nja      def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x12b, 0x1403b9e8b\ncdqe                                                                   ; +0x131, 0x1403b9e91\nmovzx   eax, ds:(byte_1403B9FD8 - 140000000h)[rax+rbp]                 ; +0x133, 0x1403b9e93\nmov     ecx, ss:(jpt_1403B9EA5 - 140000000h)[rbp+rax*4]                ; +0x13b, 0x1403b9e9b\nadd     rcx, rbp                                                       ; +0x142, 0x1403b9ea2\njmp     rcx; switch jump                                               ; +0x145, 0x1403b9ea5\nmov     rax, [rdi]; jumptable 00000001403B9EA5 cases 54,65             ; +0x147, 0x1403b9ea7\nmov     rcx, rdi                                                       ; +0x14a, 0x1403b9eaa\ncall    qword ptr [rax+0C8h]                                           ; +0x14d, 0x1403b9ead\nmovss   xmm0, dword ptr [rsi]                                          ; +0x153, 0x1403b9eb3\ncomiss  xmm0, dword ptr [rax]                                          ; +0x157, 0x1403b9eb7\njbe     def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x15a, 0x1403b9eba\ncmp     ebx, 36h ; '6'                                                 ; +0x160, 0x1403b9ec0\njz      short loc_1403B9ED8                                            ; +0x163, 0x1403b9ec3\ncmp     ebx, 41h ; 'A'                                                 ; +0x165, 0x1403b9ec5\njnz     def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x168, 0x1403b9ec8\nmov     ebx, 42h ; 'B'                                                 ; +0x16e, 0x1403b9ece\njmp     def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x173, 0x1403b9ed3\nmov     ebx, 37h ; '7'                                                 ; +0x178, 0x1403b9ed8\njmp     def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x17d, 0x1403b9edd\nmov     rax, [rdi]; jumptable 00000001403B9EA5 cases 56,67             ; +0x182, 0x1403b9ee2\nmov     rcx, rdi                                                       ; +0x185, 0x1403b9ee5\ncall    qword ptr [rax+0C8h]                                           ; +0x188, 0x1403b9ee8\nmovss   xmm0, dword ptr [rax]                                          ; +0x18e, 0x1403b9eee\ncomiss  xmm0, dword ptr [rsi]                                          ; +0x192, 0x1403b9ef2\njbe     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x195, 0x1403b9ef5\ncmp     ebx, 38h ; '8'                                                 ; +0x197, 0x1403b9ef7\njz      short loc_1403B9F08                                            ; +0x19a, 0x1403b9efa\ncmp     ebx, 43h ; 'C'                                                 ; +0x19c, 0x1403b9efc\njnz     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x19f, 0x1403b9eff\nmov     ebx, 44h ; 'D'                                                 ; +0x1a1, 0x1403b9f01\njmp     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1a6, 0x1403b9f06\nmov     ebx, 39h ; '9'                                                 ; +0x1a8, 0x1403b9f08\njmp     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1ad, 0x1403b9f0d\nmov     rax, [rdi]; jumptable 00000001403B9EA5 cases 69,71             ; +0x1af, 0x1403b9f0f\nmov     rcx, rdi                                                       ; +0x1b2, 0x1403b9f12\ncall    qword ptr [rax+0C8h]                                           ; +0x1b5, 0x1403b9f15\nmovss   xmm0, dword ptr [rax+4]                                        ; +0x1bb, 0x1403b9f1b\ncomiss  xmm0, dword ptr [rsi+4]                                        ; +0x1c0, 0x1403b9f20\njbe     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1c4, 0x1403b9f24\ncmp     ebx, 45h ; 'E'                                                 ; +0x1c6, 0x1403b9f26\njz      short loc_1403B9F37                                            ; +0x1c9, 0x1403b9f29\ncmp     ebx, 47h ; 'G'                                                 ; +0x1cb, 0x1403b9f2b\njnz     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1ce, 0x1403b9f2e\nmov     ebx, 48h ; 'H'                                                 ; +0x1d0, 0x1403b9f30\njmp     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1d5, 0x1403b9f35\nmov     ebx, 46h ; 'F'                                                 ; +0x1d7, 0x1403b9f37\njmp     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1dc, 0x1403b9f3c\nmov     rax, [rdi]; jumptable 00000001403B9EA5 cases 73,75             ; +0x1de, 0x1403b9f3e\nmov     rcx, rdi                                                       ; +0x1e1, 0x1403b9f41\ncall    qword ptr [rax+0C8h]                                           ; +0x1e4, 0x1403b9f44\nmovss   xmm0, dword ptr [rsi+4]                                        ; +0x1ea, 0x1403b9f4a\ncomiss  xmm0, dword ptr [rax+4]                                        ; +0x1ef, 0x1403b9f4f\njbe     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1f3, 0x1403b9f53\ncmp     ebx, 49h ; 'I'                                                 ; +0x1f5, 0x1403b9f55\njz      short loc_1403B9F66                                            ; +0x1f8, 0x1403b9f58\ncmp     ebx, 4Bh ; 'K'                                                 ; +0x1fa, 0x1403b9f5a\njnz     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x1fd, 0x1403b9f5d\nmov     ebx, 4Ch ; 'L'                                                 ; +0x1ff, 0x1403b9f5f\njmp     short def_1403B9EA5; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x204, 0x1403b9f64\nmov     ebx, 4Ah ; 'J'                                                 ; +0x206, 0x1403b9f66\nmov     rbp, [rsp+28h+arg_8]; jumptable 00000001403B9EA5 default case, cases 55,57-64,66,68,70,72,74 ; +0x20b, 0x1403b9f6b\nmov     eax, ebx                                                       ; +0x210, 0x1403b9f70\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x212, 0x1403b9f72\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x217, 0x1403b9f77\nadd     rsp, 20h                                                       ; +0x21c, 0x1403b9f7c\npop     rdi                                                            ; +0x220, 0x1403b9f80\nretn                                                                   ; +0x221, 0x1403b9f81\nalign 4                                                                ; +0x222, 0x1403b9f82\ndd offset loc_1403B9DFA - 140000000h; jump table for switch statement  ; +0x224, 0x1403b9f84\ndd offset loc_1403B9E4C - 140000000h; jump table for switch statement  ; +0x244, 0x1403b9fa4\ndd offset loc_1403B9EA7 - 140000000h; jump table for switch statement  ; +0x264, 0x1403b9fc4\ndb      0,     4,     1,     4; indirect table for switch statement    ; +0x278, 0x1403b9fd8", "xrefs": ["EditorUI::addObjectsToSmartTemplate @ 0x1401b5a0c", "EditorUI::createSmartObjectsFromTemplate @ 0x1401b69ae", "EditorUI::createSmartObjectsFromTemplate @ 0x1401b6b26", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba286", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba296", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba2a5", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba2b4", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba2c3", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba2d2", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba2e0", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba2ef", "GJSmartTemplate::keyFromNeighbors @ 0x1403ba30b", "<???> @ 0x140923d98"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}