//
// FMODAudioEngine::stopChannelTween from 0x1003e3100 to 0x1003e31ee (238 bytes)
//
// 2 xrefs:
// > FMODAudioEngine::stopChannelTweens @ 0x1003e3204
// > FMODAudioEngine::stopChannelTweens @ 0x1003e3220
//
// 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
//
void __fastcall FMODAudioEngine::stopChannelTween(FMODAudioEngine *a1, int a2, AudioTargetType a3, AudioModType a4)
{
__int64 v5; // r9
__int64 v6; // r8
__int64 *v7; // rdi
char **v8; // rdx
char *v9; // rax
char *v10; // rbx
__int64 *v11; // r8
char *v12; // rcx
char *v13; // rax
char *v14; // rcx
bool v15; // zf
v5 = 560;
if ( a3 == MusicChannel )
v5 = 608;
v6 = 584;
if ( a3 != SFXGroup )
v6 = v5;
v7 = *(__int64 **)((char *)&a1->m_uID + v6);
if ( v7 )
{
v8 = (char **)((char *)a1 + v6);
v9 = (char *)&a1->m_uID + v6;
v10 = v9;
v11 = v7;
do
{
if ( *((_DWORD *)v11 + 7) < a2 )
{
++v11;
}
else if ( *((_DWORD *)v11 + 7) <= a2 )
{
if ( *((_DWORD *)v11 + 8) >= a4 )
v10 = (char *)v11;
v11 += *((_DWORD *)v11 + 8) < a4;
}
else
{
v10 = (char *)v11;
}
v11 = (__int64 *)*v11;
}
while ( v11 );
if ( v10 != v9 && *((_DWORD *)v10 + 7) <= a2 && (*((_DWORD *)v10 + 7) < a2 || *((_DWORD *)v10 + 8) <= a4) )
{
v12 = *((char **)v10 + 1);
if ( v12 )
{
do
{
v13 = v12;
v12 = *(char **)v12;
}
while ( v12 );
}
else
{
v14 = v10;
do
{
v13 = *((char **)v14 + 2);
v15 = *(_QWORD *)v13 == (_QWORD)v14;
v14 = v13;
}
while ( !v15 );
}
if ( *v8 == v10 )
*v8 = v13;
--v8[2];
sub_100165F60(v7, (__int64 *)v10);
operator delete(v10);
}
}
}