//
// EditorSFXManager::decodeSound from 0x77f144 to 0x77f45e (794 bytes)
//
// 1 xrefs:
// > EditorSFXManager::deserializeAll @ 0x780e60
//
// 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
//
SFXTriggerGameObject *__fastcall EditorSFXManager::decodeSound(int a1, char *a2)
{
SFXTriggerGameObject *NewSound; // r4
int v4; // r3
char *v5; // r0
char *v6; // r0
char *v7; // r0
double v8; // r0
float *v9; // r3
char *v10; // r0
char *v11; // r0
char *v12; // r0
char *v13; // r0
char *v14; // r0
char *v15; // r0
char *v16; // r0
float v17; // s15
char *v18; // r0
char *v19; // r0
char *v20; // r0
size_t v21; // r3
bool v22; // r0
size_t v23; // r3
bool v24; // r0
char *v25; // r0
size_t v26; // r3
bool v27; // r0
int v28; // r3
int v29; // r3
char *v30; // r1
size_t v31; // r2
char *v32; // r1
size_t v33; // r2
unsigned int v35; // [sp+10h] [bp-24h] BYREF
int v36; // [sp+14h] [bp-20h] BYREF
size_t v37; // [sp+18h] [bp-1Ch]
char *v38; // [sp+1Ch] [bp-18h]
int v39; // [sp+20h] [bp-14h] BYREF
size_t v40; // [sp+24h] [bp-10h]
char *v41; // [sp+28h] [bp-Ch]
NewSound = EditorSFXManager::createNewSound(nullptr, a2);
if ( NewSound )
{
v35 = 0;
v36 = 0;
v37 = 0;
v38 = nullptr;
v39 = 0;
v40 = 0;
v41 = nullptr;
while ( sub_77F0C4((unsigned __int8 *)a2, &v35, &v36, 44) )
{
if ( (v36 & 1) != 0 )
v4 = v37;
else
v4 = (int)(unsigned __int8)v36 >> 1;
if ( v4 )
{
if ( !sub_77F0C4((unsigned __int8 *)a2, &v35, &v39, 44) )
break;
if ( (v36 & 1) != 0 )
v5 = v38;
else
v5 = (char *)&v36 + 1;
switch ( atoi(v5) )
{
case 1:
if ( (v39 & 1) != 0 )
v6 = v41;
else
v6 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 415) = atoi(v6);
continue;
case 2:
if ( (v39 & 1) != 0 )
v7 = v41;
else
v7 = (char *)&v39 + 1;
v8 = atof(v7);
v9 = (float *)((char *)NewSound + 1680);
goto LABEL_50;
case 3:
if ( (v39 & 1) != 0 )
v10 = v41;
else
v10 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 418) = atoi(v10);
continue;
case 4:
if ( (v39 & 1) != 0 )
v11 = v41;
else
v11 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 419) = atoi(v11);
continue;
case 5:
if ( (v39 & 1) != 0 )
v12 = v41;
else
v12 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 421) = atoi(v12);
continue;
case 6:
if ( (v39 & 1) != 0 )
v13 = v41;
else
v13 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 423) = atoi(v13);
continue;
case 7:
if ( (v39 & 1) != 0 )
v14 = v41;
else
v14 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 422) = atoi(v14);
continue;
case 8:
if ( (v39 & 1) != 0 )
v15 = v41;
else
v15 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 424) = atoi(v15);
continue;
case 9:
if ( (v39 & 1) != 0 )
v16 = v41;
else
v16 = (char *)&v39 + 1;
v8 = atof(v16);
v9 = (float *)((char *)NewSound + 1744);
goto LABEL_50;
case 10:
if ( (v39 & 1) != 0 )
v18 = v41;
else
v18 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 445) = atoi(v18);
continue;
case 11:
if ( (v39 & 1) != 0 )
v19 = v41;
else
v19 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 446) = atoi(v19);
continue;
case 12:
if ( (v39 & 1) != 0 )
v20 = v41;
else
v20 = (char *)&v39 + 1;
v8 = atof(v20);
v9 = (float *)((char *)NewSound + 1788);
LABEL_50:
v17 = v8;
*v9 = v17;
break;
case 13:
if ( (v39 & 1) != 0 )
v21 = v40;
else
v21 = (int)(unsigned __int8)v39 >> 1;
v22 = v21 == 1 && std::string::compare((unsigned __int8 *)&v39, 0, 0xFFFFFFFF, a1i2r3e45s789g, 1u) == 0;
*((_BYTE *)NewSound + 1792) = v22;
break;
case 14:
if ( (v39 & 1) != 0 )
v23 = v40;
else
v23 = (int)(unsigned __int8)v39 >> 1;
v24 = v23 == 1 && std::string::compare((unsigned __int8 *)&v39, 0, 0xFFFFFFFF, a1i2r3e45s789g, 1u) == 0;
*((_BYTE *)NewSound + 1701) = v24;
break;
case 15:
if ( (v39 & 1) != 0 )
v25 = v41;
else
v25 = (char *)&v39 + 1;
*((_DWORD *)NewSound + 416) = atoi(v25);
break;
case 16:
if ( (v39 & 1) != 0 )
v26 = v40;
else
v26 = (int)(unsigned __int8)v39 >> 1;
v27 = v26 == 1 && std::string::compare((unsigned __int8 *)&v39, 0, 0xFFFFFFFF, a1i2r3e45s789g, 1u) == 0;
*((_BYTE *)NewSound + 1700) = v27;
break;
default:
v28 = *((unsigned __int8 *)NewSound + 1796);
if ( (v28 & 1) != 0 )
v29 = *((_DWORD *)NewSound + 450);
else
v29 = v28 >> 1;
if ( v29 )
std::string::push_back((int *)NewSound + 449, 44);
if ( (v36 & 1) != 0 )
{
v30 = v38;
v31 = v37;
}
else
{
v31 = (int)(unsigned __int8)v36 >> 1;
v30 = (char *)&v36 + 1;
}
std::string::append((_DWORD *)NewSound + 449, v30, v31);
std::string::push_back((int *)NewSound + 449, 44);
if ( (v39 & 1) != 0 )
{
v32 = v41;
v33 = v40;
}
else
{
v33 = (int)(unsigned __int8)v39 >> 1;
v32 = (char *)&v39 + 1;
}
std::string::append((_DWORD *)NewSound + 449, v32, v33);
break;
}
}
}
std::string::~string((int)&v39);
std::string::~string((int)&v36);
}
return NewSound;
}