//
// GameStatsManager::removeErrorFromSpecialChests from 0x1401f37e0 to 0x1401f392e (334 bytes)
//
// 3 xrefs:
// > GameStatsManager::recountSpecialStats @ 0x1401e45b3
// > GameStatsManager::dataLoaded @ 0x1401f3502
// > ??> @ 0x1406cc6fc
//
// 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
//
// Hidden C++ exception states: #wind=1
void GameStatsManager::removeErrorFromSpecialChests(GameStatsManager *a1)
{
cocos2d::CCArray *v2; // rsi
unsigned int i; // ebx
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // r8
void *v7; // rcx
__int128 v8; // [rsp+20h] [rbp-38h] BYREF
__int64 v9; // [rsp+30h] [rbp-28h]
unsigned __int64 v10; // [rsp+38h] [rbp-20h]
GameStatsManager::processOnlineChests(a1);
v2 = cocos2d::CCDictionary::allKeys(a1->m_miscChests);
for ( i = 0; i < cocos2d::CCArray::count(v2); ++i )
{
v4 = cocos2d::CCArray::stringAtIndex(v2, i);
CString = cocos2d::CCString::getCString(v4);
v8 = 0;
v9 = 0;
v10 = 0;
v6 = -1;
do
++v6;
while ( CString[v6] );
sub_14003A930(&v8, CString, v6);
if ( !cocos2d::CCDictionary::objectForKey(a1->m_allSpecialChests, &v8)
&& !cocos2d::CCDictionary::objectForKey(a1->m_wraithChests, &v8) )
{
cocos2d::CCDictionary::removeObjectForKey(a1->m_miscChests, &v8);
}
if ( v10 > 0xF )
{
v7 = (void *)v8;
if ( v10 + 1 >= 0x1000 )
{
v7 = *(void **)(v8 - 8);
if ( (unsigned __int64)(v8 - (_QWORD)v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v7);
}
}
}