//
// EditorUI::editObjectSpecial from 0x100018dd0 to 0x10001956a (1946 bytes)
//
// 2 xrefs:
// > EditorUI::editObject2 @ 0x1000093e7
// > sub_100019570 @ 0x10001957a
//
// 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 12:18:55 +0000
//
__int64 __fastcall EditorUI::editObjectSpecial(__int64 *a1, int a2)
{
__int64 result; // rax
__int64 v4; // rdi
_DWORD *v5; // rax
int v6; // r15d
int v7; // r14d
__int64 v8; // rdi
char v9; // r12
__int64 v10; // r12
unsigned int v11; // r13d
_DWORD *v12; // rax
unsigned int v13; // ecx
unsigned int v14; // r13d
__int64 v15; // rax
__int64 v16; // r14
unsigned int v17; // r15d
__int64 v18; // rax
__int64 v19; // r13
unsigned int v20; // r14d
__int64 v21; // rdi
__int64 v22; // rax
__int64 v23; // rbx
__int64 v24; // rax
__int64 v25; // rax
__int64 v26; // rdi
__int64 v27; // rdi
__int64 v28; // rsi
unsigned int v29; // r14d
__int64 v30; // rax
__int64 v31; // rdi
unsigned int v32; // r14d
unsigned int v33; // r14d
__int64 v34; // rax
unsigned int v35; // r14d
__int64 v36; // rax
unsigned int v37; // [rsp+4h] [rbp-2Ch]
if ( !a1[187] )
{
result = sub_1007FEF90(a1[112]);
if ( !(_DWORD)result )
return result;
}
v4 = a1[180];
++*(_DWORD *)(v4 + 14720);
EditorBuildStats::noteAction(v4 + 14704);
v5 = (_DWORD *)a1[187];
if ( v5 )
{
v37 = v5[231];
v6 = v5[257];
v7 = v5[312];
}
else
{
v10 = a1[112];
v7 = -1;
if ( v10 )
{
v37 = -1;
v6 = -1;
if ( (unsigned int)sub_1007FEF90(a1[112]) )
{
v11 = 0;
v37 = -1;
do
{
v12 = (_DWORD *)sub_1007FEFE0(v10, v11);
if ( v6 )
{
v13 = v37;
if ( v6 == -1 )
{
v6 = v12[257];
}
else if ( v12[257] != v6 )
{
v6 = 0;
}
}
else
{
v13 = v37;
}
if ( v7 )
{
if ( v7 == -1 )
{
v7 = v12[312];
}
else if ( v12[312] != v7 )
{
v7 = 0;
}
}
if ( v13 )
{
if ( v13 == -1 )
{
v37 = v12[231];
}
else
{
if ( v12[231] != v13 )
v13 = 0;
v37 = v13;
}
}
++v11;
}
while ( v11 < (unsigned int)sub_1007FEF90(v10) );
}
}
else
{
v37 = -1;
v6 = -1;
}
}
v8 = a1[187];
if ( v8 )
{
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 1736LL))(v8);
result = v37;
if ( v6 != -1 )
goto LABEL_36;
}
else
{
v8 = a1[112];
v9 = 1;
if ( !(unsigned int)sub_1007FEF90(v8) )
goto LABEL_36;
v14 = 0;
while ( 1 )
{
v8 = sub_1007FEFE0(a1[112], v14);
if ( !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v8 + 1736LL))(v8) )
break;
++v14;
v8 = a1[112];
if ( v14 >= (unsigned int)sub_1007FEF90(v8) )
goto LABEL_36;
}
v9 = 0;
result = v37;
if ( v6 != -1 )
goto LABEL_36;
}
if ( v7 == -1 && (_DWORD)result == -1 && !v9 )
return result;
LABEL_36:
if ( v7 == 5 || (v15 = a1[187]) != 0 && *(_DWORD *)(v15 + 1248) == 5 )
{
LABEL_39:
if ( a1[112] )
{
v16 = sub_1007FE900(v8);
if ( (unsigned int)sub_1007FEF90(a1[112]) )
{
v17 = 0;
do
{
v18 = sub_1007FEFE0(a1[112], v17);
if ( *(_DWORD *)(v18 + 1248) == 5 )
sub_1007FEBF0(v16, v18);
++v17;
}
while ( v17 < (unsigned int)sub_1007FEF90(a1[112]) );
}
}
else
{
v16 = 0;
}
v21 = a1[187];
v22 = SetupSmartBlockLayer::create(v21, v16);
goto LABEL_57;
}
v19 = a1[112];
if ( v19 )
{
v8 = a1[112];
if ( (unsigned int)sub_1007FEF90(v8) )
{
v20 = 0;
do
{
v8 = v19;
if ( *(_DWORD *)(sub_1007FEFE0(v19, v20) + 1248) == 5 )
goto LABEL_39;
++v20;
v8 = v19;
}
while ( v20 < (unsigned int)sub_1007FEF90(v19) );
}
}
result = a1[180];
if ( *(_BYTE *)(result + 12238) != 1 )
{
if ( v6 > 2064 )
{
if ( v6 <= 2902 )
goto LABEL_76;
if ( v6 != 3027 )
{
if ( v6 == 2904 )
return result;
if ( v6 != 2903 )
goto LABEL_88;
LABEL_87:
v25 = sub_1006C4700(a1[187], a1[112]);
return sub_100019580(v25);
}
LABEL_82:
v25 = sub_1003441F0(a1[187], a1[112], (unsigned int)v6, *(unsigned __int8 *)(*(_QWORD *)(result + 3272) + 341LL));
return sub_100019580(v25);
}
if ( v6 > 1614 )
{
if ( v6 != 1615 )
{
if ( v6 == 2063 )
{
LABEL_85:
v25 = sub_1005A9080(a1[187], a1[112]);
return sub_100019580(v25);
}
goto LABEL_88;
}
LABEL_86:
v25 = sub_100063280(a1[187], a1[112]);
return sub_100019580(v25);
}
LABEL_73:
if ( v6 != 747 )
{
if ( v6 == 1594 )
{
v25 = sub_10035EFA0(a1[187], a1[112], *(unsigned __int8 *)(*(_QWORD *)(result + 3272) + 341LL));
return sub_100019580(v25);
}
goto LABEL_88;
}
goto LABEL_82;
}
if ( v6 <= 2062 )
{
if ( v6 > 1614 )
{
if ( v6 != 1615 )
{
if ( v6 == 1704 || v6 == 1751 )
{
v21 = a1[187];
v22 = sub_1005B3450(v21, a1[112]);
LABEL_57:
v23 = v22;
v24 = EditorSFXManager::sharedState(v21);
EditorSFXManager::playAction(v24, 109, 107);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v23 + 1312LL))(v23);
}
goto LABEL_88;
}
goto LABEL_86;
}
goto LABEL_73;
}
if ( v6 <= 2902 )
{
if ( v6 == 2063 )
goto LABEL_85;
LABEL_76:
if ( v6 == 2065 )
goto LABEL_113;
if ( v6 != 2902 )
goto LABEL_88;
goto LABEL_82;
}
switch ( v6 )
{
case 2903:
goto LABEL_87;
case 2904:
return result;
case 3027:
goto LABEL_82;
}
LABEL_88:
if ( (unsigned __int8)EditorUI::canAllowMultiActivate(v8, a1[187], a1[112]) )
{
v25 = sub_100297700(a1[187], a1[112], *(unsigned __int8 *)(*(_QWORD *)(a1[180] + 3272) + 341LL));
return sub_100019580(v25);
}
if ( v9 )
{
LABEL_91:
v25 = sub_10066E1F0(a1[187], a1[112]);
return sub_100019580(v25);
}
v26 = a1[187];
if ( a2 != 1 && v37 == 30 )
{
LABEL_94:
v25 = sub_10050F320(v26, a1[112]);
return sub_100019580(v25);
}
if ( v26 && (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v26 + 1728LL))(v26) )
{
v27 = a1[187];
v28 = 0;
LABEL_98:
v25 = sub_100061DB0(v27, v28);
return sub_100019580(v25);
}
result = sub_1007FEF90(a1[112]);
if ( !(_DWORD)result )
return result;
if ( a2 != 1 )
{
if ( !(unsigned int)sub_1007FEF90(a1[112]) )
{
LABEL_105:
v26 = a1[187];
goto LABEL_94;
}
v29 = 0;
while ( 1 )
{
v30 = sub_1007FEFE0(a1[112], v29);
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v30 + 1800LL))(v30) != 30 )
break;
if ( ++v29 >= (unsigned int)sub_1007FEF90(a1[112]) )
goto LABEL_105;
}
}
v31 = a1[187];
if ( v31 && *(_DWORD *)(v31 + 1248) == 5 )
{
v25 = SetupSmartBlockLayer::create(v31, a1[112]);
return sub_100019580(v25);
}
if ( !(unsigned int)sub_1007FEF90(a1[112]) )
{
LABEL_113:
v25 = CreateParticlePopup::create_1(a1[187], a1[112]);
return sub_100019580(v25);
}
v32 = 0;
while ( *(_DWORD *)(sub_1007FEFE0(a1[112], v32) + 1028) == 2065 )
{
if ( ++v32 >= (unsigned int)sub_1007FEF90(a1[112]) )
goto LABEL_113;
}
if ( !(unsigned int)sub_1007FEF90(a1[112]) )
{
LABEL_119:
v27 = a1[187];
v28 = a1[112];
goto LABEL_98;
}
v33 = 0;
while ( 1 )
{
v34 = sub_1007FEFE0(a1[112], v33);
if ( !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v34 + 1728LL))(v34) )
break;
if ( ++v33 >= (unsigned int)sub_1007FEF90(a1[112]) )
goto LABEL_119;
}
if ( !(unsigned int)sub_1007FEF90(a1[112]) )
goto LABEL_91;
v35 = 0;
while ( 1 )
{
v36 = sub_1007FEFE0(a1[112], v35);
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 1736LL))(v36);
if ( !(_BYTE)result )
return result;
if ( ++v35 >= (unsigned int)sub_1007FEF90(a1[112]) )
goto LABEL_91;
}
}