//
// LocalLevelManager::getAllLevelsInDict from 0x7e8b44 to 0x7e8d40 (508 bytes)
//
// 3 xrefs:
// > GameLevelManager::getNextLevelName @ 0x6f0924
// > GameLevelManager::createNewLevel @ 0x7016c8
// > ??> @ 0x6b400
//
// 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 *LocalLevelManager::getAllLevelsInDict(LocalLevelManager *a1)
{
unsigned int v2; // w19
cocos2d::CCDictionary *v3; // x26
cocos2d::CCObject *v4; // x22
char *v5; // x0
__int64 v6; // x1
__int64 *v7; // x0
unsigned int *v9; // x1
int v10; // w2
unsigned int *v11; // x1
int v12; // w2
__int64 v13; // [xsp+0h] [xbp+0h] BYREF
__int64 v14; // [xsp+68h] [xbp+68h]
char *v15; // [xsp+70h] [xbp+70h] BYREF
v2 = 0;
v3 = cocos2d::CCDictionary::create();
while ( v2 < (unsigned int)cocos2d::CCArray::count(a1->m_localLevels) )
{
v4 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a1->m_localLevels, v2);
sub_D18D28(&v15);
sub_D153B8((unsigned int)&v13 + 104, v15);
v5 = v15 - 24;
if ( v15 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v15 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v15 - 2);
*((_DWORD *)v15 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v5);
}
v6 = v14;
v7 = (__int64 *)(v14 - 24);
if ( *(_QWORD *)(v14 - 24) )
{
cocos2d::CCDictionary::setObject((int)v3, v4);
v6 = v14;
v7 = (__int64 *)(v14 - 24);
}
if ( v7 == &qword_124B6B0 )
goto LABEL_6;
if ( &pthread_create )
{
v9 = (unsigned int *)(v6 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *(_DWORD *)(v6 - 8);
*(_DWORD *)(v6 - 8) = v10 - 1;
}
if ( v10 > 0 )
{
LABEL_6:
++v2;
}
else
{
++v2;
operator delete(v7);
}
}
return v3;
}