//
// sub_30113C from 0x30113c to 0x3011ae (114 bytes)
//
// 3 xrefs:
// > FMODAudioEngine::setChannelVolume @ 0x302510
// > FMODAudioEngine::setChannelVolumeMod @ 0x302620
// > FMODAudioEngine::updateChannel @ 0x303118
//
// 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
//
int __fastcall sub_30113C(int a1, _DWORD *a2, unsigned int *a3, double *a4)
{
_DWORD *v8; // r0
unsigned int v9; // r6
float v10; // s14
_DWORD *v11; // r4
int v12; // r10
int *v13; // r0
int v14; // r9
_DWORD *inserted; // r0
v8 = (_DWORD *)operator new(0xCu);
v9 = *a3;
v10 = *a4;
v8[1] = v9;
v11 = v8;
*v8 = 0;
*((float *)v8 + 2) = v10;
v12 = v9 % a2[1];
v13 = (int *)sub_2FE19A(a2, v12, v8 + 1);
if ( v13 && (v14 = *v13) != 0 )
{
operator delete(v11);
*(_DWORD *)a1 = v14;
*(_BYTE *)(a1 + 4) = 0;
}
else
{
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(
(int)a2,
v12,
v9,
v11);
*(_BYTE *)(a1 + 4) = 1;
*(_DWORD *)a1 = inserted;
}
return a1;
}