//
// GameStatsManager::getBaseCurrencyForLevel from 0x10033259c to 0x100332690 (244 bytes)
//
// 5 xrefs:
// > LevelInfoLayer::updateLabelValues @ 0x100029670
// > LevelCell::loadCustomLevelCell @ 0x10010e71c
// > GameStatsManager::getAwardedCurrencyForLevel @ 0x100332774
// > GameStatsManager::awardCurrencyForLevel @ 0x100332904
// > LevelPage::updateDynamicPage @ 0x100403074
//
// 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::getBaseCurrencyForLevel(GameStatsManager *a1, GJGameLevel *a2)
{
int v3; // w20
GJLevelType m_levelType; // w22
GameStatsManager *v5; // x21
int random; // w23
int seed; // w24
__int64 v8; // x8
__int64 v9; // x21
char *v10; // x1
cocos2d::CCString *v11; // x0
int v12; // w21
void *__p[2]; // [xsp+0h] [xbp-70h] BYREF
char v15; // [xsp+17h] [xbp-59h]
void *v16[2]; // [xsp+18h] [xbp-58h] BYREF
char v17; // [xsp+2Fh] [xbp-41h]
v3 = a2->m_stars.random - a2->m_stars.seed;
m_levelType = a2->m_levelType;
if ( m_levelType != Main )
{
v5 = a1;
random = a2->m_dailyID.random;
seed = a2->m_dailyID.seed;
GameStatsManager::getCurrencyKey(a2, v16);
v8 = 672;
if ( random > seed )
v8 = 680;
v9 = *(__int64 *)((char *)&v5->__vftable + v8);
if ( v17 >= 0 )
v10 = (char *)v16;
else
v10 = (char *)v16[0];
sub_100009900(__p, v10);
v11 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v9, __p);
a1 = (GameStatsManager *)cocos2d::CCString::intValue(v11);
v12 = (int)a1;
if ( v15 < 0 )
operator delete(__p[0]);
if ( v12 > v3 )
v3 = v12;
if ( v17 < 0 )
operator delete(v16[0]);
}
return GameStatsManager::getBaseCurrency(a1, v3, m_levelType == Main, a2->m_levelID.random - a2->m_levelID.seed);
}