//
// sub_582D4 from 0x582d4 to 0x5833c (104 bytes)
//
// 1 xrefs:
// > FMOD::System::setSoftwareFormat @ 0xb7420
//
// 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_582D4(int a1, int a2, int a3, int a4)
{
int result; // r0
char v6; // r6
bool v7; // zf
if ( *(_BYTE *)(a1 + 4) )
return 27;
v6 = a2;
if ( a2 )
v6 = 1;
result = 31;
if ( a3 <= 8 && ((a2 - 8000 > (unsigned int)&unk_2CEC0) & (unsigned __int8)v6) == 0 )
{
v7 = a3 == 1;
if ( a3 == 1 )
v7 = a4 == 0;
if ( v7 )
{
return 31;
}
else if ( a4 <= 32 )
{
if ( a2 )
*(_DWORD *)(a1 + 1184) = a2;
*(_DWORD *)(a1 + 69188) = a3;
if ( a3 != 1 )
a4 = sub_537B4(a3);
*(_DWORD *)(a1 + 1188) = a4;
return 0;
}
else
{
return 64;
}
}
return result;
}