//
// GameStatsManager::init from 0x1402d6ae0 to 0x1402d6cf6 (534 bytes)
//
// 2 xrefs:
// > ??> @ 0x140767858
// > ??> @ 0x14091dd5c
//
// 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 11:29:45 +0000
//
// Hidden C++ exception states: #wind=1
char __fastcall GameStatsManager::init(_QWORD *a1)
{
cocos2d::CCObject *v2; // rax
__int64 v3; // rcx
cocos2d::CCObject *v4; // rax
__int64 v5; // rcx
cocos2d::CCObject *v6; // rax
cocos2d::CCObject *v7; // rbx
cocos2d::CCObject *v8; // rcx
__int64 v9; // rcx
cocos2d::CCObject *v10; // rax
__int64 v11; // rcx
cocos2d::CCObject *v12; // rax
__int64 v13; // r14
__int64 v14; // r14
__int64 i; // r15
__int64 v16; // r14
cocos2d::CCArray *v17; // rsi
unsigned int v18; // ebx
struct cocos2d::CCObject *v19; // rax
__int64 v20; // rcx
__int64 v21; // rdi
struct cocos2d::CCString *v22; // rax
_BYTE v24[32]; // [rsp+20h] [rbp-48h] BYREF
v2 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 1);
a1[41] = v2;
cocos2d::CCObject::retain(v2);
v4 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v3);
a1[116] = v4;
cocos2d::CCObject::retain(v4);
v6 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v5);
v7 = v6;
if ( (cocos2d::CCObject *)a1[66] != v6 )
{
if ( v6 )
cocos2d::CCObject::retain(v6);
v8 = (cocos2d::CCObject *)a1[66];
if ( v8 )
cocos2d::CCObject::release(v8);
a1[66] = v7;
}
GameStatsManager::setupIconCredits((__int64)a1);
GameStatsManager::createStoreItems(a1);
if ( !a1[45] )
{
v10 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v9);
a1[45] = v10;
cocos2d::CCObject::retain(v10);
v12 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v11);
a1[44] = v12;
cocos2d::CCObject::retain(v12);
GameStatsManager::createSecretChestRewards(a1);
v13 = a1[44];
if ( v13 )
{
v14 = *(_QWORD *)(v13 + 56);
if ( v14 )
{
for ( i = *(_QWORD *)(v14 + 288); ; i = *(_QWORD *)(i + 288) )
{
v16 = *(_QWORD *)(v14 + 264);
if ( v16 )
{
v17 = *(cocos2d::CCArray **)(v16 + 72);
if ( v17 )
{
v18 = 0;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(v16 + 72)) )
{
do
{
v19 = cocos2d::CCArray::objectAtIndex(v17, v18);
if ( *((_DWORD *)v19 + 14) == 9 )
{
((void (__fastcall *)(__int64, _BYTE *, _QWORD, _QWORD))GameStatsManager::getItemKey)(
v20,
v24,
*((unsigned int *)v19 + 16),
*((unsigned int *)v19 + 15));
cocos2d::CCDictionary::objectForKey(a1[45], v24);
v21 = a1[45];
v22 = cocos2d::CCString::createWithFormat(
(const char *)&word_1406ED6F8,
*(unsigned int *)(v16 + 56));
cocos2d::CCDictionary::setObject(v21, v22, v24);
sub_14003D310((__int64)v24);
}
++v18;
}
while ( v18 < cocos2d::CCArray::count(v17) );
}
}
}
v14 = i;
if ( !i )
break;
}
}
}
}
GameStatsManager::createSpecialChestItems(a1);
GameStatsManager::generateItemUnlockableData(a1);
return 1;
}