//
// EditorUI::transformObject from 0xc00e64 to 0xc01408 (1444 bytes)
//
// 5 xrefs:
// > EditorUI::flipObjectsX @ 0xc014e4
// > EditorUI::flipObjectsY @ 0xc016a0
// > EditorUI::transformObjectCall @ 0xc01954
// > EditorUI::transformObjectCall @ 0xc01b54
// > ??> @ 0xd8dd8
//
// This function is hookable on this platform (idp: arm, 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 13:03:48 +0000
//
__int64 __fastcall EditorUI::transformObject(__int64 a1, __int64 a2, int a3, char a4)
{
int v7; // w22
_BOOL4 v8; // w24
float v9; // s8
float v10; // s9
float v11; // s0
__int64 v12; // x1
float v13; // s0
__int64 v14; // x1
float (*v15)(void); // x2
void (__fastcall *v16)(__int64, float); // x23
float v17; // s0
float v19; // s0
__int64 v20; // x1
void (__fastcall *v21)(__int64, float); // x23
float v22; // s0
float v23; // s0
__int64 v24; // x1
float v25; // s0
cocos2d::CCArray *v26; // x23
float v27; // s8
void (__fastcall *v28)(__int64, float); // x23
float v29; // s0
void (__fastcall *v30)(__int64, float); // x23
float v31; // s0
float v32; // s0
void (__fastcall *v33)(__int64, _QWORD); // x23
unsigned __int8 v34; // w0
void (__fastcall *v35)(__int64, _QWORD); // x23
unsigned __int8 v36; // w0
float v37; // s8
float v38; // s0
__int64 v39; // x1
void (__fastcall *v40)(__int64, float); // x23
float v41; // s0
void (__fastcall *v42)(__int64, float); // x23
float v43; // s0
float v44; // [xsp+50h] [xbp+50h]
_BYTE v45[8]; // [xsp+70h] [xbp+70h] BYREF
if ( a4
|| isSpecialSnapObject(*(_DWORD *)(a2 + 1028)) && (unsigned int)(a3 - 37) <= 1
|| (int)fabsf((*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 368LL))(a2)) % 90
|| a3 == 44 )
{
v7 = 1;
}
else
{
v7 = 0;
EditorUI::removeOffset((GJBaseGameLayer **)a1, (GameObject *)a2);
}
v8 = 1;
v9 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 384LL))(a2);
if ( v9 == (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 400LL))(a2) )
{
v32 = fabsf((*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 368LL))(a2));
if ( v32 != 90.0 && v32 != 270.0 )
{
v8 = (int)v32 % 90 != 0;
goto LABEL_20;
}
v8 = (int)v32 % 90 != 0;
if ( a3 == 37 )
{
LABEL_43:
v35 = *(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1248LL);
v36 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1432LL))(a2);
v35(a2, v36 ^ 1u);
if ( !v8 )
goto LABEL_41;
}
else
{
if ( a3 != 38 )
goto LABEL_20;
LABEL_40:
v33 = *(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1240LL);
v34 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1424LL))(a2);
v33(a2, v34 ^ 1u);
if ( !v8 )
{
LABEL_41:
if ( *(_BYTE *)(a2 + 1212) )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a2 + 1776LL))(a2, 1);
goto LABEL_5;
}
}
v37 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 384LL))(a2);
v38 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 400LL))(a2);
v39 = *(_QWORD *)a2;
if ( v37 == v38 )
{
v42 = *(void (__fastcall **)(__int64, float))(v39 + 360);
v43 = (*(float (__fastcall **)(__int64))(v39 + 368))(a2);
}
else
{
v40 = *(void (__fastcall **)(__int64, float))(v39 + 376);
v41 = (*(float (__fastcall **)(__int64))(v39 + 384))(a2);
v40(a2, -v41);
v42 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)a2 + 392LL);
v43 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 400LL))(a2);
}
v42(a2, -v43);
goto LABEL_41;
}
LABEL_20:
switch ( a3 )
{
case '%':
goto LABEL_40;
case '&':
goto LABEL_43;
case '\'':
case '(':
case ')':
case '*':
v27 = EditorUI::rotationforCommand(a1, a3);
v28 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)a2 + 376LL);
v29 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 384LL))(a2);
v28(a2, v27 + v29);
v30 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)a2 + 392LL);
v31 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 400LL))(a2);
v30(a2, v27 + v31);
if ( fabsf((*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 384LL))(a2)) == 360.0 )
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a2 + 376LL))(a2, 0.0);
if ( fabsf((*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 400LL))(a2)) == 360.0 )
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a2 + 392LL))(a2, 0.0);
break;
case ',':
EditorUI::getSnapAngle((cocos2d::CCArray *)a1, (GameObject *)a2, nullptr);
if ( v25 != -1.0 )
{
v44 = v25;
v26 = *(cocos2d::CCArray **)(a1 + 896);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, (const cocos2d::CCPoint *)&unk_155EAE0);
EditorUI::rotateObjects(a1, v26, (cocos2d::CCPoint *)v45, 0, v44);
}
break;
default:
break;
}
LABEL_5:
v10 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 384LL))(a2);
v11 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 400LL))(a2);
v12 = *(_QWORD *)a2;
if ( v10 != v11 )
{
v19 = (*(float (__fastcall **)(__int64))(v12 + 384))(a2);
v20 = *(_QWORD *)a2;
if ( v19 < 360.0 )
{
if ( (*(float (__fastcall **)(__int64))(v20 + 384))(a2) > -360.0 )
{
LABEL_16:
v23 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 400LL))(a2);
v24 = *(_QWORD *)a2;
if ( v23 < 360.0 )
{
if ( (*(float (__fastcall **)(__int64))(v24 + 400))(a2) > -360.0 )
goto LABEL_9;
v24 = *(_QWORD *)a2;
}
v15 = *(float (**)(void))(v24 + 400);
v16 = *(void (__fastcall **)(__int64, float))(v24 + 392);
goto LABEL_8;
}
v20 = *(_QWORD *)a2;
}
v21 = *(void (__fastcall **)(__int64, float))(v20 + 376);
v22 = (*(float (**)(void))(v20 + 384))();
v21(a2, (float)((int)v22 % 360));
goto LABEL_16;
}
v13 = (*(float (__fastcall **)(__int64))(v12 + 368))(a2);
v14 = *(_QWORD *)a2;
if ( v13 >= 360.0 )
{
LABEL_7:
v15 = *(float (**)(void))(v14 + 368);
v16 = *(void (__fastcall **)(__int64, float))(v14 + 360);
LABEL_8:
v17 = v15();
v16(a2, (float)((int)v17 % 360));
goto LABEL_9;
}
if ( (*(float (__fastcall **)(__int64))(v14 + 368))(a2) <= -360.0 )
{
v14 = *(_QWORD *)a2;
goto LABEL_7;
}
LABEL_9:
if ( !v7 )
EditorUI::applyOffset((GJBaseGameLayer **)a1, (GameObject *)a2);
if ( *(_BYTE *)(a1 + 692) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, (const cocos2d::CCPoint *)&unk_155EAE0);
EditorUI::moveObject(a1, a2);
}
return _stack_chk_guard;
}