//
// sub_4DBC08 from 0x4dbc08 to 0x4dbc48 (64 bytes)
//
// 15 xrefs:
// > EditorPauseLayer::onResetUnusedColors @ 0x78b120
// > EditorPauseLayer::onSave @ 0x78b26c
// > EditorPauseLayer::playStep2 @ 0x78b3d0
// > EditorPauseLayer::init @ 0x78bb10
// > EditorPauseLayer::init @ 0x78bb38
// > EditorPauseLayer::init @ 0x78bb60
// > EditorPauseLayer::init @ 0x78bb7c
// > EditorPauseLayer::init @ 0x78bba0
// > compareStrings @ 0x78c0f4
// > EditorPauseLayer::customSetup @ 0x78e128
// > EditorPauseLayer::saveLevel @ 0x78e794
// > EditorPauseLayer::saveLevel @ 0x78e7bc
// > EditorPauseLayer::saveLevel @ 0x78e804
// > EditorPauseLayer::saveLevel @ 0x78e828
// > EditorPauseLayer::onExitNoSave @ 0x78eb78
//
// 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_4DBC08(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);
}