//
// GameLevelManager::onGetEditorSoundsCompleted from 0x4d1bb8 to 0x4d1d9a (482 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4db0ca
//
// 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:48 +0000
//
int __fastcall GameLevelManager::onGetEditorSoundsCompleted(GameLevelManager *a1, int a2, int a3)
{
char *v5; // r5
_BOOL4 v6; // r8
bool v7; // nf
size_t v8; // r0
cocos2d::CCArray *v9; // r9
int result; // r0
cocos2d::CCString *v11; // r0
const char *CString; // r10
size_t v13; // r0
cocos2d::CCString *v14; // r0
const char *v15; // r10
size_t v16; // r0
cocos2d::CCString *v17; // r0
const char *v18; // r10
size_t v19; // r0
cocos2d::CCObject *EditorSoundConfigs; // r11
void (__fastcall ***v21)(_DWORD, cocos2d::CCObject *, char *); // r0
int v22[3]; // [sp+Ch] [bp-50h] BYREF
int v23[3]; // [sp+18h] [bp-44h] BYREF
int v24[3]; // [sp+24h] [bp-38h] BYREF
int v25[3]; // [sp+30h] [bp-2Ch] BYREF
int v26[3]; // [sp+3Ch] [bp-20h] BYREF
int v27; // [sp+48h] [bp-14h] BYREF
int v28; // [sp+4Ch] [bp-10h]
int v29; // [sp+50h] [bp-Ch]
if ( (*(_BYTE *)a3 & 1) != 0 )
v5 = *(char **)(a3 + 8);
else
v5 = (char *)(a3 + 1);
GameLevelManager::removeDLFromActive(a1, v5);
v27 = 0;
v28 = 0;
v29 = 0;
std::string::__init(&v27, "-1", 2u);
v6 = sub_4A9CC4((unsigned __int8 *)a2, (unsigned __int8 *)&v27);
std::string::~string((int)&v27);
if ( v6 )
goto LABEL_10;
v7 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v27 = 0;
if ( v7 )
a2 = *(_DWORD *)(a2 + 8);
v28 = 0;
v29 = 0;
v8 = strlen((const char *)a2);
std::string::__init(&v27, (const void *)a2, v8);
v9 = sub_4C1A88(&v27, "#");
std::string::~string((int)&v27);
if ( cocos2d::CCArray::count(v9) <= 2u )
{
LABEL_10:
result = *((_DWORD *)a1 + 218);
if ( result )
return (*(int (__fastcall **)(int, char *))(*(_DWORD *)result + 4))(result, v5);
}
else
{
v11 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 0);
memset(v22, 0, sizeof(v22));
CString = (const char *)cocos2d::CCString::getCString(v11);
v13 = strlen(CString);
std::string::__init(v22, CString, v13);
v14 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 1u);
v15 = (const char *)cocos2d::CCString::getCString(v14);
memset(v23, 0, sizeof(v23));
v16 = strlen(v15);
std::string::__init(v23, v15, v16);
v17 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 2u);
v18 = (const char *)cocos2d::CCString::getCString(v17);
memset(v24, 0, sizeof(v24));
v19 = strlen(v18);
std::string::__init(v24, v18, v19);
std::string::basic_string(v25, (int)v23);
GameLevelManager::storeUserNames((unsigned __int8 *)a1, (unsigned __int8 *)v25);
std::string::~string((int)v25);
std::string::basic_string(v26, (int)v22);
EditorSoundConfigs = GameLevelManager::createAndGetEditorSoundConfigs(a1, (int)v26);
std::string::~string((int)v26);
std::string::basic_string(&v27, (int)v24);
GameLevelManager::storeSearchResult(a1, EditorSoundConfigs, COERCE_FLOAT(&v27), v5);
std::string::~string((int)&v27);
v21 = *((void (__fastcall ****)(_DWORD, cocos2d::CCObject *, char *))a1 + 218);
if ( v21 )
(**v21)(v21, EditorSoundConfigs, v5);
std::string::~string((int)v24);
std::string::~string((int)v23);
return std::string::~string((int)v22);
}
return result;
}