{"type": "func", "start": 4298320776, "end": 4298321040, "name": "GameStatsManager::getAwardedDiamondsForLevel", "pseudocode": "// \n// GameStatsManager::getAwardedDiamondsForLevel from 0x100332b88 to 0x100332c90 (264 bytes)\n// \n// 2 xrefs:\n// > LevelInfoLayer::setupLevelInfo @ 0x1000275ac\n// > LevelCell::loadCustomLevelCell @ 0x10010dbcc\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 GameStatsManager::getAwardedDiamondsForLevel(GameStatsManager *a1, GJGameLevel *a2)\n{\n  __int64 v4; // x8\n  __int64 v5; // x20\n  char *v6; // x1\n  cocos2d::CCString *v7; // x0\n  int v8; // w20\n  int v9; // w8\n  unsigned int v10; // w9\n  unsigned int v11; // w8\n  int v12; // w19\n  void *__p[2]; // [xsp+0h] [xbp-50h] BYREF\n  char v15; // [xsp+17h] [xbp-39h]\n  void *v16[2]; // [xsp+18h] [xbp-38h] BYREF\n  char v17; // [xsp+2Fh] [xbp-21h]\n\n  if ( a2->m_dailyID.random <= a2->m_dailyID.seed && !a2->m_gauntletLevel )\n    return 0;\n  GameStatsManager::getCurrencyKey(a2, v16);\n  v4 = 688;\n  if ( a2->m_dailyID.random > a2->m_dailyID.seed )\n    v4 = 696;\n  v5 = *(__int64 *)((char *)&a1->__vftable + v4);\n  if ( v17 >= 0 )\n    v6 = (char *)v16;\n  else\n    v6 = (char *)v16[0];\n  sub_100009900(__p, v6);\n  v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v5, __p);\n  v8 = cocos2d::CCString::intValue(v7);\n  if ( v15 < 0 )\n    operator delete(__p[0]);\n  v9 = a2->m_stars.random - a2->m_stars.seed;\n  v10 = v9 - 11;\n  v11 = v9 + 2;\n  if ( v10 < 0xFFFFFFF7 )\n    v11 = 0;\n  v12 = vcvtms_s32_f32((float)((float)v8 / 100.0) * (float)v11);\n  if ( v17 < 0 )\n    operator delete(v16[0]);\n  return v12;\n}", "assembly": "; \n; GameStatsManager::getAwardedDiamondsForLevel from 0x100332b88 to 0x100332c90 (264 bytes)\n; \n; 2 xrefs:\n; > LevelInfoLayer::setupLevelInfo @ 0x1000275ac\n; > LevelCell::loadCustomLevelCell @ 0x10010dbcc\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, 0x100332b88\nSTP             X22, X21, [SP,#0x50+var_20]                            ; +0x4, 0x100332b8c\nSTP             X20, X19, [SP,#0x50+var_10]                            ; +0x8, 0x100332b90\nSTP             X29, X30, [SP,#0x50+var_s0]                            ; +0xc, 0x100332b94\nADD             X29, SP, #0x50                                         ; +0x10, 0x100332b98\nMOV             X19, X1                                                ; +0x14, 0x100332b9c\nMOV             X20, X0                                                ; +0x18, 0x100332ba0\nLDR             W8, [X1,#0x324]                                        ; +0x1c, 0x100332ba4\nLDR             W9, [X1,#0x328]                                        ; +0x20, 0x100332ba8\nCMP             W8, W9                                                 ; +0x24, 0x100332bac\nB.GT            loc_100332BC0                                          ; +0x28, 0x100332bb0\nLDRB            W8, [X19,#0x281]                                       ; +0x2c, 0x100332bb4\nCMP             W8, #1                                                 ; +0x30, 0x100332bb8\nB.NE            loc_100332C74                                          ; +0x34, 0x100332bbc\nADD             X21, SP, #0x50+var_38                                  ; +0x38, 0x100332bc0\nADD             X8, SP, #0x50+var_38                                   ; +0x3c, 0x100332bc4\nMOV             X1, X19                                                ; +0x40, 0x100332bc8\nBL              GameStatsManager__getCurrencyKey                       ; +0x44, 0x100332bcc\nLDR             W8, [X19,#0x324]                                       ; +0x48, 0x100332bd0\nLDR             W9, [X19,#0x328]                                       ; +0x4c, 0x100332bd4\nCMP             W8, W9                                                 ; +0x50, 0x100332bd8\nMOV             W8, #0x2B0                                             ; +0x54, 0x100332bdc\nMOV             W9, #0x2B8                                             ; +0x58, 0x100332be0\nCSEL            X8, X9, X8, GT                                         ; +0x5c, 0x100332be4\nLDR             X20, [X20,X8]                                          ; +0x60, 0x100332be8\nLDRSB           W8, [SP,#0x50+var_21]                                  ; +0x64, 0x100332bec\nLDR             X9, [SP,#0x50+var_38]                                  ; +0x68, 0x100332bf0\nCMP             W8, #0                                                 ; +0x6c, 0x100332bf4\nCSEL            X1, X9, X21, LT; __s                                   ; +0x70, 0x100332bf8\nMOV             X0, SP; int                                            ; +0x74, 0x100332bfc\nBL              sub_100009900                                          ; +0x78, 0x100332c00\nMOV             X1, SP                                                 ; +0x7c, 0x100332c04\nMOV             X0, X20                                                ; +0x80, 0x100332c08\nBL              cocos2d__CCDictionary__valueForKey_1                   ; +0x84, 0x100332c0c\nBL              cocos2d__CCString__intValue                            ; +0x88, 0x100332c10\nMOV             X20, X0                                                ; +0x8c, 0x100332c14\nLDRSB           W8, [SP,#0x50+var_39]                                  ; +0x90, 0x100332c18\nTBZ             W8, #0x1F, loc_100332C28                               ; +0x94, 0x100332c1c\nLDR             X0, [SP,#0x50+__p]; __p                                ; +0x98, 0x100332c20\nBL              __ZdlPv; operator delete(void *)                       ; +0x9c, 0x100332c24\nLDR             W8, [X19,#0x340]                                       ; +0xa0, 0x100332c28\nLDR             W9, [X19,#0x344]                                       ; +0xa4, 0x100332c2c\nSUB             W8, W8, W9                                             ; +0xa8, 0x100332c30\nSUB             W9, W8, #0xB                                           ; +0xac, 0x100332c34\nADD             W8, W8, #2                                             ; +0xb0, 0x100332c38\nCMN             W9, #9                                                 ; +0xb4, 0x100332c3c\nCSEL            W8, WZR, W8, CC                                        ; +0xb8, 0x100332c40\nUCVTF           S0, W8                                                 ; +0xbc, 0x100332c44\nSCVTF           S1, W20                                                ; +0xc0, 0x100332c48\nMOV             W8, #0x42C80000                                        ; +0xc4, 0x100332c4c\nFMOV            S2, W8                                                 ; +0xc8, 0x100332c50\nFDIV            S1, S1, S2                                             ; +0xcc, 0x100332c54\nFMUL            S0, S1, S0                                             ; +0xd0, 0x100332c58\nFCVTMS          W19, S0                                                ; +0xd4, 0x100332c5c\nLDRSB           W8, [SP,#0x50+var_21]                                  ; +0xd8, 0x100332c60\nTBZ             W8, #0x1F, loc_100332C78                               ; +0xdc, 0x100332c64\nLDR             X0, [SP,#0x50+var_38]; __p                             ; +0xe0, 0x100332c68\nBL              __ZdlPv; operator delete(void *)                       ; +0xe4, 0x100332c6c\nB               loc_100332C78                                          ; +0xe8, 0x100332c70\nMOV             W19, #0                                                ; +0xec, 0x100332c74\nMOV             X0, X19                                                ; +0xf0, 0x100332c78\nLDP             X29, X30, [SP,#0x50+var_s0]                            ; +0xf4, 0x100332c7c\nLDP             X20, X19, [SP,#0x50+var_10]                            ; +0xf8, 0x100332c80\nLDP             X22, X21, [SP,#0x50+var_20]                            ; +0xfc, 0x100332c84\nADD             SP, SP, #0x60 ; '`'                                    ; +0x100, 0x100332c88\nRET                                                                    ; +0x104, 0x100332c8c", "xrefs": ["LevelInfoLayer::setupLevelInfo @ 0x1000275ac", "LevelCell::loadCustomLevelCell @ 0x10010dbcc"], "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"}