//
// sub_4DD2E0 from 0x4dd2e0 to 0x4dd320 (64 bytes)
//
// 29 xrefs:
// > SetGroupIDLayer::onGroupIDOptions @ 0x975a9c
// > SetGroupIDLayer::onGroupIDOptions @ 0x975ad0
// > SetGroupIDLayer::createTextInput @ 0x976030
// > SetGroupIDLayer::createTextInput @ 0x976058
// > SetGroupIDLayer::updateEditorLabel @ 0x976d90
// > SetGroupIDLayer::updateEditorLabel2 @ 0x976eb8
// > SetGroupIDLayer::updateZOrderLabel @ 0x976fe4
// > SetGroupIDLayer::updateGroupIDLabel @ 0x97710c
// > SetGroupIDLayer::updateEditorOrderLabel @ 0x97728c
// > SetGroupIDLayer::updateOrderChannelLabel @ 0x977410
// > SetGroupIDLayer::init @ 0x97960c
// > SetGroupIDLayer::init @ 0x979638
// > SetGroupIDLayer::init @ 0x979658
// > SetGroupIDLayer::init @ 0x979688
// > SetGroupIDLayer::init @ 0x9796f8
// > SetGroupIDLayer::init @ 0x979724
// > SetGroupIDLayer::init @ 0x979744
// > SetGroupIDLayer::init @ 0x97977c
// > SetGroupIDLayer::init @ 0x9797d0
// > SetupObjectOptionsPopup::init @ 0x97bf68
// > SetupObjectOptionsPopup::init @ 0x97bfd4
// > SetupObjectOptionsPopup::init @ 0x97c01c
// > SetupObjectOptions2Popup::init @ 0x97c870
// > SetupObjectOptions2Popup::init @ 0x97c898
// > SetupObjectOptions2Popup::init @ 0x97c8b4
// > SetupObjectOptions2Popup::init @ 0x97c8dc
// > SetupObjectOptions2Popup::init @ 0x97c904
// > SetupObjectOptions2Popup::init @ 0x97c92c
// > SetupObjectOptions2Popup::init @ 0x97c95c
//
// 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_4DD2E0(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);
}