//
// GameStatsManager::createSecretChestItems from 0x10005cbd0 to 0x10005ccfb (299 bytes)
//
// 4 xrefs:
// > GameStatsManager::init @ 0x10005a51c
// > GameStatsManager::generateItemUnlockableData @ 0x100065bff
// > GameStatsManager::generateItemUnlockableData @ 0x100065eee
// > GameStatsManager::generateItemUnlockableData @ 0x1000661d1
//
// 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 __fastcall GameStatsManager::createSecretChestItems(GameStatsManager *a1)
{
cocos2d::CCDictionary *v1; // rax
cocos2d::CCDictionary *v2; // rax
cocos2d::CCDictionary *m_allTreasureRoomChests; // rax
cocos2d::CCDictElement *i; // rax
cocos2d::CCObject *m_pObject; // r14
__int64 v6; // r12
unsigned int v7; // r13d
_DWORD *v8; // rax
cocos2d::CCDictionary *m_allTreasureRoomChestItems; // r15
__int64 v10; // rax
char v11; // [rsp+0h] [rbp-50h]
_BYTE v12[16]; // [rsp+8h] [rbp-48h] BYREF
void *__p; // [rsp+18h] [rbp-38h]
cocos2d::CCDictElement *next; // [rsp+20h] [rbp-30h]
if ( !a1->m_allTreasureRoomChestItems )
{
v1 = cocos2d::CCDictionary::create();
a1->m_allTreasureRoomChestItems = v1;
cocos2d::CCObject::retain(v1);
v2 = cocos2d::CCDictionary::create();
a1->m_allTreasureRoomChests = v2;
cocos2d::CCObject::retain(v2);
GameStatsManager::createSecretChestRewards(a1);
m_allTreasureRoomChests = a1->m_allTreasureRoomChests;
if ( m_allTreasureRoomChests )
{
for ( i = m_allTreasureRoomChests->m_pElements; i; i = next )
{
m_pObject = i->m_pObject;
next = (cocos2d::CCDictElement *)i->hh.next;
if ( m_pObject )
{
v6 = *(_QWORD *)&m_pObject[1].m_nTag;
if ( v6 )
{
if ( (unsigned int)sub_100720070(*(_QWORD *)&m_pObject[1].m_nTag) )
{
v7 = 0;
do
{
v8 = (_DWORD *)sub_1007200C0(v6, v7);
if ( v8[14] == 9 )
{
GameStatsManager::getItemKey(v12, v7, (unsigned int)v8[16], (unsigned int)v8[15]);
cocos2d::CCDictionary::objectForKey_1(a1->m_allTreasureRoomChestItems, v12);
m_allTreasureRoomChestItems = a1->m_allTreasureRoomChestItems;
v10 = sub_1007AB580("%i", v11);
cocos2d::CCDictionary::setObject_1(m_allTreasureRoomChestItems, v10, v12);
if ( (v12[0] & 1) != 0 )
operator delete(__p);
}
++v7;
}
while ( v7 < (unsigned int)sub_100720070(v6) );
}
}
}
}
}
}
}