//
// sub_1004D1B5C from 0x1004d1b5c to 0x1004d1c5c (256 bytes)
//
// 2 xrefs:
// > FMOD::System::createSoundGroup @ 0x1004cc168
// > sub_1004D1228 @ 0x1004d1734
//
// 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_1004D1B5C(__int64 a1, char *a2, _QWORD *a3)
{
pthread_mutex_t *v6; // x19
_QWORD *v7; // x0
_QWORD *v8; // x21
__int64 v9; // x9
_BYTE *v10; // x0
if ( !a3 )
return 31;
v6 = *((pthread_mutex_t **)off_1008524C8 + 38);
v7 = sub_1004B14F8(
*((__int64 **)off_1008524C8 + 54),
128,
(char)"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_systemi.cpp",
4469,
0);
if ( !v7 )
return 38;
v8 = v7;
sub_1004C3580((__int64)v7);
sub_1004B5C70(*((pthread_mutex_t **)off_1008524C8 + 38));
v9 = *(_QWORD *)(a1 + 69952);
*v8 = v9;
v8[1] = a1 + 69952;
*(_QWORD *)(v9 + 8) = v8;
*(_QWORD *)v8[1] = v8;
v8[3] = a1;
sub_1004B5CA0(*((pthread_mutex_t **)off_1008524C8 + 38));
if ( !a2 )
{
v8[12] = 0;
goto LABEL_9;
}
v10 = sub_1004C71E4(a2);
v8[12] = v10;
if ( v10 )
{
LABEL_9:
*a3 = v8;
return 0;
}
if ( v6 )
{
sub_1004B5C70(v6);
sub_1004C35BC(v8);
sub_1004B5CA0(v6);
}
else
{
sub_1004C35BC(v8);
}
return 38;
}