//
// GameLevelManager::onGetLevelListsCompleted from 0x4d1938 to 0x4d1bac (628 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4db00a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:50:48 +0000
//
int __fastcall GameLevelManager::onGetLevelListsCompleted(GameLevelManager *a1, int a2, int a3)
{
char *v5; // r4
const char *v6; // r7
bool v7; // nf
size_t v8; // r0
cocos2d::CCArray *v9; // r9
int result; // r0
cocos2d::CCString *v11; // r0
const char *CString; // r8
size_t v13; // r0
cocos2d::CCString *v14; // r0
const char *v15; // r10
size_t v16; // r0
cocos2d::CCString *v17; // r0
const char *v18; // r10
size_t v19; // r0
cocos2d::CCString *v20; // r0
const char *v21; // r9
size_t v22; // r0
int v23; // r10
int *v24; // r2
int v25; // r3
GJLevelList **v26; // r2
unsigned int v27; // r9
GJLevelList **v28; // r10
GJLevelList *v29; // r1
GJLevelList *v30; // t1
int v31; // r0
cocos2d::CCArray *LevelLists; // [sp+0h] [bp-7Ch]
void (__fastcall *v33)(int, int *, char *); // [sp+8h] [bp-74h]
int v34[3]; // [sp+14h] [bp-68h] BYREF
int v35[3]; // [sp+20h] [bp-5Ch] BYREF
int v36[3]; // [sp+2Ch] [bp-50h] BYREF
int v37[3]; // [sp+38h] [bp-44h] BYREF
int v38[3]; // [sp+44h] [bp-38h] BYREF
int v39[3]; // [sp+50h] [bp-2Ch] BYREF
int v40[3]; // [sp+5Ch] [bp-20h] BYREF
int v41; // [sp+68h] [bp-14h] BYREF
int v42; // [sp+6Ch] [bp-10h]
int v43; // [sp+70h] [bp-Ch]
if ( (*(_BYTE *)a3 & 1) != 0 )
v5 = *(char **)(a3 + 8);
else
v5 = (char *)(a3 + 1);
GameLevelManager::removeDLFromActive(a1, v5);
v41 = 0;
v42 = 0;
v43 = 0;
std::string::__init(&v41, "-1", 2u);
v6 = (const char *)sub_4A9CC4((unsigned __int8 *)a2, (unsigned __int8 *)&v41);
std::string::~string((int)&v41);
if ( v6 )
goto LABEL_10;
v7 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
v6 = (const char *)(a2 + 1);
v41 = 0;
if ( v7 )
v6 = *(const char **)(a2 + 8);
v42 = 0;
v43 = 0;
v8 = strlen(v6);
std::string::__init(&v41, v6, v8);
v9 = sub_4C1A88(&v41, "#");
std::string::~string((int)&v41);
if ( cocos2d::CCArray::count(v9) <= 3u )
{
LABEL_10:
result = *((_DWORD *)a1 + 205);
if ( result )
return (*(int (__fastcall **)(int, char *, int))(*(_DWORD *)result + 12))(result, v5, 1);
}
else
{
v11 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 0);
memset(v34, 0, sizeof(v34));
CString = (const char *)cocos2d::CCString::getCString(v11);
v13 = strlen(CString);
std::string::__init(v34, CString, v13);
v14 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 1u);
v15 = (const char *)cocos2d::CCString::getCString(v14);
memset(v35, 0, sizeof(v35));
v16 = strlen(v15);
std::string::__init(v35, v15, v16);
v17 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 2u);
v18 = (const char *)cocos2d::CCString::getCString(v17);
memset(v36, 0, sizeof(v36));
v19 = strlen(v18);
std::string::__init(v36, v18, v19);
v20 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v9, 3u);
v21 = (const char *)cocos2d::CCString::getCString(v20);
memset(v37, 0, sizeof(v37));
v22 = strlen(v21);
std::string::__init(v37, v21, v22);
std::string::basic_string(v38, (int)v35);
GameLevelManager::storeUserNames((unsigned __int8 *)a1, (unsigned __int8 *)v38);
std::string::~string((int)v38);
std::string::basic_string(v39, (int)v34);
LevelLists = GameLevelManager::createAndGetLevelLists(a1, (int)v39);
std::string::~string((int)v39);
if ( LevelLists )
{
v24 = *((int **)LevelLists + 13);
v25 = *v24;
if ( *v24 )
{
v26 = (GJLevelList **)v24[3];
v27 = (unsigned int)(&v26[v25] + 0x3FFFFFFF);
v28 = v26;
while ( (unsigned int)v28 <= v27 )
{
v30 = *v28++;
v29 = v30;
if ( !v30 )
break;
GameLevelManager::updateSavedLevelList(a1, v29);
}
}
}
v23 = *((_DWORD *)a1 + 205);
if ( v23 )
{
v33 = *(void (__fastcall **)(int, int *, char *))(*(_DWORD *)v23 + 16);
std::string::basic_string(v40, (int)v36);
v33(v23, v40, v5);
std::string::~string((int)v40);
}
std::string::basic_string(&v41, (int)v36);
GameLevelManager::storeSearchResult(a1, LevelLists, COERCE_FLOAT(&v41), v5);
std::string::~string((int)&v41);
v31 = *((_DWORD *)a1 + 205);
if ( v31 )
(*(void (__fastcall **)(int, cocos2d::CCArray *, char *, int))(*(_DWORD *)v31 + 8))(v31, LevelLists, v5, 1);
std::string::~string((int)v37);
std::string::~string((int)v36);
std::string::~string((int)v35);
return std::string::~string((int)v34);
}
return result;
}