//
// sub_4DDA20 from 0x4dda20 to 0x4dda60 (64 bytes)
//
// 28 xrefs:
// > SetupSFXPopup::onClose @ 0xa3dde4
// > SetupSFXPopup::onClose @ 0xa3de00
// > SetupSFXPopup::onClose @ 0xa3de2c
// > SetupAudioTriggerPopup::addTimeControls @ 0xa3e29c
// > SetupAudioTriggerPopup::addTimeControls @ 0xa3e2cc
// > SetupAudioTriggerPopup::addProxVolControls @ 0xa3f1a4
// > SetupAudioTriggerPopup::addProxVolControls @ 0xa3f1d8
// > SetupAudioTriggerPopup::addProxVolControls @ 0xa3f20c
// > SetupReverbPopup::updateReverbLabel @ 0xa3f39c
// > SetupReverbPopup::init @ 0xa3fa4c
// > SetupReverbPopup::init @ 0xa3fa74
// > SetupReverbPopup::init @ 0xa3fa9c
// > SetupReverbPopup::init @ 0xa3fac0
// > SetupReverbPopup::init @ 0xa3fae8
// > SetupSFXPopup::createSFXWidget @ 0xa400fc
// > SetupSFXPopup::createSFXWidget @ 0xa40118
// > SetupSFXPopup::createSFXWidget @ 0xa4014c
// > SetupSFXPopup::init @ 0xa4164c
// > SetupSFXPopup::init @ 0xa41678
// > SetupSFXPopup::init @ 0xa416a0
// > SetupSFXPopup::init @ 0xa416e0
// > SetupSFXPopup::init @ 0xa41724
// > SetupSFXEditPopup::init @ 0xa426c0
// > SetupSFXEditPopup::init @ 0xa426e8
// > SetupSFXEditPopup::init @ 0xa42704
// > SetupSFXEditPopup::init @ 0xa4272c
// > SetupSFXEditPopup::init @ 0xa42814
// > SetupSFXEditPopup::init @ 0xa42878
//
// 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 __fastcall sub_4DDA20(void *p)
{
unsigned int *v1; // x3
int v2; // w2
if ( &pthread_create )
{
v1 = (unsigned int *)((char *)p + 16);
do
v2 = __ldaxr(v1);
while ( __stlxr(v2 - 1, v1) );
}
else
{
v2 = *((_DWORD *)p + 4);
*((_DWORD *)p + 4) = v2 - 1;
}
if ( v2 <= 0 )
operator delete(p);
}