//
// sub_4DC9E0 from 0x4dc9e0 to 0x4dca20 (64 bytes)
//
// 32 xrefs:
// > SecretLayer::textInputOpened @ 0x901f98
// > SecretLayer::textInputOpened @ 0x901fb4
// > SecretLayer::updateSearchLabel @ 0x902390
// > SecretLayer::updateSearchLabel @ 0x9023c0
// > SecretLayer::updateSearchLabel @ 0x9023e4
// > SecretLayer::updateSearchLabel @ 0x902420
// > SecretLayer::textInputClosed @ 0x90250c
// > SecretLayer::textChanged @ 0x9025f8
// > SecretLayer::getThreadMessage @ 0x903734
// > SecretLayer::onSubmit @ 0x904be4
// > SecretLayer::onSubmit @ 0x9050c8
// > SecretLayer::onSubmit @ 0x905190
// > SecretLayer::onSubmit @ 0x9053c4
// > SecretLayer::onSubmit @ 0x9054f4
// > SecretLayer::onSubmit @ 0x90553c
// > SecretLayer::onSubmit @ 0x905558
// > SecretLayer::onSubmit @ 0x905578
// > SecretLayer::onSubmit @ 0x9055a4
// > SecretLayer::onSubmit @ 0x9055c0
// > SecretLayer::onSubmit @ 0x9055f4
// > SecretLayer::onSubmit @ 0x905620
// > SecretLayer::onSubmit @ 0x905660
// > SecretLayer::onSubmit @ 0x905808
// > SecretLayer::onSubmit @ 0x9058ec
// > SecretLayer::onSubmit @ 0x905934
// > SecretLayer::onSubmit @ 0x9059b4
// > SecretLayer::onSubmit @ 0x905a3c
// > SecretLayer::onSubmit @ 0x905b08
// > SecretLayer::onSubmit @ 0x905b44
// > SecretLayer::onSubmit @ 0x905ba4
// > SecretLayer::init @ 0x906704
// > SecretLayer::init @ 0x90672c
//
// 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_4DC9E0(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);
}