//
// FMOD_OS_CriticalSection_Create from 0xc04cc to 0xc0536 (106 bytes)
//
// 1 xrefs:
// > j_FMOD_OS_CriticalSection_Create @ 0xe12b8
//
// 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_OS_CriticalSection_Create(unsigned __int64 **a1, int a2, int a3, pthread_mutexattr_t a4)
{
unsigned __int64 *v5; // r5
pthread_mutexattr_t attr; // [sp+Ch] [bp-Ch] BYREF
attr = a4;
if ( a2 )
{
v5 = (unsigned __int64 *)&unk_1261C8;
}
else
{
v5 = sub_BD410(
*(int *)((char *)&dword_14C + (_DWORD)off_E8000),
4u,
"../android/src/fmod_os_misc.cpp",
0x21Eu,
0,
0);
if ( !v5 )
return 38;
}
if ( pthread_mutexattr_init(&attr)
|| pthread_mutexattr_settype(&attr, 1)
|| pthread_mutex_init((pthread_mutex_t *)v5, &attr)
|| pthread_mutexattr_destroy(&attr) )
{
return 28;
}
*a1 = v5;
return 0;
}