//
// sub_56298 from 0x56298 to 0x56348 (176 bytes)
//
// 1 xrefs:
// > ??> @ 0x56296
//
// 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_56298(int a1, int a2)
{
int *v4; // r0
int v5; // r2
int v6; // r1
int v7; // r3
_DWORD *v8; // r2
_DWORD *v9; // r1
__int64 v10; // kr00_8
int v11; // r0
int v12; // r3
if ( !(**(int (__fastcall ***)(int))a1)(a1) )
{
*(_DWORD *)(a1 + 192) = a2;
v4 = (int *)(a1 + 192);
goto LABEL_5;
}
*(_DWORD *)(a1 + 192) = a2;
v4 = (int *)(a1 + 192);
v5 = *(_DWORD *)(a1 + 248);
if ( !v5 )
{
LABEL_5:
v6 = 0;
v5 = 0;
goto LABEL_6;
}
*(_DWORD *)(v5 + 192) = a2;
v6 = 1;
a2 = *v4;
LABEL_6:
if ( !a2 )
{
v7 = *(_DWORD *)(*(_DWORD *)(a1 + 156) + 68900);
*v4 = v7;
if ( v6 )
*(int *)((char *)&dword_C0 + v5) = v7;
}
j_FMOD_OS_CriticalSection_Enter(*(int *)((char *)&dword_10C + (_DWORD)off_E8000));
v8 = *(_DWORD **)(a1 + 200);
*v8 = *(_DWORD *)(a1 + 196);
*(_DWORD *)(*(_DWORD *)(a1 + 196) + 4) = v8;
*(_DWORD *)(a1 + 200) = a1 + 196;
v9 = *(_DWORD **)(a1 + 192);
*(_DWORD *)(a1 + 200) = v9[6];
*(_DWORD *)(a1 + 196) = v9 + 5;
v9[6] = a1 + 196;
**(_DWORD **)(a1 + 200) = a1 + 196;
*(_DWORD *)(a1 + 204) = a1;
v10 = *(_QWORD *)v9;
*(_DWORD *)HIDWORD(v10) = v10;
*(_DWORD *)(*v9 + 4) = HIDWORD(v10);
*v9 = v9;
v11 = *(_DWORD *)(a1 + 156);
v12 = *(_DWORD *)(v11 + 68904);
*v9 = v12;
v9[1] = v11 + 68904;
*(_DWORD *)(v12 + 4) = v9;
*(_DWORD *)v9[1] = v9;
j_FMOD_OS_CriticalSection_Leave(*(int *)((char *)&dword_10C + (_DWORD)off_E8000));
return 0;
}