//
// EditorUI::selectObjects from 0x1401c7590 to 0x1401c7eca (2362 bytes)
//
// 14 xrefs:
// > EditorUI::createSmartObjectsFromTemplate @ 0x1401b7257
// > EditorUI::createSmartObjectsFromType @ 0x1401b7d0d
// > EditorUI::createNewKeyframeAnim @ 0x1401b9342
// > EditorUI::ccTouchEnded @ 0x1401c15a3
// > EditorUI::ccTouchEnded @ 0x1401c1883
// > EditorUI::selectObject @ 0x1401c751d
// > EditorUI::processSelectObjects @ 0x1401c9602
// > LevelEditorLayer::handleAction @ 0x1403f2681
// > LevelEditorLayer::handleAction @ 0x1403f2817
// > LevelEditorLayer::handleAction @ 0x1403f2e19
// > LevelEditorLayer::breakApartTextObject @ 0x1403fe3a3
// > SetupKeyframePopup::onCustomButton @ 0x1405bbe90
// > SetupKeyframePopup::onCustomButton @ 0x1405bc08c
// > ??> @ 0x14091a7e0
//
// This function is hookable on this platform (idp: pc, 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 11:28:06 +0000
//
// Hidden C++ exception states: #wind=7
void __fastcall EditorUI::selectObjects(__int64 a1, cocos2d::CCArray *a2, char a3)
{
__int64 v6; // rcx
__int64 v7; // rdi
cocos2d::CCString *v8; // rax
int v9; // edi
void *v10; // r8
__int64 v11; // rdi
cocos2d::CCString *v12; // rax
int v13; // r14d
void *v14; // r8
unsigned int v15; // edi
__int64 v16; // rdi
cocos2d::CCString *v17; // rax
int v18; // r14d
void *v19; // rcx
unsigned int v20; // edi
struct cocos2d::CCObject *v21; // rax
__int64 v22; // rdx
__int16 *v23; // rcx
__int64 v24; // rdi
cocos2d::CCString *v25; // rax
int v26; // r14d
void *v27; // rcx
unsigned int v28; // edi
struct cocos2d::CCObject *v29; // rax
int *v30; // rcx
int v31; // edx
int v32; // ecx
int *v33; // rax
int v34; // ecx
int v35; // eax
struct cocos2d::CCObject *v36; // rdx
unsigned int v37; // eax
struct cocos2d::CCObject *v38; // rdx
cocos2d::CCDictionary *v39; // r15
struct cocos2d::CCObject *v40; // r12
unsigned int i; // r14d
int *v42; // rdi
struct cocos2d::CCObject *v43; // rax
int *v44; // rbx
cocos2d::CCArray *v45; // rax
cocos2d::CCArray *v46; // r12
unsigned int j; // r15d
struct cocos2d::CCObject *v48; // rax
cocos2d::CCArray *v49; // rax
cocos2d::CCArray *v50; // r14
unsigned int v51; // ebx
struct cocos2d::CCObject *v52; // rdi
__int16 v53; // [rsp+30h] [rbp-39h] BYREF
char v54; // [rsp+32h] [rbp-37h]
void *v55; // [rsp+40h] [rbp-29h]
void *Block[2]; // [rsp+48h] [rbp-21h] BYREF
__int64 v57; // [rsp+58h] [rbp-11h]
unsigned __int64 v58; // [rsp+60h] [rbp-9h]
void *Src[2]; // [rsp+68h] [rbp-1h] BYREF
__int64 v60; // [rsp+78h] [rbp+Fh]
unsigned __int64 v61; // [rsp+80h] [rbp+17h]
if ( a2 && cocos2d::CCArray::count(a2) )
{
if ( a3 )
goto LABEL_28;
v6 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v55 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v55);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v6 = qword_14090BFD0;
}
if ( !(unsigned __int8)GameManager::getGameVariable(v6, "0064") )
goto LABEL_28;
v7 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v55 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v55);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v7 = qword_14090BFD0;
}
*(_OWORD *)Block = 0;
v57 = 3;
v58 = 15;
LODWORD(Block[0]) = 6256231;
sub_140044D80(Block, "0005", 4u);
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v7 + 432), Block);
v9 = cocos2d::CCString::intValue(v8);
if ( v58 > 0xF )
{
v10 = Block[0];
if ( v58 + 1 >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
v57 = 0;
v58 = 15;
LOBYTE(Block[0]) = 0;
if ( v9 != 3 )
goto LABEL_28;
v11 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v55 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v55);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v11 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v60 = 3;
v61 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0006", 4u);
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v11 + 432), Src);
v13 = cocos2d::CCString::intValue(v12);
if ( v61 > 0xF )
{
v14 = Src[0];
if ( v61 + 1 >= 0x1000 )
{
v14 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v14 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v14);
}
v15 = 0;
while ( v15 < cocos2d::CCArray::count(a2) )
{
if ( *((_DWORD *)cocos2d::CCArray::objectAtIndex(a2, v15) + 259) == v13 )
++v15;
else
cocos2d::CCArray::removeObjectAtIndex(a2, v15, 1);
}
if ( cocos2d::CCArray::count(a2) )
{
LABEL_28:
v16 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v55 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v55);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v16 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v60 = 3;
v61 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0133", 4u);
v17 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v16 + 432), Src);
v18 = cocos2d::CCString::intValue(v17);
if ( v61 > 0xF )
{
v19 = Src[0];
if ( v61 + 1 >= 0x1000 )
{
v19 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v19);
}
v60 = 0;
v61 = 15;
LOBYTE(Src[0]) = 0;
if ( a3 || !v18 )
goto LABEL_45;
v20 = 0;
while ( v20 < cocos2d::CCArray::count(a2) )
{
v21 = cocos2d::CCArray::objectAtIndex(a2, v20);
if ( *((__int16 *)v21 + 588) <= 0 )
{
LABEL_42:
cocos2d::CCArray::removeObjectAtIndex(a2, v20, 1);
}
else
{
v22 = 0;
v23 = *((__int16 **)v21 + 146);
while ( *v23 != v18 )
{
++v22;
++v23;
if ( v22 >= *((__int16 *)v21 + 588) )
goto LABEL_42;
}
++v20;
}
}
if ( cocos2d::CCArray::count(a2) )
{
LABEL_45:
v24 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v55 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v55);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v24 = qword_14090BFD0;
}
*(_OWORD *)Block = 0;
v57 = 3;
v58 = 15;
LODWORD(Block[0]) = 6256231;
sub_140044D80(Block, "0139", 4u);
v25 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v24 + 432), Block);
v26 = cocos2d::CCString::intValue(v25);
if ( v58 > 0xF )
{
v27 = Block[0];
if ( v58 + 1 >= 0x1000 )
{
v27 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v27 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v27);
}
if ( a3 || !v26 )
goto LABEL_70;
v28 = 0;
while ( v28 < cocos2d::CCArray::count(a2) )
{
v29 = cocos2d::CCArray::objectAtIndex(a2, v28);
v30 = *((int **)v29 + 138);
if ( v30 )
{
v31 = v30[1];
v32 = *v30;
if ( v31 == v32 || !v32 )
v32 = v31;
if ( v32 == v26 )
goto LABEL_66;
}
v33 = *((int **)v29 + 139);
if ( !v33 )
goto LABEL_67;
v34 = v33[1];
v35 = *v33;
if ( v34 == v35 || !v35 )
v35 = v34;
if ( v35 == v26 )
LABEL_66:
++v28;
else
LABEL_67:
cocos2d::CCArray::removeObjectAtIndex(a2, v28, 1);
}
if ( cocos2d::CCArray::count(a2) )
{
LABEL_70:
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)a1, 124);
v36 = *(struct cocos2d::CCObject **)(a1 + 1568);
if ( v36 && !cocos2d::CCArray::containsObject(a2, v36) )
{
v37 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944));
v38 = *(struct cocos2d::CCObject **)(a1 + 1568);
if ( v37 )
{
cocos2d::CCArray::addObject(a2, v38);
}
else
{
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 944), v38);
v53 = -256;
v54 = 0;
(*(void (__fastcall **)(_QWORD, __int16 *))(**(_QWORD **)(a1 + 1568) + 1376LL))(
*(_QWORD *)(a1 + 1568),
&v53);
}
*(_BYTE *)(a1 + 824) = 1;
}
*(_QWORD *)(a1 + 1568) = 0;
v39 = nullptr;
v40 = nullptr;
for ( i = 0; i < cocos2d::CCArray::count(a2); ++i )
{
v42 = (int *)cocos2d::CCArray::objectAtIndex(a2, i);
if ( !cocos2d::CCArray::containsObject(*(cocos2d::CCArray **)(a1 + 944), (struct cocos2d::CCObject *)v42) )
{
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 944), (struct cocos2d::CCObject *)v42);
v53 = -256;
v54 = 0;
(*(void (__fastcall **)(int *, __int16 *))(*(_QWORD *)v42 + 1376LL))(v42, &v53);
*(_BYTE *)(a1 + 824) = 1;
if ( *(_BYTE *)(a1 + 915) )
{
if ( !*(_BYTE *)(a1 + 916) && v42[220] > 0 )
{
if ( !v39 )
{
v39 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create();
v40 = (struct cocos2d::CCObject *)cocos2d::CCNode::create();
}
cocos2d::CCDictionary::setObject(v39, v40, v42[220]);
}
}
}
}
if ( cocos2d::CCArray::count(a2) == 1 && cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) == 1 )
{
v43 = cocos2d::CCArray::objectAtIndex(a2, 0);
v44 = (int *)v43;
if ( !*(_BYTE *)(a1 + 915)
|| *(_BYTE *)(a1 + 916)
|| *((int *)v43 + 220) <= 0
|| (v45 = cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(*(_QWORD *)(a1 + 1512) + 4256LL),
*((int *)v43 + 220))) == nullptr
|| cocos2d::CCArray::count(v45) <= 1 )
{
EditorUI::selectObject(a1, v44, 0);
}
}
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) )
{
if ( v39 )
{
*(_BYTE *)(a1 + 1586) = 1;
v46 = cocos2d::CCDictionary::allKeys(v39);
for ( j = 0; j < cocos2d::CCArray::count(v46); ++j )
{
v48 = cocos2d::CCArray::objectAtIndex(v46, j);
v49 = cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(*(_QWORD *)(a1 + 1512) + 4256LL),
*((int *)v48 + 14));
v50 = v49;
if ( v49 )
{
v51 = 0;
if ( cocos2d::CCArray::count(v49) )
{
do
{
v52 = cocos2d::CCArray::objectAtIndex(v50, v51);
if ( !cocos2d::CCArray::containsObject(*(cocos2d::CCArray **)(a1 + 944), v52) )
{
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 944), v52);
v53 = -256;
v54 = 0;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int16 *))(*(_QWORD *)v52 + 1376LL))(
v52,
&v53);
}
++v51;
}
while ( v51 < cocos2d::CCArray::count(v50) );
}
}
}
}
}
EditorUI::checkLiveColorSelect(a1);
}
}
}
}
}