//
// GameLevelManager::getSavedLevelLists from 0x14021f120 to 0x14021f1ca (170 bytes)
//
// 3 xrefs:
// > LevelBrowserLayer::loadPage @ 0x1403e4b6b
// > LevelBrowserLayer::FLAlert_Clicked @ 0x1403ea67b
// > ??> @ 0x14091bb18
//
// 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:28:24 +0000
//
cocos2d::CCArray *__fastcall GameLevelManager::getSavedLevelLists(__int64 a1, int a2)
{
__int64 v4; // rax
__int64 v5; // rdx
cocos2d::CCArray *v6; // rsi
__int64 v7; // rdx
__int64 i; // rbx
struct cocos2d::CCObject *v9; // rdx
v4 = cocos2d::CCArray::create(a1);
v5 = *(_QWORD *)(a1 + 880);
v6 = (cocos2d::CCArray *)v4;
if ( v5 )
{
v7 = *(_QWORD *)(v5 + 56);
if ( v7 )
{
for ( i = *(_QWORD *)(v7 + 288); ; i = *(_QWORD *)(i + 288) )
{
v9 = *(struct cocos2d::CCObject **)(v7 + 264);
if ( a2 <= 0 || *((_DWORD *)v9 + 92) == a2 )
cocos2d::CCArray::addObject(v6, v9);
v7 = i;
if ( !i )
break;
}
}
}
if ( cocos2d::CCArray::count(v6) )
qsort(
*(void **)(*((_QWORD *)v6 + 7) + 16LL),
**((unsigned int **)v6 + 7),
8u,
(_CoreCrtNonSecureSearchSortCompareFunction)sub_1402190B0);
return v6;
}