//
// sub_4DCCE0 from 0x4dcce0 to 0x4dcd20 (64 bytes)
//
// 69 xrefs:
// > SecretLayer3::onChest01 @ 0x93ad30
// > SecretLayer3::onChest02 @ 0x93aea4
// > SecretLayer2::onSecretLevel @ 0x93b0c8
// > SecretLayer2::onSecretLevel @ 0x93b0e4
// > SecretLayer3::revealStep2 @ 0x93b504
// > SecretLayer3::revealStep2 @ 0x93b530
// > SecretLayer3::firstInteractionStep4 @ 0x93ba44
// > SecretLayer3::firstInteractionStep4 @ 0x93ba6c
// > SecretLayer3::firstInteractionStep2 @ 0x93bfac
// > SecretLayer3::firstInteractionStep2 @ 0x93bfd4
// > SecretLayer3::revealStep5 @ 0x93c618
// > SecretLayer3::revealStep5 @ 0x93c644
// > SecretLayer3::revealStep4 @ 0x93ce64
// > SecretLayer3::revealStep4 @ 0x93ce8c
// > SecretLayer3::revealStep4 @ 0x93cea8
// > SecretLayer3::revealStep4 @ 0x93ceec
// > SecretLayer3::revealStep4 @ 0x93cf1c
// > SecretLayer3::revealStep4 @ 0x93cf38
// > SecretLayer3::revealStep4 @ 0x93cf5c
// > SecretLayer3::revealStep4 @ 0x93cfa4
// > SecretLayer3::revealStep4 @ 0x93cfd4
// > SecretLayer3::revealStep4 @ 0x93d014
// > SecretLayer2::showCompletedLevel @ 0x93dcf0
// > SecretLayer2::showCompletedLevel @ 0x93dd1c
// > SecretLayer3::showUnlockDialog @ 0x93e298
// > SecretLayer3::showUnlockDialog @ 0x93e2cc
// > SecretLayer2::textInputOpened @ 0x93e538
// > SecretLayer2::textInputOpened @ 0x93e554
// > SecretLayer3::onClick @ 0x93f5c4
// > SecretLayer3::onClick @ 0x93f5f8
// > SecretLayer3::onClick @ 0x93f67c
// > SecretLayer2::updateSearchLabel @ 0x93fce0
// > SecretLayer2::updateSearchLabel @ 0x93fd10
// > SecretLayer2::updateSearchLabel @ 0x93fd34
// > SecretLayer2::updateSearchLabel @ 0x93fd70
// > SecretLayer2::textInputClosed @ 0x93fe5c
// > SecretLayer2::textChanged @ 0x93ff48
// > SecretLayer2::getThreadMessage @ 0x94077c
// > SecretLayer2::getBasicMessage @ 0x940bc4
// > SecretLayer2::getErrorMessage @ 0x941168
// > SecretNumberLayer::playNumberEffect @ 0x941990
// > SecretLayer2::init @ 0x943030
// > SecretLayer2::init @ 0x943060
// > SecretLayer2::onSubmit @ 0x943a8c
// > SecretLayer2::onSubmit @ 0x944008
// > SecretLayer2::onSubmit @ 0x944018
// > SecretLayer2::onSubmit @ 0x944268
// > SecretLayer2::onSubmit @ 0x9442c8
// > SecretLayer2::onSubmit @ 0x9443b8
// > SecretLayer2::onSubmit @ 0x9443e8
// > SecretLayer2::onSubmit @ 0x944420
// > SecretLayer2::onSubmit @ 0x94443c
// > SecretLayer2::onSubmit @ 0x944464
// > SecretLayer2::onSubmit @ 0x9444d0
// > SecretLayer2::onSubmit @ 0x944518
// > SecretLayer2::onSubmit @ 0x94456c
// > SecretLayer2::onSubmit @ 0x944620
// > SecretLayer2::onSubmit @ 0x9446d8
// > SecretLayer2::onSubmit @ 0x944720
// > SecretLayer2::onSubmit @ 0x944768
// > SecretLayer2::onSubmit @ 0x9447cc
// > SecretLayer2::onSubmit @ 0x9448b4
// > SecretLayer2::onSubmit @ 0x944984
// > SecretLayer2::onSubmit @ 0x944a44
// > SecretLayer3::init @ 0x9460ac
// > SecretLayer3::init @ 0x9460d8
// > SecretLayer2::onDoor @ 0x94661c
// > SecretLayer2::onDoor @ 0x946648
// > SecretLayer2::onDoor @ 0x946670
//
// 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_4DCCE0(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);
}