//
// SongSelectNode::getSongFileName from 0x97f1a0 to 0x97f2dc (316 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'SongSelectNode::getSongFileName @ 0x97f2e0
// > ??> @ 0x6ed10
// > ??> @ 0x1471350
//
// 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 12:57:50 +0000
//
unsigned __int64 *__usercall SongSelectNode::getSongFileName@(SongSelectNode *this@, unsigned __int64 *a2@)
{
MusicDownloadManager *v4; // x0
MusicDownloadManager *v5; // x0
const char *v6; // x23
size_t v7; // x0
size_t v8; // x21
void *v9; // x3
unsigned __int64 v11; // x22
__int64 v12[2]; // [xsp+40h] [xbp+40h] BYREF
void *v13; // [xsp+50h] [xbp+50h]
v4 = (MusicDownloadManager *)*((unsigned int *)this + 86);
if ( !(_DWORD)v4 )
{
GJGameLevel::getAudioFileName(a2, *(GJGameLevel **)(*((_QWORD *)this + 53) + 384LL));
return a2;
}
v5 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v4);
v6 = (char *)v12 + 1;
MusicDownloadManager::pathForSong(v12, v5, *((_DWORD *)this + 86));
if ( (v12[0] & 1) != 0 )
v6 = (const char *)v13;
*a2 = 0;
a2[1] = 0;
a2[2] = 0;
v7 = strlen(v6);
v8 = v7;
if ( v7 > 0xFFFFFFFFFFFFFFEFLL )
sub_62D51C();
if ( v7 > 0x16 )
{
v11 = (v7 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v9 = (void *)operator new(v11);
a2[2] = (unsigned __int64)v9;
a2[1] = v8;
*a2 = v11 | 1;
}
else
{
*(_BYTE *)a2 = 2 * v7;
v9 = (char *)a2 + 1;
if ( !v7 )
goto LABEL_7;
}
v9 = memcpy(v9, v6, v8);
LABEL_7:
*((_BYTE *)v9 + v8) = 0;
if ( (v12[0] & 1) != 0 )
operator delete(v13);
return a2;
}