//
// sub_CBB14 from 0xcbb14 to 0xcbbd4 (192 bytes)
//
// 4 xrefs:
// > sub_53094 @ 0x53198
// > sub_53E48 @ 0x53e50
// > sub_59D94 @ 0x59e88
// > FMOD::DSP::disconnectAll @ 0xd3184
//
// 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_CBB14(__int64 a1, char a2, char a3)
{
__int64 result; // x0
unsigned int *v7; // x22
__int16 v8; // w8
unsigned int v9; // w10
_BYTE *v10; // x1
__int64 v11; // [xsp+8h] [xbp-28h] BYREF
if ( (a2 & 1) == 0 && (a3 & 1) == 0 )
return 0;
v7 = (unsigned int *)(a1 + 100);
v8 = atomic_load((unsigned int *)(a1 + 100));
if ( (v8 & 0x100) != 0 )
return sub_CB9DC(a1, a2 & 1, a3 & 1, 0, 0);
result = sub_CD294(*(_QWORD *)(a1 + 168), &v11, 24);
if ( !(_DWORD)result )
{
do
v9 = __ldaxr(v7);
while ( __stlxr(v9 | 0x1000, v7) );
*(_BYTE *)v11 = 5;
v10 = (_BYTE *)v11;
*(_QWORD *)(v11 + 8) = a1;
v10[16] = a2 & 1;
v10[17] = a3 & 1;
v10[18] = 0;
return sub_CD2F0(result);
}
return result;
}