//
// EditorUI::copyObjectsDetailed from 0x69016c to 0x6903d0 (612 bytes)
//
// 2 xrefs:
// > EditorUI::addObjectsToSmartTemplate @ 0x6b4470
// > ??> @ 0x91668
//
// 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
//
__int64 __usercall EditorUI::copyObjectsDetailed@(EditorUI *this@, cocos2d::CCArray *a2@, __int64 a3@)
{
cocos2d::ccArray *data; // x1
cocos2d::CCObject **arr; // x20
__int64 v8; // x0
char *v9; // x22
cocos2d::CCObject *i; // x19
const cocos2d::CCPoint *v11; // x0
bool (__fastcall *isEqual)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // x25
__int64 v13; // x0
void *v14; // x0
unsigned int *v16; // x1
int v17; // w2
char v18[8]; // [xsp+80h] [xbp+80h] BYREF
cocos2d::CCPoint v19; // [xsp+88h] [xbp+88h] BYREF
__int64 v20; // [xsp+90h] [xbp+90h] BYREF
qsort(a2->data->arr, a2->data->num, 8u, (int (*)(const void *, const void *))mIDSort);
EditorUI::getGroupCenter(this, a2, 0);
sub_D153B8(a3, &byte_F288A0);
data = a2->data;
if ( data->num )
{
arr = data->arr;
v8 = 8LL * data->num - 8;
v9 = (char *)arr + v8;
if ( arr <= (cocos2d::CCObject **)((char *)arr + v8) )
{
for ( i = *arr; *arr; i = *arr )
{
if ( HIDWORD(i[18].__vftable) != 749 )
{
v11 = (const cocos2d::CCPoint *)((__int64 (__fastcall *)(cocos2d::CCObject *))i->__vftable[2].acceptVisitor)(i);
cocos2d::CCPoint::CCPoint(&v19, v11);
isEqual = i->__vftable[2].isEqual;
v13 = ((__int64 (__fastcall *)(cocos2d::CCObject *))i->__vftable[2].acceptVisitor)(i);
cocos2d::CCPoint::operator-(&v20, v13, v18);
isEqual(i, (const cocos2d::CCObject *)&v20);
((void (__fastcall *)(cocos2d::CCObject *, LevelEditorLayer *))i->__vftable[17].~CCObject_0)(
i,
this->m_editorLayer);
i->__vftable[2].isEqual(i, (const cocos2d::CCObject *)&v19);
sub_D15E14(a3, &v20);
sub_D15FD4(a3, ";", 1);
v14 = (void *)(v20 - 24);
if ( (__int64 *)(v20 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v16 = (unsigned int *)(v20 - 8);
do
v17 = __ldaxr(v16);
while ( __stlxr(v17 - 1, v16) );
}
else
{
v17 = *(_DWORD *)(v20 - 8);
*(_DWORD *)(v20 - 8) = v17 - 1;
}
if ( v17 <= 0 )
operator delete(v14);
}
}
if ( v9 < (char *)++arr )
break;
}
}
}
return a3;
}