{"type": "func", "start": 7562560, "end": 7562984, "name": "GJLevelList::addLevelToList", "pseudocode": "// \n// GJLevelList::addLevelToList from 0x736540 to 0x7366e8 (424 bytes)\n// \n// 3 xrefs:\n// > LevelInfoLayer::cellPerformedAction @ 0x6d6670\n// > GJLevelList::duplicateListLevels @ 0x736720\n// > <???> @ 0x9f1b0\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\nvoid GJLevelList::addLevelToList(GJLevelList *a1, GJGameLevel *a2)\n{\n  int *m_start; // x0\n  int *m_finish; // x2\n  int random; // w3\n  int seed; // w4\n  int v8; // w3\n  int *i; // x0\n  int v10; // t1\n  int *m_reserveEnd; // x1\n  cocos2d::CCDictionary *m_levelsDict; // x23\n  void *v13; // x0\n  unsigned int *v14; // x2\n  int v15; // w1\n  GJGameLevel *ListSnapshot; // [xsp+48h] [xbp+48h]\n  __int64 v17; // [xsp+60h] [xbp+60h] BYREF\n\n  m_start = a1->m_levels.m_start;\n  m_finish = a1->m_levels.m_finish;\n  random = a2->m_levelID.random;\n  seed = a2->m_levelID.seed;\n  if ( m_finish == m_start )\n  {\n    v8 = random - seed;\n  }\n  else\n  {\n    v8 = random - seed;\n    if ( *m_start == v8 )\n      return;\n    for ( i = m_start + 1; m_finish != i; ++i )\n    {\n      v10 = *i;\n      if ( v10 == v8 )\n        return;\n    }\n  }\n  m_reserveEnd = a1->m_levels.m_reserveEnd;\n  LODWORD(v17) = v8;\n  if ( m_finish == m_reserveEnd )\n  {\n    std::vector<int>::_M_emplace_back_aux<int>((__int64)&a1->m_levels, &v17);\n  }\n  else\n  {\n    if ( m_finish )\n      *m_finish = v8;\n    a1->m_levels.m_finish = m_finish + 1;\n  }\n  GJLevelList::updateLevelsString(a1);\n  m_levelsDict = a1->m_levelsDict;\n  ListSnapshot = GJGameLevel::getListSnapshot(a2);\n  GameToolbox::intToString(&v17, (GameToolbox *)(unsigned int)(a2->m_levelID.random - a2->m_levelID.seed));\n  cocos2d::CCDictionary::setObject((int)m_levelsDict, ListSnapshot);\n  v13 = (void *)(v17 - 24);\n  if ( (__int64 *)(v17 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v14 = (unsigned int *)(v17 - 8);\n      do\n        v15 = __ldaxr(v14);\n      while ( __stlxr(v15 - 1, v14) );\n    }\n    else\n    {\n      v15 = *(_DWORD *)(v17 - 8);\n      *(_DWORD *)(v17 - 8) = v15 - 1;\n    }\n    if ( v15 <= 0 )\n      operator delete(v13);\n  }\n  a1->m_modified = 1;\n}", "assembly": "; \n; GJLevelList::addLevelToList from 0x736540 to 0x7366e8 (424 bytes)\n; \n; 3 xrefs:\n; > LevelInfoLayer::cellPerformedAction @ 0x6d6670\n; > GJLevelList::duplicateListLevels @ 0x736720\n; > <???> @ 0x9f1b0\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_70]!                                ; +0x0, 0x736540\nMOV             X29, SP                                                ; +0x4, 0x736544\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x736548\nADRP            X20, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x73654c\nMOV             X19, X0                                                ; +0x10, 0x736550\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0x736554\nMOV             X21, X1                                                ; +0x18, 0x736558\nLDR             X0, [X0,#0x140]                                        ; +0x1c, 0x73655c\nLDR             X1, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x736560\nLDR             X2, [X19,#0x148]                                       ; +0x24, 0x736564\nSTR             X23, [SP,#0x70+var_40]                                 ; +0x28, 0x736568\nLDR             X1, [X1]                                               ; +0x2c, 0x73656c\nCMP             X2, X0                                                 ; +0x30, 0x736570\nSTR             X1, [X29,#0x70+var_8]                                  ; +0x34, 0x736574\nLDR             W3, [X21,#0x148]                                       ; +0x38, 0x736578\nLDR             W4, [X21,#0x14C]                                       ; +0x3c, 0x73657c\nB.EQ            loc_7366B0                                             ; +0x40, 0x736580\nLDR             W1, [X0]                                               ; +0x44, 0x736584\nSUB             W3, W3, W4                                             ; +0x48, 0x736588\nCMP             W1, W3                                                 ; +0x4c, 0x73658c\nB.EQ            loc_736634                                             ; +0x50, 0x736590\nADD             X0, X0, #4                                             ; +0x54, 0x736594\nB               loc_7365A8                                             ; +0x58, 0x736598\nLDR             W1, [X0],#4                                            ; +0x5c, 0x73659c\nCMP             W1, W3                                                 ; +0x60, 0x7365a0\nB.EQ            loc_736634                                             ; +0x64, 0x7365a4\nCMP             X2, X0                                                 ; +0x68, 0x7365a8\nB.NE            loc_73659C                                             ; +0x6c, 0x7365ac\nADD             X0, X19, #0x140                                        ; +0x70, 0x7365b0\nLDR             X1, [X0,#0x10]                                         ; +0x74, 0x7365b4\nSTR             W3, [X29,#0x70+var_10]                                 ; +0x78, 0x7365b8\nCMP             X2, X1                                                 ; +0x7c, 0x7365bc\nB.EQ            loc_736690                                             ; +0x80, 0x7365c0\nCBZ             X2, loc_7365CC                                         ; +0x84, 0x7365c4\nSTR             W3, [X2]                                               ; +0x88, 0x7365c8\nADD             X3, X2, #4                                             ; +0x8c, 0x7365cc\nADD             X22, X29, #0x70+var_10                                 ; +0x90, 0x7365d0\nSTR             X3, [X0,#8]                                            ; +0x94, 0x7365d4\nMOV             X0, X19; this                                          ; +0x98, 0x7365d8\nBL              _ZN11GJLevelList18updateLevelsStringEv; GJLevelList::updateLevelsString(void) ; +0x9c, 0x7365dc\nLDR             X23, [X19,#0x1C0]                                      ; +0xa0, 0x7365e0\nMOV             X0, X21; this                                          ; +0xa4, 0x7365e4\nBL              _ZN11GJGameLevel15getListSnapshotEv; GJGameLevel::getListSnapshot(void) ; +0xa8, 0x7365e8\nSTR             X0, [X29,#0x70+var_28]                                 ; +0xac, 0x7365ec\nLDR             W2, [X21,#0x148]                                       ; +0xb0, 0x7365f0\nMOV             X8, X22                                                ; +0xb4, 0x7365f4\nLDR             W0, [X21,#0x14C]                                       ; +0xb8, 0x7365f8\nSUB             W0, W2, W0; this                                       ; +0xbc, 0x7365fc\nBL              _ZN11GameToolbox11intToStringEi; GameToolbox::intToString(int) ; +0xc0, 0x736600\nLDR             X1, [X29,#0x70+var_28]; this                           ; +0xc4, 0x736604\nMOV             X0, X23; int                                           ; +0xc8, 0x736608\nMOV             X2, X22                                                ; +0xcc, 0x73660c\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectERKSs; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const&) ; +0xd0, 0x736610\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xd4, 0x736614\nLDR             X2, [X29,#0x70+var_10]                                 ; +0xd8, 0x736618\nSUB             X0, X2, #0x18; p                                       ; +0xdc, 0x73661c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xe0, 0x736620\nCMP             X0, X1                                                 ; +0xe4, 0x736624\nB.NE            loc_73665C                                             ; +0xe8, 0x736628\nMOV             W0, #1                                                 ; +0xec, 0x73662c\nSTRB            W0, [X19,#0x18F]                                       ; +0xf0, 0x736630\nLDR             X20, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xf4, 0x736634\nLDR             X1, [X29,#0x70+var_8]                                  ; +0xf8, 0x736638\nLDR             X0, [X20]                                              ; +0xfc, 0x73663c\nCMP             X1, X0                                                 ; +0x100, 0x736640\nB.NE            loc_7366B8                                             ; +0x104, 0x736644\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x108, 0x736648\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x10c, 0x73664c\nLDR             X23, [SP,#0x70+var_40]                                 ; +0x110, 0x736650\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x114, 0x736654\nRET                                                                    ; +0x118, 0x736658\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x11c, 0x73665c\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x120, 0x736660\nCBZ             X1, loc_7366A0                                         ; +0x124, 0x736664\nSUB             X2, X2, #8                                             ; +0x128, 0x736668\nLDAXR           W1, [X2]                                               ; +0x12c, 0x73666c\nSUB             W3, W1, #1                                             ; +0x130, 0x736670\nSTLXR           W4, W3, [X2]                                           ; +0x134, 0x736674\nCBNZ            W4, loc_73666C                                         ; +0x138, 0x736678\nCMP             W1, WZR                                                ; +0x13c, 0x73667c\nB.GT            loc_73662C                                             ; +0x140, 0x736680\nADD             X1, X29, #0x70+var_18                                  ; +0x144, 0x736684\nBL              j__ZdlPv; operator delete(void *)                      ; +0x148, 0x736688\nB               loc_73662C                                             ; +0x14c, 0x73668c\nADD             X22, X29, #0x70+var_10                                 ; +0x150, 0x736690\nMOV             X1, X22                                                ; +0x154, 0x736694\nBL              _ZNSt6vectorIiSaIiEE19_M_emplace_back_auxIJiEEEvDpOT_; std::vector<int>::_M_emplace_back_aux<int>(int &&) ; +0x158, 0x736698\nB               loc_7365D8                                             ; +0x15c, 0x73669c\nLDUR            W1, [X2,#-8]                                           ; +0x160, 0x7366a0\nSUB             W3, W1, #1                                             ; +0x164, 0x7366a4\nSTUR            W3, [X2,#-8]                                           ; +0x168, 0x7366a8\nB               loc_73667C                                             ; +0x16c, 0x7366ac\nSUB             W3, W3, W4                                             ; +0x170, 0x7366b0\nB               loc_7365B0                                             ; +0x174, 0x7366b4\nBL              .__stack_chk_fail                                      ; +0x178, 0x7366b8\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x17c, 0x7366bc\nMOV             X19, X0                                                ; +0x180, 0x7366c0\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x184, 0x7366c4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x188, 0x7366c8\nSUB             X0, X0, #0x18                                          ; +0x18c, 0x7366cc\nCMP             X0, X1                                                 ; +0x190, 0x7366d0\nB.EQ            loc_7366E0                                             ; +0x194, 0x7366d4\nADD             X1, X29, #0x70+var_18                                  ; +0x198, 0x7366d8\nBL              sub_6EE220                                             ; +0x19c, 0x7366dc\nMOV             X0, X19                                                ; +0x1a0, 0x7366e0\nBL              _Unwind_Resume                                         ; +0x1a4, 0x7366e4", "xrefs": ["LevelInfoLayer::cellPerformedAction @ 0x6d6670", "GJLevelList::duplicateListLevels @ 0x736720", "<???> @ 0x9f1b0"], "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"}