//
// sub_4DDB20 from 0x4ddb20 to 0x4ddb60 (64 bytes)
//
// 20 xrefs:
// > SFXBrowser::onCredits @ 0xa5cfd0
// > SFXBrowser::musicActionFailed @ 0xa5d184
// > SFXBrowser::musicActionFailed @ 0xa5d1a0
// > SFXBrowser::updatePageLabel @ 0xa5d394
// > SFXBrowser::setupList @ 0xa5dc40
// > SFXBrowser::setupList @ 0xa5dc5c
// > SFXBrowser::setupList @ 0xa5dc78
// > SFXBrowser::setupList @ 0xa5dc94
// > SFXBrowser::setupList @ 0xa5dcb0
// > SFXBrowser::setupList @ 0xa5dcdc
// > SFXBrowser::setupList @ 0xa5dcf8
// > SFXBrowser::setupList @ 0xa5dd14
// > SearchSFXPopup::init @ 0xa5f648
// > SearchSFXPopup::init @ 0xa5f674
// > SearchSFXPopup::init @ 0xa5f690
// > SearchSFXPopup::init @ 0xa5f6c4
// > SearchSFXPopup::init @ 0xa5f6e0
// > SearchSFXPopup::create @ 0xa5f8d4
// > SFXBrowser::onSearch @ 0xa5fa10
// > SelectSFXSortLayer::init @ 0xa5ffb4
//
// 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_4DDB20(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);
}