//
// GJLevelList::getListLevelsArray from 0x4d5a08 to 0x4d5be6 (478 bytes)
//
// 2 xrefs:
// > GJLevelList::duplicateListLevels @ 0x4d8da0
// > LevelListLayer::updateResultArray @ 0x6d498c
//
// 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:51 +0000
//
cocos2d::CCArray *__fastcall GJLevelList::getListLevelsArray(GJLevelList *this, cocos2d::CCArray *a2)
{
cocos2d::CCArray *v3; // r0
unsigned int v4; // r0
int v5; // r9
unsigned int *v6; // r4
_DWORD *v7; // r2
int *v8; // r5
int *v9; // r4
int v10; // r6
int v11; // t1
unsigned int v12; // r11
GameLevelManager *v13; // r0
int *SavedLevel; // r5
int v15; // r11
int v16; // r11
GJGameLevel *v17; // r0
unsigned int v18; // r10
int v19; // r12
_DWORD *v20; // r1
_DWORD *i; // r6
int v22; // r1
GJGameLevel *v24; // r5
int v25; // r6
int *ListSnapshot; // r11
cocos2d::CCArray *v27; // [sp+0h] [bp-5Ch]
unsigned int *v28; // [sp+4h] [bp-58h]
int v29; // [sp+18h] [bp-44h] BYREF
_BYTE v30[12]; // [sp+1Ch] [bp-40h] BYREF
_BYTE v31[12]; // [sp+28h] [bp-34h] BYREF
unsigned __int8 v32[12]; // [sp+34h] [bp-28h] BYREF
int v33; // [sp+40h] [bp-1Ch] BYREF
unsigned int v34; // [sp+44h] [bp-18h]
int v35; // [sp+48h] [bp-14h]
int v36; // [sp+4Ch] [bp-10h]
int v37; // [sp+50h] [bp-Ch]
v3 = (cocos2d::CCArray *)&_stack_chk_guard;
v33 = 0;
v34 = 0;
v35 = 0;
v36 = 0;
v37 = 1065353216;
if ( a2 )
{
v7 = *((_DWORD **)a2 + 13);
if ( *v7 )
{
v8 = (int *)v7[3];
v9 = &v8[*v7 - 1];
while ( v8 <= v9 )
{
v11 = *v8++;
v10 = v11;
if ( !v11 )
break;
v29 = *(_DWORD *)(v10 + 268) - *(_DWORD *)(v10 + 272);
v3 = (cocos2d::CCArray *)std::unordered_map::operator[]((int)&v33, (unsigned int *)&v29);
*(_DWORD *)v3 = v10;
}
}
}
v4 = cocos2d::CCArray::create(v3);
v5 = 1;
v27 = (cocos2d::CCArray *)v4;
v6 = *((unsigned int **)this + 66);
v28 = *((unsigned int **)this + 67);
while ( v6 != v28 )
{
v12 = *v6;
if ( v34 )
{
v18 = v34 - 1;
if ( ((v34 - 1) & v34) != 0 )
{
v4 = v12 / v34;
v19 = v12 % v34;
}
else
{
v19 = v12 & v18;
}
v20 = *(_DWORD **)(v33 + 4 * v19);
if ( v20 )
{
for ( i = (_DWORD *)*v20; i; i = (_DWORD *)*i )
{
v4 = i[1];
if ( ((v34 - 1) & v34) != 0 )
{
v22 = v4 % v34;
v4 /= v34;
}
else
{
v22 = v18 & v4;
}
if ( v22 != v19 )
break;
if ( i[2] == v12 )
{
v24 = (GJGameLevel *)*std::unordered_map::operator[]((int)&v33, v6);
v25 = *((_DWORD *)this + 101);
ListSnapshot = GJGameLevel::getListSnapshot(v24);
GameToolbox::intToString((GameToolbox *)v30, *((_DWORD *)v24 + 67) - *((_DWORD *)v24 + 68));
cocos2d::CCDictionary::setObject(v25, (cocos2d::CCObject *)ListSnapshot);
v4 = std::string::~string((int)v30);
break;
}
}
}
}
v13 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v4);
SavedLevel = (int *)GameLevelManager::getSavedLevel(v13, (const char *)*v6);
v15 = *((_DWORD *)this + 101);
GameToolbox::intToString((GameToolbox *)v31, *v6);
v16 = cocos2d::CCDictionary::objectForKey(v15, v31);
v17 = (GJGameLevel *)std::string::~string((int)v31);
if ( SavedLevel )
{
if ( *((_BYTE *)SavedLevel + 917) )
{
if ( !v16 )
goto LABEL_12;
}
else
{
v16 = (int)SavedLevel;
}
}
else if ( !v16 )
{
SavedLevel = GJGameLevel::create(v17);
GJGameLevel::setLevelID((GJGameLevel *)SavedLevel, *v6);
GameToolbox::intToString((GameToolbox *)v32, *v6);
std::string::operator=((unsigned __int8 *)SavedLevel + 280, v32);
std::string::~string((int)v32);
goto LABEL_12;
}
SavedLevel = (int *)v16;
LABEL_12:
SavedLevel[251] = v5;
v4 = cocos2d::CCArray::addObject(v27, (cocos2d::CCObject *)SavedLevel);
++v6;
++v5;
}
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::~__hash_table((int)&v33);
return v27;
}