//
// EditorUI::createSmartObjectsFromType from 0x100043d70 to 0x1000441f4 (1156 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::onCreate @ 0x1004e6d7f
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall EditorUI::createSmartObjectsFromType(EditorUI *a1, int a2, cocos2d::CCArray *a3, bool a4, bool a5)
{
EditorUI *v6; // r13
int v7; // r15d
unsigned int v8; // ebx
int v9; // r14d
__int16 v10; // r15
ObjectToolbox *v11; // rdi
cocos2d::CCNode *v12; // rsi
__int64 v13; // rbx
unsigned int v14; // ecx
__int64 v15; // r13
cocos2d::CCNode *v16; // r14
double v17; // xmm0_8
cocos2d::CCNode *v18; // r14
double v19; // xmm0_8
__int64 v20; // rbx
cocos2d::CCNode *v21; // r14
double v22; // xmm0_8
cocos2d::CCNode *v23; // r14
double v24; // xmm0_8
unsigned int v25; // eax
cocos2d::CCArray *v26; // rdi
cocos2d::CCArray *v27; // r12
cocos2d::CCArray *v28; // rax
cocos2d::CCArray *v29; // rdx
cocos2d::CCArray *v30; // rbx
unsigned int v31; // r14d
int v32; // eax
cocos2d::CCArray *v33; // r14
cocos2d::CCArray *RockEdges; // rax
cocos2d::CCArray *RockBases; // rax
cocos2d::CCArray *Outlines; // rax
cocos2d::CCArray *Extras; // rax
EditorUI *v38; // rdi
cocos2d::CCArray *v39; // rsi
unsigned int v40; // ebx
GameObject *v41; // rax
cocos2d::CCArray *v42; // [rsp+8h] [rbp-68h]
EditorUI *v43; // [rsp+10h] [rbp-60h]
char v44[8]; // [rsp+18h] [rbp-58h] BYREF
_BOOL4 v45; // [rsp+20h] [rbp-50h]
_BOOL4 v46; // [rsp+24h] [rbp-4Ch]
cocos2d::CCArray *v47; // [rsp+28h] [rbp-48h]
char v48[8]; // [rsp+30h] [rbp-40h] BYREF
__int64 v49; // [rsp+38h] [rbp-38h]
unsigned int v50; // [rsp+40h] [rbp-30h]
unsigned int v51; // [rsp+44h] [rbp-2Ch]
v45 = a5;
v46 = a4;
v51 = a2;
if ( a3 )
{
v6 = a1;
if ( (unsigned int)sub_100720070(a3) )
{
EditorUI::deselectAll(a1);
v42 = (cocos2d::CCArray *)sub_10071F9E0(a1, *(_QWORD *)&a2);
if ( (unsigned int)sub_100720070(a3) )
{
v7 = 0;
v8 = 0;
do
{
v9 = v7;
v7 = *(__int16 *)(sub_1007200C0(a3, v8) + 1202);
if ( v9 > v7 )
v7 = v9;
++v8;
}
while ( v8 < (unsigned int)sub_100720070(a3) );
v10 = v7 + 1;
}
else
{
v10 = 1;
}
v11 = ObjectToolbox::sharedState();
v12 = (cocos2d::CCNode *)v51;
v13 = (__int64)a3;
v47 = a3;
if ( ObjectToolbox::gridNodeSizeForKey(v11, v51) == 15.0 )
{
v13 = sub_10071F9E0(v11, v51);
v11 = (ObjectToolbox *)a3;
if ( (unsigned int)sub_100720070(a3) )
{
v43 = v6;
v49 = v13;
v14 = 0;
do
{
v50 = v14;
v15 = sub_1007200C0(v47, v14);
v16 = cocos2d::CCNode::create();
sub_10028CC60(v44);
sub_10028CBE0(v48, -7.5, 7.5);
v17 = sub_10028CC90();
(*(void (__fastcall **)(__int64, char *, double))(*(_QWORD *)v15 + 192LL))(v15, v48, v17);
sub_10028CCE0(v48, v44);
((void (__fastcall *)(cocos2d::CCNode *, char *))v16->setPosition)(v16, v48);
sub_10071FCD0(v49, v16);
v18 = cocos2d::CCNode::create();
sub_10028CC60(v44);
sub_10028CBE0(v48, 7.5, 7.5);
v19 = sub_10028CC90();
(*(void (__fastcall **)(__int64, char *, double))(*(_QWORD *)v15 + 192LL))(v15, v48, v19);
sub_10028CCE0(v48, v44);
((void (__fastcall *)(cocos2d::CCNode *, char *))v18->setPosition)(v18, v48);
v20 = v49;
sub_10071FCD0(v49, v18);
v21 = cocos2d::CCNode::create();
sub_10028CC60(v44);
sub_10028CBE0(v48, -7.5, -7.5);
v22 = sub_10028CC90();
(*(void (__fastcall **)(__int64, char *, double))(*(_QWORD *)v15 + 192LL))(v15, v48, v22);
sub_10028CCE0(v48, v44);
((void (__fastcall *)(cocos2d::CCNode *))v21->setPosition)(v21);
sub_10071FCD0(v20, v21);
v23 = cocos2d::CCNode::create();
sub_10028CC60(v44);
sub_10028CBE0(v48, 7.5, -7.5);
v24 = sub_10028CC90();
(*(void (__fastcall **)(__int64, char *, double))(*(_QWORD *)v15 + 192LL))(v15, v48, v24);
sub_10028CCE0(v48, v44);
((void (__fastcall *)(cocos2d::CCNode *, char *))v23->setPosition)(v23, v48);
v12 = v23;
sub_10071FCD0(v49, v23);
++v50;
v11 = (ObjectToolbox *)v47;
v25 = sub_100720070(v47);
v14 = v50;
}
while ( v50 < v25 );
v6 = v43;
v13 = v49;
}
}
v26 = (cocos2d::CCArray *)sub_10071F9E0(v11, v12);
sub_100720050(v26, v13);
v27 = (cocos2d::CCArray *)sub_10071F9E0(v26, v13);
v28 = (cocos2d::CCArray *)sub_10071F9E0(v26, v13);
v29 = (cocos2d::CCArray *)v13;
v30 = v28;
EditorUI::processSmartObjectsFromType(v6, v51, v29, v26, v27, v28);
if ( (unsigned int)sub_100720070(v30) )
{
v31 = 0;
do
*(_WORD *)(sub_1007200C0(v30, v31++) + 1204) = v10;
while ( v31 < (unsigned int)sub_100720070(v30) );
}
sub_100720050(v42, v30);
v32 = sub_100720070(v42);
v33 = v47;
if ( v32 )
{
RockEdges = EditorUI::createRockEdges(v6, v42);
if ( RockEdges )
sub_100720050(v42, RockEdges);
RockBases = EditorUI::createRockBases(v6, v42);
if ( RockBases )
sub_100720050(v42, RockBases);
Outlines = EditorUI::createOutlines(v6, v42);
if ( Outlines )
sub_100720050(v42, Outlines);
if ( v51 - 2703 < 2 && v46 )
{
Extras = EditorUI::createExtras(v6, v42);
if ( Extras )
sub_100720050(v42, Extras);
}
EditorUI::deselectAll(v6);
if ( v45 )
{
v38 = v6;
v39 = v33;
}
else
{
if ( (unsigned int)sub_100720070(v33) )
{
v40 = 0;
do
{
v41 = (GameObject *)sub_1007200C0(v33, v40);
EditorUI::deleteObject(v6, v41, 1);
++v40;
}
while ( v40 < (unsigned int)sub_100720070(v33) );
}
v38 = v6;
v39 = v42;
}
EditorUI::selectObjects(v38, v39, 1);
EditorUI::updateButtons(v6);
EditorUI::updateObjectInfoLabel(v6);
((void (__fastcall *)(EditorUI *))v6->updateScaleControl)(v6);
}
}
}
}