//
// GameLevelManager::getSavedLevels from 0x7ff5ac to 0x7ff7a4 (504 bytes)
//
// 7 xrefs:
// > LevelBrowserLayer::loadPage @ 0x7f89c8
// > LevelBrowserLayer::loadPage @ 0x7f8ef4
// > LevelBrowserLayer::FLAlert_Clicked @ 0x7fc528
// > LevelBrowserLayer::FLAlert_Clicked @ 0x7fc638
// > GameLevelManager::limitSavedLevels @ 0x80837c
// > LevelPickerPopup::savedIndex @ 0xc73078
// > ??> @ 0xa3db0
//
// 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:43 +0000
//
cocos2d::CCArray *__fastcall GameLevelManager::getSavedLevels(cocos2d::CCDictionary **this, unsigned __int8 a2, int a3)
{
int v5; // w25
unsigned int v6; // w21
cocos2d::CCArray *v7; // x22
int v8; // w0
cocos2d::CCString *v9; // x0
const char *CString; // x0
const char *v11; // x28
size_t v12; // x0
size_t v13; // x20
__int64 v14; // x27
char *v15; // x3
__int64 v16; // x20
unsigned __int64 v18; // x26
char *v19; // x0
cocos2d::CCArray *v20; // [xsp+68h] [xbp+68h]
__int64 v21; // [xsp+70h] [xbp+70h] BYREF
size_t v22; // [xsp+78h] [xbp+78h]
void *v23; // [xsp+80h] [xbp+80h]
v5 = a2;
v6 = 0;
v20 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v7 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 95));
if ( (unsigned int)cocos2d::CCArray::count(v7) )
{
while ( 1 )
{
v8 = cocos2d::CCArray::count(v7);
v9 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v7, v8 + ~v6);
CString = (const char *)cocos2d::CCString::getCString(v9);
v21 = 0;
v22 = 0;
v11 = CString;
v23 = nullptr;
v12 = strlen(CString);
v13 = v12;
v14 = (__int64)*(this + 95);
if ( v12 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v12 > 0x16 )
break;
LOBYTE(v21) = 2 * v12;
v15 = (char *)&v21 + 1;
if ( v12 )
goto LABEL_19;
LABEL_5:
v15[v13] = 0;
v16 = cocos2d::CCDictionary::objectForKey(v14, &v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
if ( !*(_BYTE *)(v16 + 1105) && (!v5 || *(_BYTE *)(v16 + 912)) && (a3 <= 0 || a3 == *(_DWORD *)(v16 + 916)) )
{
++v6;
cocos2d::CCArray::addObject(v20, (cocos2d::CCObject *)v16);
}
else
{
++v6;
}
if ( v6 >= (unsigned int)cocos2d::CCArray::count(v7) )
goto LABEL_14;
}
v18 = (v12 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v19 = (char *)operator new(v18);
v22 = v13;
v15 = v19;
v23 = v19;
v21 = v18 | 1;
LABEL_19:
v15 = (char *)memcpy(v15, v11, v13);
goto LABEL_5;
}
LABEL_14:
if ( (unsigned int)cocos2d::CCArray::count(v20) )
qsort(
*(void **)(*((_QWORD *)v20 + 7) + 16LL),
**((unsigned int **)v20 + 7),
8u,
(int (*)(const void *, const void *))savedLevelCompare);
return v20;
}