//
// sub_1400674B0 from 0x1400674b0 to 0x140067578 (200 bytes)
//
// 14 xrefs:
// > FMODAudioEngine::updateChannel @ 0x1400617c2
// > FMODAudioEngine::loadMusic @ 0x140063120
// > FMODAudioEngine::loadMusic @ 0x14006313d
// > FMODAudioEngine::startMusic @ 0x1400632b6
// > FMODAudioEngine::startMusic @ 0x1400632d0
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034dd5f
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034dd79
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034ee83
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034eef8
// > GJBaseGameLayer::processSongState @ 0x14034fa6f
// > GJBaseGameLayer::processSongState @ 0x14034faf9
// > GJBaseGameLayer::processSongState @ 0x14034fcda
// > GJBaseGameLayer::processSongState @ 0x14034fd61
// > ??> @ 0x140911084
//
// 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_1400674B0(__int64 *a1, int *a2)
{
__int64 *v2; // rbx
__int64 *v4; // r9
__int64 *v5; // r8
int v6; // r11d
int v7; // edx
__int64 **v8; // rax
__int64 *v9; // rax
int v10; // edx
_QWORD v12[3]; // [rsp+20h] [rbp-18h] BYREF
v2 = (__int64 *)*a1;
v4 = (__int64 *)*a1;
v5 = *(__int64 **)(*a1 + 8);
if ( !*((_BYTE *)v5 + 25) )
{
v6 = *a2;
do
{
v7 = *((_DWORD *)v5 + 7);
if ( v7 < v6 || v7 <= v6 && *((_DWORD *)v5 + 8) < a2[1] )
{
v5 += 2;
}
else
{
if ( *((_BYTE *)v4 + 25) && (v6 < v7 || a2[1] < *((_DWORD *)v5 + 8)) )
v4 = v5;
v2 = v5;
}
v5 = (__int64 *)*v5;
}
while ( !*((_BYTE *)v5 + 25) );
}
if ( *((_BYTE *)v4 + 25) )
v8 = (__int64 **)(*a1 + 8);
else
v8 = (__int64 **)v4;
v9 = *v8;
if ( !*((_BYTE *)v9 + 25) )
{
v10 = *a2;
do
{
if ( v10 < *((_DWORD *)v9 + 7) || v10 <= *((_DWORD *)v9 + 7) && a2[1] < *((_DWORD *)v9 + 8) )
{
v4 = v9;
v9 = (__int64 *)*v9;
}
else
{
v9 = (__int64 *)v9[2];
}
}
while ( !*((_BYTE *)v9 + 25) );
}
v12[0] = v2;
v12[1] = v4;
return sub_140069540(a1, v12);
}