//
// EditorUI::doCopyObjects from 0xbdabd4 to 0xbdad80 (428 bytes)
//
// 4 xrefs:
// > EditorUI::handleEditorAction @ 0xbd7644
// > EditorUI::onCopy @ 0xbdadb4
// > EditorCommandsPopup::onCommand @ 0xcbc11c
// > ??> @ 0xb63e0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:03:43 +0000
//
__int64 __fastcall EditorUI::doCopyObjects(EditorUI *this, unsigned __int8 a2)
{
__int64 v4; // x0
cocos2d::CCArray *v5; // x0
cocos2d::CCArray *v6; // x23
__int64 v7; // x21
unsigned __int8 v8; // w2
_QWORD *v9; // x22
void *v10; // x0
void *v11; // x21
int v12; // w23
__int64 v13; // x2
size_t v14; // x2
GameManager *v15; // x0
__int64 v16; // x1
__int64 v17; // x21
unsigned __int64 v19; // x0
unsigned __int64 v20; // x0
unsigned __int8 v21; // w2
__int64 v22[3]; // [xsp+40h] [xbp+40h] BYREF
v4 = *((_QWORD *)this + 187);
if ( !v4 )
{
if ( !(unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
return _stack_chk_guard;
v4 = *((_QWORD *)this + 187);
if ( !v4 )
goto LABEL_3;
}
if ( *(_DWORD *)(v4 + 1028) != 749 )
{
LABEL_3:
v5 = (cocos2d::CCArray *)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112));
if ( (_DWORD)v5 )
{
v6 = *((cocos2d::CCArray **)this + 112);
}
else
{
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
v5 = (cocos2d::CCArray *)cocos2d::CCArray::addObject(v6, *((cocos2d::CCObject **)this + 187));
}
v7 = GameManager::sharedState(v5);
v8 = a2;
v9 = (_QWORD *)(v7 + 512);
EditorUI::copyObjects(v22, this, v6, v8, 0);
if ( (*(_BYTE *)(v7 + 512) & 1) == 0 )
goto LABEL_11;
**(_BYTE **)(v7 + 528) = 0;
*(_QWORD *)(v7 + 520) = 0;
if ( (*(_BYTE *)(v7 + 512) & 1) != 0 )
{
v10 = (void *)(v7 + 513);
v11 = *(void **)(v7 + 528);
v12 = 1;
}
else
{
v19 = *(_BYTE *)(v7 + 512) >> 1;
if ( v19 <= 0x16 )
goto LABEL_11;
v20 = (v19 + 16) & 0xFFFFFFFFFFFFFFF0LL;
if ( v20 == 23 )
goto LABEL_11;
v10 = (void *)operator new(v20);
v21 = *(_BYTE *)(v7 + 512);
v12 = v21 & 1;
if ( (v21 & 1) == 0 )
{
v11 = (void *)(v7 + 513);
v13 = v21 >> 1;
LABEL_9:
v14 = v13 + 1;
if ( v14 )
{
memcpy(v10, v11, v14);
if ( !v12 )
goto LABEL_11;
}
else if ( !v12 )
{
LABEL_11:
v9[2] = v22[2];
v15 = (GameManager *)v22[0];
v16 = v22[1];
*v9 = v22[0];
v9[1] = v16;
v17 = GameManager::sharedState(v15);
*(_DWORD *)(v17 + 536) = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112));
EditorUI::updateButtons(this);
return _stack_chk_guard;
}
operator delete(v11);
goto LABEL_11;
}
v11 = *(void **)(v7 + 528);
}
v13 = v9[1];
goto LABEL_9;
}
return _stack_chk_guard;
}