//
// GameLevelManager::onDownloadEditorSoundCompleted from 0x8119e8 to 0x811d10 (808 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85bd84
// > ??> @ 0x479c8
//
// 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:50 +0000
//
__int64 __fastcall GameLevelManager::onDownloadEditorSoundCompleted(GameLevelManager *this, __int64 a2, char *a3)
{
const char *v5; // x3
unsigned __int64 v6; // x1
unsigned int v7; // w24
_BOOL4 v8; // w23
__int64 v9; // x0
const char *v11; // x1
size_t v12; // x0
cocos2d::CCArray *v13; // x22
cocos2d::CCString *v14; // x0
const char *CString; // x0
size_t v16; // x0
GJEditorSoundConfig *v17; // x0
cocos2d::CCDictionary *v18; // x1
__int64 v19; // x1
void (__fastcall ***v20)(_QWORD); // x0
__int64 v21; // x0
char *v22; // x23
__int64 v23; // x0
char *v25; // [xsp+48h] [xbp+48h]
char *v26; // [xsp+48h] [xbp+48h]
__int64 v27; // [xsp+48h] [xbp+48h]
__int64 v28; // [xsp+58h] [xbp+58h] BYREF
size_t v29; // [xsp+60h] [xbp+60h]
void *v30; // [xsp+68h] [xbp+68h]
__int64 v31; // [xsp+70h] [xbp+70h] BYREF
size_t v32; // [xsp+78h] [xbp+78h]
char *v33; // [xsp+80h] [xbp+80h]
v5 = a3 + 1;
if ( (*a3 & 1) != 0 )
v5 = *((const char **)a3 + 2);
GameLevelManager::removeDLFromActive(this, v5);
v6 = (unsigned __int8)*a3 >> 1;
if ( (*a3 & 1) != 0 )
v6 = *((_QWORD *)a3 + 1);
if ( v6 > 6 )
{
std::string::basic_string(&v31, (__int64)a3, 6u, 0xFFFFFFFFFFFFFFFFLL);
if ( (v31 & 1) != 0 )
{
v22 = v33;
v7 = atoi(v33);
operator delete(v22);
}
else
{
v7 = atoi((const char *)&v31 + 1);
}
}
else
{
v7 = 0;
}
v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init(&v31, &word_117CE08, 2u);
v8 = sub_7FEA60(a2, (__int64)&v31);
if ( (v31 & 1) != 0 )
operator delete(v33);
if ( v8 )
{
v9 = *((_QWORD *)this + 167);
if ( v9 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v9 + 8LL))(v9, v7, 0xFFFFFFFFLL);
return _stack_chk_guard;
}
v11 = (const char *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v11 = *(const char **)(a2 + 16);
v25 = (char *)v11;
v31 = 0;
v32 = 0;
v33 = nullptr;
v12 = strlen(v11);
std::string::__init(&v31, v25, v12);
v13 = sub_80CFCC((unsigned __int8 *)&v31, "#");
if ( (v31 & 1) != 0 )
{
operator delete(v33);
if ( !v13 )
goto LABEL_28;
}
else if ( !v13 )
{
goto LABEL_28;
}
if ( (unsigned int)cocos2d::CCArray::count(v13) )
{
v14 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v13, 0);
CString = (const char *)cocos2d::CCString::getCString(v14);
v28 = 0;
v26 = (char *)CString;
v29 = 0;
v30 = nullptr;
v16 = strlen(CString);
std::string::__init(&v28, v26, v16);
v31 = 0;
v32 = 0;
v33 = nullptr;
if ( (v28 & 1) != 0 )
{
std::string::__init(&v31, v30, v29);
}
else
{
v33 = (char *)v30;
v31 = v28;
v32 = v29;
}
v17 = (GJEditorSoundConfig *)GameLevelManager::responseToDict((__int64)&v31, 0);
v19 = GJEditorSoundConfig::create(v17, v18);
if ( (v31 & 1) != 0 )
{
v27 = v19;
operator delete(v33);
v19 = v27;
}
if ( v19 && *(_BYTE *)(v19 + 496) )
{
v20 = *((void (__fastcall ****)(_QWORD))this + 167);
if ( v20 )
(**v20)(v20);
}
else
{
v23 = *((_QWORD *)this + 167);
if ( v23 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v23 + 8LL))(v23, v7, 4294967293LL);
}
if ( (v28 & 1) != 0 )
operator delete(v30);
return _stack_chk_guard;
}
LABEL_28:
v21 = *((_QWORD *)this + 167);
if ( v21 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v21 + 8LL))(v21, v7, 4294967294LL);
return _stack_chk_guard;
}