//
// sub_10057AFCC from 0x10057afcc to 0x10057b160 (404 bytes)
//
// 1 xrefs:
// > sub_1005F8AF4 @ 0x1005f8f94
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:08:26 +0000
//
__int64 __fastcall sub_10057AFCC(int a1, unsigned __int64 *a2)
{
unsigned __int64 v3; // x21
__int64 v5; // x24
__int64 v6; // x20
__int64 v7; // x22
__int64 v9; // x0
_QWORD *v10; // x0
int v11; // w3
int v12; // w4
int v13; // w5
int v14; // w6
int v15; // w7
__int64 v16; // x0
int v17; // [xsp+0h] [xbp-150h]
_BYTE v18[256]; // [xsp+8h] [xbp-148h] BYREF
v3 = atomic_load((unsigned __int64 *)&qword_100A10AE8[a1]);
if ( v3 )
goto LABEL_4;
v5 = a1;
v6 = *((_QWORD *)off_1009DA5E8 + 39);
sub_1005DBDD8(v6);
v3 = atomic_load((unsigned __int64 *)&qword_100A10AE8[v5]);
if ( !v3 )
{
v9 = sub_1005D7660(
*((_QWORD *)off_1009DA5E8 + 54),
376,
"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_async.cpp",
368,
0x200000);
if ( v9 )
{
v3 = v9;
v10 = (_QWORD *)sub_1005FB55C(v9);
v10[42] = v10 + 42;
v10[43] = v10 + 42;
v10[44] = 0;
v10[45] = 0;
*(_DWORD *)(v3 + 368) = a1;
v7 = sub_1005DBC40(v10 + 45, 0);
if ( !(_DWORD)v7 )
{
sub_1005ED57C(
(int)v18,
0x100u,
(int)"FMOD nonblocking thread (%d)",
v11,
v12,
v13,
v14,
v15,
*(_DWORD *)(v3 + 368));
LOBYTE(v17) = 1;
v16 = sub_1005FB59C(v3, v18, sub_10057A848, v3, 4, 1, 0, 0, v17);
if ( !(_DWORD)v16 )
{
*((_QWORD *)off_1009DA5E8 + *(int *)(v3 + 368) + 40) = *(_QWORD *)(v3 + 272);
atomic_store(v3, (unsigned __int64 *)&qword_100A10AE8[v5]);
goto LABEL_3;
}
v7 = v16;
}
}
else
{
v7 = 38;
}
sub_1005DBE08(v6);
return v7;
}
LABEL_3:
sub_1005DBE08(v6);
LABEL_4:
v7 = 0;
*a2 = v3;
return v7;
}