//
// GJTransformControl::updateButtons from 0x10015a17c to 0x10015ab24 (2472 bytes)
//
// 18 xrefs:
// > GJTransformControl::refreshControl @ 0x10015a0d0
// > GJTransformControl::refreshControl @ 0x10015a0e0
// > GJTransformControl::refreshControl @ 0x10015a158
// > GJTransformControl::refreshControl @ 0x10015a168
// > sub_10015ACD0 @ 0x10015add4
// > sub_10015B1F0 @ 0x10015b298
// > sub_10015B1F0 @ 0x10015b2a8
// > sub_10015B1F0 @ 0x10015b320
// > sub_10015B1F0 @ 0x10015b330
// > GJTransformControl::ccTouchMoved @ 0x10015bd5c
// > GJTransformControl::ccTouchEnded @ 0x10015c040
// > GJTransformControl::ccTouchEnded @ 0x10015c054
// > GJTransformControl::ccTouchEnded @ 0x10015c0cc
// > GJTransformControl::ccTouchEnded @ 0x10015c1d0
// > GJTransformControl::ccTouchEnded @ 0x10015c1e4
// > sub_10015C1F8 @ 0x10015c2f8
// > sub_10015C454 @ 0x10015c4cc
// > EditorUI::transformObjectCall_1 @ 0x10015d728
//
// 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 10:59:43 +0000
//
__int64 __fastcall GJTransformControl::updateButtons(__int64 a1, char a2, int a3)
{
__int64 *v6; // x0
__int64 v7; // x8
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
float v11; // s0
float v12; // s8
__int64 v13; // x0
double *v14; // x0
__int64 v15; // x0
__int64 v16; // x0
__int64 v17; // x0
__int64 v18; // x0
__int64 v19; // x0
float v20; // s10
float v21; // s9
int v22; // w0
int v23; // s1
__int128 v24; // q0
__int64 v25; // x22
__int64 v26; // x23
double v27; // d0
float v28; // s12
float v29; // s11
int v30; // w0
float v31; // s0
float v32; // s1
double *v33; // x0
float32x2_t v34; // d4
float32x2_t v35; // d4
float32x2_t v36; // d4
__int128 v37; // q7
float32x2_t v38; // d0
float32x2_t v39; // d0
float32x2_t v40; // d0
__int128 v41; // q2
float32x2_t *v42; // x0
float32x2_t *v43; // x0
double v44; // d0
__int64 *v45; // x0
__int64 v46; // x8
__int64 v47; // x0
__int64 v48; // x0
float v54; // s11
float v55; // s10
float v56; // s4
float v57; // s12
float v58; // s9
float v59; // s14
float v60; // s13
__int64 v61; // x21
__int64 v62; // x21
__int64 v63; // x21
__int64 v64; // x21
__int64 v65; // x21
__int64 v66; // x21
__int64 v67; // x21
__int64 v68; // x21
__int64 v69; // x21
float v70; // s10
float v71; // s0
__int64 v72; // x0
__int64 v73; // x21
float v74; // s11
__int64 v75; // x0
__int64 v76; // x20
__int64 v77; // x0
__int64 v78; // x0
__int64 v79; // x0
__int64 v80; // x0
__int64 v81; // x20
__n128 v82; // q0
__int64 v83; // x0
__int64 v84; // x0
__int64 v85; // x0
__int128 v87; // [xsp+0h] [xbp-F0h]
__int128 v88; // [xsp+10h] [xbp-E0h]
float v89; // [xsp+10h] [xbp-E0h]
float32x2_t v90; // [xsp+20h] [xbp-D0h] BYREF
float32x2_t v91; // [xsp+28h] [xbp-C8h] BYREF
float32x2_t v92; // [xsp+30h] [xbp-C0h] BYREF
float32x2_t v93; // [xsp+38h] [xbp-B8h] BYREF
float32x2_t v94; // [xsp+40h] [xbp-B0h] BYREF
float32x2_t v95; // [xsp+48h] [xbp-A8h] BYREF
float32x2_t v96; // [xsp+50h] [xbp-A0h] BYREF
float32x2_t v97; // [xsp+58h] [xbp-98h] BYREF
float32x2_t v98; // [xsp+60h] [xbp-90h] BYREF
float v99; // [xsp+68h] [xbp-88h]
float v100; // [xsp+6Ch] [xbp-84h]
float32x2_t v101; // [xsp+70h] [xbp-80h] BYREF
__int64 v102; // [xsp+78h] [xbp-78h] BYREF
v6 = *(__int64 **)(a1 + 440);
if ( v6 )
{
v7 = *v6;
if ( a3 )
{
v8 = (*(__int64 (**)(void))(v7 + 120))();
v6 = (__int64 *)sub_10015EF58(v8);
}
else
{
v6 = (__int64 *)(*(__int64 (**)(void))(v7 + 48))();
}
}
v9 = GameManager::sharedState(v6);
v10 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(v9 + 552) + 3920LL) + 168LL))(*(_QWORD *)(*(_QWORD *)(v9 + 552) + 3920LL));
v12 = v11;
v13 = GameManager::sharedState(v10);
v14 = (double *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(v13 + 552) + 3920LL) + 192LL))(*(_QWORD *)(*(_QWORD *)(v13 + 552) + 3920LL));
sub_1000262F4(&v102, v14);
v16 = GameManager::sharedState(v15);
v17 = (*(__int64 (__fastcall **)(_QWORD, float))(**(_QWORD **)(*(_QWORD *)(v16 + 552) + 3920LL) + 160LL))(
*(_QWORD *)(*(_QWORD *)(v16 + 552) + 3920LL),
1.0);
v18 = GameManager::sharedState(v17);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(*(_QWORD *)(v18 + 552) + 3920LL) + 184LL))(
*(_QWORD *)(*(_QWORD *)(v18 + 552) + 3920LL),
&unk_1009F3FA0);
v19 = *(_QWORD *)(a1 + 424);
v20 = -10000000.0;
v21 = 10000000.0;
if ( v19 && (unsigned int)sub_1002E757C(v19) )
{
v22 = sub_1002E757C(*(_QWORD *)(a1 + 424));
*(float *)&v23 = 10000000.0;
LODWORD(v24) = -887581057;
if ( v22 )
{
v25 = 0;
*(int32x2_t *)&v24 = vdup_n_s32(0xCB18967F);
v87 = v24;
*(int32x2_t *)&v24 = vdup_n_s32(0x4B18967Fu);
v88 = v24;
do
{
v26 = sub_1002E75A0(*(_QWORD *)(a1 + 424), v25);
v27 = sub_1000262F4(&v101, (double *)(v26 + 444));
v28 = *(float *)(v26 + 764);
v29 = *(float *)(v26 + 768);
v30 = (*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v26 + 1736LL))(v26, v27);
v31 = v101.f32[1];
v32 = v101.f32[0];
if ( v30 )
{
if ( v28 >= v29 )
v29 = v28;
if ( v101.f32[0] >= v101.f32[1] )
v31 = v101.f32[0];
v101.f32[0] = v31;
v101.f32[1] = v31;
v32 = v31;
v28 = v29;
}
sub_1000262CC((float *)&v98, 0.0, 0.0, v28 + v32, v29 + v31);
sub_1000262BC((float *)&v96, 0.0, 0.0);
cocos2d::CCNode::convertToWorldSpace(&v97, v26, &v96);
sub_1000262BC((float *)&v95, v99 * -0.5, v100 * 0.5);
cocos2d::CCNode::convertToWorldSpace(&v96, v26, &v95);
sub_1000262BC((float *)&v94, v99 * 0.5, v100 * 0.5);
cocos2d::CCNode::convertToWorldSpace(&v95, v26, &v94);
sub_1000262BC((float *)&v93, v99 * -0.5, v100 * -0.5);
cocos2d::CCNode::convertToWorldSpace(&v94, v26, &v93);
sub_1000262BC((float *)&v92, v99 * 0.5, v100 * -0.5);
cocos2d::CCNode::convertToWorldSpace(&v93, v26, &v92);
v33 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v26 + 192LL))(v26);
sub_1000262F4(&v92, v33);
sub_10002632C(&v96, &v97, &v90);
sub_100026318(&v92, &v90, &v91);
sub_10002630C(&v96, (double *)&v91);
sub_10002632C(&v95, &v97, &v90);
sub_100026318(&v92, &v90, &v91);
sub_10002630C(&v95, (double *)&v91);
sub_10002632C(&v94, &v97, &v90);
sub_100026318(&v92, &v90, &v91);
sub_10002630C(&v94, (double *)&v91);
sub_10002632C(&v93, &v97, &v90);
sub_100026318(&v92, &v90, &v91);
sub_10002630C(&v93, (double *)&v91);
v34 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v96, v95), (int8x8_t)v95, (int8x8_t)v96);
v35 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v34, v94), (int8x8_t)v94, (int8x8_t)v34);
v36 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v35, v93), (int8x8_t)v93, (int8x8_t)v35);
*((_QWORD *)&v37 + 1) = *((_QWORD *)&v88 + 1);
v38 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v95, v96), (int8x8_t)v95, (int8x8_t)v96);
v39 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v94, v38), (int8x8_t)v94, (int8x8_t)v38);
v40 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v93, v39), (int8x8_t)v93, (int8x8_t)v39);
*((_QWORD *)&v41 + 1) = *((_QWORD *)&v87 + 1);
*(int8x8_t *)&v41 = vbsl_s8((int8x8_t)vcgt_f32(v40, *(float32x2_t *)&v87), (int8x8_t)v40, *(int8x8_t *)&v87);
*(int8x8_t *)&v37 = vbsl_s8((int8x8_t)vcgt_f32(*(float32x2_t *)&v88, v36), (int8x8_t)v36, *(int8x8_t *)&v88);
v87 = v41;
v88 = v37;
v25 = (unsigned int)(v25 + 1);
}
while ( (unsigned int)v25 < (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 424)) );
LODWORD(v24) = v87;
v23 = v88;
v20 = *((float *)&v87 + 1);
v21 = *((float *)&v88 + 1);
}
}
else
{
*(float *)&v23 = 10000000.0;
LODWORD(v24) = -887581057;
}
v89 = *(float *)&v23;
sub_1000262BC((float *)&v101, *(float *)&v24, v20);
v42 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 192LL))(a1);
sub_10002632C(&v101, v42, &v98);
sub_1000262BC((float *)&v97, v89, v21);
v43 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 192LL))(a1);
*(float32x2_t *)&v44 = sub_10002632C(&v97, v43, &v101);
v45 = *(__int64 **)(a1 + 440);
if ( v45 )
{
v46 = *v45;
if ( a3 )
{
v47 = (*(__int64 (__fastcall **)(double))(v46 + 120))(v44);
sub_10015EB10(v47);
LABEL_22:
sub_10002630C((_QWORD *)(a1 + 456), (double *)&v98);
sub_10002630C((_QWORD *)(a1 + 464), (double *)&v101);
goto LABEL_51;
}
(*(void (__fastcall **)(double))(v46 + 56))(v44);
}
else if ( a3 )
{
goto LABEL_22;
}
if ( (a2 & 1) != 0 )
{
sub_1000262F4(&v97, (double *)&v98);
sub_1000262F4(&v96, (double *)&v101);
sub_10002632C(&v98, &v97, &v95);
sub_10002630C((_QWORD *)(a1 + 496), (double *)&v95);
sub_10002632C(&v101, &v96, &v95);
sub_10002630C((_QWORD *)(a1 + 504), (double *)&v95);
sub_10002630C((_QWORD *)(a1 + 456), (double *)&v98);
sub_10002630C((_QWORD *)(a1 + 464), (double *)&v101);
__asm { FMOV V0.2S, #1.0 }
*(_QWORD *)(a1 + 592) = _D0;
*(_QWORD *)(a1 + 604) = 0;
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 416) + 360LL))(*(_QWORD *)(a1 + 416), 0.0);
}
else
{
if ( *(float *)(a1 + 496) > 0.0 )
v98.i32[0] = *(_DWORD *)(a1 + 592);
if ( *(float *)(a1 + 504) < 0.0 )
v101.f32[0] = -*(float *)(a1 + 592);
if ( *(float *)(a1 + 500) > 0.0 )
v98.i32[1] = *(_DWORD *)(a1 + 596);
if ( *(float *)(a1 + 508) < 0.0 )
v101.f32[1] = -*(float *)(a1 + 596);
}
if ( *(float *)(a1 + 592) >= 0.0 )
v54 = v101.f32[0];
else
v54 = v98.f32[0];
if ( *(float *)(a1 + 592) >= 0.0 )
v55 = v98.f32[0];
else
v55 = v101.f32[0];
v56 = *(float *)(a1 + 596);
if ( v56 >= 0.0 )
v57 = v98.f32[1];
else
v57 = v101.f32[1];
if ( v56 >= 0.0 )
v58 = v101.f32[1];
else
v58 = v98.f32[1];
v59 = (float)(v98.f32[0] - v101.f32[0]) * 0.5;
v60 = (float)(v98.f32[1] - v101.f32[1]) * 0.5;
v61 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 2);
sub_1000262BC((float *)&v97, v55, v60 + v101.f32[1]);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v61 + 184LL))(v61, &v97);
v62 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 1);
sub_1000262BC((float *)&v97, v54, v60 + v101.f32[1]);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v62 + 184LL))(v62, &v97);
v63 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 3);
sub_1000262BC((float *)&v97, v59 + v101.f32[0], v57);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v63 + 184LL))(v63, &v97);
v64 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 4);
sub_1000262BC((float *)&v97, v59 + v101.f32[0], v58);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v64 + 184LL))(v64, &v97);
v65 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 5);
sub_1000262BC((float *)&v97, v54, v57);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v65 + 184LL))(v65, &v97);
v66 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 6);
sub_1000262BC((float *)&v97, v55, v57);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v66 + 184LL))(v66, &v97);
v67 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 7);
sub_1000262BC((float *)&v97, v54, v58);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v67 + 184LL))(v67, &v97);
v68 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 8);
sub_1000262BC((float *)&v97, v55, v58);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v68 + 184LL))(v68, &v97);
v69 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 9);
v70 = 0.0;
v71 = 0.0;
if ( (a2 & 1) == 0 )
{
v72 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 9);
v71 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v72 + 192LL))(v72);
}
sub_1000262BC((float *)&v97, v71, v98.f32[1] + 30.0);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v69 + 184LL))(v69, &v97);
v73 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 10);
v74 = v98.f32[0] + 30.0;
if ( (a2 & 1) == 0 )
{
v75 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 10);
v70 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v75 + 192LL))(v75) + 4);
}
sub_1000262BC((float *)&v97, v74, v70);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v73 + 184LL))(v73, &v97);
v76 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 528) + 512LL))(*(_QWORD *)(a1 + 528));
sub_1000262BC((float *)&v97, v59 + v101.f32[0], v98.f32[1] + 60.0);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v76 + 184LL))(v76, &v97);
v77 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 528) + 1072LL))(*(_QWORD *)(a1 + 528));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v77 + 360LL))(v77, -*(float *)(a1 + 608));
v78 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 536) + 1072LL))(*(_QWORD *)(a1 + 536));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v78 + 360LL))(v78, -*(float *)(a1 + 608));
v79 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 544) + 1072LL))(*(_QWORD *)(a1 + 544));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v79 + 360LL))(v79, -*(float *)(a1 + 608));
v80 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 552) + 1072LL))(*(_QWORD *)(a1 + 552));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v80 + 360LL))(v80, -*(float *)(a1 + 608));
sub_1000262BC((float *)&v97, v98.f32[0] + 60.0, v58 + v60);
sub_10002630C((_QWORD *)(a1 + 520), (double *)&v97);
*(float *)(a1 + 612) = (float)((float)(atan2f(*(float *)(a1 + 524), *(float *)(a1 + 520)) * -57.296) * 100.0) / 100.0;
v81 = sub_1002E75A0(*(_QWORD *)(a1 + 512), 11);
cocos2d::CCNode::convertToWorldSpace(&v96, *(_QWORD *)(a1 + 408), a1 + 520);
cocos2d::CCNode::convertToNodeSpace(&v97, a1, &v96, v82);
v48 = (*(__int64 (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v81 + 184LL))(v81, &v97);
LABEL_51:
v83 = GameManager::sharedState(v48);
v84 = (*(__int64 (__fastcall **)(_QWORD, float))(**(_QWORD **)(*(_QWORD *)(v83 + 552) + 3920LL) + 160LL))(
*(_QWORD *)(*(_QWORD *)(v83 + 552) + 3920LL),
v12);
v85 = GameManager::sharedState(v84);
return (*(__int64 (__fastcall **)(_QWORD, __int64 *))(**(_QWORD **)(*(_QWORD *)(v85 + 552) + 3920LL) + 184LL))(
*(_QWORD *)(*(_QWORD *)(v85 + 552) + 3920LL),
&v102);
}