{"type": "func", "start": 5372869904, "end": 5372870535, "name": "LevelEditorLayer::getNextFreeGroupID", "pseudocode": "// \n// LevelEditorLayer::getNextFreeGroupID from 0x1403f7d10 to 0x1403f7f87 (631 bytes)\n// \n// 9 xrefs:\n// > EditorUI::dynamicGroupUpdate @ 0x1401b894e\n// > EditorUI::assignNewGroups @ 0x1401b8fae\n// > EditorUI::createLoop @ 0x1401b960b\n// > EditorUI::createLoop @ 0x1401b98c1\n// > sub_1401BA030 @ 0x1401ba0c3\n// > EditorUI::editGroup @ 0x1401be9c6\n// > IDNameBrowserPopup::onFormNextFree @ 0x1403c45f0\n// > IDNameInput::onNextFree @ 0x1403c95e3\n// > <???> @ 0x1409255c8\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:51 +0000\n// \n\n// Hidden C++ exception states: #wind=3\n__int64 __fastcall LevelEditorLayer::getNextFreeGroupID(__int64 a1, __int64 a2)\n{\n  _QWORD *v4; // rax\n  unsigned __int8 *v5; // rdi\n  unsigned __int8 *i; // rbx\n  __int64 v7; // rcx\n  __int64 IDNames; // rdi\n  unsigned __int8 **v9; // rcx\n  unsigned __int8 *v10; // rbx\n  __int64 v11; // rax\n  unsigned int *v12; // r15\n  __int64 v13; // rax\n  __int64 *v14; // r15\n  __int64 *j; // r12\n  __int64 v16; // rbx\n  int v17; // r14d\n  __int64 v18; // rsi\n  unsigned __int64 v19; // rdi\n  __int64 v20; // rax\n  int v21; // ecx\n  int v22; // edi\n  int v23; // esi\n  int v24; // ebx\n  unsigned int v25; // ebx\n  int v27; // [rsp+20h] [rbp-79h] BYREF\n  int v28[3]; // [rsp+24h] [rbp-75h] BYREF\n  __int64 v29; // [rsp+30h] [rbp-69h] BYREF\n  void *v30[2]; // [rsp+38h] [rbp-61h] BYREF\n  __int64 v31; // [rsp+48h] [rbp-51h] BYREF\n  __int128 v32; // [rsp+50h] [rbp-49h]\n  __int64 v33; // [rsp+60h] [rbp-39h]\n  __int64 v34; // [rsp+68h] [rbp-31h]\n  _BYTE v35[16]; // [rsp+70h] [rbp-29h] BYREF\n  char v36[16]; // [rsp+80h] [rbp-19h] BYREF\n  char v37[16]; // [rsp+90h] [rbp-9h] BYREF\n  char v38[16]; // [rsp+A0h] [rbp+7h] BYREF\n  char v39[64]; // [rsp+B0h] [rbp+17h] BYREF\n  int v40; // [rsp+110h] [rbp+77h] BYREF\n  int v41; // [rsp+118h] [rbp+7Fh] BYREF\n\n  v30[1] = nullptr;\n  v4 = operator new(0x18u);\n  *v4 = v4;\n  v4[1] = v4;\n  v30[0] = v4;\n  v31 = 0;\n  v32 = 0;\n  v33 = 7;\n  v34 = 8;\n  LODWORD(v29) = 1065353216;\n  sub_14003F200((__int64)&v31, 0x10u, (unsigned __int64)v4);\n  v5 = *(unsigned __int8 **)(a2 + 8);\n  for ( i = *(unsigned __int8 **)v5; i != v5; i = *(unsigned __int8 **)i )\n    sub_140068190((__int64)&v29, (__int64)v35, i + 16);\n  v7 = *(_QWORD *)(a1 + 3528);\n  if ( v7 )\n  {\n    IDNames = LevelSettingsObject::getIDNames(v7, 1);\n    v9 = *(unsigned __int8 ***)(IDNames + 8);\n    v10 = *v9;\n    if ( *v9 != (unsigned __int8 *)v9 )\n    {\n      do\n      {\n        sub_140068190((__int64)&v29, (__int64)v35, v10 + 16);\n        v10 = *(unsigned __int8 **)v10;\n      }\n      while ( v10 != *(unsigned __int8 **)(IDNames + 8) );\n    }\n  }\n  v11 = *(_QWORD *)(a1 + 3536);\n  if ( v11 )\n  {\n    v12 = *(unsigned int **)(v11 + 56);\n    v13 = *v12;\n    if ( (_DWORD)v13 )\n    {\n      v14 = *((__int64 **)v12 + 2);\n      for ( j = &v14[v13 - 1]; v14 <= j; ++v14 )\n      {\n        v16 = *v14;\n        if ( !*v14 )\n          break;\n        if ( *(__int16 *)(v16 + 1176) > 0 )\n        {\n          v17 = 0;\n          v18 = 0;\n          v19 = 0;\n          do\n          {\n            if ( v19 <= 9 && (v20 = *(_QWORD *)(v16 + 1168)) != 0 )\n              v21 = *(__int16 *)(v18 + v20);\n            else\n              v21 = 0;\n            v40 = v21;\n            sub_140068190((__int64)&v29, (__int64)v35, (unsigned __int8 *)&v40);\n            ++v17;\n            ++v19;\n            v18 += 2;\n          }\n          while ( v17 < *(__int16 *)(v16 + 1176) );\n        }\n        if ( *(_DWORD *)(v16 + 1256) == 1 && (*(_DWORD *)(v16 + 1036) != 1006 || *(_DWORD *)(v16 + 1624) == 1) )\n        {\n          v40 = *(_DWORD *)(v16 + 1480);\n          v22 = *(_DWORD *)(v16 + 1484);\n          v41 = v22;\n          v23 = *(_DWORD *)(v16 + 1696);\n          v27 = v23;\n          v24 = *(_DWORD *)(v16 + 1684);\n          v28[0] = v24;\n          if ( v40 > 0 )\n            sub_140068190((__int64)&v29, (__int64)v36, (unsigned __int8 *)&v40);\n          if ( v22 > 0 )\n            sub_140068190((__int64)&v29, (__int64)v37, (unsigned __int8 *)&v41);\n          if ( v23 > 0 )\n            sub_140068190((__int64)&v29, (__int64)v38, (unsigned __int8 *)&v27);\n          if ( v24 > 0 )\n            sub_140068190((__int64)&v29, (__int64)v39, (unsigned __int8 *)v28);\n        }\n      }\n    }\n  }\n  v25 = sub_1403ECF00(*(_DWORD *)(*(_QWORD *)(a1 + 3528) + 444LL), 9999, &v29);\n  sub_14003EA90(&v31);\n  sub_14003EB00(v30);\n  return v25;\n}", "assembly": "; \n; LevelEditorLayer::getNextFreeGroupID from 0x1403f7d10 to 0x1403f7f87 (631 bytes)\n; \n; 9 xrefs:\n; > EditorUI::dynamicGroupUpdate @ 0x1401b894e\n; > EditorUI::assignNewGroups @ 0x1401b8fae\n; > EditorUI::createLoop @ 0x1401b960b\n; > EditorUI::createLoop @ 0x1401b98c1\n; > sub_1401BA030 @ 0x1401ba0c3\n; > EditorUI::editGroup @ 0x1401be9c6\n; > IDNameBrowserPopup::onFormNextFree @ 0x1403c45f0\n; > IDNameInput::onNextFree @ 0x1403c95e3\n; > <???> @ 0x1409255c8\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:51 +0000\n; \nmov     [rsp-8+arg_0], rbx                                             ; +0x0, 0x1403f7d10\npush    rbp                                                            ; +0x5, 0x1403f7d15\npush    rsi                                                            ; +0x6, 0x1403f7d16\npush    rdi                                                            ; +0x7, 0x1403f7d17\npush    r12                                                            ; +0x8, 0x1403f7d18\npush    r13                                                            ; +0xa, 0x1403f7d1a\npush    r14                                                            ; +0xc, 0x1403f7d1c\npush    r15                                                            ; +0xe, 0x1403f7d1e\nlea     rbp, [rsp-27h]                                                 ; +0x10, 0x1403f7d20\nsub     rsp, 0C0h                                                      ; +0x15, 0x1403f7d25\nmov     rbx, rdx                                                       ; +0x1c, 0x1403f7d2c\nmov     r13, rcx                                                       ; +0x1f, 0x1403f7d2f\nmov     dword ptr [rbp+57h+var_C0], 0                                  ; +0x22, 0x1403f7d32\nxor     edi, edi                                                       ; +0x29, 0x1403f7d39\nmov     [rbp+57h+var_B8], rdi                                          ; +0x2b, 0x1403f7d3b\nmov     [rbp+57h+var_B0], rdi                                          ; +0x2f, 0x1403f7d3f\nmov     ecx, 18h; Size                                                 ; +0x33, 0x1403f7d43\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x38, 0x1403f7d48\nmov     [rax], rax                                                     ; +0x3d, 0x1403f7d4d\nmov     [rax+8], rax                                                   ; +0x40, 0x1403f7d50\nmov     [rbp+57h+var_B8], rax                                          ; +0x44, 0x1403f7d54\nmov     [rbp+57h+var_A8], rdi                                          ; +0x48, 0x1403f7d58\nxorps   xmm0, xmm0                                                     ; +0x4c, 0x1403f7d5c\nmovdqa  [rbp+57h+var_A0], xmm0                                         ; +0x4f, 0x1403f7d5f\nmov     [rbp+57h+var_90], 7                                            ; +0x54, 0x1403f7d64\nmov     [rbp+57h+var_88], 8                                            ; +0x5c, 0x1403f7d6c\nmov     dword ptr [rbp+57h+var_C0], 3F800000h                          ; +0x64, 0x1403f7d74\nmov     r8, rax                                                        ; +0x6b, 0x1403f7d7b\nmov     edx, 10h                                                       ; +0x6e, 0x1403f7d7e\nlea     rcx, [rbp+57h+var_A8]                                          ; +0x73, 0x1403f7d83\ncall    sub_14003F200                                                  ; +0x77, 0x1403f7d87\nnop                                                                    ; +0x7c, 0x1403f7d8c\nmov     rdi, [rbx+8]                                                   ; +0x7d, 0x1403f7d8d\nmov     rbx, [rdi]                                                     ; +0x81, 0x1403f7d91\ncmp     rbx, rdi                                                       ; +0x84, 0x1403f7d94\njz      short loc_1403F7DB9                                            ; +0x87, 0x1403f7d97\nnop     dword ptr [rax+00000000h]                                      ; +0x89, 0x1403f7d99\nlea     r8, [rbx+10h]                                                  ; +0x90, 0x1403f7da0\nlea     rdx, [rbp+57h+var_80]                                          ; +0x94, 0x1403f7da4\nlea     rcx, [rbp+57h+var_C0]                                          ; +0x98, 0x1403f7da8\ncall    sub_140068190                                                  ; +0x9c, 0x1403f7dac\nmov     rbx, [rbx]                                                     ; +0xa1, 0x1403f7db1\ncmp     rbx, rdi                                                       ; +0xa4, 0x1403f7db4\njnz     short loc_1403F7DA0                                            ; +0xa7, 0x1403f7db7\nmov     rcx, [r13+0DC8h]                                               ; +0xa9, 0x1403f7db9\ntest    rcx, rcx                                                       ; +0xb0, 0x1403f7dc0\njz      short loc_1403F7DFA                                            ; +0xb3, 0x1403f7dc3\nmov     edx, 1                                                         ; +0xb5, 0x1403f7dc5\ncall    LevelSettingsObject__getIDNames                                ; +0xba, 0x1403f7dca\nmov     rdi, rax                                                       ; +0xbf, 0x1403f7dcf\nmov     rcx, [rax+8]                                                   ; +0xc2, 0x1403f7dd2\nmov     rbx, [rcx]                                                     ; +0xc6, 0x1403f7dd6\ncmp     rbx, rcx                                                       ; +0xc9, 0x1403f7dd9\njz      short loc_1403F7DFA                                            ; +0xcc, 0x1403f7ddc\nxchg    ax, ax                                                         ; +0xce, 0x1403f7dde\nlea     r8, [rbx+10h]                                                  ; +0xd0, 0x1403f7de0\nlea     rdx, [rbp+57h+var_80]                                          ; +0xd4, 0x1403f7de4\nlea     rcx, [rbp+57h+var_C0]                                          ; +0xd8, 0x1403f7de8\ncall    sub_140068190                                                  ; +0xdc, 0x1403f7dec\nmov     rbx, [rbx]                                                     ; +0xe1, 0x1403f7df1\ncmp     rbx, [rdi+8]                                                   ; +0xe4, 0x1403f7df4\njnz     short loc_1403F7DE0                                            ; +0xe8, 0x1403f7df8\nmov     rax, [r13+0DD0h]                                               ; +0xea, 0x1403f7dfa\ntest    rax, rax                                                       ; +0xf1, 0x1403f7e01\njz      loc_1403F7F3B                                                  ; +0xf4, 0x1403f7e04\nmov     r15, [rax+38h]                                                 ; +0xfa, 0x1403f7e0a\nmov     eax, [r15]                                                     ; +0xfe, 0x1403f7e0e\ntest    eax, eax                                                       ; +0x101, 0x1403f7e11\njz      loc_1403F7F3B                                                  ; +0x103, 0x1403f7e13\nmov     r15, [r15+10h]                                                 ; +0x109, 0x1403f7e19\nlea     r12, [rax-1]                                                   ; +0x10d, 0x1403f7e1d\nlea     r12, [r15+r12*8]                                               ; +0x111, 0x1403f7e21\ncmp     r15, r12                                                       ; +0x115, 0x1403f7e25\nja      loc_1403F7F3B                                                  ; +0x118, 0x1403f7e28\nxchg    ax, ax                                                         ; +0x11e, 0x1403f7e2e\nmov     rbx, [r15]                                                     ; +0x120, 0x1403f7e30\ntest    rbx, rbx                                                       ; +0x123, 0x1403f7e33\njz      loc_1403F7F3B                                                  ; +0x126, 0x1403f7e36\ncmp     word ptr [rbx+498h], 0                                         ; +0x12c, 0x1403f7e3c\njle     short loc_1403F7E94                                            ; +0x134, 0x1403f7e44\nxor     r14d, r14d                                                     ; +0x136, 0x1403f7e46\nxor     esi, esi                                                       ; +0x139, 0x1403f7e49\nxor     edi, edi                                                       ; +0x13b, 0x1403f7e4b\nnop     dword ptr [rax]                                                ; +0x13d, 0x1403f7e4d\ncmp     rdi, 9                                                         ; +0x140, 0x1403f7e50\nja      short loc_1403F7E68                                            ; +0x144, 0x1403f7e54\nmov     rax, [rbx+490h]                                                ; +0x146, 0x1403f7e56\ntest    rax, rax                                                       ; +0x14d, 0x1403f7e5d\njz      short loc_1403F7E68                                            ; +0x150, 0x1403f7e60\nmovsx   ecx, word ptr [rsi+rax]                                        ; +0x152, 0x1403f7e62\njmp     short loc_1403F7E6A                                            ; +0x156, 0x1403f7e66\nxor     ecx, ecx                                                       ; +0x158, 0x1403f7e68\nmov     [rbp+57h+arg_10], ecx                                          ; +0x15a, 0x1403f7e6a\nlea     r8, [rbp+57h+arg_10]                                           ; +0x15d, 0x1403f7e6d\nlea     rdx, [rbp+57h+var_80]                                          ; +0x161, 0x1403f7e71\nlea     rcx, [rbp+57h+var_C0]                                          ; +0x165, 0x1403f7e75\ncall    sub_140068190                                                  ; +0x169, 0x1403f7e79\ninc     r14d                                                           ; +0x16e, 0x1403f7e7e\ninc     rdi                                                            ; +0x171, 0x1403f7e81\nadd     rsi, 2                                                         ; +0x174, 0x1403f7e84\nmovsx   eax, word ptr [rbx+498h]                                       ; +0x178, 0x1403f7e88\ncmp     r14d, eax                                                      ; +0x17f, 0x1403f7e8f\njl      short loc_1403F7E50                                            ; +0x182, 0x1403f7e92\ncmp     dword ptr [rbx+4E8h], 1                                        ; +0x184, 0x1403f7e94\njnz     loc_1403F7F2E                                                  ; +0x18b, 0x1403f7e9b\ncmp     dword ptr [rbx+40Ch], 3EEh                                     ; +0x191, 0x1403f7ea1\njnz     short loc_1403F7EB6                                            ; +0x19b, 0x1403f7eab\ncmp     dword ptr [rbx+658h], 1                                        ; +0x19d, 0x1403f7ead\njnz     short loc_1403F7F2E                                            ; +0x1a4, 0x1403f7eb4\nmov     eax, [rbx+5C8h]                                                ; +0x1a6, 0x1403f7eb6\nmov     [rbp+57h+arg_10], eax                                          ; +0x1ac, 0x1403f7ebc\nmov     edi, [rbx+5CCh]                                                ; +0x1af, 0x1403f7ebf\nmov     [rbp+57h+arg_18], edi                                          ; +0x1b5, 0x1403f7ec5\nmov     esi, [rbx+6A0h]                                                ; +0x1b8, 0x1403f7ec8\nmov     [rbp+57h+var_D0], esi                                          ; +0x1be, 0x1403f7ece\nmov     ebx, [rbx+694h]                                                ; +0x1c1, 0x1403f7ed1\nmov     [rbp+57h+var_CC], ebx                                          ; +0x1c7, 0x1403f7ed7\ntest    eax, eax                                                       ; +0x1ca, 0x1403f7eda\njle     short loc_1403F7EEF                                            ; +0x1cc, 0x1403f7edc\nlea     r8, [rbp+57h+arg_10]                                           ; +0x1ce, 0x1403f7ede\nlea     rdx, [rbp+57h+var_70]                                          ; +0x1d2, 0x1403f7ee2\nlea     rcx, [rbp+57h+var_C0]                                          ; +0x1d6, 0x1403f7ee6\ncall    sub_140068190                                                  ; +0x1da, 0x1403f7eea\ntest    edi, edi                                                       ; +0x1df, 0x1403f7eef\njle     short loc_1403F7F04                                            ; +0x1e1, 0x1403f7ef1\nlea     r8, [rbp+57h+arg_18]                                           ; +0x1e3, 0x1403f7ef3\nlea     rdx, [rbp+57h+var_60]                                          ; +0x1e7, 0x1403f7ef7\nlea     rcx, [rbp+57h+var_C0]                                          ; +0x1eb, 0x1403f7efb\ncall    sub_140068190                                                  ; +0x1ef, 0x1403f7eff\ntest    esi, esi                                                       ; +0x1f4, 0x1403f7f04\njle     short loc_1403F7F19                                            ; +0x1f6, 0x1403f7f06\nlea     r8, [rbp+57h+var_D0]                                           ; +0x1f8, 0x1403f7f08\nlea     rdx, [rbp+57h+var_50]                                          ; +0x1fc, 0x1403f7f0c\nlea     rcx, [rbp+57h+var_C0]                                          ; +0x200, 0x1403f7f10\ncall    sub_140068190                                                  ; +0x204, 0x1403f7f14\ntest    ebx, ebx                                                       ; +0x209, 0x1403f7f19\njle     short loc_1403F7F2E                                            ; +0x20b, 0x1403f7f1b\nlea     r8, [rbp+57h+var_CC]                                           ; +0x20d, 0x1403f7f1d\nlea     rdx, [rbp+57h+var_40]                                          ; +0x211, 0x1403f7f21\nlea     rcx, [rbp+57h+var_C0]                                          ; +0x215, 0x1403f7f25\ncall    sub_140068190                                                  ; +0x219, 0x1403f7f29\nadd     r15, 8                                                         ; +0x21e, 0x1403f7f2e\ncmp     r15, r12                                                       ; +0x222, 0x1403f7f32\njbe     loc_1403F7E30                                                  ; +0x225, 0x1403f7f35\nmov     rcx, [r13+0DC8h]                                               ; +0x22b, 0x1403f7f3b\nlea     r8, [rbp+57h+var_C0]                                           ; +0x232, 0x1403f7f42\nmov     edx, 270Fh                                                     ; +0x236, 0x1403f7f46\nmov     ecx, [rcx+1BCh]                                                ; +0x23b, 0x1403f7f4b\ncall    sub_1403ECF00                                                  ; +0x241, 0x1403f7f51\nmov     ebx, eax                                                       ; +0x246, 0x1403f7f56\nlea     rcx, [rbp+57h+var_A8]; void *                                  ; +0x248, 0x1403f7f58\ncall    sub_14003EA90                                                  ; +0x24c, 0x1403f7f5c\nlea     rcx, [rbp+57h+var_B8]                                          ; +0x251, 0x1403f7f61\ncall    sub_14003EB00                                                  ; +0x255, 0x1403f7f65\nmov     eax, ebx                                                       ; +0x25a, 0x1403f7f6a\nmov     rbx, [rsp+0F0h+arg_0]                                          ; +0x25c, 0x1403f7f6c\nadd     rsp, 0C0h                                                      ; +0x264, 0x1403f7f74\npop     r15                                                            ; +0x26b, 0x1403f7f7b\npop     r14                                                            ; +0x26d, 0x1403f7f7d\npop     r13                                                            ; +0x26f, 0x1403f7f7f\npop     r12                                                            ; +0x271, 0x1403f7f81\npop     rdi                                                            ; +0x273, 0x1403f7f83\npop     rsi                                                            ; +0x274, 0x1403f7f84\npop     rbp                                                            ; +0x275, 0x1403f7f85\nretn                                                                   ; +0x276, 0x1403f7f86", "xrefs": ["EditorUI::dynamicGroupUpdate @ 0x1401b894e", "EditorUI::assignNewGroups @ 0x1401b8fae", "EditorUI::createLoop @ 0x1401b960b", "EditorUI::createLoop @ 0x1401b98c1", "sub_1401BA030 @ 0x1401ba0c3", "EditorUI::editGroup @ 0x1401be9c6", "IDNameBrowserPopup::onFormNextFree @ 0x1403c45f0", "IDNameInput::onNextFree @ 0x1403c95e3", "<???> @ 0x1409255c8"], "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"}