{"type": "func", "start": 7347616, "end": 7347888, "name": "GJGameLevel::getLastBuildPageForTab", "pseudocode": "// \n// GJGameLevel::getLastBuildPageForTab from 0x701da0 to 0x701eb0 (272 bytes)\n// \n// 2 xrefs:\n// > EditorUI::setupCreateMenu @ 0x6b35a0\n// > <???> @ 0x362a0\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\n// local variable allocation has failed, the output may be wrong!\nint GJGameLevel::getLastBuildPageForTab(GJGameLevel *a1, int a2)\n{\n  cocos2d::CCDictionary *m_lastBuildSave; // x21\n  cocos2d::CCString *v3; // x0\n  char *CString; // x0\n  cocos2d::CCString *v5; // x0\n  int v6; // w20\n  char *v7; // x0\n  unsigned int *v9; // x2\n  int v10; // w1\n  std::string v11; // [xsp+40h] [xbp+40h] BYREF\n\n  m_lastBuildSave = a1->m_lastBuildSave;\n  v3 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"%i\", *(const char **)&a2);\n  CString = (char *)cocos2d::CCString::getCString(v3);\n  sub_D153B8((int)&v11, CString);\n  v5 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_lastBuildSave, &v11);\n  v6 = cocos2d::CCString::intValue(v5);\n  v7 = (char *)v11.m_data.m_data - 24;\n  if ( (__int64 *)v11.m_data.m_data - 3 != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v9 = (unsigned int *)((char *)v11.m_data.m_data - 8);\n      do\n        v10 = __ldaxr(v9);\n      while ( __stlxr(v10 - 1, v9) );\n    }\n    else\n    {\n      v10 = *((_DWORD *)v11.m_data.m_data - 2);\n      *((_DWORD *)v11.m_data.m_data - 2) = v10 - 1;\n    }\n    if ( v10 <= 0 )\n      operator delete(v7);\n  }\n  return v6;\n}", "assembly": "; \n; GJGameLevel::getLastBuildPageForTab from 0x701da0 to 0x701eb0 (272 bytes)\n; \n; 2 xrefs:\n; > EditorUI::setupCreateMenu @ 0x6b35a0\n; > <???> @ 0x362a0\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             X29, X30, [SP,#var_50]!                                ; +0x0, 0x701da0\nMOV             X29, SP                                                ; +0x4, 0x701da4\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x701da8\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x701dac\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x10, 0x701db0\nLDR             X21, [X0,#0x140]                                       ; +0x14, 0x701db4\nADRL            X0, (aSongidI+8); this                                 ; +0x18, 0x701db8\nADD             X20, X29, #0x50+var_10                                 ; +0x20, 0x701dc0\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x24, 0x701dc4\nLDR             X2, [X2]                                               ; +0x28, 0x701dc8\nSTR             X2, [X29,#0x50+var_8]                                  ; +0x2c, 0x701dcc\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x30, 0x701dd0\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x34, 0x701dd4\nMOV             X1, X0; char *                                         ; +0x38, 0x701dd8\nADD             X2, X29, #0x50+var_20                                  ; +0x3c, 0x701ddc\nMOV             X0, X20; int                                           ; +0x40, 0x701de0\nBL              sub_D153B8                                             ; +0x44, 0x701de4\nMOV             X0, X21                                                ; +0x48, 0x701de8\nMOV             X1, X20                                                ; +0x4c, 0x701dec\nBL              _ZN7cocos2d12CCDictionary11valueForKeyERKSs; cocos2d::CCDictionary::valueForKey(std::string const&) ; +0x50, 0x701df0\nBL              _ZNK7cocos2d8CCString8intValueEv; cocos2d::CCString::intValue(void) ; +0x54, 0x701df4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x58, 0x701df8\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x5c, 0x701dfc\nMOV             W20, W0                                                ; +0x60, 0x701e00\nSUB             X0, X2, #0x18; p                                       ; +0x64, 0x701e04\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x68, 0x701e08\nCMP             X0, X1                                                 ; +0x6c, 0x701e0c\nB.NE            loc_701E3C                                             ; +0x70, 0x701e10\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x74, 0x701e14\nMOV             W0, W20                                                ; +0x78, 0x701e18\nLDR             X2, [X29,#0x50+var_8]                                  ; +0x7c, 0x701e1c\nLDR             X1, [X19]                                              ; +0x80, 0x701e20\nCMP             X2, X1                                                 ; +0x84, 0x701e24\nB.NE            loc_701E80                                             ; +0x88, 0x701e28\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x8c, 0x701e2c\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x90, 0x701e30\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x94, 0x701e34\nRET                                                                    ; +0x98, 0x701e38\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x9c, 0x701e3c\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xa0, 0x701e40\nCBZ             X1, loc_701E70                                         ; +0xa4, 0x701e44\nSUB             X2, X2, #8                                             ; +0xa8, 0x701e48\nLDAXR           W1, [X2]                                               ; +0xac, 0x701e4c\nSUB             W3, W1, #1                                             ; +0xb0, 0x701e50\nSTLXR           W4, W3, [X2]                                           ; +0xb4, 0x701e54\nCBNZ            W4, loc_701E4C                                         ; +0xb8, 0x701e58\nCMP             W1, WZR                                                ; +0xbc, 0x701e5c\nB.GT            loc_701E14                                             ; +0xc0, 0x701e60\nADD             X1, X29, #0x50+var_18                                  ; +0xc4, 0x701e64\nBL              j__ZdlPv; operator delete(void *)                      ; +0xc8, 0x701e68\nB               loc_701E14                                             ; +0xcc, 0x701e6c\nLDUR            W1, [X2,#-8]                                           ; +0xd0, 0x701e70\nSUB             W3, W1, #1                                             ; +0xd4, 0x701e74\nSTUR            W3, [X2,#-8]                                           ; +0xd8, 0x701e78\nB               loc_701E5C                                             ; +0xdc, 0x701e7c\nBL              .__stack_chk_fail                                      ; +0xe0, 0x701e80\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xe4, 0x701e84\nMOV             X19, X0                                                ; +0xe8, 0x701e88\nLDR             X0, [X29,#0x50+var_10]                                 ; +0xec, 0x701e8c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xf0, 0x701e90\nSUB             X0, X0, #0x18                                          ; +0xf4, 0x701e94\nCMP             X0, X1                                                 ; +0xf8, 0x701e98\nB.EQ            loc_701EA8                                             ; +0xfc, 0x701e9c\nADD             X1, X29, #0x50+var_18                                  ; +0x100, 0x701ea0\nBL              sub_6EE220                                             ; +0x104, 0x701ea4\nMOV             X0, X19                                                ; +0x108, 0x701ea8\nBL              _Unwind_Resume                                         ; +0x10c, 0x701eac", "xrefs": ["EditorUI::setupCreateMenu @ 0x6b35a0", "<???> @ 0x362a0"], "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"}