{"type": "func", "start": 4295599856, "end": 4295600044, "name": "GameLevelManager::getNextFreeTemplateID", "pseudocode": "// \n// GameLevelManager::getNextFreeTemplateID from 0x10009a6f0 to 0x10009a7ac (188 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::createSmartTemplate @ 0x10009a7c8\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 *v2; // x19\n  cocos2d::CCNode *v3; // x22\n  __int64 v4; // x23\n  int v5; // w20\n  intptr_t v6; // x2\n  intptr_t v7; // x21\n\n  v2 = cocos2d::CCDictionary::create();\n  v3 = cocos2d::CCNode::create();\n  if ( (unsigned int)sub_10024A36C(a1->m_smartTemplates) )\n  {\n    v4 = 0;\n    v5 = 0;\n    do\n    {\n      v6 = *(int *)(sub_10024A388(a1->m_smartTemplates, v4) + 192);\n      if ( (int)v6 > v5 )\n        v5 = v6;\n      cocos2d::CCDictionary::setObject(v2, v3, v6);\n      v4 = (unsigned int)(v4 + 1);\n    }\n    while ( (unsigned int)v4 < (unsigned int)sub_10024A36C(a1->m_smartTemplates) );\n  }\n  else\n  {\n    v5 = 0;\n  }\n  v7 = 1;\n  while ( cocos2d::CCDictionary::objectForKey(v2, v7) )\n  {\n    if ( ++v7 == 1001 )\n      return v5;\n  }\n  return v7;\n}", "assembly": "; \n; GameLevelManager::getNextFreeTemplateID from 0x10009a6f0 to 0x10009a7ac (188 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::createSmartTemplate @ 0x10009a7c8\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\nSTP             X24, X23, [SP,#-0x10+var_30]!                          ; +0x0, 0x10009a6f0\nSTP             X22, X21, [SP,#0x30+var_20]                            ; +0x4, 0x10009a6f4\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x8, 0x10009a6f8\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0xc, 0x10009a6fc\nADD             X29, SP, #0x30                                         ; +0x10, 0x10009a700\nMOV             X21, X0                                                ; +0x14, 0x10009a704\nBL              cocos2d__CCDictionary__create                          ; +0x18, 0x10009a708\nMOV             X19, X0                                                ; +0x1c, 0x10009a70c\nBL              cocos2d__CCNode__create                                ; +0x20, 0x10009a710\nMOV             X22, X0                                                ; +0x24, 0x10009a714\nLDR             X0, [X21,#0x3B0]                                       ; +0x28, 0x10009a718\nBL              sub_10024A36C                                          ; +0x2c, 0x10009a71c\nCBZ             W0, loc_10009A768                                      ; +0x30, 0x10009a720\nMOV             W23, #0                                                ; +0x34, 0x10009a724\nMOV             W20, #0                                                ; +0x38, 0x10009a728\nLDR             X0, [X21,#0x3B0]                                       ; +0x3c, 0x10009a72c\nMOV             X1, X23                                                ; +0x40, 0x10009a730\nBL              sub_10024A388                                          ; +0x44, 0x10009a734\nLDRSW           X2, [X0,#0xC0]                                         ; +0x48, 0x10009a738\nCMP             W2, W20                                                ; +0x4c, 0x10009a73c\nCSEL            W20, W2, W20, GT                                       ; +0x50, 0x10009a740\nMOV             X0, X19                                                ; +0x54, 0x10009a744\nMOV             X1, X22                                                ; +0x58, 0x10009a748\nBL              cocos2d__CCDictionary__setObject                       ; +0x5c, 0x10009a74c\nADD             W23, W23, #1                                           ; +0x60, 0x10009a750\nLDR             X0, [X21,#0x3B0]                                       ; +0x64, 0x10009a754\nBL              sub_10024A36C                                          ; +0x68, 0x10009a758\nCMP             W23, W0                                                ; +0x6c, 0x10009a75c\nB.CC            loc_10009A72C                                          ; +0x70, 0x10009a760\nB               loc_10009A76C                                          ; +0x74, 0x10009a764\nMOV             W20, #0                                                ; +0x78, 0x10009a768\nMOV             W21, #1                                                ; +0x7c, 0x10009a76c\nMOV             X0, X19                                                ; +0x80, 0x10009a770\nMOV             X1, X21                                                ; +0x84, 0x10009a774\nBL              cocos2d__CCDictionary__objectForKey                    ; +0x88, 0x10009a778\nCBZ             X0, loc_10009A790                                      ; +0x8c, 0x10009a77c\nADD             X21, X21, #1                                           ; +0x90, 0x10009a780\nCMP             X21, #0x3E9                                            ; +0x94, 0x10009a784\nB.NE            loc_10009A770                                          ; +0x98, 0x10009a788\nB               loc_10009A794                                          ; +0x9c, 0x10009a78c\nMOV             X20, X21                                               ; +0xa0, 0x10009a790\nMOV             X0, X20                                                ; +0xa4, 0x10009a794\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0xa8, 0x10009a798\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0xac, 0x10009a79c\nLDP             X22, X21, [SP,#0x30+var_20]                            ; +0xb0, 0x10009a7a0\nLDP             X24, X23, [SP+0x30+var_30],#0x40                       ; +0xb4, 0x10009a7a4\nRET                                                                    ; +0xb8, 0x10009a7a8", "xrefs": ["GameLevelManager::createSmartTemplate @ 0x10009a7c8"], "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"}