//
// FMODAudioEngine::isPersistentMatchPlaying from 0x1003e7230 to 0x1003e7335 (261 bytes)
//
// 3 xrefs:
// > FMODAudioEngine::updateQueuedMusic @ 0x1003df25e
// > FMODAudioEngine::loadMusic @ 0x1003e12ad
// > FMODAudioEngine::queueStartMusic @ 0x1003e7ccd
//
// 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 FMODAudioEngine::isPersistentMatchPlaying(
FMODAudioEngine *a1,
unsigned __int8 *a2,
int a3,
double a4)
{
FMOD::Channel *ActiveMusicChannel; // rax
unsigned int v7; // r14d
unsigned int v8; // r12d
char v9; // r15
size_t v10; // r13
char *v11; // rdi
size_t v12; // r12
const void *v13; // r14
size_t v14; // rdx
int v15; // eax
int *v17; // [rsp+8h] [rbp-58h] BYREF
int v18; // [rsp+14h] [rbp-4Ch] BYREF
__int64 v19; // [rsp+18h] [rbp-48h] BYREF
size_t v20; // [rsp+20h] [rbp-40h]
void *__p; // [rsp+28h] [rbp-38h]
char v22[41]; // [rsp+37h] [rbp-29h] BYREF
v18 = a3;
LOBYTE(v19) = 1;
ActiveMusicChannel = FMODAudioEngine::getActiveMusicChannel(a1, a3);
if ( !ActiveMusicChannel )
return 0;
FMOD::ChannelControl::getPaused(ActiveMusicChannel, (bool *)&v19);
if ( (v19 & 1) != 0 )
return 0;
FMODAudioEngine::getActiveMusic(&v19, (__int64)a1, a3, a4);
v8 = *a2;
v9 = v19 & 1;
if ( (v19 & 1) == 0 )
{
v10 = (unsigned __int8)v19 >> 1;
v11 = (char *)&v19 + 1;
if ( (v8 & 1) == 0 )
goto LABEL_6;
LABEL_8:
v12 = *((_QWORD *)a2 + 1);
v13 = *((const void **)a2 + 2);
goto LABEL_9;
}
v10 = v20;
v11 = (char *)__p;
if ( (v8 & 1) != 0 )
goto LABEL_8;
LABEL_6:
v12 = v8 >> 1;
v13 = a2 + 1;
LABEL_9:
v14 = v10;
if ( v12 < v10 )
v14 = v12;
v15 = memcmp(v11, v13, v14);
v7 = 0;
if ( !v15 && v12 == v10 )
{
v17 = &v18;
v7 = *(unsigned __int8 *)(sub_1003EF570(&a1->m_fmodMusic, &v18, &unk_10081B0A2, &v17, v22) + 65);
v9 = v19 & 1;
}
if ( v9 )
operator delete(__p);
return v7;
}