//
// GameStatsManager::postLoadGameStats from 0x1402f85b0 to 0x1402f87a5 (501 bytes)
//
// 3 xrefs:
// > GameStatsManager::dataLoaded @ 0x1402f81c3
// > GJAccountManager::onSyncAccountCompleted @ 0x14030941c
// > ??> @ 0x14091e1ac
//
// 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:30:05 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall GameStatsManager::postLoadGameStats(__int64 a1, __int64 a2, __int64 a3)
{
char v4; // bp
__int64 v5; // rdx
__int64 v6; // rcx
__int64 v7; // r8
int i; // edi
cocos2d::CCString *v9; // rax
const char *CString; // rax
size_t v11; // r8
__int128 *v12; // rdx
size_t v13; // r8
__int128 *v14; // rbx
cocos2d::CCString *v15; // rax
unsigned int v16; // eax
__int64 v17; // rcx
__int64 v18; // r8
void *v19; // rcx
__int64 v20; // rdx
void *v21; // rcx
__int64 result; // rax
__int128 v23; // [rsp+30h] [rbp-58h] BYREF
__int128 v24; // [rsp+40h] [rbp-48h]
__int128 v25; // [rsp+50h] [rbp-38h] BYREF
__int128 v26; // [rsp+60h] [rbp-28h]
v4 = *(_BYTE *)(AchievementManager::sharedState(a1, a2, a3) + 360);
*(_BYTE *)(AchievementManager::sharedState(v6, v5, v7) + 360) = 1;
for ( i = 1; i <= 44; ++i )
{
v9 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)i);
CString = cocos2d::CCString::getCString(v9);
v23 = 0;
v24 = 0;
v11 = -1;
do
++v11;
while ( CString[v11] );
sub_14003D230(&v23, CString, v11);
v12 = &v23;
if ( *((_QWORD *)&v24 + 1) > 0xFu )
v12 = (__int128 *)v23;
v25 = 0;
v26 = 0;
v13 = -1;
do
++v13;
while ( *((_BYTE *)v12 + v13) );
sub_14003D230(&v25, v12, v13);
v14 = &v23;
if ( *((_QWORD *)&v24 + 1) > 0xFu )
v14 = (__int128 *)v23;
v15 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(a1 + 576), &v25);
v16 = cocos2d::CCString::intValue(v15);
GameStatsManager::setStat(a1, v14, v16);
if ( *((_QWORD *)&v26 + 1) > 0xFu )
{
v19 = (void *)v25;
if ( (unsigned __int64)(*((_QWORD *)&v26 + 1) + 1LL) >= 0x1000 )
{
v19 = *(void **)(v25 - 8);
if ( (unsigned __int64)(v25 - (_QWORD)v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v19);
}
v20 = *((_QWORD *)&v24 + 1);
if ( *((_QWORD *)&v24 + 1) > 0xFu )
{
v21 = (void *)v23;
if ( (unsigned __int64)(*((_QWORD *)&v24 + 1) + 1LL) >= 0x1000 )
{
v21 = *(void **)(v23 - 8);
if ( (unsigned __int64)(v23 - (_QWORD)v21 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v21);
}
}
result = AchievementManager::sharedState(v17, v20, v18);
*(_BYTE *)(result + 360) = v4;
return result;
}