//
// SongSelectNode::getSongFileName from 0x83be7c to 0x83bf94 (280 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'SongSelectNode::getSongFileName @ 0x83bf98
// > ??> @ 0x4f458
// > ??> @ 0x118c2b0
//
// 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
//
__int64 *__usercall SongSelectNode::getSongFileName@(SongSelectNode *this@, __int64 *a2@)
{
MusicDownloadManager *v4; // x0
char *v5; // x0
unsigned int *v7; // x2
int v8; // w1
char *v9; // [xsp+40h] [xbp+40h] BYREF
if ( this->m_selectedSongID )
{
v4 = MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSong((__int64 *)&v9, v4, this->m_selectedSongID);
sub_D153B8((int)a2, v9);
v5 = v9 - 24;
if ( v9 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v5);
}
}
else
{
GJGameLevel::getAudioFileName(a2, this->m_settingsObject->m_level);
}
return a2;
}