//
// GameStatsManager::getAwardedDiamondsForLevel from 0x100332b88 to 0x100332c90 (264 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::setupLevelInfo @ 0x1000275ac
// > LevelCell::loadCustomLevelCell @ 0x10010dbcc
//
// 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::getAwardedDiamondsForLevel(GameStatsManager *a1, GJGameLevel *a2)
{
__int64 v4; // x8
__int64 v5; // x20
char *v6; // x1
cocos2d::CCString *v7; // x0
int v8; // w20
int v9; // w8
unsigned int v10; // w9
unsigned int v11; // w8
int v12; // w19
void *__p[2]; // [xsp+0h] [xbp-50h] BYREF
char v15; // [xsp+17h] [xbp-39h]
void *v16[2]; // [xsp+18h] [xbp-38h] BYREF
char v17; // [xsp+2Fh] [xbp-21h]
if ( a2->m_dailyID.random <= a2->m_dailyID.seed && !a2->m_gauntletLevel )
return 0;
GameStatsManager::getCurrencyKey(a2, v16);
v4 = 688;
if ( a2->m_dailyID.random > a2->m_dailyID.seed )
v4 = 696;
v5 = *(__int64 *)((char *)&a1->__vftable + v4);
if ( v17 >= 0 )
v6 = (char *)v16;
else
v6 = (char *)v16[0];
sub_100009900(__p, v6);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v5, __p);
v8 = cocos2d::CCString::intValue(v7);
if ( v15 < 0 )
operator delete(__p[0]);
v9 = a2->m_stars.random - a2->m_stars.seed;
v10 = v9 - 11;
v11 = v9 + 2;
if ( v10 < 0xFFFFFFF7 )
v11 = 0;
v12 = vcvtms_s32_f32((float)((float)v8 / 100.0) * (float)v11);
if ( v17 < 0 )
operator delete(v16[0]);
return v12;
}