//
// GameStatsManager::storeUserCoin from 0x7a2840 to 0x7a293c (252 bytes)
//
// 4 xrefs:
// > GameStatsManager::checkCoinsForLevel @ 0x7ba394
// > GameStatsManager::dataLoaded @ 0x7be9e4
// > GJBaseGameLayer::processItems @ 0x85a5c0
// > ??> @ 0x848e8
//
// 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::storeUserCoin(GameStatsManager *a1, const char *a2)
{
cocos2d::CCDictionary *m_verifiedUserCoins; // x22
cocos2d::CCString *m_trueString; // x21
void *v4; // x0
unsigned int *v5; // x2
int v6; // w1
__int64 v7; // [xsp+40h] [xbp+40h] BYREF
m_verifiedUserCoins = a1->m_verifiedUserCoins;
m_trueString = a1->m_trueString;
sub_D153B8((int)&v7, (char *)a2);
cocos2d::CCDictionary::setObject((int)m_verifiedUserCoins, m_trueString);
v4 = (void *)(v7 - 24);
if ( (__int64 *)(v7 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v7 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *(_DWORD *)(v7 - 8);
*(_DWORD *)(v7 - 8) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v4);
}
}