//
// FMODAudioEngine::isPersistentMatchPlaying from 0x1400639d0 to 0x140063b2b (347 bytes)
//
// 4 xrefs:
// > FMODAudioEngine::loadMusic @ 0x140062f51
// > FMODAudioEngine::queueStartMusic @ 0x140063759
// > FMODAudioEngine::updateQueuedMusic @ 0x14006439e
// > ??> @ 0x140910c7c
//
// 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:44 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall FMODAudioEngine::isPersistentMatchPlaying(_QWORD *a1, _QWORD *a2, int a3)
{
char v5; // bl
_QWORD *v6; // rdi
_QWORD *v7; // rax
unsigned __int8 v8; // di
void *v9; // rcx
int v11; // [rsp+30h] [rbp-68h] BYREF
int v12; // [rsp+38h] [rbp-60h] BYREF
_BYTE v13[16]; // [rsp+40h] [rbp-58h] BYREF
_QWORD *v14; // [rsp+50h] [rbp-48h]
void *Block[2]; // [rsp+58h] [rbp-40h] BYREF
__m128i si128; // [rsp+68h] [rbp-30h]
v14 = a2;
v12 = a3;
v5 = 0;
v11 = 0;
if ( !FMODAudioEngine::isMusicPlaying_1(a1, a3) )
goto LABEL_8;
v11 = v12;
v6 = a1 + 40;
if ( sub_140066B50(v6, &v11) )
{
v7 = (_QWORD *)sub_140068620(v6, v13, &v11);
sub_14003F4F0((__int64)Block, *v7 + 40LL);
}
else
{
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
}
v5 = 3;
v11 = 3;
if ( !sub_14003D160(Block, a2) && *(_BYTE *)(*(_QWORD *)sub_140068620(v6, v13, &v12) + 73LL) )
v8 = 1;
else
LABEL_8:
v8 = 0;
if ( (v5 & 1) != 0 && si128.m128i_i64[1] > 0xFuLL )
{
v9 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v9);
}
sub_14003D310((__int64)a2);
return v8;
}