{"type": "func", "start": 4295591100, "end": 4295591440, "name": "GameLevelManager::getCompletedWeeklyLevels", "pseudocode": "// \n// GameLevelManager::getCompletedWeeklyLevels from 0x1000984bc to 0x100098610 (340 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::updateUserScore @ 0x1000a2024\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::getCompletedWeeklyLevels(GameLevelManager *a1)\n{\n  cocos2d::CCArray *v2; // x0\n  cocos2d::ccArray *data; // x9\n  __int64 num; // x8\n  int v5; // w20\n  cocos2d::CCString **arr; // x25\n  unsigned __int64 v7; // x26\n  cocos2d::CCString *v8; // x23\n  cocos2d::CCDictionary *m_dailyLevels; // x24\n  char *CString; // x0\n  const void *v11; // x0\n  GJGameLevel *v12; // x23\n  GameStatsManager *v13; // x0\n  void *__p[2]; // [xsp+8h] [xbp-68h] BYREF\n  char v16; // [xsp+1Fh] [xbp-51h]\n\n  v2 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);\n  if ( v2 )\n  {\n    data = v2->data;\n    num = data->num;\n    if ( (_DWORD)num )\n    {\n      v5 = 0;\n      arr = (cocos2d::CCString **)data->arr;\n      v7 = (unsigned __int64)&arr[num - 1];\n      while ( 1 )\n      {\n        v8 = *arr;\n        if ( !*arr )\n          return v5;\n        if ( (unsigned int)(cocos2d::CCString::intValue(*arr) - 100001) >> 5 <= 0xC34 )\n        {\n          m_dailyLevels = a1->m_dailyLevels;\n          CString = (char *)cocos2d::CCString::getCString(v8);\n          sub_100009900(__p, CString);\n          v11 = (const void *)cocos2d::CCDictionary::objectForKey_1(m_dailyLevels, __p);\n          if ( v11 )\n            v12 = (GJGameLevel *)__dynamic_cast(\n                                   v11,\n                                   (const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,\n                                   (const struct __class_type_info *)&`typeinfo for'GJGameLevel,\n                                   0);\n          else\n            v12 = nullptr;\n          if ( v16 < 0 )\n          {\n            operator delete(__p[0]);\n            if ( v12 )\n            {\nLABEL_13:\n              if ( v12->m_stars.random - v12->m_stars.seed == 10\n                && v12->m_normalPercent.random - v12->m_normalPercent.seed == 100 )\n              {\n                v13 = GameStatsManager::sharedState();\n                v5 += GameStatsManager::hasCompletedLevel(v13, v12);\n              }\n            }\n          }\n          else if ( v12 )\n          {\n            goto LABEL_13;\n          }\n        }\n        if ( (unsigned __int64)++arr > v7 )\n          return v5;\n      }\n    }\n  }\n  return 0;\n}", "assembly": "; \n; GameLevelManager::getCompletedWeeklyLevels from 0x1000984bc to 0x100098610 (340 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::updateUserScore @ 0x1000a2024\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, #0x80                                          ; +0x0, 0x1000984bc\nSTP             X28, X27, [SP,#0x70+var_50]                            ; +0x4, 0x1000984c0\nSTP             X26, X25, [SP,#0x70+var_40]                            ; +0x8, 0x1000984c4\nSTP             X24, X23, [SP,#0x70+var_30]                            ; +0xc, 0x1000984c8\nSTP             X22, X21, [SP,#0x70+var_20]                            ; +0x10, 0x1000984cc\nSTP             X20, X19, [SP,#0x70+var_10]                            ; +0x14, 0x1000984d0\nSTP             X29, X30, [SP,#0x70+var_s0]                            ; +0x18, 0x1000984d4\nADD             X29, SP, #0x70                                         ; +0x1c, 0x1000984d8\nMOV             X19, X0                                                ; +0x20, 0x1000984dc\nLDR             X0, [X0,#0x1C0]                                        ; +0x24, 0x1000984e0\nBL              cocos2d__CCDictionary__allKeys                         ; +0x28, 0x1000984e4\nCBZ             X0, loc_1000985E8                                      ; +0x2c, 0x1000984e8\nLDR             X9, [X0,#0x38]                                         ; +0x30, 0x1000984ec\nLDR             W8, [X9]                                               ; +0x34, 0x1000984f0\nCBZ             W8, loc_1000985E8                                      ; +0x38, 0x1000984f4\nMOV             W20, #0                                                ; +0x3c, 0x1000984f8\nLDR             X25, [X9,#0x10]                                        ; +0x40, 0x1000984fc\nADD             X8, X25, X8,LSL#3                                      ; +0x44, 0x100098500\nSUB             X26, X8, #8                                            ; +0x48, 0x100098504\nMOV             W27, #0xFFFE795F                                       ; +0x4c, 0x100098508\nADRL            X21, _ZTIN7cocos2d8CCObjectE; `typeinfo for'cocos2d::CCObject ; +0x54, 0x100098510\nADRL            X22, _ZTI11GJGameLevel; `typeinfo for'GJGameLevel      ; +0x5c, 0x100098518\nLDR             X23, [X25]                                             ; +0x64, 0x100098520\nCBZ             X23, loc_1000985EC                                     ; +0x68, 0x100098524\nMOV             X0, X23                                                ; +0x6c, 0x100098528\nBL              cocos2d__CCString__intValue                            ; +0x70, 0x10009852c\nADD             W8, W0, W27                                            ; +0x74, 0x100098530\nLSR             W8, W8, #5                                             ; +0x78, 0x100098534\nCMP             W8, #0xC34                                             ; +0x7c, 0x100098538\nB.HI            loc_1000985D8                                          ; +0x80, 0x10009853c\nLDR             X24, [X19,#0x1C0]                                      ; +0x84, 0x100098540\nMOV             X0, X23                                                ; +0x88, 0x100098544\nBL              cocos2d__CCString__getCString                          ; +0x8c, 0x100098548\nMOV             X1, X0; __s                                            ; +0x90, 0x10009854c\nADD             X0, SP, #0x70+__p; int                                 ; +0x94, 0x100098550\nBL              sub_100009900                                          ; +0x98, 0x100098554\nADD             X1, SP, #0x70+__p                                      ; +0x9c, 0x100098558\nMOV             X0, X24                                                ; +0xa0, 0x10009855c\nBL              cocos2d__CCDictionary__objectForKey_1                  ; +0xa4, 0x100098560\nCBZ             X0, loc_100098580                                      ; +0xa8, 0x100098564\nMOV             X1, X21; lpstype                                       ; +0xac, 0x100098568\nMOV             X2, X22; lpdtype                                       ; +0xb0, 0x10009856c\nMOV             X3, #0; s2d                                            ; +0xb4, 0x100098570\nBL              ___dynamic_cast                                        ; +0xb8, 0x100098574\nMOV             X23, X0                                                ; +0xbc, 0x100098578\nB               loc_100098584                                          ; +0xc0, 0x10009857c\nMOV             X23, #0                                                ; +0xc4, 0x100098580\nLDRSB           W8, [SP,#0x70+var_51]                                  ; +0xc8, 0x100098584\nTBNZ            W8, #0x1F, loc_100098594                               ; +0xcc, 0x100098588\nCBNZ            X23, loc_1000985A0                                     ; +0xd0, 0x10009858c\nB               loc_1000985D8                                          ; +0xd4, 0x100098590\nLDR             X0, [SP,#0x70+__p]; __p                                ; +0xd8, 0x100098594\nBL              __ZdlPv; operator delete(void *)                       ; +0xdc, 0x100098598\nCBZ             X23, loc_1000985D8                                     ; +0xe0, 0x10009859c\nLDR             W8, [X23,#0x340]                                       ; +0xe4, 0x1000985a0\nLDR             W9, [X23,#0x344]                                       ; +0xe8, 0x1000985a4\nSUB             W8, W8, W9                                             ; +0xec, 0x1000985a8\nCMP             W8, #0xA                                               ; +0xf0, 0x1000985ac\nB.NE            loc_1000985D8                                          ; +0xf4, 0x1000985b0\nLDR             W8, [X23,#0x2E8]                                       ; +0xf8, 0x1000985b4\nLDR             W9, [X23,#0x2E4]                                       ; +0xfc, 0x1000985b8\nSUB             W8, W8, W9                                             ; +0x100, 0x1000985bc\nCMP             W8, #0x64 ; 'd'                                        ; +0x104, 0x1000985c0\nB.NE            loc_1000985D8                                          ; +0x108, 0x1000985c4\nBL              GameStatsManager__sharedState                          ; +0x10c, 0x1000985c8\nMOV             X1, X23                                                ; +0x110, 0x1000985cc\nBL              GameStatsManager__hasCompletedLevel                    ; +0x114, 0x1000985d0\nADD             W20, W20, W0                                           ; +0x118, 0x1000985d4\nADD             X25, X25, #8                                           ; +0x11c, 0x1000985d8\nCMP             X25, X26                                               ; +0x120, 0x1000985dc\nB.LS            loc_100098520                                          ; +0x124, 0x1000985e0\nB               loc_1000985EC                                          ; +0x128, 0x1000985e4\nMOV             W20, #0                                                ; +0x12c, 0x1000985e8\nMOV             X0, X20                                                ; +0x130, 0x1000985ec\nLDP             X29, X30, [SP,#0x70+var_s0]                            ; +0x134, 0x1000985f0\nLDP             X20, X19, [SP,#0x70+var_10]                            ; +0x138, 0x1000985f4\nLDP             X22, X21, [SP,#0x70+var_20]                            ; +0x13c, 0x1000985f8\nLDP             X24, X23, [SP,#0x70+var_30]                            ; +0x140, 0x1000985fc\nLDP             X26, X25, [SP,#0x70+var_40]                            ; +0x144, 0x100098600\nLDP             X28, X27, [SP,#0x70+var_50]                            ; +0x148, 0x100098604\nADD             SP, SP, #0x80                                          ; +0x14c, 0x100098608\nRET                                                                    ; +0x150, 0x10009860c", "xrefs": ["GameLevelManager::updateUserScore @ 0x1000a2024"], "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"}