//
// GameManager::getMenuMusicFile from 0x415898 to 0x415946 (174 bytes)
//
// 2 xrefs:
// > GameManager::playMenuMusic @ 0x416858
// > GameManager::fadeInMenuMusic @ 0x416908
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:47:40 +0000
//
int *__fastcall GameManager::getMenuMusicFile(GameManager *this, int a2)
{
int *v2; // r4
char *v3; // r5
MusicDownloadManager *v4; // r0
int v5; // r0
bool v6; // nf
size_t v7; // r0
char v9; // [sp+0h] [bp-14h] BYREF
char v10; // [sp+1h] [bp-13h] BYREF
char *v11; // [sp+8h] [bp-Ch]
v2 = (int *)this;
v3 = (char *)a2;
if ( *(int *)(a2 + 908) > 0 )
{
v4 = (MusicDownloadManager *)MusicDownloadManager::sharedState(this);
this = (GameManager *)MusicDownloadManager::isSongDownloaded(v4, *((_DWORD *)v3 + 227));
if ( !this )
*((_DWORD *)v3 + 227) = 0;
}
if ( *((int *)v3 + 227) <= 0 )
{
*v2 = 0;
v2[1] = 0;
v2[2] = 0;
std::string::__init(v2, "menuLoop.mp3", 0xCu);
}
else
{
v5 = MusicDownloadManager::sharedState(this);
MusicDownloadManager::pathForSong((MusicDownloadManager *)&v9, v5);
v6 = (v9 & 1) != 0;
if ( (v9 & 1) == 0 )
v3 = &v10;
*v2 = 0;
if ( v6 )
v3 = v11;
v2[1] = 0;
v2[2] = 0;
v7 = strlen(v3);
std::string::__init(v2, v3, v7);
std::string::~string((int)&v9);
}
return v2;
}