//
// GameStatsManager::hasPendingUserCoin from 0x7a293c to 0x7a2a38 (252 bytes)
//
// 8 xrefs:
// > LevelCell::loadCustomLevelCell @ 0x610764
// > LevelInfoLayer::updateLabelValues @ 0x6d9f3c
// > GameLevelManager::getLevelLeaderboard @ 0x720b58
// > GameStatsManager::checkCoinsForLevel @ 0x7ba2f4
// > EndLevelLayer::customSetup @ 0x7d67d4
// > GJBaseGameLayer::processItems @ 0x85a658
// > GJBaseGameLayer::hasUniqueCoin @ 0x85a788
// > ??> @ 0xa8fd8
//
// 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::hasPendingUserCoin(GameStatsManager *a1, const char *a2)
{
cocos2d::CCDictionary *m_pendingUserCoins; // 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_pendingUserCoins = a1->m_pendingUserCoins;
sub_D153B8((int)&v9, (char *)a2);
v3 = cocos2d::CCDictionary::objectForKey(m_pendingUserCoins, &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;
}