//
// FMOD_Memory_Initialize from 0x43044 to 0x43116 (210 bytes)
//
// 1 xrefs:
// > j_FMOD_Memory_Initialize @ 0xe1548
//
// 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_Memory_Initialize(int a1, int a2, int a3, unsigned int a4, int a5, int a6)
{
int v8; // r1
void *v9; // r5
int result; // r0
bool v12; // zf
bool v13; // zf
_DWORD *v14; // r0
_DWORD *v15; // r0
_DWORD *v16; // r0
v8 = 0;
v9 = off_E8000;
while ( v8 != 8 )
{
if ( *((_DWORD *)off_E8000 + v8++ + 75) )
return 27;
}
if ( a2 << 24 )
return 31;
v12 = a1 == 0;
*(int *)((char *)&dword_20 + (_DWORD)off_E8000) = a6;
if ( a1 )
v12 = a2 == 0;
if ( v12 )
{
v13 = a1 == 0;
result = 31;
if ( !a1 )
v13 = a2 == 0;
if ( v13 )
{
if ( a3 && a5 )
{
v14 = (_DWORD *)(*(int *)((char *)&dword_14C + (_DWORD)v9) + 52);
*v14 = a3;
v14[1] = a4;
v14[2] = a5;
return 0;
}
result = 31;
if ( !a3 && __PAIR64__(a4, 0) == a5 )
{
v16 = *(_DWORD **)((char *)&dword_14C + (_DWORD)v9);
v16[13] = j_j_j_malloc;
v16[14] = j_j_j_realloc;
v16[15] = j_j_j_free;
return 0;
}
}
}
else
{
result = 31;
if ( a2 >= 256 && !a3 && __PAIR64__(a4, 0) == a5 )
{
result = sub_BDA34(*(int *)((char *)&dword_14C + (_DWORD)v9), a1, a2, 4);
if ( !result )
{
v15 = *(_DWORD **)((char *)&dword_14C + (_DWORD)off_E8000);
v15[13] = 0;
v15[14] = 0;
v15[15] = 0;
return 0;
}
}
}
return result;
}