//
// GameLevelManager::getCompletedLevels from 0x805a10 to 0x805bd8 (456 bytes)
//
// 3 xrefs:
// > GameLevelManager::submitUserInfo @ 0x82cb48
// > GameLevelManager::getOnlineLevels @ 0x82e610
// > ??> @ 0x6d5e8
//
// 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:54:45 +0000
//
cocos2d::CCArray *__fastcall GameLevelManager::getCompletedLevels(cocos2d::CCDictionary **this, unsigned __int8 a2)
{
int v3; // w24
unsigned int v4; // w21
cocos2d::CCArray *v5; // x25
cocos2d::CCArray *v6; // x22
int v7; // w0
cocos2d::CCString *v8; // x0
const char *CString; // x0
const char *v10; // x28
size_t v11; // x0
size_t v12; // x20
__int64 v13; // x26
char *v14; // x3
cocos2d::CCObject *v15; // x20
unsigned __int64 v17; // x0
__int64 v18; // x27
char *v19; // x0
__int64 v20; // [xsp+60h] [xbp+60h] BYREF
size_t v21; // [xsp+68h] [xbp+68h]
void *v22; // [xsp+70h] [xbp+70h]
v3 = a2;
v4 = 0;
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v6 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 95));
if ( (unsigned int)cocos2d::CCArray::count(v6) )
{
do
{
v7 = cocos2d::CCArray::count(v6);
v8 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v6, v7 + ~v4);
CString = (const char *)cocos2d::CCString::getCString(v8);
v20 = 0;
v21 = 0;
v10 = CString;
v22 = nullptr;
v11 = strlen(CString);
v12 = v11;
v13 = (__int64)*(this + 95);
if ( v11 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v11 > 0x16 )
{
v17 = (v11 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v18 = v17 | 1;
v19 = (char *)operator new(v17);
v20 = v18;
v14 = v19;
v22 = v19;
v21 = v12;
}
else
{
LOBYTE(v20) = 2 * v11;
v14 = (char *)&v20 + 1;
if ( !v11 )
goto LABEL_5;
}
v14 = (char *)memcpy(v14, v10, v12);
LABEL_5:
v14[v12] = 0;
v15 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v13, &v20);
if ( (v20 & 1) != 0 )
{
operator delete(v22);
if ( v3 )
{
LABEL_7:
if ( *((_DWORD *)v15 + 216) - *((_DWORD *)v15 + 217) > 99 )
goto LABEL_13;
goto LABEL_8;
}
}
else if ( v3 )
{
goto LABEL_7;
}
if ( (int)GJGameLevel::getNormalPercent(v15) > 99 )
{
LABEL_13:
++v4;
cocos2d::CCArray::addObject(v5, v15);
continue;
}
LABEL_8:
++v4;
}
while ( v4 < (unsigned int)cocos2d::CCArray::count(v6) );
}
return v5;
}