//
// MusicDownloadManager::pathForSFX from 0x82f150 to 0x82f2a0 (336 bytes)
//
// 20 xrefs:
// > GameManager::playSFXTrigger @ 0x5e90e4
// > MusicDownloadManager::onDownloadSFXCompleted @ 0x82f350
// > MusicDownloadManager::deleteSFX @ 0x82f490
// > MusicDownloadManager::isSFXDownloaded @ 0x82f5c4
// > GJBaseGameLayer::processSFXObjects @ 0x880f90
// > RewardUnlockLayer::playRewardEffect @ 0x939eac
// > CustomSFXWidget::onPlayback @ 0xa3168c
// > CustomSFXWidget::deleteSFX @ 0xa324e0
// > SetupSFXPopup::onClose @ 0xa3dbb0
// > SetupSFXPopup::createSFXWidget @ 0xa3ff08
// > SecretLayer5::playWinSFX @ 0xa8ff5c
// > SecretLayer5::animateHead @ 0xa90858
// > SecretLayer5::showFailAnimation @ 0xa91858
// > SecretLayer5::showFailAnimation @ 0xa918a0
// > SecretLayer5::showSuccessAnimation @ 0xa920b4
// > SecretLayer5::showSuccessAnimation @ 0xa920fc
// > SecretLayer5::showSuccessAnimation @ 0xa92154
// > SecretLayer5::showSuccessAnimation @ 0xa921a4
// > SecretLayer5::onSubmit @ 0xa95548
// > ??> @ 0x75588
//
// 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 MusicDownloadManager::pathForSFX@(
__int64 *__return_ptr a1@,
MusicDownloadManager *this@,
unsigned int a3@)
{
void *v5; // x0
unsigned int *v7; // x1
int v8; // w2
__int64 v9; // [xsp+50h] [xbp+50h] BYREF
MusicDownloadManager::pathForSFXFolder(this, a3, (__int64)a1);
sub_D15FD4(a1, "s", 1);
GameToolbox::intToString(&v9, (GameToolbox *)a3);
sub_D15E14(a1, &v9);
v5 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v5);
}
sub_D15FD4(a1, ".ogg", 4);
return a1;
}