//
// EditorUI::pasteObjects from 0x1005b6630 to 0x1005b7a6f (5183 bytes)
//
// 7 xrefs:
// > EditorUI::onCreateObject @ 0x100011483
// > EditorUI::createSmartObjectsFromTemplate @ 0x10001426b
// > EditorUI::createPrefab @ 0x100014c61
// > SetupSmartBlockLayer::onPasteTemplate @ 0x1004e1872
// > EditorUI::onDuplicate @ 0x1005b5ee4
// > EditorUI::doPasteObjects @ 0x1005b7fda
// > EditorUI::doPasteInPlace @ 0x1005b8253
//
// 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:32:42 +0000
//
__int64 __fastcall EditorUI::pasteObjects(_QWORD *a1, std::string *a2, int a3, int a4)
{
char v4; // r14
__m128 v5; // xmm0
unsigned int v6; // edx
std::string::pointer data; // r15
signed __int64 size; // rdx
char *v9; // r12
void *v10; // rax
char *v11; // rax
std::string *v12; // r15
std::string *v13; // r12
std::string *v14; // rdi
unsigned int locked; // eax
__int64 ObjectsFromString; // r15
__int64 v18; // rbx
char *v19; // rbx
char **v20; // r14
void *v21; // rdi
__m128 v22; // xmm0
const char *v23; // rdi
char *ColorAction; // rbx
bool v25; // al
int NextColorChannel; // r12d
__int64 v27; // rbx
signed __int64 v28; // r14
__int64 v29; // r13
unsigned __int64 v30; // rax
unsigned __int64 v31; // r15
_QWORD *v32; // r12
void *v33; // r15
char **v34; // rbx
unsigned int *v35; // rax
int **v36; // r13
char *v37; // r12
std::string *v38; // rcx
unsigned __int64 v39; // r9
unsigned __int64 v40; // rdi
__int64 **v41; // rax
__int64 *v42; // r8
unsigned __int64 v43; // rax
unsigned __int64 v44; // rax
int *v45; // r12
int *MainColor; // rax
int *v47; // rbx
int v48; // ecx
unsigned __int64 v49; // r10
unsigned __int64 v50; // rdi
__int64 **v51; // rax
__int64 *v52; // r9
unsigned __int64 v53; // rax
__int64 v54; // rax
int v55; // eax
int *SecondaryColor; // rax
int *v57; // rbx
int v58; // ecx
unsigned __int64 v59; // r10
unsigned __int64 v60; // rdi
__int64 **v61; // rax
__int64 *v62; // r9
unsigned __int64 v63; // rax
__int64 v64; // rax
int v65; // eax
int v66; // eax
std::string *v67; // rcx
unsigned __int64 v68; // r8
unsigned __int64 v69; // r9
unsigned __int64 v70; // rsi
__int64 **v71; // rax
unsigned __int64 v72; // rdi
unsigned __int64 v73; // rcx
unsigned __int64 v74; // r9
__int64 v75; // rsi
__int64 **v76; // rax
std::string *v77; // rcx
unsigned __int64 v78; // r9
unsigned __int64 v79; // rsi
__int64 **v80; // rax
__int64 *v81; // rdi
unsigned __int64 v82; // rax
unsigned __int64 v83; // rdx
__int64 *v84; // r8
unsigned __int64 v85; // rdi
unsigned __int64 v86; // rax
__int64 v87; // rax
__int64 *v88; // r8
unsigned __int64 v89; // rax
unsigned __int64 v90; // rdx
int v91; // ecx
_DWORD *v92; // r12
unsigned __int64 v93; // r10
unsigned __int64 v94; // rdi
__int64 **v95; // rax
__int64 *v96; // r9
unsigned __int64 v97; // r8
unsigned __int64 v98; // rax
__int64 v99; // rax
void **v100; // rbx
void **v101; // r15
void *v102; // rax
void **v103; // rbx
void *v104; // rdi
void **v105; // r14
_QWORD *v106; // rdi
_QWORD *v107; // rbx
std::string *v108; // rdi
char *v109; // rax
__int64 v110; // rax
__int64 v111; // rdi
unsigned int i; // ebx
__int64 v113; // r14
int **v114; // [rsp+8h] [rbp-118h]
char *v115; // [rsp+10h] [rbp-110h]
char *v116; // [rsp+18h] [rbp-108h]
__m128 v117; // [rsp+20h] [rbp-100h] BYREF
void *v118; // [rsp+30h] [rbp-F0h]
std::string v119; // [rsp+40h] [rbp-E0h] BYREF
void *v120[2]; // [rsp+60h] [rbp-C0h] BYREF
__int64 v121; // [rsp+70h] [rbp-B0h]
void *__p[2]; // [rsp+80h] [rbp-A0h] BYREF
__int64 v123; // [rsp+90h] [rbp-90h]
int v124; // [rsp+9Ch] [rbp-84h]
char **v125; // [rsp+A0h] [rbp-80h]
__int64 v126; // [rsp+A8h] [rbp-78h]
std::string *__str[2]; // [rsp+B0h] [rbp-70h] BYREF
void *v128[2]; // [rsp+C0h] [rbp-60h]
int v129; // [rsp+D0h] [rbp-50h]
void *__src; // [rsp+D8h] [rbp-48h]
int *v131; // [rsp+E0h] [rbp-40h] BYREF
_QWORD *v132; // [rsp+E8h] [rbp-38h]
int v133; // [rsp+F0h] [rbp-30h] BYREF
v124 = a4;
v4 = a3;
v132 = a1;
v5 = 0;
memset(&v119, 0, sizeof(v119));
if ( a3 )
{
v6 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v6 & 1) != 0 )
{
size = a2->__r_.__value_.__l.__size_;
data = a2->__r_.__value_.__l.__data_;
if ( size <= 0 )
goto LABEL_22;
}
else
{
data = a2->__r_.__value_.__s.__data_;
size = v6 >> 1;
if ( !size )
goto LABEL_22;
}
v9 = &data[size];
v10 = data;
do
{
v11 = (char *)memchr(v10, 35, size);
if ( !v11 )
break;
if ( *v11 == 35 )
{
if ( v11 != v9 && v11 - data != -1 )
{
v5 = 0;
*(_OWORD *)__str = 0;
v128[0] = nullptr;
sub_1005B82B0(a2, "#", __str);
v12 = __str[0];
if ( 0xAAAAAAAAAAAAAAABLL * (((char *)__str[1] - (char *)__str[0]) >> 3) >= 2 )
{
std::string::operator=(a2, __str[0]);
std::string::operator=(&v119, __str[0] + 1);
v12 = __str[0];
}
if ( v12 )
{
v13 = __str[1];
v14 = v12;
if ( __str[1] != v12 )
{
do
{
if ( (*(_BYTE *)&v13[-1].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v13[-1].__r_.__value_.__l.__data_);
--v13;
}
while ( v13 != v12 );
v14 = __str[0];
}
__str[1] = v12;
operator delete(v14);
}
}
break;
}
v10 = v11 + 1;
size = v9 - (_BYTE *)v10;
}
while ( v9 - (_BYTE *)v10 > 0 );
}
LABEL_22:
locked = LevelEditorLayer::lockedLayerForObjectString(v132[180], (unsigned __int8 *)a2);
if ( locked != -1 )
{
EditorUI::showLockedLayerAlert(v132, locked);
LABEL_24:
ObjectsFromString = 0;
goto LABEL_25;
}
sub_10011C0A0((_QWORD *)v132[180], v5);
ObjectsFromString = LevelEditorLayer::createObjectsFromString(
v132[180],
(unsigned __int8 *)a2,
1,
*(unsigned __int8 *)(*(_QWORD *)(v132[180] + 1936LL) + 1201LL));
sub_10011C180((_QWORD *)v132[180]);
if ( !ObjectsFromString )
goto LABEL_24;
v18 = v132[180];
*(_DWORD *)(v18 + 14708) += sub_1007FEF90(ObjectsFromString);
if ( v4 )
{
if ( (*(_BYTE *)&v119.__r_.__value_.__s.0 & 1) != 0 )
{
if ( !v119.__r_.__value_.__l.__size_ )
goto LABEL_314;
goto LABEL_34;
}
if ( *(_BYTE *)&v119.__r_.__value_.__l.0 >> 1 )
{
LABEL_34:
*(_OWORD *)v128 = 0;
*(_OWORD *)__str = 0;
v129 = 1065353216;
*(_OWORD *)v120 = 0;
v121 = 0;
sub_1005B82B0(&v119, "|", v120);
v19 = (char *)v120[0];
v116 = (char *)v120[1];
if ( v120[0] == v120[1] )
{
__src = nullptr;
if ( !v120[0] )
goto LABEL_308;
LABEL_301:
v102 = v19;
v103 = (void **)v120[1];
v104 = v102;
v105 = (void **)v102;
if ( v120[1] != v102 )
{
do
{
if ( (*(_BYTE *)(v103 - 3) & 1) != 0 )
operator delete(*(v103 - 1));
v103 -= 3;
}
while ( v103 != v105 );
v104 = v120[0];
}
v120[1] = v105;
operator delete(v104);
LABEL_308:
if ( __src )
operator delete(__src);
v106 = v128[0];
if ( v128[0] )
{
do
{
v107 = (_QWORD *)*v106;
operator delete(v106);
v106 = v107;
}
while ( v107 );
}
v108 = __str[0];
__str[0] = nullptr;
if ( v108 )
operator delete(v108);
goto LABEL_314;
}
__src = nullptr;
v20 = nullptr;
v125 = nullptr;
v126 = ObjectsFromString;
while ( 1 )
{
v22 = 0;
*(_OWORD *)__p = 0;
v123 = 0;
sub_1005B82B0(v19, ",", __p);
v115 = v19;
if ( 0xAAAAAAAAAAAAAAABLL * (((char *)__p[1] - (char *)__p[0]) >> 3) < 2 )
goto LABEL_68;
if ( (*(_BYTE *)__p[0] & 1) != 0 )
v23 = *((const char **)__p[0] + 2);
else
v23 = (char *)__p[0] + 1;
v133 = atoi(v23);
ColorAction = GJEffectManager::getColorAction(*(_QWORD *)(*(_QWORD *)(v132[180] + 3272LL) + 320LL), v133);
v25 = ColorAction::isInUse((__int64)ColorAction);
ObjectsFromString = v126;
if ( v25 )
{
NextColorChannel = LevelEditorLayer::getNextColorChannel((_QWORD *)v132[180]);
if ( (unsigned int)(NextColorChannel - 1) > 0x3E6 )
goto LABEL_54;
ColorAction = GJEffectManager::getColorAction(
*(_QWORD *)(*(_QWORD *)(v132[180] + 3272LL) + 320LL),
NextColorChannel);
v131 = &v133;
*((_DWORD *)sub_10001C2C0((float *)__str, &v133, (__m128)0LL, (__int64)&unk_100A0D509, &v131) + 5) = NextColorChannel;
}
if ( ColorAction )
{
if ( (*((_BYTE *)__p[0] + 24) & 1) != 0 )
{
sub_10001AD30(&v117, *((const void **)__p[0] + 5), *((_QWORD *)__p[0] + 4));
}
else
{
v118 = *((void **)__p[0] + 5);
v22 = *(__m128 *)((char *)__p[0] + 24);
v117 = v22;
}
ColorAction::setupFromString((__int64)ColorAction, (__int64)&v117);
ObjectsFromString = v126;
if ( (v117.i8[0] & 1) != 0 )
operator delete(v118);
if ( v20 >= v125 )
{
v28 = (char *)v20 - (_BYTE *)__src;
v29 = v28 >> 3;
v30 = (v28 >> 3) + 1;
if ( v30 > 0x1FFFFFFFFFFFFFFFLL )
sub_1002DAEA0();
v31 = ((char *)v125 - (_BYTE *)__src) >> 2;
if ( v31 <= v30 )
v31 = (v28 >> 3) + 1;
if ( (unsigned __int64)((char *)v125 - (_BYTE *)__src) >= 0x7FFFFFFFFFFFFFF8LL )
v31 = 0x1FFFFFFFFFFFFFFFLL;
if ( v31 )
{
if ( v31 > 0x1FFFFFFFFFFFFFFFLL )
sub_10001ADB0();
v32 = operator new(8 * v31);
}
else
{
v32 = nullptr;
}
v125 = (char **)&v32[v31];
v32[v29] = ColorAction;
v27 = (__int64)&v32[v29 + 1];
v33 = __src;
memcpy(v32, __src, v28);
if ( v33 )
operator delete(v33);
__src = v32;
ObjectsFromString = v126;
goto LABEL_67;
}
*v20++ = ColorAction;
}
LABEL_54:
v27 = (__int64)v20;
LABEL_67:
v20 = (char **)v27;
LABEL_68:
if ( v128[1] )
{
v34 = (char **)__src;
if ( __src != v20 )
{
while ( 1 )
{
v37 = *v34;
v38 = (std::string *)*((unsigned int *)*v34 + 30);
v133 = (int)v38;
if ( (unsigned int)((_DWORD)v38 - 1) <= 0x3E6 )
{
if ( __str[1] )
{
v39 = (0x101010101010101LL
* (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)
+ (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v39 > 1 )
{
v40 = (unsigned __int64)v38;
if ( __str[1] <= v38 )
v40 = (unsigned __int16)((unsigned __int16)v38 % LOWORD(__str[1]));
}
else
{
v40 = (LODWORD(__str[1]) + 1023) & (unsigned int)v38;
}
v41 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v40];
if ( v41 )
{
v42 = *v41;
if ( *v41 )
break;
}
}
}
LABEL_72:
if ( ++v34 == v20 )
goto LABEL_70;
}
if ( (unsigned int)v39 < 2 )
{
while ( 1 )
{
v44 = v42[1];
if ( (std::string *)v44 == v38 )
{
if ( *((_DWORD *)v42 + 4) == (_DWORD)v38 )
goto LABEL_98;
}
else if ( (((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7) & v44) != v40 )
{
goto LABEL_72;
}
v42 = (__int64 *)*v42;
if ( !v42 )
goto LABEL_72;
}
}
while ( 2 )
{
v43 = v42[1];
if ( (std::string *)v43 == v38 )
{
if ( *((_DWORD *)v42 + 4) == (_DWORD)v38 )
{
LABEL_98:
v131 = &v133;
*((_DWORD *)v37 + 30) = *((_DWORD *)sub_10001C2C0(
(float *)__str,
&v133,
v22,
(__int64)&unk_100A0D509,
&v131)
+ 5);
goto LABEL_72;
}
}
else if ( (std::string *)v43 < __str[1] )
{
LABEL_89:
if ( v43 != v40 )
goto LABEL_72;
}
else
{
if ( ((unsigned __int64)__str[1] | v43) >> 32 )
{
v43 %= (unsigned __int64)__str[1];
goto LABEL_89;
}
if ( (unsigned int)v43 % LODWORD(__str[1]) != v40 )
goto LABEL_72;
}
v42 = (__int64 *)*v42;
if ( !v42 )
goto LABEL_72;
continue;
}
}
LABEL_70:
v35 = *(unsigned int **)(ObjectsFromString + 56);
if ( *v35 )
{
v36 = *((int ***)v35 + 2);
v114 = &v36[*v35 - 1];
do
{
v45 = *v36;
if ( !*v36 )
break;
MainColor = (int *)GameObject::getMainColor(*v36);
v47 = MainColor;
if ( MainColor )
{
v48 = *MainColor;
if ( !*MainColor )
v48 = MainColor[1];
v133 = v48;
if ( __str[1] )
{
v49 = (0x101010101010101LL
* (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)
+ (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v49 <= 1 )
{
v50 = v48 & ((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7);
v51 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v50];
if ( !v51 )
goto LABEL_137;
goto LABEL_113;
}
v50 = v48;
if ( __str[1] > (std::string *)v48 )
{
LABEL_112:
v51 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v50];
if ( !v51 )
goto LABEL_137;
}
else
{
if ( ((unsigned __int64)__str[1] | v48) >> 32 )
{
v50 = v48 % (unsigned __int64)__str[1];
goto LABEL_112;
}
v50 = (unsigned int)v48 % LODWORD(__str[1]);
v51 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v50];
if ( !v51 )
goto LABEL_137;
}
LABEL_113:
v52 = *v51;
if ( !*v51 )
goto LABEL_137;
if ( (unsigned int)v49 < 2 )
{
while ( 1 )
{
v54 = v52[1];
if ( v54 == v48 )
{
if ( *((_DWORD *)v52 + 4) == v48 )
goto LABEL_131;
}
else if ( (((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7) & v54) != v50 )
{
goto LABEL_137;
}
v52 = (__int64 *)*v52;
if ( !v52 )
goto LABEL_137;
}
}
while ( 2 )
{
v53 = v52[1];
if ( v53 == v48 )
{
if ( *((_DWORD *)v52 + 4) == v48 )
{
LABEL_131:
v131 = &v133;
v55 = *((_DWORD *)sub_10001C2C0((float *)__str, &v133, v22, (__int64)&unk_100A0D509, &v131) + 5);
if ( v55 <= 0 )
v55 = 0;
if ( v55 >= 1101 )
v55 = 1101;
*v47 = v55;
break;
}
}
else if ( (std::string *)v53 < __str[1] )
{
LABEL_122:
if ( v53 != v50 )
break;
}
else
{
if ( ((unsigned __int64)__str[1] | v53) >> 32 )
{
v53 %= (unsigned __int64)__str[1];
goto LABEL_122;
}
if ( (unsigned int)v53 % LODWORD(__str[1]) != v50 )
break;
}
v52 = (__int64 *)*v52;
if ( !v52 )
break;
continue;
}
}
}
LABEL_137:
SecondaryColor = (int *)GameObject::getSecondaryColor(v45);
v57 = SecondaryColor;
if ( SecondaryColor )
{
v58 = *SecondaryColor;
if ( !*SecondaryColor )
v58 = SecondaryColor[1];
v133 = v58;
if ( __str[1] )
{
v59 = (0x101010101010101LL
* (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)
+ (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v59 > 1 )
{
v60 = v58;
if ( __str[1] <= (std::string *)v58 )
{
if ( !(((unsigned __int64)__str[1] | v58) >> 32) )
{
v60 = (unsigned int)v58 % LODWORD(__str[1]);
v61 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v60];
if ( !v61 )
goto LABEL_172;
goto LABEL_148;
}
v60 = v58 % (unsigned __int64)__str[1];
}
v61 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v60];
if ( !v61 )
goto LABEL_172;
goto LABEL_148;
}
v60 = v58 & ((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7);
v61 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v60];
if ( !v61 )
goto LABEL_172;
LABEL_148:
v62 = *v61;
if ( !*v61 )
goto LABEL_172;
if ( (unsigned int)v59 < 2 )
{
while ( 1 )
{
v64 = v62[1];
if ( v64 == v58 )
{
if ( *((_DWORD *)v62 + 4) == v58 )
goto LABEL_166;
}
else if ( (((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7) & v64) != v60 )
{
goto LABEL_172;
}
v62 = (__int64 *)*v62;
if ( !v62 )
goto LABEL_172;
}
}
while ( 2 )
{
v63 = v62[1];
if ( v63 == v58 )
{
if ( *((_DWORD *)v62 + 4) == v58 )
{
LABEL_166:
v131 = &v133;
v65 = *((_DWORD *)sub_10001C2C0((float *)__str, &v133, v22, (__int64)&unk_100A0D509, &v131) + 5);
if ( v65 <= 0 )
v65 = 0;
if ( v65 >= 1101 )
v65 = 1101;
*v57 = v65;
break;
}
}
else if ( (std::string *)v63 < __str[1] )
{
LABEL_157:
if ( v63 != v60 )
break;
}
else
{
if ( ((unsigned __int64)__str[1] | v63) >> 32 )
{
v63 %= (unsigned __int64)__str[1];
goto LABEL_157;
}
if ( (unsigned int)v63 % LODWORD(__str[1]) != v60 )
break;
}
v62 = (__int64 *)*v62;
if ( !v62 )
break;
continue;
}
}
}
LABEL_172:
v66 = v45[257];
if ( v66 == 1006 )
{
v72 = (unsigned __int64)__str[1];
if ( v45[402] )
goto LABEL_179;
v77 = (std::string *)v45[256];
v133 = v45[256];
if ( !__str[1] )
{
v72 = 0;
goto LABEL_179;
}
v78 = (0x101010101010101LL
* (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)
+ (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v78 <= 1 )
{
v79 = (unsigned __int64)v77 & ((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7);
v80 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v79];
if ( !v80 )
goto LABEL_179;
LABEL_236:
v88 = *v80;
if ( !*v80 )
goto LABEL_179;
if ( (unsigned int)v78 < 2 )
{
while ( 1 )
{
v90 = v88[1];
if ( (std::string *)v90 == v77 )
{
if ( *((_DWORD *)v88 + 4) == (_DWORD)v77 )
goto LABEL_289;
}
else if ( (((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7) & v90) != v79 )
{
goto LABEL_179;
}
v88 = (__int64 *)*v88;
if ( !v88 )
goto LABEL_179;
}
}
while ( 2 )
{
v89 = v88[1];
if ( (std::string *)v89 == v77 )
{
if ( *((_DWORD *)v88 + 4) == (_DWORD)v77 )
{
LABEL_289:
v131 = &v133;
v45[256] = *((_DWORD *)sub_10001C2C0((float *)__str, &v133, v22, (__int64)&unk_100A0D509, &v131)
+ 5);
v72 = (unsigned __int64)__str[1];
goto LABEL_179;
}
}
else if ( (std::string *)v89 < __str[1] )
{
LABEL_245:
if ( v89 != v79 )
goto LABEL_179;
}
else
{
if ( ((unsigned __int64)__str[1] | v89) >> 32 )
{
v89 %= (unsigned __int64)__str[1];
goto LABEL_245;
}
if ( (unsigned int)v89 % LODWORD(__str[1]) != v79 )
goto LABEL_179;
}
v88 = (__int64 *)*v88;
if ( !v88 )
goto LABEL_179;
continue;
}
}
v79 = (unsigned __int64)v77;
if ( __str[1] > v77 )
{
LABEL_235:
v80 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v79];
if ( !v80 )
goto LABEL_179;
goto LABEL_236;
}
if ( ((unsigned __int64)__str[1] | (unsigned __int64)v77) >> 32 )
{
v79 = (unsigned __int64)v77 % (unsigned __int64)__str[1];
goto LABEL_235;
}
v79 = (unsigned int)v77 % LODWORD(__str[1]);
v80 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v79];
if ( v80 )
goto LABEL_236;
LABEL_179:
v73 = v45[407];
v133 = v45[407];
if ( !v72 )
goto LABEL_100;
v74 = (0x101010101010101LL
* ((((v72 - ((v72 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v72 - ((v72 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v72 - ((v72 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v72 - ((v72 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v74 > 1 )
{
v75 = v73;
if ( v72 <= v73 )
{
if ( !((v72 | v73) >> 32) )
{
v75 = (unsigned int)v73 % (unsigned int)v72;
v76 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v75];
if ( !v76 )
goto LABEL_100;
goto LABEL_213;
}
v75 = v73 % v72;
}
v76 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v75];
if ( !v76 )
goto LABEL_100;
}
else
{
v75 = v73 & (v72 - 1);
v76 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v75];
if ( !v76 )
goto LABEL_100;
}
LABEL_213:
v84 = *v76;
if ( !*v76 )
goto LABEL_100;
if ( (unsigned int)v74 < 2 )
{
v85 = v72 - 1;
while ( 1 )
{
v87 = v84[1];
if ( v87 == v73 )
{
if ( *((_DWORD *)v84 + 4) == (_DWORD)v73 )
goto LABEL_257;
}
else if ( (v85 & v87) != v75 )
{
goto LABEL_100;
}
v84 = (__int64 *)*v84;
if ( !v84 )
goto LABEL_100;
}
}
while ( 2 )
{
v86 = v84[1];
if ( v86 == v73 )
{
if ( *((_DWORD *)v84 + 4) == (_DWORD)v73 )
{
LABEL_257:
v131 = &v133;
v45[407] = *((_DWORD *)sub_10001C2C0((float *)__str, &v133, v22, (__int64)&unk_100A0D509, &v131)
+ 5);
goto LABEL_100;
}
}
else if ( v86 < v72 )
{
LABEL_222:
if ( v86 != v75 )
goto LABEL_100;
}
else
{
if ( (v72 | v86) >> 32 )
{
v86 %= v72;
goto LABEL_222;
}
if ( (unsigned int)v86 % (unsigned int)v72 != v75 )
goto LABEL_100;
}
v84 = (__int64 *)*v84;
if ( !v84 )
goto LABEL_100;
continue;
}
}
if ( v66 != 899 )
goto LABEL_100;
v67 = (std::string *)v45[256];
v133 = v45[256];
v68 = (unsigned __int64)__str[1];
if ( !__str[1] )
goto LABEL_100;
v69 = (0x101010101010101LL
* (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)
+ (((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL))
& 0x3333333333333333LL)
+ ((((unsigned __int64)__str[1] - (((unsigned __int64)__str[1] >> 1) & 0x5555555555555555LL)) >> 2)
& 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v69 > 1 )
{
v70 = (unsigned __int64)v67;
if ( __str[1] <= v67 )
{
if ( !(((unsigned __int64)__str[1] | (unsigned __int64)v67) >> 32) )
{
v70 = (unsigned int)v67 % LODWORD(__str[1]);
v71 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v70];
if ( !v71 )
{
LABEL_259:
v91 = v45[407];
v92 = v45 + 407;
v133 = v91;
LABEL_260:
v93 = (0x101010101010101LL
* ((((v68 - ((v68 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v68 - ((v68 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v68 - ((v68 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v68 - ((v68 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v93 <= 1 )
{
v94 = v91 & (v68 - 1);
v95 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v94];
if ( !v95 )
goto LABEL_100;
goto LABEL_267;
}
v94 = v91;
if ( v68 > v91 )
{
LABEL_266:
v95 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v94];
if ( !v95 )
goto LABEL_100;
goto LABEL_267;
}
if ( (v68 | v91) >> 32 )
{
v94 = v91 % v68;
goto LABEL_266;
}
v94 = v91 % (unsigned int)v68;
v95 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v94];
if ( !v95 )
goto LABEL_100;
LABEL_267:
v96 = *v95;
if ( !*v95 )
goto LABEL_100;
if ( (unsigned int)v93 < 2 )
{
v97 = v68 - 1;
while ( 1 )
{
v99 = v96[1];
if ( v99 == v91 )
{
if ( *((_DWORD *)v96 + 4) == v91 )
goto LABEL_99;
}
else if ( (v97 & v99) != v94 )
{
goto LABEL_100;
}
v96 = (__int64 *)*v96;
if ( !v96 )
goto LABEL_100;
}
}
while ( 2 )
{
v98 = v96[1];
if ( v98 == v91 )
{
if ( *((_DWORD *)v96 + 4) == v91 )
{
LABEL_99:
v131 = &v133;
*v92 = *((_DWORD *)sub_10001C2C0((float *)__str, &v133, v22, (__int64)&unk_100A0D509, &v131)
+ 5);
goto LABEL_100;
}
}
else if ( v98 < v68 )
{
LABEL_276:
if ( v98 != v94 )
goto LABEL_100;
}
else
{
if ( (v68 | v98) >> 32 )
{
v98 %= v68;
goto LABEL_276;
}
if ( (unsigned int)v98 % (unsigned int)v68 != v94 )
goto LABEL_100;
}
v96 = (__int64 *)*v96;
if ( !v96 )
goto LABEL_100;
continue;
}
}
goto LABEL_191;
}
v70 = (unsigned __int64)v67 % (unsigned __int64)__str[1];
}
v71 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v70];
if ( !v71 )
goto LABEL_259;
}
else
{
v70 = (unsigned __int64)v67 & ((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7);
v71 = (__int64 **)__str[0]->__r_.__value_.__r.__words[v70];
if ( !v71 )
goto LABEL_259;
}
LABEL_191:
v81 = *v71;
if ( !*v71 )
goto LABEL_259;
if ( (unsigned int)v69 < 2 )
{
while ( 1 )
{
v83 = v81[1];
if ( (std::string *)v83 == v67 )
{
if ( *((_DWORD *)v81 + 4) == (_DWORD)v67 )
goto LABEL_254;
}
else if ( (((unsigned __int64)&__str[1][-1].__r_.__value_.__r.__words[2] + 7) & v83) != v70 )
{
goto LABEL_255;
}
v81 = (__int64 *)*v81;
if ( !v81 )
goto LABEL_255;
}
}
while ( 1 )
{
v82 = v81[1];
if ( (std::string *)v82 == v67 )
break;
if ( (std::string *)v82 < __str[1] )
goto LABEL_200;
if ( ((unsigned __int64)__str[1] | v82) >> 32 )
{
v82 %= (unsigned __int64)__str[1];
LABEL_200:
if ( v82 != v70 )
goto LABEL_255;
goto LABEL_195;
}
if ( (unsigned int)v82 % LODWORD(__str[1]) != v70 )
goto LABEL_255;
LABEL_195:
v81 = (__int64 *)*v81;
if ( !v81 )
goto LABEL_255;
}
if ( *((_DWORD *)v81 + 4) != (_DWORD)v67 )
goto LABEL_195;
LABEL_254:
v131 = &v133;
v45[256] = *((_DWORD *)sub_10001C2C0((float *)__str, &v133, v22, (__int64)&unk_100A0D509, &v131) + 5);
v68 = (unsigned __int64)__str[1];
LABEL_255:
v91 = v45[407];
v133 = v91;
if ( v68 )
{
v92 = v45 + 407;
goto LABEL_260;
}
LABEL_100:
++v36;
}
while ( v36 <= v114 );
}
}
v100 = (void **)__p[0];
if ( __p[0] )
{
v101 = (void **)__p[1];
v21 = __p[0];
if ( __p[1] != __p[0] )
{
do
{
if ( (*(_BYTE *)(v101 - 3) & 1) != 0 )
operator delete(*(v101 - 1));
v101 -= 3;
}
while ( v101 != v100 );
v21 = __p[0];
}
__p[1] = v100;
operator delete(v21);
ObjectsFromString = v126;
}
v19 = v115 + 24;
if ( v115 + 24 == v116 )
{
v19 = (char *)v120[0];
if ( !v120[0] )
goto LABEL_308;
goto LABEL_301;
}
}
}
}
LABEL_314:
if ( !(_BYTE)v124 )
{
v109 = UndoObject::createWithArray(ObjectsFromString, 3);
LevelEditorLayer::addToUndoList(v132[180], (__int64)v109, 0);
}
if ( (unsigned int)sub_1007FEF90(ObjectsFromString) )
{
EditorUI::deselectAll(v132);
if ( (unsigned int)sub_1007FEF90(ObjectsFromString) == 1 )
{
v110 = sub_1007FEFE0(ObjectsFromString, 0);
EditorUI::selectObject(v132, v110, 0);
v111 = v132[187];
if ( v111 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v111 + 1528LL))(v111, 16776960);
}
else
{
for ( i = 0; i < (unsigned int)sub_1007FEF90(ObjectsFromString); ++i )
{
v113 = sub_1007FEFE0(ObjectsFromString, i);
sub_1007FEBF0(v132[112], v113);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v113 + 1528LL))(v113, 16776960);
}
}
GJBaseGameLayer::assignNewStickyGroups(v132[180], ObjectsFromString);
}
LABEL_25:
if ( (*(_BYTE *)&v119.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v119.__r_.__value_.__l.__data_);
return ObjectsFromString;
}