//
// sub_4DC220 from 0x4dc220 to 0x4dc260 (64 bytes)
//
// 21 xrefs:
// > CustomizeObjectLayer::onClear @ 0x83fea8
// > CustomizeObjectLayer::textInputOpened @ 0x840100
// > CustomizeObjectLayer::textInputOpened @ 0x84012c
// > CustomizeObjectLayer::updateKerningLabel @ 0x8403a4
// > CustomizeObjectLayer::updateKerningLabel @ 0x8403c0
// > CustomizeObjectLayer::updateKerningLabel @ 0x8403f0
// > CustomizeObjectLayer::onHSV @ 0x840cc8
// > CustomizeObjectLayer::onHSV @ 0x840cf4
// > CustomizeObjectLayer::onHSV @ 0x840d1c
// > CustomizeObjectLayer::updateCustomColorLabels @ 0x8411ac
// > CustomizeObjectLayer::textChanged @ 0x8415a0
// > CustomizeObjectLayer::textChanged @ 0x8415bc
// > CustomizeObjectLayer::init @ 0x843dec
// > CustomizeObjectLayer::init @ 0x843e0c
// > CustomizeObjectLayer::init @ 0x843e40
// > CustomizeObjectLayer::init @ 0x843e74
// > CustomizeObjectLayer::init @ 0x843e94
// > CustomizeObjectSettingsPopup::init @ 0x844760
// > CustomizeObjectSettingsPopup::init @ 0x844784
// > CustomizeObjectSettingsPopup::init @ 0x8447a8
// > CustomizeObjectSettingsPopup::init @ 0x8447cc
//
// 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_4DC220(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);
}