{"type": "func", "start": 4299239856, "end": 4299240436, "name": "GJSmartTemplate::smartObjectToType", "pseudocode": "// \n// GJSmartTemplate::smartObjectToType from 0x1004131b0 to 0x1004133f4 (580 bytes)\n// \n// 11 xrefs:\n// > EditorUI::addObjectsToSmartTemplate @ 0x10001262f\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412c07\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412c69\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412cd3\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412d3a\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412d96\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412dfd\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412e5a\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412eba\n// > GJSmartTemplate::keyFromNeighbors @ 0x100412f1a\n// > GJSmartTemplate::offsetForObject @ 0x10041317e\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 12:30:10 +0000\n// \n\n__int64 __fastcall GJSmartTemplate::smartObjectToType(_DWORD *a1, float *a2, __m128 a3)\n{\n  unsigned int v3; // ebx\n  int v4; // eax\n  unsigned __int64 v5; // rax\n  __m128 v6; // xmm0\n  char v7; // cl\n  float v9; // [rsp+0h] [rbp-1Ch]\n  float v10; // [rsp+0h] [rbp-1Ch]\n  float v11; // [rsp+0h] [rbp-1Ch]\n  float v12; // [rsp+0h] [rbp-1Ch]\n\n  v3 = 48;\n  if ( a1 )\n  {\n    v4 = a1[257];\n    switch ( v4 )\n    {\n      case 2897:\n        *(double *)a3.i64 = (*(double (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 368LL))(a1);\n        v6 = _mm_and_ps(a3, (__m128)xmmword_100A038A0);\n        v7 = _mm_cvtsi128_si32((__m128i)_mm_or_ps(\n                                          _mm_cmpeq_ps((__m128)0x42B40000u, v6),\n                                          _mm_cmpeq_ps((__m128)0x43870000u, v6)));\n        switch ( a1[271] )\n        {\n          case 0:\n          case 7:\n            v3 = 54;\n            if ( (v7 & 1) != 0 )\n              v3 = 69;\n            break;\n          case 1:\n          case 5:\n            v3 = 8 * (v7 & 1) + 65;\n            break;\n          case 2:\n          case 4:\n            v3 = 56;\n            if ( (v7 & 1) != 0 )\n              v3 = 71;\n            break;\n          case 3:\n          case 6:\n            v3 = 8 * (v7 & 1) + 67;\n            break;\n          default:\n            goto LABEL_17;\n        }\n        break;\n      case 2896:\n        v5 = (unsigned int)a1[271];\n        if ( v5 < 8 )\n          v3 = *(_DWORD *)&a2_3[4 * v5];\n        break;\n      case 2895:\n        v3 = 49;\n        break;\n    }\n  }\nLABEL_17:\n  if ( !sub_100278420(a2, (float *)&qword_100BE3838) )\n  {\n    switch ( v3 )\n    {\n      case '6':\n      case 'A':\n        v9 = *a2;\n        if ( v9 > *(float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 192LL))(a1) )\n        {\n          if ( v3 == 65 )\n          {\n            v3 = 66;\n          }\n          else if ( v3 == 54 )\n          {\n            v3 = 55;\n          }\n        }\n        break;\n      case '8':\n      case 'C':\n        v12 = *a2;\n        if ( *(float *)(*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 192LL))(a1) > v12 )\n        {\n          if ( v3 == 67 )\n          {\n            v3 = 68;\n          }\n          else if ( v3 == 56 )\n          {\n            v3 = 57;\n          }\n        }\n        break;\n      case 'E':\n      case 'G':\n        v11 = a2[1];\n        if ( *(float *)((*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 192LL))(a1) + 4) > v11 )\n        {\n          if ( v3 == 71 )\n          {\n            v3 = 72;\n          }\n          else if ( v3 == 69 )\n          {\n            v3 = 70;\n          }\n        }\n        break;\n      case 'I':\n      case 'K':\n        v10 = a2[1];\n        if ( v10 > *(float *)((*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)a1 + 192LL))(a1) + 4) )\n        {\n          if ( v3 == 75 )\n          {\n            v3 = 76;\n          }\n          else if ( v3 == 73 )\n          {\n            v3 = 74;\n          }\n        }\n        break;\n      default:\n        return v3;\n    }\n  }\n  return v3;\n}", "assembly": "; \n; GJSmartTemplate::smartObjectToType from 0x1004131b0 to 0x1004133f4 (580 bytes)\n; \n; 11 xrefs:\n; > EditorUI::addObjectsToSmartTemplate @ 0x10001262f\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412c07\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412c69\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412cd3\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412d3a\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412d96\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412dfd\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412e5a\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412eba\n; > GJSmartTemplate::keyFromNeighbors @ 0x100412f1a\n; > GJSmartTemplate::offsetForObject @ 0x10041317e\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 12:30:10 +0000\n; \npush    rbp                                                            ; +0x0, 0x1004131b0\nmov     rbp, rsp                                                       ; +0x1, 0x1004131b1\npush    r15                                                            ; +0x4, 0x1004131b4\npush    r14                                                            ; +0x6, 0x1004131b6\npush    rbx                                                            ; +0x8, 0x1004131b8\npush    rax                                                            ; +0x9, 0x1004131b9\nmov     r15, rsi                                                       ; +0xa, 0x1004131ba\nmov     r14, rdi                                                       ; +0xd, 0x1004131bd\nmov     ebx, 30h ; '0'                                                 ; +0x10, 0x1004131c0\ntest    rdi, rdi                                                       ; +0x15, 0x1004131c5\njz      def_100413265; jumptable 0000000100413265 default case         ; +0x18, 0x1004131c8\nmov     eax, [r14+404h]                                                ; +0x1e, 0x1004131ce\ncmp     eax, 0B51h                                                     ; +0x25, 0x1004131d5\njz      short loc_100413218                                            ; +0x2a, 0x1004131da\ncmp     eax, 0B50h                                                     ; +0x2c, 0x1004131dc\njz      short loc_1004131F8                                            ; +0x31, 0x1004131e1\ncmp     eax, 0B4Fh                                                     ; +0x33, 0x1004131e3\njnz     def_100413265; jumptable 0000000100413265 default case         ; +0x38, 0x1004131e8\nmov     ebx, 31h ; '1'                                                 ; +0x3e, 0x1004131ee\njmp     def_100413265; jumptable 0000000100413265 default case         ; +0x43, 0x1004131f3\nmov     eax, [r14+43Ch]                                                ; +0x48, 0x1004131f8\ncmp     rax, 8                                                         ; +0x4f, 0x1004131ff\njnb     def_100413265; jumptable 0000000100413265 default case         ; +0x53, 0x100413203\nlea     rcx, a2_3; \"2\"                                                 ; +0x59, 0x100413209\nmov     ebx, [rcx+rax*4]                                               ; +0x60, 0x100413210\njmp     def_100413265; jumptable 0000000100413265 default case         ; +0x63, 0x100413213\nmov     rax, [r14]                                                     ; +0x68, 0x100413218\nmov     rdi, r14                                                       ; +0x6b, 0x10041321b\ncall    qword ptr [rax+170h]                                           ; +0x6e, 0x10041321e\nmov     eax, [r14+43Ch]                                                ; +0x74, 0x100413224\ncmp     rax, 7; switch 8 cases                                         ; +0x7b, 0x10041322b\nja      short def_100413265; jumptable 0000000100413265 default case   ; +0x7f, 0x10041322f\nandps   xmm0, cs:xmmword_100A038A0                                     ; +0x81, 0x100413231\nmovss   xmm1, cs:dword_100A04190                                       ; +0x88, 0x100413238\ncmpeqps xmm1, xmm0                                                     ; +0x90, 0x100413240\nmovss   xmm2, cs:flt_100A035A4                                         ; +0x94, 0x100413244\ncmpeqps xmm2, xmm0                                                     ; +0x9c, 0x10041324c\norps    xmm2, xmm1                                                     ; +0xa0, 0x100413250\nmovd    ecx, xmm2                                                      ; +0xa3, 0x100413253\nlea     rdx, jpt_100413265                                             ; +0xa7, 0x100413257\nmovsxd  rax, (jpt_100413265 - 1004133F4h)[rdx+rax*4]                   ; +0xae, 0x10041325e\nadd     rax, rdx                                                       ; +0xb2, 0x100413262\njmp     rax; switch jump                                               ; +0xb5, 0x100413265\ntest    cl, 1; jumptable 0000000100413265 cases 0,7                    ; +0xb7, 0x100413267\nmov     eax, 45h ; 'E'                                                 ; +0xba, 0x10041326a\nmov     ebx, 36h ; '6'                                                 ; +0xbf, 0x10041326f\ncmovnz  ebx, eax                                                       ; +0xc4, 0x100413274\njmp     short def_100413265; jumptable 0000000100413265 default case   ; +0xc7, 0x100413277\ntest    cl, 1; jumptable 0000000100413265 cases 2,4                    ; +0xc9, 0x100413279\nmov     eax, 47h ; 'G'                                                 ; +0xcc, 0x10041327c\nmov     ebx, 38h ; '8'                                                 ; +0xd1, 0x100413281\ncmovnz  ebx, eax                                                       ; +0xd6, 0x100413286\njmp     short def_100413265; jumptable 0000000100413265 default case   ; +0xd9, 0x100413289\nmovzx   eax, cl; jumptable 0000000100413265 cases 3,6                  ; +0xdb, 0x10041328b\nand     eax, 1                                                         ; +0xde, 0x10041328e\nlea     ebx, ds:43h[rax*8]                                             ; +0xe1, 0x100413291\njmp     short def_100413265; jumptable 0000000100413265 default case   ; +0xe8, 0x100413298\nmovzx   eax, cl; jumptable 0000000100413265 cases 1,5                  ; +0xea, 0x10041329a\nand     eax, 1                                                         ; +0xed, 0x10041329d\nlea     ebx, ds:41h[rax*8]                                             ; +0xf0, 0x1004132a0\nlea     rsi, qword_100BE3838; jumptable 0000000100413265 default case  ; +0xf7, 0x1004132a7\nmov     rdi, r15                                                       ; +0xfe, 0x1004132ae\ncall    sub_100278420                                                  ; +0x101, 0x1004132b1\ntest    al, al                                                         ; +0x106, 0x1004132b6\njz      short loc_1004132C7                                            ; +0x108, 0x1004132b8\nmov     eax, ebx; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x10a, 0x1004132ba\nadd     rsp, 8                                                         ; +0x10c, 0x1004132bc\npop     rbx                                                            ; +0x110, 0x1004132c0\npop     r14                                                            ; +0x111, 0x1004132c1\npop     r15                                                            ; +0x113, 0x1004132c3\npop     rbp                                                            ; +0x115, 0x1004132c5\nretn                                                                   ; +0x116, 0x1004132c6\nlea     eax, [rbx-36h]; switch 22 cases                                ; +0x117, 0x1004132c7\ncmp     eax, 15h                                                       ; +0x11a, 0x1004132ca\nja      short def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x11d, 0x1004132cd\nlea     rcx, jpt_1004132DD                                             ; +0x11f, 0x1004132cf\nmovsxd  rax, (jpt_1004132DD - 100413414h)[rcx+rax*4]                   ; +0x126, 0x1004132d6\nadd     rax, rcx                                                       ; +0x12a, 0x1004132da\njmp     rax; switch jump                                               ; +0x12d, 0x1004132dd\nmovss   xmm0, dword ptr [r15]; jumptable 00000001004132DD cases 54,65  ; +0x12f, 0x1004132df\nmovss   [rbp+var_1C], xmm0                                             ; +0x134, 0x1004132e4\nmov     rax, [r14]                                                     ; +0x139, 0x1004132e9\nmov     rdi, r14                                                       ; +0x13c, 0x1004132ec\ncall    qword ptr [rax+0C0h]                                           ; +0x13f, 0x1004132ef\nmovss   xmm0, [rbp+var_1C]                                             ; +0x145, 0x1004132f5\nucomiss xmm0, dword ptr [rax]                                          ; +0x14a, 0x1004132fa\njbe     short def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x14d, 0x1004132fd\ncmp     ebx, 41h ; 'A'                                                 ; +0x14f, 0x1004132ff\njz      loc_1004133CC                                                  ; +0x152, 0x100413302\ncmp     ebx, 36h ; '6'                                                 ; +0x158, 0x100413308\njnz     short def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x15b, 0x10041330b\nmov     ebx, 37h ; '7'                                                 ; +0x15d, 0x10041330d\njmp     short def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x162, 0x100413312\nmovss   xmm0, dword ptr [r15+4]; jumptable 00000001004132DD cases 73,75 ; +0x164, 0x100413314\nmovss   [rbp+var_1C], xmm0                                             ; +0x16a, 0x10041331a\nmov     rax, [r14]                                                     ; +0x16f, 0x10041331f\nmov     rdi, r14                                                       ; +0x172, 0x100413322\ncall    qword ptr [rax+0C0h]                                           ; +0x175, 0x100413325\nmovss   xmm0, [rbp+var_1C]                                             ; +0x17b, 0x10041332b\nucomiss xmm0, dword ptr [rax+4]                                        ; +0x180, 0x100413330\njbe     short def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x184, 0x100413334\ncmp     ebx, 4Bh ; 'K'                                                 ; +0x186, 0x100413336\njz      loc_1004133D6                                                  ; +0x189, 0x100413339\ncmp     ebx, 49h ; 'I'                                                 ; +0x18f, 0x10041333f\njnz     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x192, 0x100413342\nmov     ebx, 4Ah ; 'J'                                                 ; +0x198, 0x100413348\njmp     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x19d, 0x10041334d\nmovss   xmm0, dword ptr [r15+4]; jumptable 00000001004132DD cases 69,71 ; +0x1a2, 0x100413352\nmovss   [rbp+var_1C], xmm0                                             ; +0x1a8, 0x100413358\nmov     rax, [r14]                                                     ; +0x1ad, 0x10041335d\nmov     rdi, r14                                                       ; +0x1b0, 0x100413360\ncall    qword ptr [rax+0C0h]                                           ; +0x1b3, 0x100413363\nmovss   xmm0, dword ptr [rax+4]                                        ; +0x1b9, 0x100413369\nucomiss xmm0, [rbp+var_1C]                                             ; +0x1be, 0x10041336e\njbe     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x1c2, 0x100413372\ncmp     ebx, 47h ; 'G'                                                 ; +0x1c8, 0x100413378\njz      short loc_1004133E0                                            ; +0x1cb, 0x10041337b\ncmp     ebx, 45h ; 'E'                                                 ; +0x1cd, 0x10041337d\njnz     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x1d0, 0x100413380\nmov     ebx, 46h ; 'F'                                                 ; +0x1d6, 0x100413386\njmp     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x1db, 0x10041338b\nmovss   xmm0, dword ptr [r15]; jumptable 00000001004132DD cases 56,67  ; +0x1e0, 0x100413390\nmovss   [rbp+var_1C], xmm0                                             ; +0x1e5, 0x100413395\nmov     rax, [r14]                                                     ; +0x1ea, 0x10041339a\nmov     rdi, r14                                                       ; +0x1ed, 0x10041339d\ncall    qword ptr [rax+0C0h]                                           ; +0x1f0, 0x1004133a0\nmovss   xmm0, dword ptr [rax]                                          ; +0x1f6, 0x1004133a6\nucomiss xmm0, [rbp+var_1C]                                             ; +0x1fa, 0x1004133aa\njbe     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x1fe, 0x1004133ae\ncmp     ebx, 43h ; 'C'                                                 ; +0x204, 0x1004133b4\njz      short loc_1004133EA                                            ; +0x207, 0x1004133b7\ncmp     ebx, 38h ; '8'                                                 ; +0x209, 0x1004133b9\njnz     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x20c, 0x1004133bc\nmov     ebx, 39h ; '9'                                                 ; +0x212, 0x1004133c2\njmp     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x217, 0x1004133c7\nmov     ebx, 42h ; 'B'                                                 ; +0x21c, 0x1004133cc\njmp     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x221, 0x1004133d1\nmov     ebx, 4Ch ; 'L'                                                 ; +0x226, 0x1004133d6\njmp     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x22b, 0x1004133db\nmov     ebx, 48h ; 'H'                                                 ; +0x230, 0x1004133e0\njmp     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x235, 0x1004133e5\nmov     ebx, 44h ; 'D'                                                 ; +0x23a, 0x1004133ea\njmp     def_1004132DD; jumptable 00000001004132DD default case, cases 55,57-64,66,68,70,72,74 ; +0x23f, 0x1004133ef", "xrefs": ["EditorUI::addObjectsToSmartTemplate @ 0x10001262f", "GJSmartTemplate::keyFromNeighbors @ 0x100412c07", "GJSmartTemplate::keyFromNeighbors @ 0x100412c69", "GJSmartTemplate::keyFromNeighbors @ 0x100412cd3", "GJSmartTemplate::keyFromNeighbors @ 0x100412d3a", "GJSmartTemplate::keyFromNeighbors @ 0x100412d96", "GJSmartTemplate::keyFromNeighbors @ 0x100412dfd", "GJSmartTemplate::keyFromNeighbors @ 0x100412e5a", "GJSmartTemplate::keyFromNeighbors @ 0x100412eba", "GJSmartTemplate::keyFromNeighbors @ 0x100412f1a", "GJSmartTemplate::offsetForObject @ 0x10041317e"], "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"}