//
// GameStatsManager::getBaseCurrencyForLevel from 0x517c38 to 0x517d1a (226 bytes)
//
// 4 xrefs:
// > LevelPage::updateDynamicPage @ 0x514748
// > GameStatsManager::getAwardedCurrencyForLevel @ 0x517dd6
// > GameStatsManager::orbInfoForLevel @ 0x517e7c
// > GameStatsManager::awardCurrencyForLevel @ 0x52a284
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:51:43 +0000
//
int __fastcall GameStatsManager::getBaseCurrencyForLevel(GameStatsManager *this, GJGameLevel *a2)
{
int v4; // r7
int v5; // r6
_BOOL4 v6; // r8
char *v7; // r1
int v8; // r11
size_t v9; // r0
cocos2d::CCString *v10; // r0
int v11; // r11
int v13; // [sp+4h] [bp-28h]
char *v14; // [sp+4h] [bp-28h]
char v15; // [sp+Ch] [bp-20h] BYREF
char v16; // [sp+Dh] [bp-1Fh] BYREF
char *v17; // [sp+14h] [bp-18h]
int v18[3]; // [sp+18h] [bp-14h] BYREF
v4 = *((_DWORD *)a2 + 186);
v5 = *((_DWORD *)a2 + 193) - *((_DWORD *)a2 + 194);
v6 = *((_DWORD *)a2 + 238) == 1;
v13 = *((_DWORD *)a2 + 187);
if ( *((_DWORD *)a2 + 238) != 1 )
{
GameStatsManager::getCurrencyKey((GameStatsManager *)&v15, this, a2);
v8 = *((_DWORD *)this + 112);
if ( v4 - v13 <= 0 )
v8 = *((_DWORD *)this + 111);
if ( (v15 & 1) == 0 )
v7 = &v16;
v18[0] = 0;
if ( (v15 & 1) != 0 )
v7 = v17;
v18[1] = 0;
v18[2] = 0;
v14 = v7;
v9 = strlen(v7);
std::string::__init(v18, v14, v9);
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v8, v18);
v11 = cocos2d::CCString::intValue(v10);
std::string::~string((int)v18);
if ( v5 < v11 )
v5 = v11;
std::string::~string((int)&v15);
}
return GameStatsManager::getBaseCurrency(this, v5, v6, *((_DWORD *)a2 + 67) - *((_DWORD *)a2 + 68));
}