{"type": "func", "start": 4298317324, "end": 4298317556, "name": "GameStatsManager::checkCoinsForLevel", "pseudocode": "// \n// GameStatsManager::checkCoinsForLevel from 0x100331e0c to 0x100331ef4 (232 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::updateLevelRewards @ 0x100093a78\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::checkCoinsForLevel(GameStatsManager *a1, GJGameLevel *a2)\n{\n  int i; // w21\n  char *CoinKey; // x23\n  cocos2d::CCDictionary *m_pendingUserCoins; // x24\n  void *__p[2]; // [xsp+8h] [xbp-48h] BYREF\n  char v8; // [xsp+1Fh] [xbp-31h]\n\n  if ( a2->m_coins >= 1 && a2->m_coinsVerified.random - a2->m_coinsVerified.seed == 1 )\n  {\n    for ( i = 1; i != 4; ++i )\n    {\n      CoinKey = (char *)GJGameLevel::getCoinKey(a2, i);\n      if ( GameStatsManager::hasPendingUserCoin(a1, CoinKey) )\n      {\n        if ( !GameStatsManager::hasUserCoin(a1, CoinKey) )\n        {\n          GameStatsManager::storeUserCoin(a1, CoinKey);\n          GameStatsManager::incrementStat(a1, \"12\", 1);\n        }\n        m_pendingUserCoins = a1->m_pendingUserCoins;\n        sub_100009900(__p, CoinKey);\n        cocos2d::CCDictionary::removeObjectForKey_1((int)m_pendingUserCoins, (char *)__p);\n        if ( v8 < 0 )\n          operator delete(__p[0]);\n      }\n    }\n  }\n}", "assembly": "; \n; GameStatsManager::checkCoinsForLevel from 0x100331e0c to 0x100331ef4 (232 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::updateLevelRewards @ 0x100093a78\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, #0x60                                          ; +0x0, 0x100331e0c\nSTP             X24, X23, [SP,#0x50+var_30]                            ; +0x4, 0x100331e10\nSTP             X22, X21, [SP,#0x50+var_20]                            ; +0x8, 0x100331e14\nSTP             X20, X19, [SP,#0x50+var_10]                            ; +0xc, 0x100331e18\nSTP             X29, X30, [SP,#0x50+var_s0]                            ; +0x10, 0x100331e1c\nADD             X29, SP, #0x50                                         ; +0x14, 0x100331e20\nLDR             W8, [X1,#0x350]                                        ; +0x18, 0x100331e24\nCMP             W8, #1                                                 ; +0x1c, 0x100331e28\nB.LT            loc_100331EDC                                          ; +0x20, 0x100331e2c\nMOV             X19, X1                                                ; +0x24, 0x100331e30\nLDR             W8, [X1,#0x354]                                        ; +0x28, 0x100331e34\nLDR             W9, [X1,#0x358]                                        ; +0x2c, 0x100331e38\nSUB             W8, W8, W9                                             ; +0x30, 0x100331e3c\nCMP             W8, #1                                                 ; +0x34, 0x100331e40\nB.NE            loc_100331EDC                                          ; +0x38, 0x100331e44\nMOV             X20, X0                                                ; +0x3c, 0x100331e48\nMOV             W21, #1                                                ; +0x40, 0x100331e4c\nADRL            X22, a12; \"12\"                                         ; +0x44, 0x100331e50\nMOV             X0, X19                                                ; +0x4c, 0x100331e58\nMOV             X1, X21                                                ; +0x50, 0x100331e5c\nBL              GJGameLevel__getCoinKey                                ; +0x54, 0x100331e60\nMOV             X23, X0                                                ; +0x58, 0x100331e64\nMOV             X0, X20                                                ; +0x5c, 0x100331e68\nMOV             X1, X23                                                ; +0x60, 0x100331e6c\nBL              GameStatsManager__hasPendingUserCoin                   ; +0x64, 0x100331e70\nCBZ             W0, loc_100331ED0                                      ; +0x68, 0x100331e74\nMOV             X0, X20                                                ; +0x6c, 0x100331e78\nMOV             X1, X23                                                ; +0x70, 0x100331e7c\nBL              GameStatsManager__hasUserCoin                          ; +0x74, 0x100331e80\nTBNZ            W0, #0, loc_100331EA4                                  ; +0x78, 0x100331e84\nMOV             X0, X20                                                ; +0x7c, 0x100331e88\nMOV             X1, X23                                                ; +0x80, 0x100331e8c\nBL              GameStatsManager__storeUserCoin                        ; +0x84, 0x100331e90\nMOV             X0, X20; int                                           ; +0x88, 0x100331e94\nMOV             X1, X22; char *                                        ; +0x8c, 0x100331e98\nMOV             W2, #1                                                 ; +0x90, 0x100331e9c\nBL              GameStatsManager__incrementStat                        ; +0x94, 0x100331ea0\nLDR             X24, [X20,#0x270]                                      ; +0x98, 0x100331ea4\nADD             X0, SP, #0x50+__p; int                                 ; +0x9c, 0x100331ea8\nMOV             X1, X23; __s                                           ; +0xa0, 0x100331eac\nBL              sub_100009900                                          ; +0xa4, 0x100331eb0\nADD             X1, SP, #0x50+__p; __s                                 ; +0xa8, 0x100331eb4\nMOV             X0, X24; int                                           ; +0xac, 0x100331eb8\nBL              cocos2d__CCDictionary__removeObjectForKey_1            ; +0xb0, 0x100331ebc\nLDRSB           W8, [SP,#0x50+var_31]                                  ; +0xb4, 0x100331ec0\nTBZ             W8, #0x1F, loc_100331ED0                               ; +0xb8, 0x100331ec4\nLDR             X0, [SP,#0x50+__p]; __p                                ; +0xbc, 0x100331ec8\nBL              __ZdlPv; operator delete(void *)                       ; +0xc0, 0x100331ecc\nADD             W21, W21, #1                                           ; +0xc4, 0x100331ed0\nCMP             W21, #4                                                ; +0xc8, 0x100331ed4\nB.NE            loc_100331E58                                          ; +0xcc, 0x100331ed8\nLDP             X29, X30, [SP,#0x50+var_s0]                            ; +0xd0, 0x100331edc\nLDP             X20, X19, [SP,#0x50+var_10]                            ; +0xd4, 0x100331ee0\nLDP             X22, X21, [SP,#0x50+var_20]                            ; +0xd8, 0x100331ee4\nLDP             X24, X23, [SP,#0x50+var_30]                            ; +0xdc, 0x100331ee8\nADD             SP, SP, #0x60 ; '`'                                    ; +0xe0, 0x100331eec\nRET                                                                    ; +0xe4, 0x100331ef0", "xrefs": ["GameLevelManager::updateLevelRewards @ 0x100093a78"], "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"}