//
// sub_4DC260 from 0x4dc260 to 0x4dc2a0 (64 bytes)
//
// 20 xrefs:
// > AccountHelpLayer::onReLogin @ 0x84a2e8
// > AccountLayer::onLogin @ 0x84a3e0
// > AccountHelpLayer::onAccountManagement @ 0x84a51c
// > AccountLayer::onHelp @ 0x84a65c
// > AccountHelpLayer::onUnlink @ 0x84a850
// > AccountLayer::onSync @ 0x84aa5c
// > AccountLayer::onBackup @ 0x84ad24
// > AccountLayer::updatePage @ 0x84b6e4
// > AccountLayer::customSetup @ 0x84be1c
// > AccountLayer::backupAccountFinished @ 0x84c218
// > AccountLayer::backupAccountFinished @ 0x84c244
// > AccountLayer::backupAccountFailed @ 0x84c5ac
// > AccountLayer::backupAccountFailed @ 0x84c5d8
// > AccountLayer::backupAccountFailed @ 0x84c600
// > AccountLayer::syncAccountFinished @ 0x84c7e8
// > AccountLayer::syncAccountFinished @ 0x84c814
// > AccountLayer::syncAccountFailed @ 0x84ca2c
// > AccountHelpLayer::verifyUnlink @ 0x84cd68
// > AccountHelpLayer::updatePage @ 0x84d154
// > AccountHelpLayer::customSetup @ 0x84d5ac
//
// 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_4DC260(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);
}