//
// processSFXGroupEdit from 0x87cbbc to 0x87cdd8 (540 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x88deb8
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x88decc
// > ??> @ 0x591d8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall processSFXGroupEdit(double *a1, char **a2, float a3)
{
__int64 v3; // x21
char *v5; // x3
int v6; // w6
unsigned __int64 v8; // x23
unsigned __int64 v9; // x19
__int64 **v10; // x0
__int64 *v11; // x1
int v12; // w4
__int64 v13; // x5
__int64 v14; // x23
double v15; // d8
_DWORD *v16; // x19
int v17; // w1
char *v18; // x21
unsigned __int64 v19; // x22
unsigned __int64 v20; // x21
_QWORD *v21; // x0
__int64 *v22; // x0
float v23; // s0
__int64 v24; // x0
char *v25; // x0
double v26; // d4
double v27; // d3
float v28; // s1
float v29; // s2
__int64 v30; // x0
int v31; // w5
char *inserted; // x0
v3 = *(_QWORD *)a1;
v5 = a2[1];
v6 = *(_DWORD *)(*(_QWORD *)a1 + 1916LL);
v8 = v6;
v9 = v6 % (unsigned __int64)v5;
v10 = *(__int64 ***)&(*a2)[8 * v9];
if ( !v10 || (v11 = *v10) == nullptr )
{
LABEL_10:
v14 = *((_QWORD *)a1 + 2);
v15 = *(float *)(v3 + 1436);
v16 = (_DWORD *)operator new(0x30u);
v17 = *(_DWORD *)(v3 + 1916);
v18 = a2[1];
v19 = v17;
*(_QWORD *)v16 = 0;
v16[2] = v17;
*((_BYTE *)v16 + 40) = 1;
*((_QWORD *)v16 + 2) = v14;
*((float *)v16 + 8) = a3;
*((double *)v16 + 3) = v15;
*((float *)v16 + 9) = 1.0;
v20 = v17 % (unsigned __int64)v18;
v21 = sub_8561D8(a2, v20, v16 + 2);
if ( v21 && *v21 )
operator delete(v16);
else
std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_insert_unique_node(
a2,
v20,
v19,
(char *)v16);
return;
}
v12 = *((_DWORD *)v11 + 2);
v13 = 0;
while ( v6 == v12 )
{
v11 = (__int64 *)*v11;
++v13;
if ( !v11 )
goto LABEL_9;
LABEL_6:
v12 = *((_DWORD *)v11 + 2);
if ( v9 != v12 % (unsigned __int64)v5 )
goto LABEL_9;
}
if ( v13 )
goto LABEL_13;
v11 = (__int64 *)*v11;
if ( v11 )
goto LABEL_6;
LABEL_9:
if ( !v13 )
goto LABEL_10;
LABEL_13:
v22 = sub_8561D8(a2, v6 % (unsigned __int64)v5, (int *)(v3 + 1916));
v23 = a3;
if ( v22 && (v24 = *v22) != 0 )
{
v25 = (char *)(v24 + 16);
}
else
{
v30 = operator new(0x30u);
v31 = *(_DWORD *)(v3 + 1916);
*(_QWORD *)v30 = 0;
*(_DWORD *)(v30 + 8) = v31;
*(_BYTE *)(v30 + 40) = 0;
inserted = std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_insert_unique_node(
a2,
v9,
v8,
(char *)v30);
v3 = *(_QWORD *)a1;
v25 = inserted + 16;
v23 = a3;
}
v26 = *((double *)v25 + 1);
v27 = a1[2];
v28 = *((float *)v25 + 4);
if ( *(double *)v25 + v26 > v27 )
v28 = *((float *)v25 + 5) + (float)(v28 - *((float *)v25 + 5)) * ((v27 - *(double *)v25) / v26);
v29 = *(float *)(v3 + 1436);
*(double *)v25 = v27;
*((float *)v25 + 4) = v23;
*((float *)v25 + 5) = v28;
*((double *)v25 + 1) = v29;
}