//
// sub_1004C5314 from 0x1004c5314 to 0x1004c53ac (152 bytes)
//
// 1 xrefs:
// > sub_1004C51B4 @ 0x1004c52e8
//
// 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
//
__int64 __fastcall sub_1004C5314(_QWORD *a1, __int64 a2, __int64 *a3)
{
pthread_mutex_t *v6; // x22
__int64 v7; // x9
__int64 v8; // x10
_QWORD *v9; // x8
__int64 result; // x0
v6 = (pthread_mutex_t *)a1[45];
sub_1004B5C70(v6);
v7 = *a3;
v8 = a3[1];
*(_DWORD *)(v8 + 192) = *((_DWORD *)a3 + 4);
atomic_store(5u, (unsigned int *)(v8 + 272));
atomic_store(5u, (unsigned int *)(v7 + 272));
v9 = *(_QWORD **)(a2 + 264);
v9[3] = a1 + 42;
v9 += 3;
v9[1] = a1[43];
v9[2] = a2;
a1[43] = v9;
*(_QWORD *)v9[1] = v9;
sub_1004B5CA0(v6);
result = a1[37];
if ( result )
return sub_1004B5DD4(result);
return result;
}