//
// sub_4DD9E0 from 0x4dd9e0 to 0x4dda20 (64 bytes)
//
// 15 xrefs:
// > SetupKeyframeAnimPopup::init @ 0xa3aea0
// > SetupKeyframeAnimPopup::init @ 0xa3aec8
// > SetupKeyframeAnimPopup::init @ 0xa3aef4
// > SetupKeyframeAnimPopup::init @ 0xa3af2c
// > SetupKeyframeAnimPopup::init @ 0xa3af58
// > SetupKeyframeAnimPopup::init @ 0xa3af80
// > SetupKeyframePopup::init @ 0xa3c978
// > SetupKeyframePopup::init @ 0xa3c9a4
// > SetupKeyframePopup::init @ 0xa3c9e4
// > SetupKeyframePopup::init @ 0xa3cacc
// > SetupKeyframePopup::init @ 0xa3cae8
// > SetupKeyframePopup::init @ 0xa3cbf4
// > SetupKeyframePopup::init @ 0xa3cc34
// > SetupKeyframePopup::init @ 0xa3cc74
// > SetupKeyframePopup::init @ 0xa3ccb4
//
// 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_4DD9E0(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);
}