//
// EditorUI::createRockBases from 0x1006154b0 to 0x100615dec (2364 bytes)
//
// 2 xrefs:
// > EditorUI::createSmartObjectsFromType @ 0x100044107
// > EditorPauseLayer::onCreateExtras @ 0x100293e58
//
// 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
//
cocos2d::CCArray *__fastcall EditorUI::createRockBases(EditorUI *a1, cocos2d::CCArray *a2)
{
double v2; // xmm0_8
__int64 v3; // xmm1_8
__int64 v4; // r15
cocos2d::CCArray *v5; // r14
__int64 v6; // rbx
unsigned int v7; // r15d
__m128 *v8; // r12
float *v9; // rbx
unsigned int v10; // eax
__int64 v11; // rax
__int64 v12; // rbx
float v13; // xmm0_4
unsigned int v14; // r13d
int v15; // r12d
int v16; // r14d
int v17; // ebx
int v18; // edx
int v19; // r13d
int v20; // r14d
unsigned int v21; // r12d
int v22; // r15d
unsigned int v23; // eax
int v24; // r14d
__int64 v25; // rax
unsigned __int64 *v26; // rax
int v27; // edx
bool v28; // al
int v29; // ecx
bool v30; // al
__m128 *v31; // r14
int v32; // r13d
char v33; // r12
cocos2d::CCPoint v34; // xmm0_8
GameObject *Object; // r13
unsigned __int8 v36; // al
unsigned __int8 v37; // al
bool v38; // zf
EditorUI *v39; // r13
cocos2d::CCPoint v40; // xmm0_8
GameObject *v41; // r13
unsigned __int8 v42; // al
unsigned __int8 v43; // al
int v44; // ecx
int v45; // ecx
int v46; // ecx
unsigned __int64 v48; // [rsp+8h] [rbp-B8h] BYREF
double v49; // [rsp+10h] [rbp-B0h] BYREF
double v50; // [rsp+18h] [rbp-A8h] BYREF
double v51; // [rsp+20h] [rbp-A0h] BYREF
double v52; // [rsp+28h] [rbp-98h] BYREF
float *v53; // [rsp+30h] [rbp-90h]
EditorUI *v54; // [rsp+38h] [rbp-88h]
unsigned __int64 v55; // [rsp+40h] [rbp-80h] BYREF
cocos2d::CCArray *v56; // [rsp+48h] [rbp-78h]
unsigned __int64 v57; // [rsp+50h] [rbp-70h] BYREF
__int64 v58; // [rsp+58h] [rbp-68h]
__m128 v59; // [rsp+64h] [rbp-5Ch] BYREF
unsigned __int64 v60; // [rsp+74h] [rbp-4Ch] BYREF
unsigned int v61; // [rsp+7Ch] [rbp-44h]
int v62; // [rsp+80h] [rbp-40h]
unsigned int v63; // [rsp+84h] [rbp-3Ch]
unsigned int v64; // [rsp+88h] [rbp-38h]
unsigned __int64 v65; // [rsp+8Ch] [rbp-34h] BYREF
int v66; // [rsp+94h] [rbp-2Ch]
v54 = a1;
if ( !a2 || !(unsigned int)sub_100720070(a2) )
return nullptr;
v4 = sub_10071F9E0(a2, a2);
v5 = (cocos2d::CCArray *)sub_10071F9E0(a2, a2);
v6 = v4;
sub_100720050(v4, a2);
if ( !(unsigned int)sub_100720070(v4) )
return v5;
v56 = v5;
v7 = 0;
v8 = &v59;
v58 = v6;
do
{
v61 = v7;
v9 = (float *)sub_1007200C0(v6, v7);
(*(void (__fastcall **)(unsigned __int64 *, float *))(*(_QWORD *)v9 + 1344LL))(&v48, v9);
v10 = (_DWORD)v9[257] & 0xFFFFFFFC;
v66 = 0;
v64 = 0;
LOBYTE(v7) = 0;
if ( v10 == 1348 )
{
sub_10028CC30(&v65);
sub_10028CC30(&v55);
sub_10028CC30(&v60);
sub_10028CC30(&v57);
v53 = v9;
v11 = (unsigned int)(*((_DWORD *)v9 + 257) - 1348);
v12 = v58;
switch ( v11 )
{
case 0LL:
sub_10028CBE0(v59.f32, 30.0, 0.0);
sub_10028CC90(&v65, (double *)v59.i64);
sub_10028CBE0(v59.f32, 30.0, -30.0);
sub_10028CC90(&v55, (double *)v59.i64);
sub_10028CBE0(v59.f32, 0.0, -30.0);
sub_10028CC90(&v60, (double *)v59.i64);
v13 = 0.0;
v3 = 3253731328LL;
goto LABEL_12;
case 1LL:
sub_10028CBE0(v59.f32, -30.0, 0.0);
sub_10028CC90(&v65, (double *)v59.i64);
sub_10028CBE0(v59.f32, -30.0, -30.0);
sub_10028CC90(&v55, (double *)v59.i64);
sub_10028CBE0(v59.f32, 0.0, -30.0);
sub_10028CC90(&v60, (double *)v59.i64);
v3 = 0;
v13 = -30.0;
goto LABEL_12;
case 2LL:
sub_10028CBE0(v59.f32, 0.0, 30.0);
sub_10028CC90(&v65, (double *)v59.i64);
sub_10028CBE0(v59.f32, 30.0, 30.0);
sub_10028CC90(&v55, (double *)v59.i64);
sub_10028CBE0(v59.f32, 30.0, 0.0);
sub_10028CC90(&v60, (double *)v59.i64);
v3 = 0;
v13 = 30.0;
goto LABEL_12;
case 3LL:
sub_10028CBE0(v59.f32, 0.0, 30.0);
sub_10028CC90(&v65, (double *)v59.i64);
sub_10028CBE0(v59.f32, -30.0, 30.0);
sub_10028CC90(&v55, (double *)v59.i64);
sub_10028CBE0(v59.f32, -30.0, 0.0);
sub_10028CC90(&v60, (double *)v59.i64);
v13 = 0.0;
v3 = 1106247680;
LABEL_12:
sub_10028CBE0(v59.f32, v13, *(float *)&v3);
v2 = sub_10028CC90(&v57, (double *)v59.i64);
break;
default:
break;
}
sub_10028CCE0(&v49, &v48, &v65);
sub_10028CCE0(&v50, &v48, &v55);
sub_10028CCE0(&v51, &v48, &v60);
sub_10028CCE0(&v52, &v48, &v57);
v14 = 0;
if ( (unsigned int)sub_100720070(v12) )
{
v7 = 0;
v15 = 0;
v16 = 0;
v17 = 0;
v18 = 0;
do
{
if ( v61 != v14 )
{
v64 = v16;
v63 = v7;
v24 = v18;
v25 = sub_1007200C0(v58, v14);
v26 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v25 + 1312LL))(v25, v2);
v2 = sub_10028D180(&v59, v26);
v27 = v24;
if ( (v24 & 1) == 0 )
{
v28 = sub_10028D2D0(v59.f32, v2, *(double *)&v3, (float *)&v49);
v27 = (unsigned __int8)v24;
if ( v28 )
v27 = 1;
}
v29 = v17;
v62 = v27;
if ( (v17 & 1) == 0 )
{
v30 = sub_10028D2D0(v59.f32, v2, *(double *)&v3, (float *)&v50);
v29 = (unsigned __int8)v17;
if ( v30 )
v29 = 1;
}
v7 = v63;
v16 = v64;
v17 = v29;
if ( (v64 & 1) == 0 )
{
v16 = (unsigned __int8)v64;
if ( sub_10028D2D0(v59.f32, v2, *(double *)&v3, (float *)&v51) )
v16 = 1;
}
if ( (v15 & 1) == 0 )
{
v15 = (unsigned __int8)v15;
if ( sub_10028D2D0(v59.f32, v2, *(double *)&v3, (float *)&v52) )
v15 = 1;
}
v18 = v62;
}
if ( (v18 & 1) != 0 && (v17 & 1) != 0 )
{
v7 = (unsigned __int8)v7;
if ( (v16 & 1) != 0 )
v7 = 1;
}
if ( (v7 & 1) != 0 && (v15 & 1) != 0 )
break;
v64 = v14 + 1;
v19 = v16;
v20 = v15;
v21 = v7;
v22 = v18;
v23 = sub_100720070(v58);
v18 = v22;
v7 = v21;
v15 = v20;
v16 = v19;
v14 = v64;
}
while ( v64 < v23 );
v64 = v15;
}
else
{
v64 = 0;
LOBYTE(v7) = 0;
}
v8 = &v59;
v9 = v53;
}
v2 = sub_10028CC60(v8, &dbl_1009A3570);
switch ( *((_DWORD *)v9 + 257) )
{
case 0x544:
v31 = v8;
v32 = 1387;
if ( (v7 & 1) != 0 )
v32 = 1352;
v66 = 0;
v33 = 0;
if ( !(v7 & 1 | ((v64 & 1) == 0)) )
{
v3 = 3253731328LL;
sub_10028CBE0((float *)&v65, 0.0, -30.0);
v2 = sub_10028CC90(v31, (double *)&v65);
v66 = 1391;
v33 = 1;
v32 = 1387;
}
break;
case 0x545:
v31 = v8;
if ( (v7 & 1) != 0 )
{
v33 = 0;
v32 = 1353;
goto LABEL_64;
}
v33 = v64;
v44 = 0;
if ( (v64 & 1) != 0 )
v44 = 1392;
v66 = v44;
v32 = 1388;
break;
case 0x546:
v31 = v8;
if ( (v7 & 1) != 0 )
{
v33 = 0;
v32 = 1354;
goto LABEL_64;
}
v33 = v64;
v46 = 0;
if ( (v64 & 1) != 0 )
v46 = 1394;
v66 = v46;
v32 = 1389;
break;
case 0x547:
v31 = v8;
if ( (v7 & 1) != 0 )
{
v33 = 0;
v32 = 1355;
LABEL_64:
v66 = 0;
}
else
{
v33 = v64;
v45 = 0;
if ( (v64 & 1) != 0 )
v45 = 1393;
v66 = v45;
v32 = 1390;
}
break;
case 0x597:
v31 = v8;
v32 = 1442;
v33 = 0;
break;
case 0x598:
v31 = v8;
v33 = 0;
v32 = 1443;
goto LABEL_64;
case 0x599:
v31 = v8;
v33 = 0;
v32 = 1444;
goto LABEL_64;
case 0x59A:
v31 = v8;
v33 = 0;
v32 = 1445;
goto LABEL_64;
case 0x59B:
v31 = v8;
v33 = 0;
v32 = 1446;
goto LABEL_64;
case 0x59C:
v31 = v8;
v33 = 0;
v32 = 1447;
goto LABEL_64;
case 0x59D:
v31 = v8;
v33 = 0;
v32 = 1448;
goto LABEL_64;
case 0x59E:
v31 = v8;
v33 = 0;
v32 = 1449;
goto LABEL_64;
case 0x59F:
v31 = v8;
v33 = 0;
v32 = 1450;
goto LABEL_64;
case 0x5A0:
v31 = v8;
v33 = 0;
v32 = 1451;
goto LABEL_64;
case 0x5A1:
v31 = v8;
v33 = 0;
v32 = 1452;
goto LABEL_64;
case 0x5E6:
v31 = v8;
v33 = 0;
v32 = 1513;
goto LABEL_64;
case 0x5E7:
v31 = v8;
v33 = 0;
v32 = 1514;
goto LABEL_64;
case 0x5E8:
v31 = v8;
v33 = 0;
v32 = 1515;
goto LABEL_64;
default:
goto LABEL_5;
}
*(double *)&v34 = (*(double (__fastcall **)(unsigned __int64 *, float *, double))(*(_QWORD *)v9 + 1344LL))(
&v65,
v9,
v2);
Object = EditorUI::createObject(v54, v32, v34);
(*(void (__fastcall **)(float *))(*(_QWORD *)v9 + 352LL))(v9);
((void (__fastcall *)(GameObject *))Object->setRotation)(Object);
v36 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v9 + 1408LL))(v9);
((void (__fastcall *)(GameObject *, _QWORD))Object->setFlipX)(Object, v36);
v37 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v9 + 1416LL))(v9);
((void (__fastcall *)(GameObject *, _QWORD))Object->setFlipY)(Object, v37);
GameObject::updateCustomScaleX(Object, v9[288]);
*(_QWORD *)&v2 = *((unsigned int *)v9 + 289);
GameObject::updateCustomScaleY(Object, *(float *)&v2);
Object->m_editorLayer2 = *((_WORD *)v9 + 601) + 2;
sub_10071FCD0(v56, Object);
v38 = (v33 & 1) == 0;
v8 = v31;
if ( !v38 )
{
(*(void (__fastcall **)(unsigned __int64 *, float *))(*(_QWORD *)v9 + 1344LL))(&v65, v9);
v39 = v54;
EditorUI::offsetForKey((EditorUI *)&v60, (int)v54);
v8 = &v59;
sub_10028CCE0((double *)&v55, &v65, &v60);
sub_10028CC90(&v65, (double *)&v55);
sub_10028CCE0((double *)&v55, &v65, (unsigned __int64 *)&v59);
sub_10028CC90(&v65, (double *)&v55);
*(double *)&v40 = sub_10028CC60(&v55, (double *)&v65);
v41 = EditorUI::createObject(v39, v66, v40);
(*(void (__fastcall **)(float *))(*(_QWORD *)v9 + 352LL))(v9);
((void (__fastcall *)(GameObject *))v41->setRotation)(v41);
v42 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v9 + 1408LL))(v9);
((void (__fastcall *)(GameObject *, _QWORD))v41->setFlipX)(v41, v42);
v43 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v9 + 1416LL))(v9);
((void (__fastcall *)(GameObject *, _QWORD))v41->setFlipY)(v41, v43);
GameObject::updateCustomScaleX(v41, v9[288]);
*(_QWORD *)&v2 = *((unsigned int *)v9 + 289);
GameObject::updateCustomScaleY(v41, *(float *)&v2);
v41->m_editorLayer2 = *((_WORD *)v9 + 601) + 2;
sub_10071FCD0(v56, v41);
}
LABEL_5:
v7 = v61 + 1;
v6 = v58;
}
while ( v7 < (unsigned int)sub_100720070(v58) );
return v56;
}