//
// GameManager::getMenuMusicFile from 0x100311f04 to 0x100311fb0 (172 bytes)
//
// 2 xrefs:
// > GameManager::playMenuMusic @ 0x1003120dc
// > GameManager::fadeInMenuMusic @ 0x100312324
//
// 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 __usercall GameManager::getMenuMusicFile(__int64 a1@, _QWORD *a2@)
{
MusicDownloadManager *v4; // x0
std::string *p_p; // x1
std::string __p; // [xsp+8h] [xbp-28h] BYREF
if ( *(int *)(a1 + 1048) < 1 )
goto LABEL_11;
v4 = MusicDownloadManager::sharedState();
if ( !MusicDownloadManager::isSongDownloaded(v4, *(_DWORD *)(a1 + 1048)) )
{
*(_DWORD *)(a1 + 1048) = 0;
goto LABEL_11;
}
if ( *(int *)(a1 + 1048) < 1 )
{
LABEL_11:
sub_100009900(a2, "menuLoop.mp3");
return;
}
MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSong(*(unsigned int *)(a1 + 1048), &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
sub_100009900(a2, (char *)p_p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
}