//
// GameStatsManager::removeErrorFromSpecialChests from 0x7bd43c to 0x7bd5b4 (376 bytes)
//
// 3 xrefs:
// > GameStatsManager::recountSpecialStats @ 0x7bd69c
// > GameStatsManager::dataLoaded @ 0x7be65c
// > ??> @ 0x6f2a0
//
// 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::removeErrorFromSpecialChests(GameStatsManager *a1)
{
unsigned int v2; // w19
cocos2d::CCArray *v3; // x21
cocos2d::CCString *v4; // x0
char *CString; // x0
char *v6; // x0
unsigned int *v7; // x1
int v8; // w2
std::string v9; // [xsp+60h] [xbp+60h] BYREF
v2 = 0;
GameStatsManager::processOnlineChests(a1);
v3 = cocos2d::CCDictionary::allKeys(a1->m_miscChests);
if ( (unsigned int)cocos2d::CCArray::count(v3) )
{
do
{
v4 = cocos2d::CCArray::stringAtIndex(v3, v2);
CString = (char *)cocos2d::CCString::getCString(v4);
sub_D153B8((int)&v9, CString);
if ( !cocos2d::CCDictionary::objectForKey(a1->m_allSpecialChests, &v9)
&& !cocos2d::CCDictionary::objectForKey(a1->m_wraithChests, &v9) )
{
cocos2d::CCDictionary::removeObjectForKey(a1->m_miscChests, &v9);
}
v6 = (char *)v9.m_data.m_data - 24;
if ( (__int64 *)v9.m_data.m_data - 3 == &qword_124B6B0 )
goto LABEL_4;
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 )
{
LABEL_4:
++v2;
}
else
{
++v2;
operator delete(v6);
}
}
while ( v2 < (unsigned int)cocos2d::CCArray::count(v3) );
}
}