//
// GameStatsManager::verifyUserCoins from 0x8de044 to 0x8de150 (268 bytes)
//
// 3 xrefs:
// > GameManager::dataLoaded @ 0x728aa8
// > GJAccountManager::onSyncAccountCompleted @ 0x98a258
// > ??> @ 0x6f940
//
// 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:48 +0000
//
__int64 __fastcall GameStatsManager::verifyUserCoins(cocos2d::CCDictionary **this)
{
int Stat; // w23
int v3; // w20
int v4; // w21
char *v5; // x19
cocos2d::CCString *v6; // x0
__int64 result; // x0
__int64 v8; // x1
AchievementManager *v9; // x0
cocos2d::CCString *v10; // x0
char *v11; // [xsp+48h] [xbp+48h]
Stat = GameStatsManager::getStat((GameStatsManager *)this, (const char *)&word_120A570);
if ( Stat > (int)cocos2d::CCDictionary::count(*(this + 77)) )
return GameStatsManager::recountUserCoins(this, 0);
v3 = 10;
v4 = 2;
v5 = (char *)&dword_0 + 1;
while ( 1 )
{
if ( (_DWORD)v5 == 1 )
{
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"geometry.ach.usercoins%02d",
(_BYTE *)&dword_0 + 1);
result = cocos2d::CCString::getCString(v10);
v8 = result;
if ( Stat > 0 )
goto LABEL_4;
}
else
{
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"geometry.ach.usercoins%02d",
(const char *)(unsigned int)v5);
result = cocos2d::CCString::getCString(v6);
v8 = result;
if ( v3 <= Stat )
goto LABEL_3;
}
v11 = (char *)v8;
v9 = (AchievementManager *)AchievementManager::sharedState((AchievementManager *)result);
result = AchievementManager::isAchievementEarned(v9, v11);
if ( (_BYTE)result )
return GameStatsManager::recountUserCoins(this, 1u);
LABEL_3:
if ( v4 == 22 )
return result;
LABEL_4:
LODWORD(v5) = (_DWORD)v5 + 1;
++v4;
v3 += 10;
}
}