{"type": "func", "start": 4300533600, "end": 4300533795, "name": "GameLevelManager::getNextFreeTemplateID", "pseudocode": "// \n// GameLevelManager::getNextFreeTemplateID from 0x10054ef60 to 0x10054f023 (195 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::createSmartTemplate @ 0x10054f045\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:32:02 +0000\n// \n\n__int64 __fastcall GameLevelManager::getNextFreeTemplateID(__int64 a1)\n{\n  _QWORD *v1; // rbx\n  void *v2; // r12\n  unsigned int v3; // r13d\n  int v4; // r14d\n  __int64 v5; // rdx\n  __int64 v6; // r15\n\n  v1 = cocos2d::CCDictionary::create();\n  v2 = cocos2d::CCNode::create();\n  if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 1520)) )\n  {\n    v3 = 0;\n    v4 = 0;\n    do\n    {\n      v5 = *(int *)(sub_1007FEFE0(*(_QWORD *)(a1 + 1520), v3) + 192);\n      if ( (int)v5 > v4 )\n        v4 = v5;\n      cocos2d::CCDictionary::setObject_1((__int64)v1, (__int64)v2, v5);\n      ++v3;\n    }\n    while ( v3 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 1520)) );\n  }\n  else\n  {\n    v4 = 0;\n  }\n  v6 = 1;\n  while ( cocos2d::CCDictionary::objectForKey_1((__int64)v1, v6) )\n  {\n    if ( ++v6 == 1001 )\n      return (unsigned int)v4;\n  }\n  return (unsigned int)v6;\n}", "assembly": "; \n; GameLevelManager::getNextFreeTemplateID from 0x10054ef60 to 0x10054f023 (195 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::createSmartTemplate @ 0x10054f045\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:32:02 +0000\n; \npush    rbp                                                            ; +0x0, 0x10054ef60\nmov     rbp, rsp                                                       ; +0x1, 0x10054ef61\npush    r15                                                            ; +0x4, 0x10054ef64\npush    r14                                                            ; +0x6, 0x10054ef66\npush    r13                                                            ; +0x8, 0x10054ef68\npush    r12                                                            ; +0xa, 0x10054ef6a\npush    rbx                                                            ; +0xc, 0x10054ef6c\npush    rax                                                            ; +0xd, 0x10054ef6d\nmov     r15, rdi                                                       ; +0xe, 0x10054ef6e\ncall    cocos2d__CCDictionary__create                                  ; +0x11, 0x10054ef71\nmov     rbx, rax                                                       ; +0x16, 0x10054ef76\ncall    cocos2d__CCNode__create                                        ; +0x19, 0x10054ef79\nmov     r12, rax                                                       ; +0x1e, 0x10054ef7e\nmov     rdi, [r15+5F0h]                                                ; +0x21, 0x10054ef81\ncall    sub_1007FEF90                                                  ; +0x28, 0x10054ef88\ntest    eax, eax                                                       ; +0x2d, 0x10054ef8d\njz      short loc_10054EFDE                                            ; +0x2f, 0x10054ef8f\nxor     r13d, r13d                                                     ; +0x31, 0x10054ef91\nxor     r14d, r14d                                                     ; +0x34, 0x10054ef94\nnop     word ptr [rax+rax+00000000h]                                   ; +0x37, 0x10054ef97\nmov     rdi, [r15+5F0h]                                                ; +0x40, 0x10054efa0\nmov     esi, r13d                                                      ; +0x47, 0x10054efa7\ncall    sub_1007FEFE0                                                  ; +0x4a, 0x10054efaa\nmovsxd  rdx, dword ptr [rax+0C0h]                                      ; +0x4f, 0x10054efaf\ncmp     edx, r14d                                                      ; +0x56, 0x10054efb6\ncmovg   r14d, edx                                                      ; +0x59, 0x10054efb9\nmov     rdi, rbx                                                       ; +0x5d, 0x10054efbd\nmov     rsi, r12                                                       ; +0x60, 0x10054efc0\ncall    cocos2d__CCDictionary__setObject_1                             ; +0x63, 0x10054efc3\ninc     r13d                                                           ; +0x68, 0x10054efc8\nmov     rdi, [r15+5F0h]                                                ; +0x6b, 0x10054efcb\ncall    sub_1007FEF90                                                  ; +0x72, 0x10054efd2\ncmp     r13d, eax                                                      ; +0x77, 0x10054efd7\njb      short loc_10054EFA0                                            ; +0x7a, 0x10054efda\njmp     short loc_10054EFE1                                            ; +0x7c, 0x10054efdc\nxor     r14d, r14d                                                     ; +0x7e, 0x10054efde\nmov     r15d, 1                                                        ; +0x81, 0x10054efe1\nnop     word ptr [rax+rax+00000000h]                                   ; +0x87, 0x10054efe7\nmov     rdi, rbx                                                       ; +0x90, 0x10054eff0\nmov     rsi, r15                                                       ; +0x93, 0x10054eff3\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0x96, 0x10054eff6\ntest    rax, rax                                                       ; +0x9b, 0x10054effb\njz      short loc_10054F00E                                            ; +0x9e, 0x10054effe\ninc     r15                                                            ; +0xa0, 0x10054f000\ncmp     r15, 3E9h                                                      ; +0xa3, 0x10054f003\njnz     short loc_10054EFF0                                            ; +0xaa, 0x10054f00a\njmp     short loc_10054F011                                            ; +0xac, 0x10054f00c\nmov     r14d, r15d                                                     ; +0xae, 0x10054f00e\nmov     eax, r14d                                                      ; +0xb1, 0x10054f011\nadd     rsp, 8                                                         ; +0xb4, 0x10054f014\npop     rbx                                                            ; +0xb8, 0x10054f018\npop     r12                                                            ; +0xb9, 0x10054f019\npop     r13                                                            ; +0xbb, 0x10054f01b\npop     r14                                                            ; +0xbd, 0x10054f01d\npop     r15                                                            ; +0xbf, 0x10054f01f\npop     rbp                                                            ; +0xc1, 0x10054f021\nretn                                                                   ; +0xc2, 0x10054f022", "xrefs": ["GameLevelManager::createSmartTemplate @ 0x10054f045"], "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"}