//
// GameLevelManager::getSavedLevelLists from 0x3bf718 to 0x3bf784 (108 bytes)
//
// 2 xrefs:
// > LevelBrowserLayer::loadPage @ 0x3bb9ec
// > LevelBrowserLayer::FLAlert_Clicked @ 0x3bdc8a
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
cocos2d::CCArray *GameLevelManager::getSavedLevelLists(GameLevelManager *a1, int a2)
{
cocos2d::CCArray *v4; // r0
cocos2d::CCDictionary *m_favoriteLists; // r3
cocos2d::CCArray *v6; // r5
cocos2d::CCDictElement *m_pElements; // r3
cocos2d::CCDictElement *next; // r4
cocos2d::CCObject *m_pObject; // r1
cocos2d::CCDictElement *v10; // r2
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);
m_favoriteLists = a1->m_favoriteLists;
v6 = v4;
if ( m_favoriteLists )
{
m_pElements = m_favoriteLists->m_pElements;
if ( m_pElements )
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
else
next = nullptr;
while ( m_pElements )
{
m_pObject = m_pElements->m_pObject;
if ( a2 <= 0 || m_pObject[5].m_nZOrder == a2 )
cocos2d::CCArray::addObject(v6, m_pObject);
if ( next )
v10 = (cocos2d::CCDictElement *)next->hh.next;
else
v10 = nullptr;
m_pElements = next;
next = v10;
}
}
if ( cocos2d::CCArray::count(v6) )
qsort(v6->data->arr, v6->data->num, 4u, savedListCompare);
return v6;
}