//
// EditorUI::getGroupCenter from 0x10003baf0 to 0x10003bcf6 (518 bytes)
//
// 11 xrefs:
// > EditorUI::repositionObjectsToCenter @ 0x1000345d4
// > EditorUI::onCreateObject @ 0x100035433
// > EditorUI::rotateObjects @ 0x10003bd3f
// > EditorUI::activateRotationControl @ 0x10003d687
// > EditorUI::copyObjectsDetailed @ 0x10003decf
// > EditorUI::activateScaleControl @ 0x10003ed1c
// > EditorUI::scaleObjects @ 0x10003f85d
// > EditorUI::activateTransformControl @ 0x100040265
// > EditorUI::transformObjects @ 0x100040837
// > EditorUI::alignObjects @ 0x10004db67
// > KeyframeGameObject::updateShadowObjects @ 0x1001c6a6c
//
// 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!
cocos2d::CCPoint __fastcall EditorUI::getGroupCenter(EditorUI *a1, cocos2d::CCArray *a2, bool a3)
{
char v3; // cl
char v4; // r14
_BOOL8 v5; // rbx
EditorUI *v6; // r15
GameObject *v7; // rbx
GameObject *v9; // r12
float v10; // xmm1_4
unsigned int v11; // ebx
GameObject *v12; // r15
__m128 v13; // xmm0
__m128 inserted; // xmm1
bool m_hasGroupParent; // al
unsigned int v16; // eax
float v17; // xmm2_4
float v18; // xmm3_4
_BYTE v19[16]; // [rsp+0h] [rbp-80h] BYREF
__m128 v20; // [rsp+10h] [rbp-70h]
__m128 v21; // [rsp+20h] [rbp-60h]
_BOOL8 v22; // [rsp+38h] [rbp-48h]
EditorUI *v23; // [rsp+40h] [rbp-40h]
float v24; // [rsp+48h] [rbp-38h]
float x; // [rsp+4Ch] [rbp-34h]
float v26; // [rsp+50h] [rbp-30h]
float v27; // [rsp+54h] [rbp-2Ch]
cocos2d::CCPoint result; // 0:xmm0_8.8
v4 = v3;
v5 = a3;
v6 = a1;
if ( (unsigned int)sub_100720070(a3) == 1 )
{
v7 = (GameObject *)sub_1007200C0(v5, 0);
GameObject::updateStartPos(v7);
((void (__fastcall *)(GameObject *))v7->getPosition)(v7);
*(double *)&result = sub_10028CC60(a1);
return result;
}
if ( !(unsigned int)sub_100720070(v5) )
{
v18 = 999999.0;
result = (cocos2d::CCPoint)3379831792LL;
v10 = -999999.0;
v17 = 999999.0;
goto LABEL_13;
}
v23 = a1;
v21 = (__m128)xmmword_1008154A0;
v9 = nullptr;
result.x = -999999.0;
v10 = -999999.0;
v22 = v5;
v11 = 0;
do
{
v24 = v10;
x = result.x;
v12 = v9;
v9 = (GameObject *)sub_1007200C0(v22, v11);
GameObject::updateStartPos(v9);
v13 = (__m128)0x3F800000u;
((void (__fastcall *)(_BYTE *, GameObject *, float, float))v9->getObjectRect_0)(v19, v9, 1.0, 1.0);
*(double *)v13.i64 = sub_10028D230(v19);
v26 = v13.f32[0];
*(double *)v13.i64 = sub_10028D270(v19);
v20 = v13;
*(double *)v13.i64 = sub_10028D280(v19);
v27 = v13.f32[0];
*(double *)v13.i64 = sub_10028D2C0(v19);
v26 = fmaxf(v26, x);
inserted = _mm_insert_ps(v13, (__m128)v20.u32[0], 16);
v21 = _mm_blendv_ps(
v21,
inserted,
_mm_or_ps(_mm_cmplt_ps(inserted, v21), _mm_cmpeq_ps(v21, (__m128)xmmword_1008150A0)));
v27 = fmaxf(v27, v24);
m_hasGroupParent = v9->m_hasGroupParent;
if ( v12 )
v9 = v12;
v4 |= m_hasGroupParent && v12 != nullptr;
if ( !m_hasGroupParent )
v9 = v12;
++v11;
v16 = sub_100720070(v22);
v10 = v27;
result = (cocos2d::CCPoint)LODWORD(v26);
}
while ( v11 < v16 );
v17 = v21.f32[0];
if ( v4 & 1 | (v9 == nullptr) )
{
v18 = _mm_movehdup_ps(v21).f32[0];
v6 = v23;
LABEL_13:
result.x = (float)((float)(result.x - v18) * 0.5) + v18;
sub_10028CBE0(v6, result.x, (float)((float)(v10 - v17) * 0.5) + v17);
return result;
}
return ((cocos2d::CCPoint (__fastcall *)(EditorUI *, GameObject *, float, float, double))v9->getRealPosition)(
v23,
v9,
v26,
v27,
*(double *)v21.i64);
}