//
// LocalLevelManager::getAllLevelsInDict from 0x1005f7180 to 0x1005f736c (492 bytes)
//
// 2 xrefs:
// > GameLevelManager::createNewLevel @ 0x10052c653
// > GameLevelManager::getNextLevelName @ 0x10052c98e
//
// 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::CCDictionary *__fastcall LocalLevelManager::getAllLevelsInDict(LocalLevelManager *a1)
{
__int128 v1; // xmm0
LocalLevelManager *v2; // r13
const char *v3; // r12
unsigned int i; // r15d
__int64 v5; // rax
__int64 v6; // rax
const char *v7; // rbx
size_t v8; // rax
size_t v9; // r14
char *v10; // rbx
char v11; // al
const char *v12; // r15
LocalLevelManager *v13; // r12
size_t v14; // r13
const char *__src; // [rsp+8h] [rbp-88h]
cocos2d::CCObject *v17; // [rsp+10h] [rbp-80h]
cocos2d::CCDictionary *v18; // [rsp+18h] [rbp-78h]
__int128 v19; // [rsp+20h] [rbp-70h] BYREF
void *__p; // [rsp+30h] [rbp-60h]
unsigned int v21; // [rsp+44h] [rbp-4Ch]
__int64 __dst; // [rsp+48h] [rbp-48h] BYREF
size_t v23; // [rsp+50h] [rbp-40h]
void *v24; // [rsp+58h] [rbp-38h]
char v25; // [rsp+67h] [rbp-29h]
v2 = a1;
v18 = cocos2d::CCDictionary::create();
if ( (unsigned int)sub_100720070(a1->m_localLevels) )
{
v3 = (char *)&v19 + 1;
for ( i = 0; i < (unsigned int)sub_100720070(v2->m_localLevels); ++i )
{
v5 = sub_1007200C0(v2->m_localLevels, i);
v17 = (cocos2d::CCObject *)v5;
if ( (*(_BYTE *)(v5 + 344) & 1) != 0 )
{
sub_100006B70(&v19, *(const void **)(v5 + 360), *(_QWORD *)(v5 + 352), *(double *)&v1);
}
else
{
v6 = v5 + 344;
__p = *(void **)(v6 + 16);
v1 = *(_OWORD *)v6;
v19 = *(_OWORD *)v6;
}
v7 = v3;
v25 = v19 & 1;
if ( (v19 & 1) != 0 )
v7 = (const char *)__p;
v8 = strlen(v7);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v9 = v8;
__src = v7;
if ( v8 >= 0x17 )
{
v21 = i;
v12 = v3;
v13 = v2;
v14 = (v8 | 7) + 1;
if ( (v8 | 7) == 0x17 )
v14 = 26;
v10 = (char *)operator new(v14);
v24 = v10;
__dst = v14 | 1;
v23 = v9;
v2 = v13;
v3 = v12;
i = v21;
}
else
{
LOBYTE(__dst) = 2 * v8;
v10 = (char *)&__dst + 1;
if ( !v8 )
{
BYTE1(__dst) = 0;
if ( (v19 & 1) == 0 )
goto LABEL_14;
LABEL_13:
operator delete(__p);
goto LABEL_14;
}
}
memmove(v10, __src, v9);
v10[v9] = 0;
if ( (v19 & 1) != 0 )
goto LABEL_13;
LABEL_14:
v11 = __dst & 1;
if ( (__dst & 1) != 0 )
{
if ( !v23 )
goto LABEL_24;
LABEL_23:
cocos2d::CCDictionary::setObject_1((__int64)v18, v17, (char *)&__dst);
v11 = __dst & 1;
goto LABEL_24;
}
if ( (unsigned __int8)__dst >> 1 )
goto LABEL_23;
LABEL_24:
if ( v11 )
operator delete(v24);
}
}
return v18;
}