//
// GameStatsManager::verifyUserCoins from 0x7b4cdc to 0x7b4de8 (268 bytes)
//
// 3 xrefs:
// > GameManager::dataLoaded @ 0x5fba08
// > GJAccountManager::onSyncAccountCompleted @ 0x848d38
// > ??> @ 0x4ff08
//
// 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
//
void GameStatsManager::verifyUserCoins(GameStatsManager *a1)
{
int Stat; // w23
int v3; // w20
int v4; // w21
char *v5; // x19
cocos2d::CCString *v6; // x0
const char *CString; // x1
AchievementManager *v8; // x0
cocos2d::CCString *v9; // x0
char *v10; // [xsp+48h] [xbp+48h]
Stat = GameStatsManager::getStat(a1, "12");
if ( Stat > (int)cocos2d::CCDictionary::count(a1->m_verifiedUserCoins) )
{
GameStatsManager::recountUserCoins(a1, 0);
return;
}
v3 = 10;
v4 = 2;
v5 = (char *)&dword_0 + 1;
while ( 1 )
{
if ( (_DWORD)v5 == 1 )
{
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"geometry.ach.usercoins%02d",
(_BYTE *)&dword_0 + 1);
CString = cocos2d::CCString::getCString(v9);
if ( Stat > 0 )
goto LABEL_4;
}
else
{
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"geometry.ach.usercoins%02d",
(const char *)(unsigned int)v5);
CString = cocos2d::CCString::getCString(v6);
if ( v3 <= Stat )
goto LABEL_3;
}
v10 = (char *)CString;
v8 = AchievementManager::sharedState();
if ( AchievementManager::isAchievementEarned(v8, v10) )
break;
LABEL_3:
if ( v4 == 22 )
return;
LABEL_4:
LODWORD(v5) = (_DWORD)v5 + 1;
++v4;
v3 += 10;
}
GameStatsManager::recountUserCoins(a1, 1);
}