//
// EditorSFXManager::dataLoaded from 0x1008ec7b0 to 0x1008eccff (1359 bytes)
//
// 1 xrefs:
// > GameManager::dataLoaded @ 0x10037352a
//
// This function is hookable on this platform (idp: pc, 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:37:54 +0000
//
void __fastcall EditorSFXManager::dataLoaded(__int64 a1, __int64 a2)
{
bool v2; // bl
std::string::size_type v3; // rax
std::string::size_type v4; // rax
std::string::size_type size; // rcx
bool v6; // r14
bool v7; // r15
__int64 v8; // r12
bool v9; // al
__int64 v10; // rcx
unsigned int v11; // eax
std::string::size_type v12; // rax
unsigned __int64 v13; // rax
unsigned int v14; // ecx
unsigned __int64 v15; // rcx
__int64 v16; // rdi
int v17; // ebx
char *v18; // rax
const char *CString; // r12
size_t v20; // rax
size_t v21; // r15
char *v22; // r13
char *v23; // rsi
__int64 v24; // rax
__int64 v25; // rdi
__int64 v26; // rax
size_t v27; // r14
__int64 v28; // rdi
int v29; // ebx
char *v30; // rax
const char *v31; // r12
size_t v32; // rax
size_t v33; // r13
char *v34; // r15
char *v35; // rsi
__int64 v36; // rax
__int64 v37; // rdi
__int64 v38; // rax
size_t v39; // r14
int v40; // eax
int v41; // ecx
__int64 v42; // rax
double FloatForKey; // xmm0_8
int v44; // xmm1_4
__int64 v45; // rdi
__int64 v46; // rdi
int IntegerForKey; // [rsp+Ch] [rbp-74h]
std::string __str; // [rsp+10h] [rbp-70h] BYREF
int v49; // [rsp+28h] [rbp-58h]
int v50; // [rsp+2Ch] [rbp-54h]
__int128 __dst; // [rsp+30h] [rbp-50h] BYREF
void *__p; // [rsp+40h] [rbp-40h]
__int64 v53; // [rsp+48h] [rbp-38h]
__int64 v54; // [rsp+50h] [rbp-30h]
v54 = a1;
if ( a2 )
{
memset(&__str, 0, sizeof(__str));
IntegerForKey = DS_Dictionary::getIntegerForKey(a2, "editorSFXVersion");
if ( IntegerForKey > 0 )
{
DS_Dictionary::getStringForKey(&__dst, a2, "editorSFX", 0.0);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)__p;
*(_OWORD *)&__str.__r_.__value_.__l.0 = __dst;
}
v49 = DS_Dictionary::getIntegerForKey(a2, "editorSFXFavoriteCount");
v53 = a2;
v50 = DS_Dictionary::getIntegerForKey(a2, "editorSFXMyCount");
v2 = 0;
v3 = std::string::find(&__str, 59, 0);
if ( v3 != -1 )
{
v4 = v3 + 1;
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
size = __str.__r_.__value_.__l.__size_;
else
size = *(_BYTE *)&__str.__r_.__value_.__l.0 >> 1;
v2 = v4 < size;
}
v6 = v49 > 0;
v7 = v50 > 0;
v8 = v54;
if ( *(_QWORD *)(v54 + 24) )
goto LABEL_12;
v12 = std::string::find((const std::string *)(v54 + 168), 59, 0);
if ( v12 != -1 )
{
v13 = v12 + 1;
v14 = *(unsigned __int8 *)(v8 + 168);
if ( (v14 & 1) != 0 )
{
v15 = *(_QWORD *)(v8 + 176);
v8 = v54;
if ( v13 < v15 )
goto LABEL_12;
}
else
{
v8 = v54;
if ( v13 < v14 >> 1 )
goto LABEL_12;
}
}
v45 = *(_QWORD *)(v8 + 144);
if ( !v45 || !(unsigned int)sub_1007FEF90(v45) )
{
v46 = *(_QWORD *)(v54 + 152);
if ( !v46 )
goto LABEL_14;
v9 = (unsigned int)sub_1007FEF90(v46) == 0;
LABEL_13:
if ( !v9 && !v7 && !v6 && !v2 )
{
LABEL_76:
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
return;
}
LABEL_14:
EditorSFXManager::clearAll(v54);
v10 = v54;
if ( (*(_BYTE *)(v54 + 168) & 1) != 0 )
{
**(_BYTE **)(v54 + 184) = 0;
*(_QWORD *)(v10 + 176) = 0;
v11 = (unsigned int)__str.__r_.__value_.__l.0;
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_16:
if ( !(v11 >> 1) )
goto LABEL_25;
goto LABEL_24;
}
}
else
{
*(_WORD *)(v54 + 168) = 0;
v11 = (unsigned int)__str.__r_.__value_.__l.0;
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_16;
}
if ( !__str.__r_.__value_.__l.__size_ )
{
LABEL_25:
v16 = *(_QWORD *)(v54 + 144);
if ( v16 )
sub_1007FF190(v16);
if ( v49 > 0 )
{
v17 = 0;
while ( 1 )
{
v18 = sub_10088E820("editorSFXFavorite_%d", v17);
CString = (const char *)cocos2d::CCString::getCString((__int64)v18);
v20 = strlen(CString);
if ( v20 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v21 = v20;
if ( v20 >= 0x17 )
break;
LOBYTE(__dst) = 2 * v20;
v22 = (char *)&__dst + 1;
if ( v20 )
goto LABEL_45;
BYTE1(__dst) = 0;
v23 = (char *)&__dst + 1;
if ( (__dst & 1) != 0 )
goto LABEL_34;
LABEL_35:
if ( DS_Dictionary::stepIntoSubDictWithKey(v53, v23) )
{
v24 = GJEditorSoundConfig::createWithCoder(v53);
if ( v24 )
{
v25 = *(_QWORD *)(v54 + 144);
if ( v25 )
sub_1007FEBF0(v25, v24);
}
DS_Dictionary::stepOutOfSubDict(v53);
}
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v49 == ++v17 )
goto LABEL_47;
}
v26 = v20 | 7;
v27 = 26;
if ( (v21 | 7) != 0x17 )
v27 = v26 + 1;
v22 = (char *)operator new(v27);
__p = v22;
*(_QWORD *)&__dst = v27 | 1;
*((_QWORD *)&__dst + 1) = v21;
LABEL_45:
memmove(v22, CString, v21);
v22[v21] = 0;
v23 = (char *)&__dst + 1;
if ( (__dst & 1) == 0 )
goto LABEL_35;
LABEL_34:
v23 = (char *)__p;
goto LABEL_35;
}
LABEL_47:
v28 = *(_QWORD *)(v54 + 152);
if ( v28 )
sub_1007FF190(v28);
if ( v50 > 0 )
{
v29 = 0;
while ( 1 )
{
v30 = sub_10088E820("editorSFXMy_%d", v29);
v31 = (const char *)cocos2d::CCString::getCString((__int64)v30);
v32 = strlen(v31);
if ( v32 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v33 = v32;
if ( v32 >= 0x17 )
break;
LOBYTE(__dst) = 2 * v32;
v34 = (char *)&__dst + 1;
if ( v32 )
goto LABEL_67;
BYTE1(__dst) = 0;
v35 = (char *)&__dst + 1;
if ( (__dst & 1) != 0 )
goto LABEL_56;
LABEL_57:
if ( DS_Dictionary::stepIntoSubDictWithKey(v53, v35) )
{
v36 = GJEditorSoundConfig::createWithCoder(v53);
if ( v36 )
{
v37 = *(_QWORD *)(v54 + 152);
if ( v37 )
sub_1007FEBF0(v37, v36);
}
DS_Dictionary::stepOutOfSubDict(v53);
}
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v50 == ++v29 )
goto LABEL_69;
}
v38 = v32 | 7;
v39 = 26;
if ( (v33 | 7) != 0x17 )
v39 = v38 + 1;
v34 = (char *)operator new(v39);
__p = v34;
*(_QWORD *)&__dst = v39 | 1;
*((_QWORD *)&__dst + 1) = v33;
LABEL_67:
memmove(v34, v31, v33);
v34[v33] = 0;
v35 = (char *)&__dst + 1;
if ( (__dst & 1) == 0 )
goto LABEL_57;
LABEL_56:
v35 = (char *)__p;
goto LABEL_57;
}
LABEL_69:
v40 = DS_Dictionary::getIntegerForKey(v53, "editorSFXNextLocalID");
v41 = 1;
if ( v40 >= 2 )
v41 = v40;
v42 = v54;
*(_DWORD *)(v54 + 160) = v41;
*(_DWORD *)(v42 + 192) = 1065353216;
if ( IntegerForKey > 0 )
{
FloatForKey = DS_Dictionary::getFloatForKey(v53, "editorSFXGlobalVolume");
v44 = 0;
if ( *(float *)&FloatForKey >= 0.0 )
{
v44 = LODWORD(FloatForKey);
if ( *(float *)&FloatForKey > 1.0 )
v44 = 1065353216;
}
*(_DWORD *)(v54 + 192) = v44;
}
goto LABEL_76;
}
LABEL_24:
std::string::operator=((std::string *)(v54 + 168), &__str);
goto LABEL_25;
}
LABEL_12:
v9 = 0;
goto LABEL_13;
}
}