//
// sub_100454E64 from 0x100454e64 to 0x100454ff8 (404 bytes)
//
// 1 xrefs:
// > sub_1004D298C @ 0x1004d2e2c
//
// 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_100454E64(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_100886EB8[a1]);
if ( v3 )
goto LABEL_4;
v5 = a1;
v6 = *((_QWORD *)off_1008524C8 + 39);
sub_1004B5C70(v6);
v3 = atomic_load((unsigned __int64 *)&qword_100886EB8[v5]);
if ( !v3 )
{
v9 = sub_1004B14F8(
*((_QWORD *)off_1008524C8 + 54),
376,
"/opt/teamcity-agent/work/570ad728b1678096/core_api/src/fmod_async.cpp",
368,
0x200000);
if ( v9 )
{
v3 = v9;
v10 = (_QWORD *)sub_1004D53F4(v9);
v10[42] = v10 + 42;
v10[43] = v10 + 42;
v10[44] = 0;
v10[45] = 0;
*(_DWORD *)(v3 + 368) = a1;
v7 = sub_1004B5AD8(v10 + 45, 0);
if ( !(_DWORD)v7 )
{
sub_1004C7414(
(int)v18,
0x100u,
(int)"FMOD nonblocking thread (%d)",
v11,
v12,
v13,
v14,
v15,
*(_DWORD *)(v3 + 368));
LOBYTE(v17) = 1;
v16 = sub_1004D5434(v3, v18, sub_1004546E0, v3, 4, 1, 0, 0, v17);
if ( !(_DWORD)v16 )
{
*((_QWORD *)off_1008524C8 + *(int *)(v3 + 368) + 40) = *(_QWORD *)(v3 + 272);
atomic_store(v3, (unsigned __int64 *)&qword_100886EB8[v5]);
goto LABEL_3;
}
v7 = v16;
}
}
else
{
v7 = 38;
}
sub_1004B5CA0(v6);
return v7;
}
LABEL_3:
sub_1004B5CA0(v6);
LABEL_4:
v7 = 0;
*a2 = v3;
return v7;
}