//
// sub_4DBC48 from 0x4dbc48 to 0x4dbc88 (64 bytes)
//
// 44 xrefs:
// > GJGarageLayer::onInfo @ 0x7902e4
// > GJGarageLayer::onInfo @ 0x790300
// > GJGarageLayer::onRewardedVideo @ 0x790910
// > GJGarageLayer::onRewardedVideo @ 0x79092c
// > GJGarageLayer::onRewardedVideo @ 0x790954
// > GJGarageLayer::onRewardedVideo @ 0x790970
// > GJGarageLayer::onRewardedVideo @ 0x79099c
// > GJGarageLayer::onRewardedVideo @ 0x7909c4
// > GJGarageLayer::textInputOpened @ 0x790ccc
// > GJGarageLayer::textInputOpened @ 0x790ce8
// > GJGarageLayer::textInputOpened @ 0x790d18
// > GJGarageLayer::textInputClosed @ 0x791004
// > GJGarageLayer::textInputClosed @ 0x791020
// > GJGarageLayer::textInputClosed @ 0x791050
// > GJGarageLayer::textChanged @ 0x791138
// > GJGarageLayer::titleForUnlock @ 0x791344
// > GJGarageLayer::titleForUnlock @ 0x791360
// > GJGarageLayer::descriptionForUnlock @ 0x791514
// > GJGarageLayer::descriptionForUnlock @ 0x791530
// > GJGarageLayer::achievementForUnlock @ 0x791704
// > GJGarageLayer::achievementForUnlock @ 0x791720
// > SimplePlayer::updatePlayerFrame @ 0x7929d0
// > SimplePlayer::init @ 0x7941b4
// > SimplePlayer::init @ 0x7941d0
// > SimplePlayer::init @ 0x7941ec
// > SimplePlayer::init @ 0x794208
// > GJItemIcon::init @ 0x794860
// > ItemInfoPopup::init @ 0x796058
// > ItemInfoPopup::init @ 0x796074
// > ItemInfoPopup::init @ 0x796090
// > ItemInfoPopup::init @ 0x7960ac
// > ItemInfoPopup::init @ 0x7960c8
// > ItemInfoPopup::init @ 0x7960e8
// > ItemInfoPopup::init @ 0x796110
// > ItemInfoPopup::init @ 0x796134
// > ItemInfoPopup::init @ 0x79615c
// > GJGarageLayer::showUnlockPopup @ 0x796a6c
// > GJGarageLayer::showUnlockPopup @ 0x796a98
// > GJGarageLayer::setupPage @ 0x797c80
// > GJGarageLayer::init @ 0x79a73c
// > GJGarageLayer::init @ 0x79a768
// > GJGarageLayer::init @ 0x79a790
// > GJGarageLayer::init @ 0x79a7b4
// > GJGarageLayer::init @ 0x79a7d8
//
// 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_4DBC48(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);
}