//
// EditorSFXManager::dataLoaded from 0xcc3fc4 to 0xcc4414 (1104 bytes)
//
// 2 xrefs:
// > GameManager::dataLoaded @ 0x727a30
// > ??> @ 0xdbc70
//
// 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 13:06:19 +0000
//
__int64 __fastcall EditorSFXManager::dataLoaded(cocos2d::CCArray **this, DS_Dictionary *a2)
{
int IntegerForKey; // w25
int v5; // w26
int v6; // w22
int v7; // w20
cocos2d::CCArray *v8; // x0
cocos2d::CCArray *v9; // x0
__int64 *v10; // x0
size_t v11; // x1
cocos2d::CCArray *v12; // x0
unsigned int v13; // w20
cocos2d::CCString *v14; // x0
const char *CString; // x0
size_t v16; // x0
const char *v17; // x1
DS_Dictionary *v18; // x1
cocos2d::CCObject *v19; // x1
cocos2d::CCArray *v20; // x0
cocos2d::CCArray *v21; // x0
unsigned int v22; // w20
cocos2d::CCString *v23; // x0
const char *v24; // x0
size_t v25; // x0
const char *v26; // x1
DS_Dictionary *v27; // x1
cocos2d::CCObject *v28; // x1
cocos2d::CCArray *v29; // x0
int v30; // w0
float v31; // s0
char *v33; // [xsp+68h] [xbp+68h]
char *v34; // [xsp+68h] [xbp+68h]
__int64 v35; // [xsp+78h] [xbp+78h] BYREF
size_t v36; // [xsp+80h] [xbp+80h]
void *v37; // [xsp+88h] [xbp+88h]
__int64 v38; // [xsp+90h] [xbp+90h] BYREF
size_t v39; // [xsp+98h] [xbp+98h]
void *v40; // [xsp+A0h] [xbp+A0h]
if ( !a2 )
return _stack_chk_guard;
v35 = 0;
v36 = 0;
v37 = nullptr;
IntegerForKey = DS_Dictionary::getIntegerForKey(a2, "editorSFXVersion");
if ( IntegerForKey > 0 )
{
DS_Dictionary::getStringForKey(&v38, a2, "editorSFX");
LOWORD(v35) = 0;
std::string::reserve(&v35, 0);
v37 = v40;
v35 = v38;
v36 = v39;
}
v5 = DS_Dictionary::getIntegerForKey(a2, "editorSFXFavoriteCount");
v6 = DS_Dictionary::getIntegerForKey(a2, "editorSFXMyCount");
if ( sub_CBF304((char *)&v35) || v5 > 0 || v6 > 0 )
{
if ( *(this + 3) || (v7 = 1, sub_CBF304((char *)this + 168)) )
{
LABEL_13:
EditorSFXManager::clearAll((EditorSFXManager *)this);
v10 = (__int64 *)(this + 21);
if ( (*(_BYTE *)(this + 21) & 1) != 0 )
{
*(_BYTE *)*(this + 23) = 0;
*(this + 22) = nullptr;
}
else
{
*((_BYTE *)this + 169) = 0;
*((_BYTE *)this + 168) = 0;
}
v11 = (unsigned __int8)v35 >> 1;
if ( (v35 & 1) != 0 )
v11 = v36;
if ( v11 && v10 != &v35 )
{
if ( (v35 & 1) != 0 )
std::string::assign(v10, v37, v36);
else
std::string::assign(v10, (char *)&v35 + 1, (unsigned __int8)v35 >> 1);
}
v12 = *(this + 18);
if ( v12 )
cocos2d::CCArray::removeAllObjects(v12);
v13 = 0;
if ( v5 > 0 )
{
while ( 1 )
{
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"editorSFXFavorite_%d",
(const char *)v13);
CString = (const char *)cocos2d::CCString::getCString(v14);
v38 = 0;
v39 = 0;
v40 = nullptr;
v33 = (char *)CString;
v16 = strlen(CString);
std::string::__init(&v38, v33, v16);
v17 = (char *)&v38 + 1;
if ( (v38 & 1) != 0 )
v17 = (const char *)v40;
if ( (unsigned __int8)DS_Dictionary::stepIntoSubDictWithKey(a2, v17) )
{
v19 = (cocos2d::CCObject *)GJEditorSoundConfig::createWithCoder(a2, v18);
if ( v19 )
{
v20 = *(this + 18);
if ( v20 )
cocos2d::CCArray::addObject(v20, v19);
}
DS_Dictionary::stepOutOfSubDict(a2);
if ( (v38 & 1) != 0 )
goto LABEL_34;
LABEL_26:
if ( ++v13 == v5 )
break;
}
else
{
if ( (v38 & 1) == 0 )
goto LABEL_26;
LABEL_34:
++v13;
operator delete(v40);
if ( v13 == v5 )
break;
}
}
}
v21 = *(this + 19);
if ( v21 )
cocos2d::CCArray::removeAllObjects(v21);
v22 = 0;
if ( v6 > 0 )
{
while ( 1 )
{
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"editorSFXMy_%d",
(const char *)v22);
v24 = (const char *)cocos2d::CCString::getCString(v23);
v38 = 0;
v39 = 0;
v40 = nullptr;
v34 = (char *)v24;
v25 = strlen(v24);
std::string::__init(&v38, v34, v25);
v26 = (char *)&v38 + 1;
if ( (v38 & 1) != 0 )
v26 = (const char *)v40;
if ( (unsigned __int8)DS_Dictionary::stepIntoSubDictWithKey(a2, v26) )
{
v28 = (cocos2d::CCObject *)GJEditorSoundConfig::createWithCoder(a2, v27);
if ( v28 )
{
v29 = *(this + 19);
if ( v29 )
cocos2d::CCArray::addObject(v29, v28);
}
DS_Dictionary::stepOutOfSubDict(a2);
if ( (v38 & 1) != 0 )
goto LABEL_48;
LABEL_40:
if ( ++v22 == v6 )
break;
}
else
{
if ( (v38 & 1) == 0 )
goto LABEL_40;
LABEL_48:
++v22;
operator delete(v40);
if ( v22 == v6 )
break;
}
}
}
v30 = DS_Dictionary::getIntegerForKey(a2, "editorSFXNextLocalID");
if ( v30 <= 0 )
v30 = 1;
*((_DWORD *)this + 40) = v30;
*((float *)this + 48) = 1.0;
if ( IntegerForKey > 0 )
{
DS_Dictionary::getFloatForKey(a2, "editorSFXGlobalVolume");
if ( v31 < 0.0 )
{
*((_DWORD *)this + 48) = 0;
}
else
{
if ( v31 > 1.0 )
v31 = 1.0;
*((float *)this + 48) = v31;
}
}
goto LABEL_56;
}
}
else
{
if ( *(this + 3) )
goto LABEL_56;
v7 = 0;
if ( sub_CBF304((char *)this + 168) )
goto LABEL_56;
}
v8 = *(this + 18);
if ( !v8 || !(unsigned int)cocos2d::CCArray::count(v8) )
{
v9 = *(this + 19);
if ( !v9 || !(unsigned int)cocos2d::CCArray::count(v9) )
goto LABEL_13;
}
if ( v7 )
goto LABEL_13;
LABEL_56:
if ( (v35 & 1) != 0 )
operator delete(v37);
return _stack_chk_guard;
}