{"type": "func", "start": 4298313564, "end": 4298313808, "name": "GameStatsManager::completedStarLevel", "pseudocode": "// \n// GameStatsManager::completedStarLevel from 0x100330f5c to 0x100331050 (244 bytes)\n// \n// 4 xrefs:\n// > LevelInfoLayer::init @ 0x100025888\n// > GameLevelManager::updateLevelRewards @ 0x100093a6c\n// > GameManager::verifyStarUnlocks @ 0x100313ee0\n// > GameStatsManager::completedLevel @ 0x100330e4c\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 __fastcall GameStatsManager::completedStarLevel(GameStatsManager *a1, GJGameLevel *a2)\n{\n  _BOOL8 hasCompletedStarLevel; // x0\n  char *StarLevelKey; // x0\n  cocos2d::CCDictionary *m_completedLevels; // x21\n  cocos2d::CCString *m_trueString; // x22\n  int v8; // w2\n  const char *v9; // x1\n  void *__p[2]; // [xsp+8h] [xbp-38h] BYREF\n  char v11; // [xsp+1Fh] [xbp-21h]\n\n  hasCompletedStarLevel = GameStatsManager::hasCompletedStarLevel(a1, a2);\n  if ( !hasCompletedStarLevel && a2->m_stars.random > a2->m_stars.seed )\n  {\n    StarLevelKey = (char *)GameStatsManager::getStarLevelKey((GameStatsManager *)hasCompletedStarLevel, a2);\n    m_completedLevels = a1->m_completedLevels;\n    m_trueString = a1->m_trueString;\n    sub_100009900(__p, StarLevelKey);\n    cocos2d::CCDictionary::setObject_1(m_completedLevels, m_trueString, __p);\n    if ( v11 < 0 )\n      operator delete(__p[0]);\n    v8 = a2->m_stars.random - a2->m_stars.seed;\n    if ( v8 >= 11 && a2->m_levelType != Main )\n      v8 = 0;\n    if ( a2->m_levelLength == 5 )\n      v9 = \"28\";\n    else\n      v9 = \"6\";\n    GameStatsManager::incrementStat(a1, v9, v8);\n    if ( ((a2->m_stars.random - a2->m_stars.seed) & 0xFFFFFFFE) == 8 )\n      GameStatsManager::incrementStat(a1, \"42\", 1);\n  }\n}", "assembly": "; \n; GameStatsManager::completedStarLevel from 0x100330f5c to 0x100331050 (244 bytes)\n; \n; 4 xrefs:\n; > LevelInfoLayer::init @ 0x100025888\n; > GameLevelManager::updateLevelRewards @ 0x100093a6c\n; > GameManager::verifyStarUnlocks @ 0x100313ee0\n; > GameStatsManager::completedLevel @ 0x100330e4c\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\nSUB             SP, SP, #0x50                                          ; +0x0, 0x100330f5c\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x4, 0x100330f60\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0x8, 0x100330f64\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0xc, 0x100330f68\nADD             X29, SP, #0x40                                         ; +0x10, 0x100330f6c\nMOV             X20, X1                                                ; +0x14, 0x100330f70\nMOV             X19, X0                                                ; +0x18, 0x100330f74\nBL              GameStatsManager__hasCompletedStarLevel                ; +0x1c, 0x100330f78\nTBNZ            W0, #0, loc_10033103C                                  ; +0x20, 0x100330f7c\nLDR             W8, [X20,#0x340]                                       ; +0x24, 0x100330f80\nLDR             W9, [X20,#0x344]                                       ; +0x28, 0x100330f84\nCMP             W8, W9                                                 ; +0x2c, 0x100330f88\nB.LE            loc_10033103C                                          ; +0x30, 0x100330f8c\nMOV             X1, X20                                                ; +0x34, 0x100330f90\nBL              GameStatsManager__getStarLevelKey                      ; +0x38, 0x100330f94\nMOV             X1, X0; __s                                            ; +0x3c, 0x100330f98\nLDR             X21, [X19,#0x260]                                      ; +0x40, 0x100330f9c\nLDR             X22, [X19,#0x140]                                      ; +0x44, 0x100330fa0\nADD             X0, SP, #0x40+__p; int                                 ; +0x48, 0x100330fa4\nBL              sub_100009900                                          ; +0x4c, 0x100330fa8\nADD             X2, SP, #0x40+__p                                      ; +0x50, 0x100330fac\nMOV             X0, X21                                                ; +0x54, 0x100330fb0\nMOV             X1, X22                                                ; +0x58, 0x100330fb4\nBL              cocos2d__CCDictionary__setObject_1                     ; +0x5c, 0x100330fb8\nLDRSB           W8, [SP,#0x40+var_21]                                  ; +0x60, 0x100330fbc\nTBZ             W8, #0x1F, loc_100330FCC                               ; +0x64, 0x100330fc0\nLDR             X0, [SP,#0x40+__p]; __p                                ; +0x68, 0x100330fc4\nBL              __ZdlPv; operator delete(void *)                       ; +0x6c, 0x100330fc8\nLDR             W8, [X20,#0x340]                                       ; +0x70, 0x100330fcc\nLDR             W9, [X20,#0x344]                                       ; +0x74, 0x100330fd0\nSUB             W2, W8, W9                                             ; +0x78, 0x100330fd4\nCMP             W2, #0xB                                               ; +0x7c, 0x100330fd8\nB.LT            loc_100330FEC                                          ; +0x80, 0x100330fdc\nLDR             W8, [X20,#0x404]                                       ; +0x84, 0x100330fe0\nCMP             W8, #1                                                 ; +0x88, 0x100330fe4\nCSEL            W2, W2, WZR, EQ                                        ; +0x8c, 0x100330fe8\nLDR             W8, [X20,#0x310]                                       ; +0x90, 0x100330fec\nADRL            X9, a6; \"6\"                                            ; +0x94, 0x100330ff0\nADRL            X10, a28; \"28\"                                         ; +0x9c, 0x100330ff8\nCMP             W8, #5                                                 ; +0xa4, 0x100331000\nCSEL            X1, X10, X9, EQ; char *                                ; +0xa8, 0x100331004\nMOV             X0, X19; int                                           ; +0xac, 0x100331008\nBL              GameStatsManager__incrementStat                        ; +0xb0, 0x10033100c\nLDR             W8, [X20,#0x340]                                       ; +0xb4, 0x100331010\nLDR             W9, [X20,#0x344]                                       ; +0xb8, 0x100331014\nSUB             W8, W8, W9                                             ; +0xbc, 0x100331018\nAND             W8, W8, #0xFFFFFFFE                                    ; +0xc0, 0x10033101c\nCMP             W8, #8                                                 ; +0xc4, 0x100331020\nB.NE            loc_10033103C                                          ; +0xc8, 0x100331024\nADRL            X1, a42; \"42\"                                          ; +0xcc, 0x100331028\nMOV             X0, X19; int                                           ; +0xd4, 0x100331030\nMOV             W2, #1                                                 ; +0xd8, 0x100331034\nBL              GameStatsManager__incrementStat                        ; +0xdc, 0x100331038\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0xe0, 0x10033103c\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0xe4, 0x100331040\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0xe8, 0x100331044\nADD             SP, SP, #0x50 ; 'P'                                    ; +0xec, 0x100331048\nRET                                                                    ; +0xf0, 0x10033104c", "xrefs": ["LevelInfoLayer::init @ 0x100025888", "GameLevelManager::updateLevelRewards @ 0x100093a6c", "GameManager::verifyStarUnlocks @ 0x100313ee0", "GameStatsManager::completedLevel @ 0x100330e4c"], "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"}