//
// GameStatsManager::linkSpecialChestUnlocks from 0x1401e9f90 to 0x1401ea09d (269 bytes)
//
// 4 xrefs:
// > GameStatsManager::createSpecialChestItems @ 0x1401e9f1d
// > GameStatsManager::unlockOnlineChest @ 0x1401ea824
// > GameStatsManager::processOnlineChests @ 0x1401f374f
// > ??> @ 0x1406cc624
//
// 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=2
void __fastcall GameStatsManager::linkSpecialChestUnlocks(__int64 a1, __int64 a2, void **a3)
{
cocos2d::CCArray *v5; // rsi
unsigned int v6; // ebx
struct cocos2d::CCObject *v7; // rax
__int64 v8; // rcx
__int64 v9; // rax
void **v10; // rcx
void *v11; // rdx
_BYTE v12[16]; // [rsp+20h] [rbp-58h] BYREF
void **v13; // [rsp+30h] [rbp-48h]
_QWORD v14[4]; // [rsp+38h] [rbp-40h] BYREF
v13 = a3;
if ( a2 )
{
v5 = *(cocos2d::CCArray **)(a2 + 72);
if ( v5 )
{
v6 = 0;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a2 + 72)) )
{
do
{
v7 = cocos2d::CCArray::objectAtIndex(v5, v6);
if ( LODWORD(v7[1].__vftable) == 9 )
{
GameStatsManager::getItemKey(v8, v14, v7[1].m_uID, HIDWORD(v7[1].__vftable));
v9 = cocos2d::CCString::create(a3);
cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 376), v9, v14);
v10 = (void **)(*(_QWORD *)sub_1401F4F70(a1 + 448, v12, v14) + 48LL);
if ( v10 != a3 )
{
v11 = a3;
if ( (unsigned __int64)a3[3] > 0xF )
v11 = *a3;
sub_14003CCE0(v10, v11, (size_t)a3[2]);
}
sub_14003A830((__int64)v14);
}
++v6;
}
while ( v6 < cocos2d::CCArray::count(v5) );
}
}
}
sub_14003A830((__int64)a3);
}