//
// SetupSongTriggerPopup::onPlayback from 0x100258fb0 to 0x100259194 (484 bytes)
//
// 2 xrefs:
// > sub_1002591B0 @ 0x1002591b4
// > ??> @ 0x10090f2b8
//
// This function is hookable on this platform (idp: arm, 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:01:35 +0000
//
__int64 __fastcall SetupSongTriggerPopup::onPlayback(__int64 a1, __int64 a2)
{
__int64 v4; // x0
__int64 isMusicPlaying_1; // x0
_QWORD *v6; // x0
float v7; // s8
float v8; // s9
float v9; // s10
float v10; // s12
float v11; // s11
float v12; // s13
float v13; // s14
__int64 v14; // x20
float v15; // s0
__int64 v16; // x0
__int64 v17; // x0
__int64 v18; // x0
std::string __p; // [xsp+8h] [xbp-88h] BYREF
v4 = FMODAudioEngine::sharedEngine();
isMusicPlaying_1 = FMODAudioEngine::isMusicPlaying_1(v4, 0);
if ( (_DWORD)isMusicPlaying_1 )
{
v6 = (_QWORD *)FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v6, 1);
}
else if ( *(_QWORD *)(GameManager::sharedState(isMusicPlaying_1) + 552) )
{
v7 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 408);
v8 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 410);
v9 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 409);
v10 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 411);
v11 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 413);
v12 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 406);
v13 = (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1464LL))(a1, 404);
v14 = FMODAudioEngine::sharedEngine();
MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSong(*(unsigned int *)(a2 + 316), &__p);
FMODAudioEngine::sharedEngine();
v15 = sub_1001B8188((int)v13);
FMODAudioEngine::loadMusic(v14, (__int128 *)&__p, v11 != 0.0, 0, 0, 0, v15, 0.0, v12);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v16 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::setMusicTimeMS(v16, (int)v7, 0, 0);
v17 = FMODAudioEngine::sharedEngine();
sub_1001BA52C(v17, (int)v7, (int)v8, (int)v9, (int)v10, v11 != 0.0, 0, 0);
}
v18 = MusicDownloadManager::sharedState();
return MusicDownloadManager::songStateChanged(v18);
}