//
// sub_680B8 from 0x680b8 to 0x68164 (172 bytes)
//
// 2 xrefs:
// > sub_66340 @ 0x66358
// > sub_68164 @ 0x6820c
//
// 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_680B8(__int64 a1)
{
_QWORD *v2; // x8
_QWORD *v3; // x9
_QWORD *v4; // x10
_QWORD *v5; // x11
int v6; // w20
__int64 v7; // x10
if ( *(_QWORD *)(a1 + 264) && !sub_6808C(a1) )
{
FMOD_OS_CriticalSection_Enter(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 264) + 16LL) + 360LL));
v2 = *(_QWORD **)(a1 + 264);
v3 = v2 + 3;
v4 = (_QWORD *)v2[3];
if ( v4 == v2 + 3 )
{
v5 = (_QWORD *)v2[4];
if ( v5 == v3 )
{
v6 = 1;
LABEL_7:
*v5 = v4;
*(_QWORD *)(v2[3] + 8LL) = v5;
v7 = v2[2];
v2[3] = v3;
v2[4] = v3;
FMOD_OS_CriticalSection_Leave(*(_QWORD *)(v7 + 360));
if ( v6 )
{
while ( !sub_6808C(a1) )
FMOD_OS_Time_Sleep(2);
}
else
{
atomic_store(0, (unsigned int *)(a1 + 272));
}
return 0;
}
}
else
{
v5 = (_QWORD *)v2[4];
}
v6 = 0;
goto LABEL_7;
}
return 0;
}