//
// sub_582D4 from 0x582d4 to 0x5833c (104 bytes)
//
// 1 xrefs:
// > FMOD::System::setSoftwareFormat @ 0xb7420
//
// 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:40:47 +0000
//
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;
}