//
// FMODAudioEngine::loadAndPlayMusic from 0x1003d4390 to 0x1003d4437 (167 bytes)
//
// 3 xrefs:
// > SongOptionsLayer::onPlayback @ 0x1001faab8
// > CreateGuidelinesLayer::playMusic @ 0x10050dcf9
// > FindBPMLayer::playMusic @ 0x10050ee3f
//
// 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
//
FMOD::ChannelControl *__fastcall FMODAudioEngine::loadAndPlayMusic(__int64 a1, __int128 *a2, int a3, unsigned int a4)
{
FMOD::ChannelControl *result; // rax
__int128 v7; // [rsp+0h] [rbp-30h] BYREF
void *__p; // [rsp+10h] [rbp-20h]
if ( (*(_BYTE *)a2 & 1) != 0 )
{
sub_10001AD30(&v7, *((const void **)a2 + 2), *((_QWORD *)a2 + 1));
}
else
{
__p = *((void **)a2 + 2);
v7 = *a2;
}
FMODAudioEngine::loadMusic(a1, (unsigned __int8 *)&v7, 0, a4, 0, 0, (__m128)0x3F800000u, 0.0, 1.0);
if ( (v7 & 1) != 0 )
operator delete(__p);
if ( a3 )
FMODAudioEngine::setMusicTimeMS(a1, a3, 0, a4);
result = (FMOD::ChannelControl *)FMODAudioEngine::getActiveMusicChannel(a1, a4);
if ( result )
return (FMOD::ChannelControl *)FMOD::ChannelControl::setPaused(result, 0);
return result;
}