//
// sub_6865FC from 0x6865fc to 0x686640 (68 bytes)
//
// 84 xrefs:
// > EditorUI::onDeleteInfo @ 0x686d24
// > EditorUI::onGroupIDFilter @ 0x686f08
// > EditorUI::onGroupIDFilter @ 0x686f24
// > EditorUI::showDeleteConfirmation @ 0x688688
// > EditorUI::updateDeleteButtons @ 0x688d98
// > EditorUI::showMaxError @ 0x689714
// > EditorUI::showMaxBasicError @ 0x689880
// > EditorUI::showMaxCoinError @ 0x6899dc
// > EditorUI::updateEditButtonColor @ 0x68a004
// > EditorUI::createMoveMenu @ 0x68bad8
// > EditorUI::editObject @ 0x68d8b4
// > EditorUI::editObject @ 0x68d8c0
// > EditorUI::editObject @ 0x68dd38
// > EditorUI::editObject @ 0x68dd54
// > EditorUI::copyObjectsDetailed @ 0x690398
// > EditorUI::copyObjectsDetailed @ 0x6903c4
// > CreateMenuItem::create @ 0x6945ec
// > CreateMenuItem::create @ 0x694608
// > EditorUI::getCreateBtn @ 0x694e30
// > EditorUI::getCreateBtn @ 0x694e58
// > EditorUI::getCreateBtn @ 0x694e7c
// > GJTransformControl::init @ 0x696944
// > EditorUI::menuItemFromObjectString @ 0x6974fc
// > EditorUI::createCustomItems @ 0x6978ac
// > EditorUI::createCustomItems @ 0x6978d8
// > EditorUI::setupCreateMenu @ 0x6b3b3c
// > EditorUI::setupCreateMenu @ 0x6b3b64
// > EditorUI::addObjectsToSmartTemplate @ 0x6b491c
// > EditorUI::addObjectsToSmartTemplate @ 0x6b494c
// > EditorUI::addObjectsToSmartTemplate @ 0x6b4974
// > EditorUI::addObjectsToSmartTemplate @ 0x6b49f0
// > EditorUI::addObjectsToSmartTemplate @ 0x6b4a2c
// > EditorUI::toggleSpecialEditButtons @ 0x6b4ff4
// > sub_6B6FCC @ 0x6b7200
// > EditorUI::updateObjectInfoLabel @ 0x6bb81c
// > EditorUI::updateObjectInfoLabel @ 0x6bb8b0
// > EditorUI::updateObjectInfoLabel @ 0x6bb8f8
// > EditorUI::updateObjectInfoLabel @ 0x6bbad0
// > EditorUI::updateObjectInfoLabel @ 0x6bbaec
// > EditorUI::updateObjectInfoLabel @ 0x6bbb7c
// > EditorUI::setIDPopupClosed @ 0x6be8b0
// > EditorUI::setIDPopupClosed @ 0x6be8cc
// > EditorUI::pasteObjects @ 0x6bfb88
// > EditorUI::pasteObjects @ 0x6bfc44
// > EditorUI::onCreateObject @ 0x6c0440
// > EditorUI::onCreateObject @ 0x6c0470
// > EditorUI::onCreateObject @ 0x6c049c
// > EditorUI::createPrefab @ 0x6c09e4
// > EditorUI::createPrefab @ 0x6c0a14
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c27b4
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c27d0
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c27ec
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c2814
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c284c
// > EditorUI::createSmartObjectsFromTemplate @ 0x6c2878
// > EditorUI::doPasteObjects @ 0x6c39e4
// > EditorUI::doPasteInPlace @ 0x6c3b10
// > EditorUI::copyObjects @ 0x6c4784
// > EditorUI::copyObjects @ 0x6c47e8
// > EditorUI::onNewCustomItem @ 0x6c4bd0
// > EditorUI::onNewCustomItem @ 0x6c4bfc
// > EditorUI::onNewCustomItem @ 0x6c4c18
// > EditorUI::doCopyObjects @ 0x6c4db0
// > EditorUI::onDuplicate @ 0x6c500c
// > EditorUI::onDuplicate @ 0x6c5028
// > EditorUI::keyDown @ 0x6c5b78
// > EditorUI::keyDown @ 0x6c5d8c
// > EditorUI::keyDown @ 0x6c5d98
// > EditorUI::keyDown @ 0x6c60b0
// > EditorUI::keyDown @ 0x6c61d0
// > EditorUI::keyDown @ 0x6c61fc
// > EditorUI::keyDown @ 0x6c6208
// > EditorUI::keyDown @ 0x6c62cc
// > EditorUI::keyDown @ 0x6c62e8
// > EditorUI::keyDown @ 0x6c6304
// > EditorUI::keyDown @ 0x6c63c0
// > EditorUI::keyDown @ 0x6c6544
// > EditorUI::keyDown @ 0x6c6560
// > EditorUI::keyDown @ 0x6c657c
// > EditorUI::keyDown @ 0x6c6588
// > EditorUI::keyDown @ 0x6c65b0
// > EditorUI::keyDown @ 0x6c65cc
// > EditorUI::keyDown @ 0x6c6618
// > EditorUI::keyDown @ 0x6c6634
//
// 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_6865FC(void *p)
{
unsigned int *v1; // x3
int v2; // w2
int v3; // w2
if ( !&pthread_create )
{
v3 = *((_DWORD *)p + 4);
*((_DWORD *)p + 4) = v3 - 1;
if ( v3 > 0 )
return;
LABEL_7:
operator delete(p);
return;
}
v1 = (unsigned int *)((char *)p + 16);
do
v2 = __ldaxr(v1);
while ( __stlxr(v2 - 1, v1) );
if ( v2 <= 0 )
goto LABEL_7;
}