//
// FMODAudioEngine::setMusicTimeMS from 0x10013ae08 to 0x10013aefc (244 bytes)
//
// 7 xrefs:
// > PlayLayer::prepareMusic @ 0x100119484
// > FMODAudioEngine::updateQueuedMusic @ 0x10013946c
// > FMODAudioEngine::loadAudioState @ 0x100139e38
// > FMODAudioEngine::loadAndPlayMusic @ 0x10013d0a0
// > SetupSongTriggerPopup::onPlayback @ 0x1001c35fc
// > GJBaseGameLayer::processSongState @ 0x1002073f8
// > MusicBrowser::sliderEnded @ 0x1003c21f8
//
// 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
//
void __fastcall FMODAudioEngine::setMusicTimeMS(FMODAudioEngine *a1, unsigned int a2, bool a3, int a4)
{
__int64 v7; // x0
FMOD::Channel *v8; // x0
FMOD::Channel *v9; // x22
int v10; // w8
__int64 v11; // x0
int v12; // [xsp+0h] [xbp-40h] BYREF
char v13; // [xsp+7h] [xbp-39h] BYREF
int *v14; // [xsp+8h] [xbp-38h] BYREF
v12 = a4;
v14 = &v12;
v7 = sub_1001418C4(&a1->m_fmodMusic, &v12, &unk_100637FD3, &v14, &v13);
v8 = FMODAudioEngine::channelForChannelID(a1, *(_DWORD *)(v7 + 24));
if ( v8 )
{
v9 = v8;
v14 = &v12;
if ( *(_BYTE *)(sub_1001418C4(&a1->m_fmodMusic, &v12, &unk_100637FD3, &v14, &v13) + 64) )
v10 = 0;
else
v10 = 40;
FMOD::Channel::setPosition(v9, a1->m_musicOffset + a2 + v10, 1u);
if ( !a3 )
{
v14 = &v12;
v11 = sub_1001418C4(&a1->m_fmodMusic, &v12, &unk_100637FD3, &v14, &v13);
FMODAudioEngine::waitUntilSoundReady(a1, *(FMOD::Sound **)(v11 + 32));
}
}
}