//
// FMODAudioEngine::playEffect from 0x5b8bc8 to 0x5b8cc8 (256 bytes)
//
// 33 xrefs:
// > PlayLayer::showCompleteEffect @ 0x5ca840
// > PlayLayer::showNewBest @ 0x5caed4
// > PlayLayer::showNewBest @ 0x5cb038
// > PlayLayer::showNewBest @ 0x5cb3dc
// > MapPackCell::playCompleteEffect @ 0x613698
// > EndLevelLayer::coinEnterFinished @ 0x7d4224
// > EndLevelLayer::playEndEffect @ 0x7d4d30
// > EndLevelLayer::playEndEffect @ 0x7d4d84
// > EndLevelLayer::playEndEffect @ 0x7d4e6c
// > SecretLayer::onSubmit @ 0x90452c
// > ChallengeNode::onClaimReward @ 0x908e98
// > DailyLevelNode::onClaimReward @ 0x9158d8
// > GJShopLayer::didPurchaseItem @ 0x92abc4
// > RewardUnlockLayer::playDropSound @ 0x934c00
// > RewardUnlockLayer::step2 @ 0x937b20
// > RewardUnlockLayer::playRewardEffect @ 0x938ed8
// > RewardUnlockLayer::playRewardEffect @ 0x938f74
// > RewardUnlockLayer::playRewardEffect @ 0x939a88
// > RewardUnlockLayer::playRewardEffect @ 0x939acc
// > RewardUnlockLayer::playRewardEffect @ 0x939b38
// > RewardUnlockLayer::playRewardEffect @ 0x939b7c
// > RewardUnlockLayer::playRewardEffect @ 0x939bec
// > RewardUnlockLayer::playRewardEffect @ 0x939c30
// > RewardUnlockLayer::playRewardEffect @ 0x939cd0
// > RewardUnlockLayer::playRewardEffect @ 0x939d5c
// > RewardUnlockLayer::playRewardEffect @ 0x939e14
// > RewardUnlockLayer::playRewardEffect @ 0x939e58
// > SecretLayer3::onClick @ 0x93e8a8
// > SecretLayer3::onClick @ 0x93e8e8
// > SecretLayer2::onSubmit @ 0x94385c
// > LevelAreaLayer::onEnterTower @ 0xa313a4
// > LevelListLayer::onClaimReward @ 0xa7399c
// > ??> @ 0x620d0
//
// 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 __fastcall FMODAudioEngine::playEffect(__int64 a1, __int64 a2)
{
unsigned int v3; // w20
void *v4; // x0
unsigned int *v6; // x2
int v7; // w1
__int64 v8; // [xsp+40h] [xbp+40h] BYREF
sub_D18D28(&v8, a2);
v3 = FMODAudioEngine::playEffect(a1, (__int64)&v8, 1.0, 0.0, 1.0);
v4 = (void *)(v8 - 24);
if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v8 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v8 - 8);
*(_DWORD *)(v8 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v4);
}
return v3;
}