//
// sub_4DCC20 from 0x4dcc20 to 0x4dcc60 (64 bytes)
//
// 61 xrefs:
// > AnimatedShopKeeper::startAnimating @ 0x92a80c
// > GJShopLayer::onExit @ 0x92ab20
// > GJShopLayer::onExit @ 0x92ab48
// > GJShopLayer::didPurchaseItem @ 0x92b33c
// > GJShopLayer::didPurchaseItem @ 0x92b358
// > GJShopLayer::didPurchaseItem @ 0x92b39c
// > GJShopLayer::onBack @ 0x92b5ec
// > AnimatedShopKeeper::animationFinished @ 0x92bebc
// > AnimatedShopKeeper::animationFinished @ 0x92befc
// > AnimatedShopKeeper::animationFinished @ 0x92bf2c
// > GJShopLayer::dialogClosed @ 0x92c1c8
// > GJShopLayer::showReactMessage @ 0x92d774
// > GJShopLayer::showReactMessage @ 0x92d790
// > GJShopLayer::showReactMessage @ 0x92d7ac
// > GJShopLayer::showReactMessage @ 0x92d7c8
// > GJShopLayer::showReactMessage @ 0x92d7e4
// > GJShopLayer::showReactMessage @ 0x92d80c
// > GJShopLayer::showReactMessage @ 0x92d84c
// > GJShopLayer::showReactMessage @ 0x92d870
// > GJShopLayer::showReactMessage @ 0x92d8d8
// > GJShopLayer::showReactMessage @ 0x92d8f4
// > GJShopLayer::showReactMessage @ 0x92d930
// > GJShopLayer::showReactMessage @ 0x92d94c
// > GJShopLayer::showReactMessage @ 0x92d97c
// > GJShopLayer::showReactMessage @ 0x92d9fc
// > GJShopLayer::showReactMessage @ 0x92da3c
// > GJShopLayer::showReactMessage @ 0x92dab4
// > GJShopLayer::showReactMessage @ 0x92dae0
// > GJShopLayer::showReactMessage @ 0x92db04
// > GJShopLayer::showReactMessage @ 0x92db3c
// > GJShopLayer::showReactMessage @ 0x92db84
// > GJShopLayer::init @ 0x92f334
// > GJShopLayer::init @ 0x92f354
// > GJShopLayer::init @ 0x92f378
// > GJShopLayer::init @ 0x92f398
// > GJShopLayer::init @ 0x92f3c4
// > GJShopLayer::init @ 0x92f3e4
// > GJShopLayer::init @ 0x92f42c
// > GJShopLayer::init @ 0x92f4a0
// > AnimatedShopKeeper::playReactAnimation @ 0x92f8e8
// > AnimatedShopKeeper::playReactAnimation @ 0x92f904
// > AnimatedShopKeeper::playReactAnimation @ 0x92f934
// > GJShopLayer::ccTouchBegan @ 0x92fb84
// > PurchaseItemPopup::init @ 0x930734
// > PurchaseItemPopup::init @ 0x930750
// > PurchaseItemPopup::init @ 0x93076c
// > PurchaseItemPopup::init @ 0x930788
// > PurchaseItemPopup::init @ 0x9307a4
// > PurchaseItemPopup::init @ 0x9307c0
// > PurchaseItemPopup::init @ 0x9307dc
// > PurchaseItemPopup::init @ 0x9307f8
// > PurchaseItemPopup::init @ 0x93082c
// > PurchaseItemPopup::init @ 0x93086c
// > GJShopLayer::showCantAffordMessage @ 0x930f2c
// > GJShopLayer::showCantAffordMessage @ 0x930f48
// > GJShopLayer::showCantAffordMessage @ 0x930f74
// > GJShopLayer::showCantAffordMessage @ 0x930f98
// > GJShopLayer::showCantAffordMessage @ 0x930fbc
// > GJShopLayer::showCantAffordMessage @ 0x930fec
// > GJShopLayer::showCantAffordMessage @ 0x931010
// > GJShopLayer::onSelectItem @ 0x931198
//
// 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_4DCC20(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);
}