//
// GJGameLevel::getAudioFileName from 0x701fdc to 0x7020f0 (276 bytes)
//
// 11 xrefs:
// > PlayLayer::prepareMusic @ 0x5d2a88
// > PlayLayer::setupHasCompleted @ 0x5dc4e8
// > LevelInfoLayer::playStep2 @ 0x6d6508
// > EditLevelLayer::playStep2 @ 0x6deca4
// > EditLevelLayer::onEdit @ 0x6e2b98
// > EditorPauseLayer::playStep2 @ 0x78b2c4
// > LevelPage::playStep2 @ 0x79b378
// > SongSelectNode::getSongFileName @ 0x83bf18
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x88e178
// > GJWorldNode::playStep2 @ 0x95e4a0
// > ??> @ 0x66228
//
// 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 GJGameLevel::getAudioFileName@(__int64 *__return_ptr a1@, GJGameLevel *this@)
{
MusicDownloadManager *v4; // x0
char *v5; // x0
unsigned int *v7; // x2
int v8; // w1
char *v9; // [xsp+40h] [xbp+40h] BYREF
if ( this->m_songID )
{
v4 = MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSong((__int64 *)&v9, v4, this->m_songID);
sub_D153B8((int)a1, 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
{
LevelTools::getAudioFileName((LevelTools *)(unsigned int)this->m_audioTrack, (__int64)a1);
}
return a1;
}