//
// GameStatsManager::getAwardedCurrencyForLevel from 0x1003326c4 to 0x1003327d8 (276 bytes)
//
// 9 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
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall GameStatsManager::getAwardedCurrencyForLevel(GameStatsManager *a1, GJGameLevel *a2)
{
__int64 v4; // x8
__int64 v5; // x21
char *v6; // x1
cocos2d::CCString *v7; // x0
int v8; // w21
int BaseCurrencyForLevel; // w0
float v10; // s0
int v11; // w19
void *__p[2]; // [xsp+0h] [xbp-50h] BYREF
char v14; // [xsp+17h] [xbp-39h]
void *v15[2]; // [xsp+18h] [xbp-38h] BYREF
char v16; // [xsp+2Fh] [xbp-21h]
if ( a2->m_dailyID.random <= a2->m_dailyID.seed )
{
v4 = 640;
if ( a2->m_gauntletLevel )
v4 = 656;
if ( a2->m_levelType == Main )
v4 = 648;
}
else
{
v4 = 664;
}
v5 = *(__int64 *)((char *)&a1->__vftable + v4);
GameStatsManager::getCurrencyKey(a2, v15);
if ( v16 >= 0 )
v6 = (char *)v15;
else
v6 = (char *)v15[0];
sub_100009900(__p, v6);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v5, __p);
v8 = cocos2d::CCString::intValue(v7);
if ( v14 < 0 )
operator delete(__p[0]);
BaseCurrencyForLevel = GameStatsManager::getBaseCurrencyForLevel(a1, a2);
v10 = (float)BaseCurrencyForLevel;
if ( v8 > 99 )
v11 = BaseCurrencyForLevel + (int)(float)(v10 * 0.25);
else
v11 = vcvtms_s32_f32((float)((float)v8 / 100.0) * v10);
if ( v16 < 0 )
operator delete(v15[0]);
return v11;
}