//
// EditorSFXManager::serializeAll from 0x77eda8 to 0x77f05a (690 bytes)
//
// 2 xrefs:
// > EditorSFXManager::serializeCompressed @ 0x77f088
// > EditorSFXManager::encodeDataTo @ 0x7810e8
//
// 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:26 +0000
//
int *__fastcall EditorSFXManager::serializeAll(EditorSFXManager *this, int a2)
{
_DWORD *v2; // r5
int *v3; // r4
cocos2d::CCArray **v5; // r8
unsigned int i; // r7
int v7; // r0
_DWORD *v8; // r2
char *v9; // r3
_DWORD *v10; // r1
GameManager *v11; // r5
GameManager *v12; // r0
_DWORD *v13; // r3
int v14; // r3
size_t v15; // r0
_DWORD *j; // r7
int v17; // r5
int v18; // r0
char *v19; // r1
size_t v20; // r2
unsigned int k; // r8
char *v22; // r1
size_t v23; // r2
float *v24; // r0
float v25; // s14
int v26; // r3
int v27; // r3
int v28; // r2
const void *v29; // r1
size_t v30; // r2
void *v32; // [sp+24h] [bp-A8h] BYREF
char *v33; // [sp+28h] [bp-A4h]
unsigned int v34; // [sp+2Ch] [bp-A0h]
_DWORD **v35; // [sp+30h] [bp-9Ch] BYREF
_DWORD *v36[2]; // [sp+34h] [bp-98h] BYREF
unsigned __int8 v37; // [sp+3Ch] [bp-90h] BYREF
char v38; // [sp+3Dh] [bp-8Fh] BYREF
size_t v39; // [sp+40h] [bp-8Ch]
char *v40; // [sp+44h] [bp-88h]
int v41[3]; // [sp+48h] [bp-84h] BYREF
char v42[16]; // [sp+54h] [bp-78h] BYREF
char v43[32]; // [sp+64h] [bp-68h] BYREF
char v44[64]; // [sp+84h] [bp-48h] BYREF
v2 = *(_DWORD **)(a2 + 8);
v3 = (int *)this;
v32 = nullptr;
v33 = nullptr;
v34 = 0;
while ( v2 )
{
v5 = (cocos2d::CCArray **)v2[3];
if ( v5 && *v5 )
{
for ( i = 0; ; ++i )
{
this = (EditorSFXManager *)cocos2d::CCArray::count(*v5);
if ( i >= (unsigned int)this )
break;
v7 = cocos2d::CCArray::objectAtIndex(*v5, i);
if ( v7 && *(int *)(v7 + 1660) > 0 )
{
v8 = *(_DWORD **)(v7 + 1664);
v35 = *(_DWORD ***)(v7 + 1660);
v9 = v33;
v36[0] = v8;
if ( (unsigned int)v33 >= v34 )
{
std::vector>::__push_back_slow_path>(&v32, (int *)&v35);
}
else
{
if ( v33 )
{
v10 = v36[0];
*(_DWORD *)v33 = v35;
*((_DWORD *)v9 + 1) = v10;
}
v33 += 8;
}
}
}
}
v2 = (_DWORD *)*v2;
}
v36[0] = nullptr;
v36[1] = nullptr;
v35 = v36;
v11 = (GameManager *)MusicDownloadManager::sharedState(this);
v12 = (GameManager *)GameManager::sharedState(v11);
if ( GameManager::getGameVariable(v12, "0233") )
v13 = &v35;
else
v13 = nullptr;
MusicDownloadManager::rebuildCustomSFXMappings(v11, &v32, a2 + 60, v13);
if ( *(_DWORD *)(a2 + 68) )
v14 = 2;
else
v14 = 1;
sub_993B88(v42, 16, "%d;", v14);
*v3 = 0;
v3[1] = 0;
v3[2] = 0;
v15 = strlen(v42);
std::string::__init(v3, v42, v15);
for ( j = *(_DWORD **)(a2 + 8); j; j = (_DWORD *)*j )
{
v17 = j[3];
if ( v17 && *(_DWORD *)v17 && cocos2d::CCArray::count(*(cocos2d::CCArray **)v17) )
{
sub_993B88(v44, 64, "%d,%d,%d,%d", 1, j[2], 2, *(_DWORD *)(v17 + 4));
std::string::append(v3, v44);
v24 = (float *)std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
(_DWORD *)(a2 + 40),
j + 2);
if ( v24 )
{
v25 = v24[3];
if ( v25 > 0.0 )
{
sub_993B88(v43, 32, ",%d,%g", 3, v25);
std::string::append(v3, v43);
}
}
v26 = *(unsigned __int8 *)(v17 + 12);
if ( (v26 & 1) != 0 )
v27 = *(_DWORD *)(v17 + 16);
else
v27 = v26 >> 1;
if ( v27 )
{
std::string::push_back(v3, 44);
v28 = *(unsigned __int8 *)(v17 + 12);
if ( (v28 & 1) != 0 )
{
v29 = *(const void **)(v17 + 20);
v30 = *(_DWORD *)(v17 + 16);
}
else
{
v29 = (const void *)(v17 + 13);
v30 = v28 >> 1;
}
std::string::append(v3, v29, v30);
}
std::string::push_back(v3, 59);
for ( k = 0; k < cocos2d::CCArray::count(*(cocos2d::CCArray **)v17); ++k )
{
if ( k )
std::string::push_back(v3, 58);
v18 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)v17, k);
EditorSFXManager::encodeSound((EditorSFXManager *)&v37, (SFXTriggerGameObject *)a2, v18);
if ( (v37 & 1) != 0 )
{
v19 = v40;
v20 = v39;
}
else
{
v20 = (int)v37 >> 1;
v19 = &v38;
}
std::string::append(v3, v19, v20);
std::string::~string((int)&v37);
}
std::string::push_back(v3, 59);
}
}
if ( *(_DWORD *)(a2 + 68) )
{
std::string::append(v3, "M|");
MusicDownloadManager::encodeCustomSFXMappingEntries(v41, (_DWORD **)(a2 + 60));
if ( (v41[0] & 1) != 0 )
{
v22 = (char *)v41[2];
v23 = v41[1];
}
else
{
v23 = (int)LOBYTE(v41[0]) >> 1;
v22 = (char *)v41 + 1;
}
std::string::append(v3, v22, v23);
std::string::~string((int)v41);
}
std::__tree::destroy((int)&v35, v36[0]);
if ( v32 )
{
v33 -= 8 * ((unsigned int)(v33 - (_BYTE *)v32) >> 3);
operator delete(v32);
}
return v3;
}