//
// GameLevelManager::updateLevelOrders from 0x4ad20c to 0x4ad2f0 (228 bytes)
//
// 2 xrefs:
// > GameLevelManager::encodeDataTo @ 0x4ae30e
// > GameLevelManager::encodeDataTo @ 0x4ae314
//
// 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:00 +0000
//
signed int __fastcall GameLevelManager::updateLevelOrders(cocos2d::CCDictionary **this)
{
unsigned int v2; // r8
size_t **v3; // r7
cocos2d::CCArray *v4; // r9
int v5; // r0
cocos2d::CCString *v6; // r0
const char *CString; // r0
int v8; // r11
size_t v9; // r0
int v10; // r11
signed int v11; // r4
signed int result; // r0
signed int v13; // r5
int v14; // r3
const char *v15; // [sp+4h] [bp-18h]
int v16[3]; // [sp+8h] [bp-14h] BYREF
v2 = 0;
v3 = (size_t **)cocos2d::CCArray::create((cocos2d::CCArray *)this);
v4 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 136));
while ( v2 < cocos2d::CCArray::count(v4) )
{
v5 = cocos2d::CCArray::count(v4);
v6 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v4, ~v2 + v5);
CString = (const char *)cocos2d::CCString::getCString(v6);
memset(v16, 0, sizeof(v16));
v8 = (int)*(this + 136);
v15 = CString;
v9 = strlen(CString);
std::string::__init(v16, v15, v9);
v10 = cocos2d::CCDictionary::objectForKey(v8, v16);
std::string::~string((int)v16);
if ( *(_BYTE *)(v10 + 917) )
*(_DWORD *)(v10 + 460) = 0;
else
cocos2d::CCArray::addObject((cocos2d::CCArray *)v3, (cocos2d::CCObject *)v10);
++v2;
}
if ( cocos2d::CCArray::count((cocos2d::CCArray *)v3) )
qsort((void *)v3[13][3], *v3[13], 4u, savedLevelCompare);
v11 = 0;
result = cocos2d::CCArray::count((cocos2d::CCArray *)v3);
v13 = result;
while ( v11 < v13 )
{
result = cocos2d::CCArray::objectAtIndex((cocos2d::CCArray *)v3, v11);
v14 = v13 - v11++;
*(_DWORD *)(result + 460) = v14;
}
return result;
}