//
// GameStatsManager::hasUserCoin from 0x7a2744 to 0x7a2840 (252 bytes)
//
// 9 xrefs:
// > LevelCell::loadCustomLevelCell @ 0x610750
// > LevelInfoLayer::updateLabelValues @ 0x6d9f28
// > GameLevelManager::getLevelLeaderboard @ 0x720b08
// > GameStatsManager::checkCoinsForLevel @ 0x7ba318
// > GameStatsManager::dataLoaded @ 0x7be1fc
// > EndLevelLayer::customSetup @ 0x7d639c
// > GJBaseGameLayer::processItems @ 0x85a564
// > GJBaseGameLayer::hasUniqueCoin @ 0x85a704
// > ??> @ 0x82038
//
// 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
//
bool GameStatsManager::hasUserCoin(GameStatsManager *a1, const char *a2)
{
cocos2d::CCDictionary *m_verifiedUserCoins; // x21
bool v3; // zf
__int64 *v4; // x0
bool v5; // w20
unsigned int *v7; // x2
int v8; // w1
std::string v9; // [xsp+40h] [xbp+40h] BYREF
m_verifiedUserCoins = a1->m_verifiedUserCoins;
sub_D153B8((int)&v9, (char *)a2);
v3 = cocos2d::CCDictionary::objectForKey(m_verifiedUserCoins, &v9) == 0;
v4 = (__int64 *)((char *)v9.m_data.m_data - 24);
v5 = !v3;
if ( v4 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)((char *)v9.m_data.m_data - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9.m_data.m_data - 2);
*((_DWORD *)v9.m_data.m_data - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v4);
}
return v5;
}