//
// GameLevelManager::createAndGetEditorSoundConfigs from 0x8104a8 to 0x81071c (628 bytes)
//
// 2 xrefs:
// > GameLevelManager::onGetEditorSoundsCompleted @ 0x849194
// > ??> @ 0x43b10
//
// 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:54:49 +0000
//
cocos2d::CCArray *__fastcall GameLevelManager::createAndGetEditorSoundConfigs(__int64 a1, char *a2)
{
cocos2d::CCArray *v3; // x25
char *v4; // x19
char v5; // t1
size_t v6; // x0
cocos2d::CCArray *v7; // x24
unsigned int v8; // w21
cocos2d::CCString *v9; // x0
const char *CString; // x0
const char *v11; // x27
size_t v12; // x0
size_t v13; // x20
char *v14; // x3
GJEditorSoundConfig *v15; // x0
cocos2d::CCDictionary *v16; // x1
cocos2d::CCObject *v17; // x1
unsigned __int64 v19; // x0
__int64 v20; // x22
char *v21; // x0
cocos2d::CCObject *v23; // [xsp+68h] [xbp+68h]
__int64 v24; // [xsp+78h] [xbp+78h] BYREF
size_t v25; // [xsp+80h] [xbp+80h]
void *v26; // [xsp+88h] [xbp+88h]
__int64 v27; // [xsp+90h] [xbp+90h] BYREF
size_t v28; // [xsp+98h] [xbp+98h]
void *v29; // [xsp+A0h] [xbp+A0h]
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v5 = *a2;
v4 = a2 + 1;
if ( (v5 & 1) != 0 )
v4 = *((char **)a2 + 2);
v27 = 0;
v28 = 0;
v29 = nullptr;
v6 = strlen(v4);
std::string::__init(&v27, v4, v6);
v7 = sub_80CFCC((unsigned __int8 *)&v27, "|");
if ( (v27 & 1) != 0 )
operator delete(v29);
v8 = 0;
while ( v8 < (unsigned int)cocos2d::CCArray::count(v7) )
{
v9 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v7, v8);
CString = (const char *)cocos2d::CCString::getCString(v9);
v24 = 0;
v25 = 0;
v11 = CString;
v26 = nullptr;
v12 = strlen(CString);
v13 = v12;
if ( v12 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v12 > 0x16 )
{
v19 = (v12 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v20 = v19 | 1;
v21 = (char *)operator new(v19);
v24 = v20;
v14 = v21;
v26 = v21;
v25 = v13;
}
else
{
LOBYTE(v24) = 2 * v12;
v14 = (char *)&v24 + 1;
if ( !v12 )
goto LABEL_9;
}
v14 = (char *)memcpy(v14, v11, v13);
LABEL_9:
v14[v13] = 0;
if ( (v24 & 1) != 0 )
{
if ( !v25 )
goto LABEL_20;
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, v26, v25);
}
else
{
if ( !((int)(unsigned __int8)v24 >> 1) )
goto LABEL_17;
v29 = v26;
v27 = v24;
v28 = v25;
}
v15 = (GJEditorSoundConfig *)GameLevelManager::responseToDict((__int64)&v27, 0);
v17 = (cocos2d::CCObject *)GJEditorSoundConfig::create(v15, v16);
if ( (v27 & 1) != 0 )
{
v23 = v17;
operator delete(v29);
v17 = v23;
}
if ( v17 )
cocos2d::CCArray::addObject(v3, v17);
if ( (v24 & 1) != 0 )
{
LABEL_20:
++v8;
operator delete(v26);
continue;
}
LABEL_17:
++v8;
}
return v3;
}