//
// FMODAudioEngine::isMusicPlaying from 0x1003d40a0 to 0x1003d417a (218 bytes)
//
// 6 xrefs:
// > CustomSongCell::onDelete @ 0x10023caab
// > GameManager::playMenuMusic @ 0x10036045b
// > GameManager::fadeInMusic @ 0x1003607cc
// > CustomSongWidget::onPlayback @ 0x1006f8b91
// > CustomSongWidget::updatePlaybackBtn @ 0x1006fac05
// > CustomSongWidget::deleteSong @ 0x1006faeef
//
// 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 12:29:40 +0000
//
_BOOL8 __fastcall FMODAudioEngine::isMusicPlaying(__int64 a1, unsigned __int8 *a2, int a3)
{
unsigned int v4; // r13d
char v5; // r12
size_t v6; // rbx
char *p_s1; // rdi
size_t v8; // r13
const void *v9; // r15
size_t v10; // rdx
int v11; // eax
_BOOL4 v12; // r15d
FMOD::ChannelControl *ActiveMusicChannel; // rax
unsigned __int8 v15; // [rsp+8h] [rbp-48h] BYREF
char __s1; // [rsp+9h] [rbp-47h] BYREF
size_t v17; // [rsp+10h] [rbp-40h]
void *__p; // [rsp+18h] [rbp-38h]
int v19; // [rsp+20h] [rbp-30h]
bool v20; // [rsp+27h] [rbp-29h] BYREF
v19 = a3;
FMODAudioEngine::getActiveMusic(&v15, a1);
v4 = *a2;
v5 = v15 & 1;
if ( (v15 & 1) != 0 )
{
v6 = v17;
p_s1 = (char *)__p;
if ( (v4 & 1) == 0 )
{
LABEL_3:
v8 = v4 >> 1;
v9 = a2 + 1;
goto LABEL_6;
}
}
else
{
v6 = v15 >> 1;
p_s1 = &__s1;
if ( (v4 & 1) == 0 )
goto LABEL_3;
}
v8 = *((_QWORD *)a2 + 1);
v9 = *((const void **)a2 + 2);
LABEL_6:
v10 = v6;
if ( v8 < v6 )
v10 = v8;
v11 = memcmp(p_s1, v9, v10);
v12 = 0;
if ( !v11 && v8 == v6 )
{
v20 = 1;
ActiveMusicChannel = (FMOD::ChannelControl *)FMODAudioEngine::getActiveMusicChannel(a1, v19);
if ( ActiveMusicChannel )
{
FMOD::ChannelControl::getPaused(ActiveMusicChannel, &v20);
v12 = v20;
LOBYTE(v12) = !v20;
}
else
{
v12 = 0;
}
v5 = v15 & 1;
}
if ( v5 )
operator delete(__p);
LOBYTE(v12) = v12;
return v12;
}