//
// sub_1400672C0 from 0x1400672c0 to 0x1400673b5 (245 bytes)
//
// 3 xrefs:
// > FMODAudioEngine::queueStartMusic @ 0x140063975
// > FMODAudioEngine::activateQueuedMusic @ 0x140064a4d
// > ??> @ 0x140911060
//
// This function is hookable on this platform (idp: pc, 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:25:46 +0000
//
__int64 __fastcall sub_1400672C0(_QWORD *a1, unsigned __int8 *a2)
{
_DWORD *v3; // r8
void **v4; // rcx
_DWORD *v5; // r11
_QWORD *v6; // rbx
_QWORD *v7; // rax
__int64 v8; // rcx
v3 = (_DWORD *)a1[1];
v4 = (void **)(a1[3]
+ 16
* (a1[6]
& (0x100000001B3LL
* (a2[3]
^ (0x100000001B3LL
* (a2[2] ^ (0x100000001B3LL * (a2[1] ^ (0x100000001B3LL * (*a2 ^ 0xCBF29CE484222325uLL))))))))));
v5 = v4[1];
v6 = v5;
if ( v5 != v3 )
{
if ( *(_DWORD *)a2 == v5[4] )
goto LABEL_7;
while ( v6 != *v4 )
{
v6 = (_QWORD *)v6[1];
if ( *(_DWORD *)a2 == *((_DWORD *)v6 + 4) )
goto LABEL_7;
}
}
v6 = nullptr;
LABEL_7:
if ( !v6 )
return 0;
v7 = *v4;
if ( v5 == (_DWORD *)v6 )
{
if ( v7 == v6 )
*v4 = v3;
else
v3 = (_DWORD *)v6[1];
v4[1] = v3;
}
else if ( v7 == v6 )
{
*v4 = (void *)*v6;
}
v8 = *v6;
--a1[2];
*(_QWORD *)v6[1] = v8;
*(_QWORD *)(v8 + 8) = v6[1];
sub_14003D310((__int64)(v6 + 3));
j_j_free(v6);
return 1;
}