//
// sub_4D04C from 0x4d04c to 0x4d0ae (98 bytes)
//
// 1 xrefs:
// > sub_46B58 @ 0x46c48
//
// 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_4D04C(int a1, int a2, int a3, int a4)
{
int v6; // r0
int result; // r0
int v8; // [sp+0h] [bp-10h] BYREF
int v9; // [sp+4h] [bp-Ch] BYREF
v8 = a3;
v9 = a4;
if ( *(_DWORD *)(a1 + 300) )
{
if ( FMOD::ChannelI::validate(a2, &v9, 0) )
{
if ( !sub_48F28(a2, &v8, nullptr) )
{
v6 = v8;
if ( *(_DWORD *)(v8 + 380) == 1 )
{
*(_DWORD *)(v8 + 380) = 2;
return v6 + 368;
}
}
}
else
{
result = *(_DWORD *)(a1 + 300) + 44 * *(_DWORD *)(v9 + 324);
if ( *(_DWORD *)(result + 12) == 1 )
{
*(_DWORD *)(result + 12) = 2;
return result;
}
}
}
return 0;
}