//
// GameStatsManager::getCompletedMapPacks from 0x8d5e50 to 0x8d60a8 (600 bytes)
//
// 2 xrefs:
// > GameManager::recountUserStats @ 0x726c3c
// > ??> @ 0x84280
//
// This function is hookable on this platform (idp: arm, 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:56:42 +0000
//
cocos2d::CCArray *__fastcall GameStatsManager::getCompletedMapPacks(cocos2d::CCDictionary **this)
{
unsigned int v1; // w20
cocos2d::CCArray *v2; // x21
cocos2d::CCString *v3; // x0
const char *CString; // x0
const char *v5; // x22
size_t v6; // x0
size_t v7; // x27
char *v8; // x4
cocos2d::CCArray *v9; // x22
unsigned __int64 v11; // x28
char *v12; // x0
cocos2d::CCString *v13; // x0
size_t v14; // x0
_BOOL4 v15; // w27
cocos2d::CCObject *v16; // x0
cocos2d::CCArray *v17; // [xsp+60h] [xbp+60h]
char *v18; // [xsp+68h] [xbp+68h]
__int64 v19; // [xsp+70h] [xbp+70h] BYREF
size_t v20; // [xsp+78h] [xbp+78h]
void *v21; // [xsp+80h] [xbp+80h]
__int64 v22[2]; // [xsp+88h] [xbp+88h] BYREF
void *v23; // [xsp+98h] [xbp+98h]
__int64 v24[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v25; // [xsp+B0h] [xbp+B0h]
v1 = 0;
v2 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 76));
v17 = (cocos2d::CCArray *)cocos2d::CCArray::create(v2);
if ( (unsigned int)cocos2d::CCArray::count(v2) )
{
do
{
v3 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v2, v1);
CString = (const char *)cocos2d::CCString::getCString(v3);
v19 = 0;
v20 = 0;
v5 = CString;
v21 = nullptr;
v6 = strlen(CString);
v7 = v6;
if ( v6 > 0xFFFFFFFFFFFFFFEFLL )
sub_62CC1C();
if ( v6 > 0x16 )
{
v11 = (v6 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v12 = (char *)operator new(v11);
v20 = v7;
v8 = v12;
v21 = v12;
v19 = v11 | 1;
}
else
{
LOBYTE(v19) = 2 * v6;
v8 = (char *)&v19 + 1;
if ( !v6 )
goto LABEL_5;
}
v8 = (char *)memcpy(v8, v5, v7);
LABEL_5:
v8[v7] = 0;
v9 = sub_8CF0E8((unsigned __int8 *)&v19, &byte_11528B0);
if ( (unsigned int)cocos2d::CCArray::count(v9) == 2 )
{
v13 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v9, 0);
v18 = (char *)cocos2d::CCString::getCString(v13);
v22[0] = 0;
v22[1] = 0;
v23 = nullptr;
v14 = strlen(v18);
std::string::__init(v22, v18, v14);
v24[0] = 0;
v24[1] = 0;
v25 = nullptr;
std::string::__init(v24, "pack", 4u);
v15 = sub_8C9338((__int64)v22, (__int64)v24);
if ( (v24[0] & 1) != 0 )
{
operator delete(v25);
if ( v15 )
goto LABEL_17;
}
else
{
if ( !v15 )
goto LABEL_14;
LABEL_17:
v16 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(v9, 1u);
cocos2d::CCArray::addObject(v17, v16);
}
LABEL_14:
if ( (v22[0] & 1) != 0 )
operator delete(v23);
}
++v1;
if ( (v19 & 1) != 0 )
operator delete(v21);
}
while ( v1 < (unsigned int)cocos2d::CCArray::count(v2) );
}
return v17;
}