//
// GameStatsManager::completedMapPack from 0x1402e26f0 to 0x1402e2882 (402 bytes)
//
// 4 xrefs:
// > MapPackCell::onClaimReward @ 0x14014e43e
// > GJAccountManager::onSyncAccountCompleted @ 0x1403091ab
// > ??> @ 0x14091dea0
// > ??> @ 0x14091deac
//
// 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:49 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall GameStatsManager::completedMapPack(__int64 a1, __int64 a2)
{
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // r8
void *v7; // rcx
cocos2d::CCArray *v8; // rcx
int v9; // ebx
unsigned int v10; // ebp
unsigned int v11; // edi
void *Block[2]; // [rsp+30h] [rbp-48h] BYREF
__int128 v13; // [rsp+40h] [rbp-38h]
if ( !(unsigned __int8)GameStatsManager::hasCompletedMapPack(a1, *(unsigned int *)(a2 + 328)) )
{
v4 = cocos2d::CCString::createWithFormat("pack_%i", *(_DWORD *)(a2 + 328));
CString = cocos2d::CCString::getCString(v4);
*(_OWORD *)Block = 0;
v13 = 0;
v6 = -1;
do
++v6;
while ( CString[v6] );
sub_14003D230(Block, CString, v6);
cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 712), *(_QWORD *)(a1 + 328), Block);
if ( *((_QWORD *)&v13 + 1) > 0xFu )
{
v7 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v13 + 1) + 1LL) >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
v8 = *(cocos2d::CCArray **)(a2 + 320);
if ( v8 && (int)cocos2d::CCArray::count(v8) >= 3 )
{
v9 = *(_DWORD *)(a2 + 340);
v10 = 0;
v11 = 0;
if ( *(int *)(a2 + 336) <= 10 )
v11 = *(_DWORD *)(a2 + 336);
GameStatsManager::incrementStat(a1, "6", v11);
if ( v9 <= 2 )
v10 = v9;
GameStatsManager::incrementStat(a1, (const char *)&word_14070D038, v10);
GameStatsManager::incrementStat(a1, (const char *)&word_14070D040, 1u);
GameStatsManager::setStarsForMapPack(a1, *(unsigned int *)(a2 + 328), v11);
}
}
}