//
// GameStatsManager::linkSpecialChestUnlocks from 0x41cf78 to 0x41d008 (144 bytes)
//
// 3 xrefs:
// > GameStatsManager::processOnlineChests @ 0x41d066
// > GameStatsManager::createSpecialChestItems @ 0x4204e0
// > GameStatsManager::unlockOnlineChest @ 0x42063e
//
// 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
//
_DWORD *__fastcall GameStatsManager::linkSpecialChestUnlocks(_DWORD *result, _DWORD *a2, cocos2d::CCString *a3)
{
int v4; // r8
cocos2d::CCArray *v5; // r7
_DWORD *v6; // r10
unsigned int i; // r5
_DWORD *v8; // r3
int v9; // r11
const std::string *v10; // r1
cocos2d::CCObject *v11; // r0
_DWORD *v12; // r0
const void *v13[3]; // [sp+0h] [bp-Ch] BYREF
v13[0] = result;
v13[1] = a2;
v13[2] = a3;
v4 = (int)result;
if ( a2 )
{
v5 = (cocos2d::CCArray *)a2[16];
if ( v5 )
{
v6 = result + 80;
for ( i = 0; ; ++i )
{
result = (_DWORD *)cocos2d::CCArray::count(v5);
if ( i >= (unsigned int)result )
break;
v8 = (_DWORD *)cocos2d::CCArray::objectAtIndex(v5, i);
if ( v8[13] == 9 )
{
GameStatsManager::getItemKey((GameStatsManager *)v13, v4, v8[15], v8[14]);
v9 = *(_DWORD *)(v4 + 288);
v11 = (cocos2d::CCObject *)cocos2d::CCString::create(a3, v10);
cocos2d::CCDictionary::setObject(v9, v11);
v12 = std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[](
v6,
v13);
sub_775D40(v12, a3);
sub_774008(v13);
}
}
}
}
return result;
}