//
// EditorSFXManager::dataLoaded from 0x77f968 to 0x77fc58 (752 bytes)
//
// 1 xrefs:
// > GameManager::dataLoaded @ 0x41c5b8
//
// 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:59:27 +0000
//
int __fastcall EditorSFXManager::dataLoaded(int this, DS_Dictionary *a2)
{
int v2; // r4
int v4; // r0
unsigned int v5; // r1
char *v6; // r2
int v7; // r11
int v8; // r9
int v9; // r0
unsigned int v10; // r0
unsigned int v11; // r3
_BOOL4 v12; // r7
int v13; // r0
int v14; // r3
unsigned int v15; // r0
unsigned int v16; // r3
cocos2d::CCArray *v17; // r0
int v18; // r3
cocos2d::CCArray *v19; // r0
const char *i; // r7
cocos2d::CCString *v21; // r0
size_t v22; // r0
char *v23; // r1
DS_Dictionary *v24; // r1
cocos2d::CCObject *v25; // r1
cocos2d::CCArray *v26; // r0
cocos2d::CCArray *v27; // r0
const char *j; // r7
cocos2d::CCString *v29; // r0
size_t v30; // r0
char *v31; // r1
DS_Dictionary *v32; // r1
cocos2d::CCObject *v33; // r1
cocos2d::CCArray *v34; // r0
int v35; // r0
float v36; // r0
float v37; // s15
cocos2d::CCArray *v38; // r0
int IntegerForKey; // [sp+0h] [bp-34h]
cocos2d::CCString *v40; // [sp+8h] [bp-2Ch]
const char *CString; // [sp+Ch] [bp-28h]
int v42; // [sp+14h] [bp-20h] BYREF
unsigned int v43; // [sp+18h] [bp-1Ch]
char *v44; // [sp+1Ch] [bp-18h]
int v45; // [sp+20h] [bp-14h] BYREF
unsigned int v46; // [sp+24h] [bp-10h]
char *v47; // [sp+28h] [bp-Ch]
v2 = this;
if ( a2 )
{
v42 = 0;
v43 = 0;
v44 = nullptr;
IntegerForKey = DS_Dictionary::getIntegerForKey(a2, "editorSFXVersion");
if ( IntegerForKey > 0 )
{
DS_Dictionary::getStringForKey((DS_Dictionary *)&v45, (const char *)a2);
LOWORD(v42) = 0;
std::string::reserve(&v42, 0);
v4 = v45;
v5 = v46;
v6 = v47;
v45 = 0;
v46 = 0;
v47 = nullptr;
v42 = v4;
v43 = v5;
v44 = v6;
std::string::~string((int)&v45);
}
v7 = DS_Dictionary::getIntegerForKey(a2, "editorSFXFavoriteCount");
v8 = DS_Dictionary::getIntegerForKey(a2, "editorSFXMyCount");
v9 = std::string::find((unsigned __int8 *)&v42, 59, 0);
v12 = v9 != -1 && ((v10 = v9 + 1, (v42 & 1) != 0) ? (v11 = v43) : (v11 = (int)(unsigned __int8)v42 >> 1), v10 < v11)
|| v7 > 0
|| v8 > 0;
if ( !*(_DWORD *)(v2 + 12)
&& ((v13 = std::string::find((unsigned __int8 *)(v2 + 84), 59, 0), v13 == -1)
|| ((v14 = *(unsigned __int8 *)(v2 + 84), v15 = v13 + 1, (v14 & 1) != 0)
? (v16 = *(_DWORD *)(v2 + 88))
: (v16 = v14 >> 1),
v15 >= v16))
&& ((v17 = *(cocos2d::CCArray **)(v2 + 72)) == nullptr || !cocos2d::CCArray::count(v17))
&& ((v38 = *(cocos2d::CCArray **)(v2 + 76)) == nullptr || !cocos2d::CCArray::count(v38))
|| v12 )
{
EditorSFXManager::clearAll((EditorSFXManager *)v2);
if ( (*(_BYTE *)(v2 + 84) & 1) != 0 )
{
**(_BYTE **)(v2 + 92) = 0;
*(_DWORD *)(v2 + 88) = 0;
}
else
{
*(_BYTE *)(v2 + 85) = 0;
*(_BYTE *)(v2 + 84) = 0;
}
if ( (v42 & 1) != 0 )
v18 = v43;
else
v18 = (int)(unsigned __int8)v42 >> 1;
if ( v18 )
std::string::operator=((unsigned __int8 *)(v2 + 84), (unsigned __int8 *)&v42);
v19 = *(cocos2d::CCArray **)(v2 + 72);
if ( v19 )
cocos2d::CCArray::removeAllObjects(v19);
for ( i = nullptr; (int)i < v7; ++i )
{
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"editorSFXFavorite_%d", i);
CString = (const char *)cocos2d::CCString::getCString(v21);
v45 = 0;
v46 = 0;
v47 = nullptr;
v22 = strlen(CString);
std::string::__init(&v45, CString, v22);
if ( (v45 & 1) != 0 )
v23 = v47;
else
v23 = (char *)&v45 + 1;
if ( DS_Dictionary::stepIntoSubDictWithKey(a2, v23) )
{
v25 = (cocos2d::CCObject *)GJEditorSoundConfig::createWithCoder(a2, v24);
if ( v25 )
{
v26 = *(cocos2d::CCArray **)(v2 + 72);
if ( v26 )
cocos2d::CCArray::addObject(v26, v25);
}
DS_Dictionary::stepOutOfSubDict(a2);
}
std::string::~string((int)&v45);
}
v27 = *(cocos2d::CCArray **)(v2 + 76);
if ( v27 )
cocos2d::CCArray::removeAllObjects(v27);
for ( j = nullptr; (int)j < v8; ++j )
{
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"editorSFXMy_%d", j);
v40 = (cocos2d::CCString *)cocos2d::CCString::getCString(v29);
v45 = 0;
v46 = 0;
v47 = nullptr;
v30 = strlen((const char *)v40);
std::string::__init(&v45, v40, v30);
if ( (v45 & 1) != 0 )
v31 = v47;
else
v31 = (char *)&v45 + 1;
if ( DS_Dictionary::stepIntoSubDictWithKey(a2, v31) )
{
v33 = (cocos2d::CCObject *)GJEditorSoundConfig::createWithCoder(a2, v32);
if ( v33 )
{
v34 = *(cocos2d::CCArray **)(v2 + 76);
if ( v34 )
cocos2d::CCArray::addObject(v34, v33);
}
DS_Dictionary::stepOutOfSubDict(a2);
}
std::string::~string((int)&v45);
}
v35 = DS_Dictionary::getIntegerForKey(a2, "editorSFXNextLocalID");
if ( v35 < 1 )
v35 = 1;
*(_DWORD *)(v2 + 80) = v35;
*(float *)(v2 + 96) = 1.0;
if ( IntegerForKey > 0 )
{
v36 = COERCE_FLOAT(DS_Dictionary::getFloatForKey(a2, "editorSFXGlobalVolume"));
v37 = v36;
if ( v36 < 0.0 )
{
v37 = 0.0;
}
else if ( v36 > 1.0 )
{
v37 = 1.0;
}
*(float *)(v2 + 96) = v37;
}
}
return std::string::~string((int)&v42);
}
return this;
}