//
// SecretLayer5::playWinSFX from 0xa8ff24 to 0xa90028 (260 bytes)
//
// 3 xrefs:
// > ??> @ 0x54030
// > SecretLayer5::showSuccessAnimation @ 0xa922fc
// > ??> @ 0x122ab30
//
// 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
//
void SecretLayer5::playWinSFX(SecretLayer5 *a1)
{
FMODAudioEngine *v1; // x21
MusicDownloadManager *v2; // x0
void *v3; // x0
unsigned int *v4; // x2
int v5; // w1
__int64 v6; // [xsp+40h] [xbp+40h] BYREF
v1 = FMODAudioEngine::sharedEngine();
v2 = MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSFX(&v6, v2, 0x51F6u);
FMODAudioEngine::playEffect((__int64)v1, (__int64)&v6, 1.0, 0.0, 0.7);
v3 = (void *)(v6 - 24);
if ( (__int64 *)(v6 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v4 = (unsigned int *)(v6 - 8);
do
v5 = __ldaxr(v4);
while ( __stlxr(v5 - 1, v4) );
}
else
{
v5 = *(_DWORD *)(v6 - 8);
*(_DWORD *)(v6 - 8) = v5 - 1;
}
if ( v5 <= 0 )
operator delete(v3);
}
}