//
// GameStatsManager::getAwardedCurrencyForLevel from 0x8ce03c to 0x8ce21c (480 bytes)
//
// 3 xrefs:
// > GameStatsManager::getAwardedCurrencyForLevel @ 0x8ce22c
// > GameStatsManager::orbInfoForLevel @ 0x8ce278
// > ??> @ 0x1033f0
//
// 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::getAwardedCurrencyForLevel(GameStatsManager *this, GJGameLevel *a2, char *a3)
{
int v5; // w1
__int64 v6; // x24
cocos2d::CCString *v7; // x0
const char *CString; // x1
char *v9; // x22
size_t v10; // x0
size_t v11; // x0
cocos2d::CCString *v12; // x0
int v13; // w20
int BaseCurrencyForLevel; // w0
unsigned int v15; // w20
cocos2d::CCString *v17; // x0
char *v18; // [xsp+48h] [xbp+48h]
__int64 v19[2]; // [xsp+58h] [xbp+58h] BYREF
void *v20; // [xsp+68h] [xbp+68h]
__int64 v21[2]; // [xsp+70h] [xbp+70h] BYREF
void *v22; // [xsp+80h] [xbp+80h]
v5 = *((_DWORD *)a2 + 285);
if ( (int)a3 <= 0 )
{
if ( v5 == 1 )
{
v6 = *((_QWORD *)this + 81);
}
else if ( *((_BYTE *)a2 + 649) )
{
v6 = *((_QWORD *)this + 82);
}
else
{
v6 = *((_QWORD *)this + 80);
}
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)(*((_DWORD *)a2 + 82) - *((_DWORD *)a2 + 83)));
CString = (const char *)cocos2d::CCString::getCString(v17);
}
else
{
v6 = *((_QWORD *)this + 83);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a3);
CString = (const char *)cocos2d::CCString::getCString(v7);
}
v18 = (char *)CString;
v19[0] = 0;
v19[1] = 0;
v9 = (char *)v19 + 1;
v20 = nullptr;
v10 = strlen(CString);
std::string::__init(v19, v18, v10);
if ( (v19[0] & 1) != 0 )
v9 = (char *)v20;
v21[0] = 0;
v21[1] = 0;
v22 = nullptr;
v11 = strlen(v9);
std::string::__init(v21, v9, v11);
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v6, v21);
v13 = cocos2d::CCString::intValue(v12);
if ( (v21[0] & 1) != 0 )
operator delete(v22);
BaseCurrencyForLevel = GameStatsManager::getBaseCurrencyForLevel(this, a2);
if ( v13 > 99 )
v15 = BaseCurrencyForLevel + (int)(float)((float)BaseCurrencyForLevel * 0.25);
else
v15 = vcvtms_s32_f32((float)BaseCurrencyForLevel * (float)((float)v13 / 100.0));
if ( (v19[0] & 1) != 0 )
operator delete(v20);
return v15;
}