{"type": "func", "start": 4298319556, "end": 4298319832, "name": "GameStatsManager::getAwardedCurrencyForLevel", "pseudocode": "// \n// GameStatsManager::getAwardedCurrencyForLevel from 0x1003326c4 to 0x1003327d8 (276 bytes)\n// \n// 9 xrefs:\n// > LevelInfoLayer::updateLabelValues @ 0x100029660\n// > LevelCell::loadCustomLevelCell @ 0x10010e72c\n// > GameStatsManager::getTotalCollectedCurrency @ 0x100334a18\n// > GameStatsManager::getTotalCollectedCurrency @ 0x100334adc\n// > GameStatsManager::getTotalCollectedCurrency @ 0x100334b9c\n// > GameStatsManager::getTotalCollectedCurrency @ 0x100334c78\n// > GameStatsManager::getTotalCollectedCurrency @ 0x100334d50\n// > GameStatsManager::getTotalCollectedCurrency @ 0x100334e28\n// > LevelPage::updateDynamicPage @ 0x10040308c\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::getAwardedCurrencyForLevel(GameStatsManager *a1, GJGameLevel *a2)\n{\n  __int64 v4; // x8\n  __int64 v5; // x21\n  char *v6; // x1\n  cocos2d::CCString *v7; // x0\n  int v8; // w21\n  int BaseCurrencyForLevel; // w0\n  float v10; // s0\n  int v11; // w19\n  void *__p[2]; // [xsp+0h] [xbp-50h] BYREF\n  char v14; // [xsp+17h] [xbp-39h]\n  void *v15[2]; // [xsp+18h] [xbp-38h] BYREF\n  char v16; // [xsp+2Fh] [xbp-21h]\n\n  if ( a2->m_dailyID.random <= a2->m_dailyID.seed )\n  {\n    v4 = 640;\n    if ( a2->m_gauntletLevel )\n      v4 = 656;\n    if ( a2->m_levelType == Main )\n      v4 = 648;\n  }\n  else\n  {\n    v4 = 664;\n  }\n  v5 = *(__int64 *)((char *)&a1->__vftable + v4);\n  GameStatsManager::getCurrencyKey(a2, v15);\n  if ( v16 >= 0 )\n    v6 = (char *)v15;\n  else\n    v6 = (char *)v15[0];\n  sub_100009900(__p, v6);\n  v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v5, __p);\n  v8 = cocos2d::CCString::intValue(v7);\n  if ( v14 < 0 )\n    operator delete(__p[0]);\n  BaseCurrencyForLevel = GameStatsManager::getBaseCurrencyForLevel(a1, a2);\n  v10 = (float)BaseCurrencyForLevel;\n  if ( v8 > 99 )\n    v11 = BaseCurrencyForLevel + (int)(float)(v10 * 0.25);\n  else\n    v11 = vcvtms_s32_f32((float)((float)v8 / 100.0) * v10);\n  if ( v16 < 0 )\n    operator delete(v15[0]);\n  return v11;\n}", "assembly": "; \n; GameStatsManager::getAwardedCurrencyForLevel from 0x1003326c4 to 0x1003327d8 (276 bytes)\n; \n; 9 xrefs:\n; > LevelInfoLayer::updateLabelValues @ 0x100029660\n; > LevelCell::loadCustomLevelCell @ 0x10010e72c\n; > GameStatsManager::getTotalCollectedCurrency @ 0x100334a18\n; > GameStatsManager::getTotalCollectedCurrency @ 0x100334adc\n; > GameStatsManager::getTotalCollectedCurrency @ 0x100334b9c\n; > GameStatsManager::getTotalCollectedCurrency @ 0x100334c78\n; > GameStatsManager::getTotalCollectedCurrency @ 0x100334d50\n; > GameStatsManager::getTotalCollectedCurrency @ 0x100334e28\n; > LevelPage::updateDynamicPage @ 0x10040308c\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, 0x1003326c4\nSTP             X22, X21, [SP,#0x50+var_20]                            ; +0x4, 0x1003326c8\nSTP             X20, X19, [SP,#0x50+var_10]                            ; +0x8, 0x1003326cc\nSTP             X29, X30, [SP,#0x50+var_s0]                            ; +0xc, 0x1003326d0\nADD             X29, SP, #0x50                                         ; +0x10, 0x1003326d4\nMOV             X19, X1                                                ; +0x14, 0x1003326d8\nMOV             X20, X0                                                ; +0x18, 0x1003326dc\nLDR             W8, [X1,#0x324]                                        ; +0x1c, 0x1003326e0\nLDR             W9, [X1,#0x328]                                        ; +0x20, 0x1003326e4\nCMP             W8, W9                                                 ; +0x24, 0x1003326e8\nB.LE            loc_1003326F8                                          ; +0x28, 0x1003326ec\nMOV             W8, #0x298                                             ; +0x2c, 0x1003326f0\nB               loc_10033271C                                          ; +0x30, 0x1003326f4\nLDRB            W8, [X19,#0x281]                                       ; +0x34, 0x1003326f8\nLDR             W9, [X19,#0x404]                                       ; +0x38, 0x1003326fc\nCMP             W8, #0                                                 ; +0x3c, 0x100332700\nMOV             W8, #0x280                                             ; +0x40, 0x100332704\nMOV             W10, #0x290                                            ; +0x44, 0x100332708\nCSEL            X8, X10, X8, NE                                        ; +0x48, 0x10033270c\nCMP             W9, #1                                                 ; +0x4c, 0x100332710\nMOV             W9, #0x288                                             ; +0x50, 0x100332714\nCSEL            X8, X9, X8, EQ                                         ; +0x54, 0x100332718\nLDR             X21, [X20,X8]                                          ; +0x58, 0x10033271c\nADD             X22, SP, #0x50+var_38                                  ; +0x5c, 0x100332720\nADD             X8, SP, #0x50+var_38                                   ; +0x60, 0x100332724\nMOV             X1, X19                                                ; +0x64, 0x100332728\nBL              GameStatsManager__getCurrencyKey                       ; +0x68, 0x10033272c\nLDRSB           W8, [SP,#0x50+var_21]                                  ; +0x6c, 0x100332730\nLDR             X9, [SP,#0x50+var_38]                                  ; +0x70, 0x100332734\nCMP             W8, #0                                                 ; +0x74, 0x100332738\nCSEL            X1, X9, X22, LT; __s                                   ; +0x78, 0x10033273c\nMOV             X0, SP; int                                            ; +0x7c, 0x100332740\nBL              sub_100009900                                          ; +0x80, 0x100332744\nMOV             X1, SP                                                 ; +0x84, 0x100332748\nMOV             X0, X21                                                ; +0x88, 0x10033274c\nBL              cocos2d__CCDictionary__valueForKey_1                   ; +0x8c, 0x100332750\nBL              cocos2d__CCString__intValue                            ; +0x90, 0x100332754\nMOV             X21, X0                                                ; +0x94, 0x100332758\nLDRSB           W8, [SP,#0x50+var_39]                                  ; +0x98, 0x10033275c\nTBZ             W8, #0x1F, loc_10033276C                               ; +0x9c, 0x100332760\nLDR             X0, [SP,#0x50+__p]; __p                                ; +0xa0, 0x100332764\nBL              __ZdlPv; operator delete(void *)                       ; +0xa4, 0x100332768\nMOV             X0, X20                                                ; +0xa8, 0x10033276c\nMOV             X1, X19                                                ; +0xac, 0x100332770\nBL              GameStatsManager__getBaseCurrencyForLevel              ; +0xb0, 0x100332774\nSCVTF           S0, W0                                                 ; +0xb4, 0x100332778\nCMP             W21, #0x63 ; 'c'                                       ; +0xb8, 0x10033277c\nB.GT            loc_1003327A0                                          ; +0xbc, 0x100332780\nSCVTF           S1, W21                                                ; +0xc0, 0x100332784\nMOV             W8, #0x42C80000                                        ; +0xc4, 0x100332788\nFMOV            S2, W8                                                 ; +0xc8, 0x10033278c\nFDIV            S1, S1, S2                                             ; +0xcc, 0x100332790\nFMUL            S0, S1, S0                                             ; +0xd0, 0x100332794\nFCVTMS          W19, S0                                                ; +0xd4, 0x100332798\nB               loc_1003327B0                                          ; +0xd8, 0x10033279c\nFMOV            S1, #0.25                                              ; +0xdc, 0x1003327a0\nFMUL            S0, S0, S1                                             ; +0xe0, 0x1003327a4\nFCVTZS          W8, S0                                                 ; +0xe4, 0x1003327a8\nADD             W19, W0, W8                                            ; +0xe8, 0x1003327ac\nLDRSB           W8, [SP,#0x50+var_21]                                  ; +0xec, 0x1003327b0\nTBZ             W8, #0x1F, loc_1003327C0                               ; +0xf0, 0x1003327b4\nLDR             X0, [SP,#0x50+var_38]; __p                             ; +0xf4, 0x1003327b8\nBL              __ZdlPv; operator delete(void *)                       ; +0xf8, 0x1003327bc\nMOV             X0, X19                                                ; +0xfc, 0x1003327c0\nLDP             X29, X30, [SP,#0x50+var_s0]                            ; +0x100, 0x1003327c4\nLDP             X20, X19, [SP,#0x50+var_10]                            ; +0x104, 0x1003327c8\nLDP             X22, X21, [SP,#0x50+var_20]                            ; +0x108, 0x1003327cc\nADD             SP, SP, #0x60 ; '`'                                    ; +0x10c, 0x1003327d0\nRET                                                                    ; +0x110, 0x1003327d4", "xrefs": ["LevelInfoLayer::updateLabelValues @ 0x100029660", "LevelCell::loadCustomLevelCell @ 0x10010e72c", "GameStatsManager::getTotalCollectedCurrency @ 0x100334a18", "GameStatsManager::getTotalCollectedCurrency @ 0x100334adc", "GameStatsManager::getTotalCollectedCurrency @ 0x100334b9c", "GameStatsManager::getTotalCollectedCurrency @ 0x100334c78", "GameStatsManager::getTotalCollectedCurrency @ 0x100334d50", "GameStatsManager::getTotalCollectedCurrency @ 0x100334e28", "LevelPage::updateDynamicPage @ 0x10040308c"], "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"}