//
// GameStatsManager::checkCoinsForLevel from 0x5293d8 to 0x529496 (190 bytes)
//
// 1 xrefs:
// > GameLevelManager::updateLevelRewards @ 0x4ab48c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:51:58 +0000
//
int __fastcall GameStatsManager::checkCoinsForLevel(int this, GJGameLevel *a2)
{
GameStatsManager *v2; // r7
int v4; // r4
const char *CoinKey; // r6
int v6; // r2
int v7; // r3
cocos2d::CCDictionary *v8; // r3
size_t v9; // r0
cocos2d::CCDictionary *v10; // [sp+4h] [bp-18h]
int v11[3]; // [sp+8h] [bp-14h] BYREF
v2 = (GameStatsManager *)this;
if ( *((int *)a2 + 197) > 0 )
{
v4 = *((_DWORD *)a2 + 198) - *((_DWORD *)a2 + 199);
if ( v4 == 1 )
{
do
{
CoinKey = (const char *)GJGameLevel::getCoinKey(a2, v4);
this = GameStatsManager::hasPendingUserCoin(v2, CoinKey);
if ( this )
{
if ( !GameStatsManager::hasUserCoin(v2, CoinKey) )
{
GameStatsManager::storeUserCoin(v2, CoinKey, v6, v7);
GameStatsManager::incrementStat(v2, "12");
}
v8 = *((cocos2d::CCDictionary **)v2 + 105);
memset(v11, 0, sizeof(v11));
v10 = v8;
v9 = strlen(CoinKey);
std::string::__init(v11, CoinKey, v9);
cocos2d::CCDictionary::removeObjectForKey(v10);
this = std::string::~string((int)v11);
}
++v4;
}
while ( v4 != 4 );
}
}
return this;
}