//
// GameStatsManager::getAwardedDiamondsForLevel from 0x8ce2a8 to 0x8ce42c (388 bytes)
//
// 3 xrefs:
// > LevelCell::loadCustomLevelCell @ 0x747630
// > LevelInfoLayer::setupLevelInfo @ 0x7e9950
// > ??> @ 0x100828
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:56:37 +0000
//
__int64 __fastcall GameStatsManager::getAwardedDiamondsForLevel(GameStatsManager *this, GJGameLevel *a2)
{
char *v4; // x23
__int64 v5; // x22
size_t v6; // x0
cocos2d::CCString *v7; // x0
int v8; // w22
unsigned int v9; // w19
__int64 v11[2]; // [xsp+48h] [xbp+48h] BYREF
void *v12; // [xsp+58h] [xbp+58h]
__int64 v13[2]; // [xsp+60h] [xbp+60h] BYREF
void *v14; // [xsp+70h] [xbp+70h]
if ( *((_DWORD *)a2 + 230) - *((_DWORD *)a2 + 231) > 0 || *((_BYTE *)a2 + 649) )
{
v4 = (char *)v11 + 1;
GameStatsManager::getCurrencyKey(a2, v11);
v5 = *((_QWORD *)this + 87);
if ( *((_DWORD *)a2 + 230) - *((_DWORD *)a2 + 231) <= 0 )
v5 = *((_QWORD *)this + 86);
if ( (v11[0] & 1) != 0 )
v4 = (char *)v12;
v13[0] = 0;
v13[1] = 0;
v14 = nullptr;
v6 = strlen(v4);
std::string::__init(v13, v4, v6);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v5, v13);
v8 = cocos2d::CCString::intValue(v7);
if ( (v13[0] & 1) != 0 )
operator delete(v14);
v9 = vcvtms_s32_f32(
(float)(int)GameStatsManager::getBaseDiamonds(this, *((_DWORD *)a2 + 237) - *((_DWORD *)a2 + 238))
* (float)((float)v8 / 100.0));
if ( (v11[0] & 1) != 0 )
operator delete(v12);
}
else
{
return 0;
}
return v9;
}