//
// GameStatsManager::createSecretChestItems from 0x100021e70 to 0x100021f9b (299 bytes)
//
// 4 xrefs:
// > GameStatsManager::init @ 0x10001f7bc
// > GameStatsManager::generateItemUnlockableData @ 0x10002b23c
// > GameStatsManager::generateItemUnlockableData @ 0x10002b528
// > GameStatsManager::generateItemUnlockableData @ 0x10002b808
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:18:59 +0000
//
void __fastcall GameStatsManager::createSecretChestItems(__int64 a1, __int64 a2)
{
__int64 v3; // rax
__int64 v4; // rdi
__int64 v5; // rax
__int64 v6; // rax
__int64 i; // rax
__int64 v8; // r14
__int64 v9; // r12
unsigned int v10; // r13d
_DWORD *v11; // rax
__int64 v12; // r15
__int64 v13; // rax
char v14; // [rsp+0h] [rbp-50h]
_BYTE v15[16]; // [rsp+8h] [rbp-48h] BYREF
void *__p; // [rsp+18h] [rbp-38h]
__int64 v17; // [rsp+20h] [rbp-30h]
if ( !*(_QWORD *)(a1 + 352) )
{
v3 = cocos2d::CCDictionary::create(a1, a2);
*(_QWORD *)(a1 + 352) = v3;
v4 = v3;
cocos2d::CCObject::retain(v3);
v5 = cocos2d::CCDictionary::create(v4, a2);
*(_QWORD *)(a1 + 344) = v5;
cocos2d::CCObject::retain(v5);
GameStatsManager::createSecretChestRewards(a1);
v6 = *(_QWORD *)(a1 + 344);
if ( v6 )
{
for ( i = *(_QWORD *)(v6 + 56); i; i = v17 )
{
v8 = *(_QWORD *)(i + 264);
v17 = *(_QWORD *)(i + 288);
if ( v8 )
{
v9 = *(_QWORD *)(v8 + 72);
if ( v9 )
{
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(v8 + 72)) )
{
v10 = 0;
do
{
v11 = (_DWORD *)sub_1007FEFE0(v9, v10);
if ( v11[14] == 9 )
{
GameStatsManager::getItemKey(v15, v10, (unsigned int)v11[16], (unsigned int)v11[15]);
cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 352), v15);
v12 = *(_QWORD *)(a1 + 352);
v13 = sub_10088E820("%i", v14);
cocos2d::CCDictionary::setObject(v12, v13, v15);
if ( (v15[0] & 1) != 0 )
operator delete(__p);
}
++v10;
}
while ( v10 < (unsigned int)sub_1007FEF90(v9) );
}
}
}
}
}
}
}