//
// GameLevelManager::createAndGetLevels from 0x4cf9d4 to 0x4cfabe (234 bytes)
//
// 1 xrefs:
// > GameLevelManager::onGetOnlineLevelsCompleted @ 0x4d16b2
//
// 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:45 +0000
//
cocos2d::CCArray *__fastcall GameLevelManager::createAndGetLevels(cocos2d::CCArray *a1, int a2)
{
cocos2d::CCArray *v3; // r0
bool v4; // nf
cocos2d::CCArray *v5; // r8
size_t v6; // r0
cocos2d::CCArray *v7; // r10
unsigned int i; // r5
cocos2d::CCString *v9; // r0
const char *CString; // r0
const char *v11; // r11
size_t v12; // r0
GJGameLevel *v13; // r0
bool v14; // r2
int *v15; // r11
int v17[3]; // [sp+4h] [bp-20h] BYREF
int v18[3]; // [sp+10h] [bp-14h] BYREF
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v4 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v18[0] = 0;
if ( v4 )
a2 = *(_DWORD *)(a2 + 8);
v18[1] = 0;
v18[2] = 0;
v5 = v3;
v6 = strlen((const char *)a2);
std::string::__init(v18, (const void *)a2, v6);
v7 = sub_4C1A88(v18, "|");
std::string::~string((int)v18);
for ( i = 0; i < cocos2d::CCArray::count(v7); ++i )
{
v9 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v7, i);
CString = (const char *)cocos2d::CCString::getCString(v9);
memset(v17, 0, sizeof(v17));
v11 = CString;
v12 = strlen(CString);
std::string::__init(v17, v11, v12);
std::string::basic_string(v18, (int)v17);
v13 = (GJGameLevel *)GameLevelManager::responseToDict((cocos2d::CCDictionary *)v18, 0);
v15 = GJGameLevel::create(v13, (cocos2d::CCDictionary *)((char *)&dword_0 + 1), v14);
std::string::~string((int)v18);
if ( v15 )
cocos2d::CCArray::addObject(v5, (cocos2d::CCObject *)v15);
std::string::~string((int)v17);
}
return v5;
}