{"type": "func", "start": 4300450272, "end": 4300450467, "name": "GameLevelManager::getNextFreeTemplateID", "pseudocode": "// \n// GameLevelManager::getNextFreeTemplateID from 0x10053a9e0 to 0x10053aaa3 (195 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::createSmartTemplate @ 0x10053aac5\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nint __fastcall GameLevelManager::getNextFreeTemplateID(GameLevelManager *a1)\n{\n  cocos2d::CCDictionary *v1; // rbx\n  cocos2d::CCNode *v2; // r12\n  unsigned int v3; // r13d\n  int v4; // r14d\n  intptr_t v5; // rdx\n  intptr_t v6; // r15\n\n  v1 = cocos2d::CCDictionary::create();\n  v2 = cocos2d::CCNode::create();\n  if ( (unsigned int)sub_100720070(a1->m_smartTemplates) )\n  {\n    v3 = 0;\n    v4 = 0;\n    do\n    {\n      v5 = *(int *)(sub_1007200C0(a1->m_smartTemplates, v3) + 192);\n      if ( (int)v5 > v4 )\n        v4 = v5;\n      cocos2d::CCDictionary::setObject(v1, v2, v5);\n      ++v3;\n    }\n    while ( v3 < (unsigned int)sub_100720070(a1->m_smartTemplates) );\n  }\n  else\n  {\n    v4 = 0;\n  }\n  v6 = 1;\n  while ( cocos2d::CCDictionary::objectForKey(v1, v6) )\n  {\n    if ( ++v6 == 1001 )\n      return v4;\n  }\n  return v6;\n}", "assembly": "; \n; GameLevelManager::getNextFreeTemplateID from 0x10053a9e0 to 0x10053aaa3 (195 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::createSmartTemplate @ 0x10053aac5\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\npush    rbp                                                            ; +0x0, 0x10053a9e0\nmov     rbp, rsp                                                       ; +0x1, 0x10053a9e1\npush    r15                                                            ; +0x4, 0x10053a9e4\npush    r14                                                            ; +0x6, 0x10053a9e6\npush    r13                                                            ; +0x8, 0x10053a9e8\npush    r12                                                            ; +0xa, 0x10053a9ea\npush    rbx                                                            ; +0xc, 0x10053a9ec\npush    rax                                                            ; +0xd, 0x10053a9ed\nmov     r15, rdi                                                       ; +0xe, 0x10053a9ee\ncall    cocos2d__CCDictionary__create                                  ; +0x11, 0x10053a9f1\nmov     rbx, rax                                                       ; +0x16, 0x10053a9f6\ncall    cocos2d__CCNode__create                                        ; +0x19, 0x10053a9f9\nmov     r12, rax                                                       ; +0x1e, 0x10053a9fe\nmov     rdi, [r15+3B0h]                                                ; +0x21, 0x10053aa01\ncall    sub_100720070                                                  ; +0x28, 0x10053aa08\ntest    eax, eax                                                       ; +0x2d, 0x10053aa0d\njz      short loc_10053AA5E                                            ; +0x2f, 0x10053aa0f\nxor     r13d, r13d                                                     ; +0x31, 0x10053aa11\nxor     r14d, r14d                                                     ; +0x34, 0x10053aa14\nnop     word ptr [rax+rax+00000000h]                                   ; +0x37, 0x10053aa17\nmov     rdi, [r15+3B0h]                                                ; +0x40, 0x10053aa20\nmov     esi, r13d                                                      ; +0x47, 0x10053aa27\ncall    sub_1007200C0                                                  ; +0x4a, 0x10053aa2a\nmovsxd  rdx, dword ptr [rax+0C0h]                                      ; +0x4f, 0x10053aa2f\ncmp     edx, r14d                                                      ; +0x56, 0x10053aa36\ncmovg   r14d, edx                                                      ; +0x59, 0x10053aa39\nmov     rdi, rbx                                                       ; +0x5d, 0x10053aa3d\nmov     rsi, r12                                                       ; +0x60, 0x10053aa40\ncall    cocos2d__CCDictionary__setObject                               ; +0x63, 0x10053aa43\ninc     r13d                                                           ; +0x68, 0x10053aa48\nmov     rdi, [r15+3B0h]                                                ; +0x6b, 0x10053aa4b\ncall    sub_100720070                                                  ; +0x72, 0x10053aa52\ncmp     r13d, eax                                                      ; +0x77, 0x10053aa57\njb      short loc_10053AA20                                            ; +0x7a, 0x10053aa5a\njmp     short loc_10053AA61                                            ; +0x7c, 0x10053aa5c\nxor     r14d, r14d                                                     ; +0x7e, 0x10053aa5e\nmov     r15d, 1                                                        ; +0x81, 0x10053aa61\nnop     word ptr [rax+rax+00000000h]                                   ; +0x87, 0x10053aa67\nmov     rdi, rbx                                                       ; +0x90, 0x10053aa70\nmov     rsi, r15                                                       ; +0x93, 0x10053aa73\ncall    cocos2d__CCDictionary__objectForKey                            ; +0x96, 0x10053aa76\ntest    rax, rax                                                       ; +0x9b, 0x10053aa7b\njz      short loc_10053AA8E                                            ; +0x9e, 0x10053aa7e\ninc     r15                                                            ; +0xa0, 0x10053aa80\ncmp     r15, 3E9h                                                      ; +0xa3, 0x10053aa83\njnz     short loc_10053AA70                                            ; +0xaa, 0x10053aa8a\njmp     short loc_10053AA91                                            ; +0xac, 0x10053aa8c\nmov     r14d, r15d                                                     ; +0xae, 0x10053aa8e\nmov     eax, r14d                                                      ; +0xb1, 0x10053aa91\nadd     rsp, 8                                                         ; +0xb4, 0x10053aa94\npop     rbx                                                            ; +0xb8, 0x10053aa98\npop     r12                                                            ; +0xb9, 0x10053aa99\npop     r13                                                            ; +0xbb, 0x10053aa9b\npop     r14                                                            ; +0xbd, 0x10053aa9d\npop     r15                                                            ; +0xbf, 0x10053aa9f\npop     rbp                                                            ; +0xc1, 0x10053aaa1\nretn                                                                   ; +0xc2, 0x10053aaa2", "xrefs": ["GameLevelManager::createSmartTemplate @ 0x10053aac5"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}