//
// EditorUI::rotateObjects from 0x1003ed19c to 0x1003ed510 (884 bytes)
//
// 5 xrefs:
// > EditorUI::onCreateObject @ 0x1003eb944
// > EditorUI::createSmartObjectsFromTemplate @ 0x1003f1ca4
// > EditorUI::transformObjectCall_1 @ 0x1003f660c
// > EditorUI::transformObject @ 0x1003f71c0
// > EditorUI::angleChanged @ 0x1003f81fc
//
// 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
//
void __fastcall EditorUI::rotateObjects(EditorUI *a1, cocos2d::CCArray *a2, float a3, cocos2d::CCPoint a4)
{
float *v4; // x2
float32x2_t *v5; // x19
_BOOL8 v9; // x0
unsigned int v10; // w22
GameObject *v11; // x23
float32x2_t *v12; // x0
float v13; // s9
float v14; // s0
__n128 v15; // q0
__n128 v16; // q1
double v17; // d0
float v18; // s9
float v19; // s0
GameObject_vtbl *v20; // x8
float v21; // s0
float v22; // s0
float v23; // s9
float v24; // s0
float v25; // s9
float v26; // s0
__int64 v27; // x8
__int64 v28; // x24
float v29; // s0
float v30; // s9
float32x2_t *v31; // x0
float32x2_t v32; // [xsp+0h] [xbp-90h] BYREF
float32x2_t v33; // [xsp+8h] [xbp-88h] BYREF
float32x2_t v34; // [xsp+10h] [xbp-80h] BYREF
float32x2_t v35; // [xsp+18h] [xbp-78h] BYREF
__float2 v36; // 0:kr08_8.8
cocos2d::CCPoint v37; // 0:s0.4,4:s1.4
v5 = (float32x2_t *)v4;
v9 = sub_100022A5C(v4, (float *)&dword_10086E8B0);
if ( v9 )
{
EditorUI::getGroupCenter((EditorUI *)v9, a2, 0);
sub_1000229D0(v5, (double *)&v35);
}
if ( (unsigned int)sub_10024A36C((__int64)a2) )
{
v10 = 0;
while ( 1 )
{
v11 = (GameObject *)sub_10024A388((__int64)a2, v10);
v12 = (float32x2_t *)((__int64 (__fastcall *)(GameObject *))v11->getPosition)(v11);
sub_1000229F0(v12, v5, &v35);
v13 = sqrtf((float)(v35.f32[0] * v35.f32[0]) + (float)(v35.f32[1] * v35.f32[1]));
v14 = atan2f(v35.f32[1], v35.f32[0]);
v36 = __sincosf_stret(v14 + (float)((float)-a3 * 0.017453));
v15.n128_u32[0] = LODWORD(v36.__cosval);
v16.n128_u32[0] = LODWORD(v36.__sinval);
sub_100022980(v15, v16, &v32);
sub_100022A14(&v32, &v33, v13);
*(float32x2_t *)&v17 = sub_1000229DC(v5, &v33, &v34);
v18 = ((float (__fastcall *)(GameObject *, double))v11->getRotationX)(v11, v17);
v19 = ((float (__fastcall *)(GameObject *))v11->getRotationY)(v11);
v20 = v11->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v18 != v19 )
break;
v29 = ((float (__fastcall *)(GameObject *))v20->getRotation)(v11);
((void (__fastcall *)(GameObject *, float))v11->setRotation)(v11, v29 + a3);
v30 = ((float (__fastcall *)(GameObject *))v11->getRotation)(v11);
((void (__fastcall *)(GameObject *))v11->getRotation)(v11);
if ( v30 >= 360.0 )
{
v28 = 344;
goto LABEL_19;
}
if ( v26 <= -360.0 )
{
v27 = 352;
v28 = 344;
LABEL_16:
(*(void (__fastcall **)(GameObject *))((char *)&v11->copyWithZone + v27))(v11);
LABEL_19:
(*(void (__fastcall **)(GameObject *, float))((char *)&v11->copyWithZone + v28))(v11, (float)((int)v26 % 360));
}
LABEL_20:
v31 = (float32x2_t *)((__int64 (__fastcall *)(GameObject *))v11->getPosition)(v11);
v37.x = sub_1000229F0(&v34, v31, &v33).f32[0];
EditorUI::moveObject(a1, v11, v37);
if ( ++v10 >= (unsigned int)sub_10024A36C((__int64)a2) )
return;
}
v21 = ((float (__fastcall *)(GameObject *))v20->getRotationX)(v11);
((void (__fastcall *)(GameObject *, float))v11->setRotationX)(v11, v21 + a3);
v22 = ((float (__fastcall *)(GameObject *))v11->getRotationY)(v11);
((void (__fastcall *)(GameObject *, float))v11->setRotationY)(v11, v22 + a3);
v11->m_isDirty = 1;
v23 = ((float (__fastcall *)(GameObject *))v11->getRotationX)(v11);
((void (__fastcall *)(GameObject *))v11->getRotationX)(v11);
if ( v23 < 360.0 )
{
if ( v24 > -360.0 )
{
LABEL_10:
v25 = ((float (__fastcall *)(GameObject *))v11->getRotationY)(v11);
((void (__fastcall *)(GameObject *))v11->getRotationY)(v11);
if ( v25 >= 360.0 )
{
v28 = 376;
goto LABEL_19;
}
if ( v26 <= -360.0 )
{
v27 = 384;
v28 = 376;
goto LABEL_16;
}
goto LABEL_20;
}
v24 = ((float (__fastcall *)(GameObject *))v11->getRotationX)(v11);
}
((void (__fastcall *)(GameObject *, float))v11->setRotationX)(v11, (float)((int)v24 % 360));
goto LABEL_10;
}
}