//
// LocalLevelManager::getAllLevelsInDict from 0x911268 to 0x911470 (520 bytes)
//
// 3 xrefs:
// > GameLevelManager::getNextLevelName @ 0x81d454
// > GameLevelManager::createNewLevel @ 0x83c0e0
// > ??> @ 0x90fd0
//
// 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:57:16 +0000
//
__int64 __fastcall LocalLevelManager::getAllLevelsInDict(cocos2d::CCArray **this)
{
unsigned int v2; // w23
__int64 v3; // x26
__int64 v4; // x24
char v5; // w0
__int64 v6; // x0
__int64 v7; // x1
const char *v8; // x22
size_t v9; // x0
size_t v10; // x21
char *v11; // x3
unsigned __int64 v13; // x28
__int64 v14; // [xsp+68h] [xbp+68h] BYREF
size_t v15; // [xsp+70h] [xbp+70h]
void *v16; // [xsp+78h] [xbp+78h]
__int64 v17; // [xsp+80h] [xbp+80h] BYREF
__int64 v18; // [xsp+88h] [xbp+88h]
void *v19; // [xsp+90h] [xbp+90h]
v2 = 0;
v3 = cocos2d::CCDictionary::create(_stack_chk_guard);
if ( (unsigned int)cocos2d::CCArray::count(*(this + 45)) )
{
while ( 1 )
{
v4 = cocos2d::CCArray::objectAtIndex(*(this + 45), v2);
v5 = *(_BYTE *)(v4 + 344);
v17 = 0;
v18 = 0;
v19 = nullptr;
if ( (v5 & 1) != 0 )
{
std::string::__init(&v17, *(void **)(v4 + 360), *(_QWORD *)(v4 + 352));
}
else
{
v6 = *(_QWORD *)(v4 + 344);
v7 = *(_QWORD *)(v4 + 352);
v19 = *(void **)(v4 + 360);
v17 = v6;
v18 = v7;
}
v8 = (char *)&v17 + 1;
if ( (v17 & 1) != 0 )
v8 = (const char *)v19;
v14 = 0;
v15 = 0;
v16 = nullptr;
v9 = strlen(v8);
v10 = v9;
if ( v9 > 0xFFFFFFFFFFFFFFEFLL )
sub_62D09C();
if ( v9 > 0x16 )
break;
LOBYTE(v14) = 2 * v9;
v11 = (char *)&v14 + 1;
if ( v9 )
goto LABEL_20;
BYTE1(v14) = 0;
if ( (v17 & 1) == 0 )
goto LABEL_10;
LABEL_21:
operator delete(v19);
LABEL_10:
if ( (v14 & 1) == 0 )
{
if ( !((int)(unsigned __int8)v14 >> 1) )
goto LABEL_13;
LABEL_17:
cocos2d::CCDictionary::setObject(v3, (cocos2d::CCObject *)v4);
if ( (v14 & 1) == 0 )
{
++v2;
goto LABEL_14;
}
goto LABEL_12;
}
if ( v15 )
goto LABEL_17;
LABEL_12:
operator delete(v16);
LABEL_13:
++v2;
LABEL_14:
if ( v2 >= (unsigned int)cocos2d::CCArray::count(*(this + 45)) )
return v3;
}
v13 = (v9 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v11 = (char *)operator new(v13);
v16 = v11;
v15 = v10;
v14 = v13 | 1;
LABEL_20:
*((_BYTE *)memcpy(v11, v8, v10) + v10) = 0;
if ( (v17 & 1) == 0 )
goto LABEL_10;
goto LABEL_21;
}
return v3;
}