//
// sub_10045AB84 from 0x10045ab84 to 0x10045acd8 (340 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008279f0
//
// 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 sub_10045AB84(__int64 a1, bool *a2)
{
_QWORD *v3; // x20
int v4; // w21
int v5; // w22
_QWORD *v6; // x23
int v7; // w24
_QWORD *v8; // x8
int v9; // w9
_QWORD *v10; // x21
int v11; // w8
_QWORD *v12; // x9
unsigned int v13; // w22
int v14; // w23
int v15; // w10
unsigned int v16; // w9
_QWORD *v17; // x11
int v18; // w8
unsigned int v19; // w9
_QWORD *v20; // x10
__int64 result; // x0
v3 = (_QWORD *)a1;
*a2 = 0;
v4 = *(_DWORD *)(a1 + 476);
if ( v4 < 1 )
{
LABEL_9:
v10 = v3 + 50;
v11 = 1;
v12 = v3 + 50;
do
{
v12 = (_QWORD *)*v12;
--v11;
}
while ( v12 != v10 );
if ( !v11 )
return 0;
v13 = 0;
v14 = -v11;
while ( 1 )
{
v15 = 0;
v16 = -1;
v17 = v10;
do
{
v18 = v15;
v17 = (_QWORD *)*v17;
++v16;
++v15;
}
while ( v17 != v10 );
if ( v16 <= v13 )
break;
v19 = v13;
v20 = v10;
do
{
v20 = (_QWORD *)*v20;
if ( !v19 )
v3 = (_QWORD *)v20[2];
--v19;
--v18;
}
while ( v18 );
result = (*(__int64 (__fastcall **)(_QWORD *, bool *))(*v3 + 168LL))(v3, a2);
if ( !(_DWORD)result && !*a2 && v14 != ++v13 )
continue;
return result;
}
}
else
{
v5 = 0;
v6 = (_QWORD *)(a1 + 424);
v7 = 1;
while ( 1 )
{
v8 = (_QWORD *)*v6;
v9 = v7;
if ( (_QWORD *)*v6 == v6 )
break;
while ( --v9 )
{
v8 = (_QWORD *)*v8;
if ( v8 == v6 )
return 31;
}
FMOD::ChannelControl::isPlaying(*(FMOD::ChannelControl **)(v8[2] + 80LL), a2);
if ( *a2 )
return 0;
++v5;
++v7;
if ( v5 == v4 )
goto LABEL_9;
}
}
return 31;
}