//
// FMOD_System_Create from 0x431f0 to 0x4328e (158 bytes)
//
// 1 xrefs:
// > j_FMOD_System_Create @ 0xe1598
//
// 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 FMOD_System_Create(_DWORD *a1, unsigned int a2)
{
int v3; // r0
int v4; // r4
int i; // r5
int result; // r0
if ( a2 >> 8 != 514 )
return 20;
if ( !a1 )
return 31;
v3 = sub_BD580(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), 72016, "../../src/fmod.cpp", 145, 0);
if ( v3 )
{
v4 = v3;
*a1 = sub_57BF0();
for ( i = 75; ; ++i )
{
if ( i == 83 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), v4, "../../src/fmod.cpp", 163, 1);
return 38;
}
if ( !*((_DWORD *)off_E8000 + i) )
break;
}
result = sub_4ECA0();
if ( !result )
{
*((_DWORD *)off_E8000 + i) = v4;
*(_DWORD *)(*((_DWORD *)off_E8000 + i) + 68832) = i - 75;
return 0;
}
}
else
{
*a1 = 0;
return 38;
}
return result;
}