//
// sub_4DBC88 from 0x4dbc88 to 0x4dbcc8 (64 bytes)
//
// 18 xrefs:
// > LevelPage::playStep2 @ 0x79b484
// > LevelPage::playStep3 @ 0x79b5bc
// > LevelPage::onTheTower @ 0x79bc38
// > LevelPage::onTheTower @ 0x79bc60
// > LevelPage::onSecretDoor @ 0x79c628
// > LevelPage::onSecretDoor @ 0x79c654
// > LevelPage::onPlay @ 0x79c984
// > LevelPage::onPlay @ 0x79c9ac
// > LevelPage::onPlay @ 0x79c9d4
// > LevelPage::updateDynamicPage @ 0x7a00a0
// > LevelPage::updateDynamicPage @ 0x7a00bc
// > LevelPage::updateDynamicPage @ 0x7a00d8
// > LevelPage::updateDynamicPage @ 0x7a0104
// > LevelPage::onInfo @ 0x7a0620
// > LevelPage::onInfo @ 0x7a064c
// > LevelPage::onInfo @ 0x7a0674
// > LevelPage::onInfo @ 0x7a06a0
// > LevelPage::onInfo @ 0x7a06bc
//
// 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_4DBC88(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);
}