//
// sub_4DBE90 from 0x4dbe90 to 0x4dbed0 (64 bytes)
//
// 29 xrefs:
// > SongInfoLayer::showCustomMusicUnlockInfo @ 0x7de5cc
// > SongInfoLayer::showCustomMusicUnlockInfo @ 0x7de5e8
// > SongInfoLayer::showCustomMusicUnlockInfo @ 0x7de604
// > formatTags @ 0x7ded04
// > formatTags @ 0x7ded70
// > formatTags @ 0x7dedc8
// > formatTags @ 0x7dee04
// > SongInfoLayer::init @ 0x7dfe78
// > SongInfoLayer::init @ 0x7dfea0
// > SongInfoLayer::create @ 0x7e03ec
// > SongInfoLayer::create @ 0x7e040c
// > SongInfoLayer::create @ 0x7e042c
// > SongInfoLayer::create @ 0x7e044c
// > SongInfoLayer::create @ 0x7e0498
// > SongInfoLayer::create @ 0x7e04b4
// > SongInfoLayer::create @ 0x7e04f0
// > SongInfoLayer::create @ 0x7e0b84
// > SongInfoLayer::create @ 0x7e0bb0
// > SongInfoLayer::create @ 0x7e0bcc
// > SongInfoLayer::create @ 0x7e0be8
// > SongInfoLayer::create @ 0x7e0c04
// > SongInfoLayer::create @ 0x7e0c20
// > SongInfoLayer::create @ 0x7e0c3c
// > SongInfoLayer::create @ 0x7e0c58
// > SongInfoLayer::create @ 0x7e0c74
// > SongInfoLayer::create @ 0x7e0c90
// > SongInfoLayer::create @ 0x7e0cac
// > SongInfoLayer::create @ 0x7e0d40
// > SongInfoLayer::create @ 0x7e0d5c
//
// 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_4DBE90(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);
}