//
// GJTransformControl::ccTouchEnded from 0xbd3988 to 0xbd3cc8 (832 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJTransformControl::ccTouchEnded @ 0xbd3ccc
// > ??> @ 0xb7c10
// > ??> @ 0x14e2810
//
// 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:38 +0000
//
__int64 __fastcall GJTransformControl::ccTouchEnded(__int64 a1, __int64 a2)
{
__int64 v2; // x21
int v5; // w21
float v6; // s0
__int64 v7; // x0
__int64 v8; // x0
const cocos2d::CCPoint *v9; // x0
__int64 v10; // x0
const cocos2d::CCPoint *v11; // x0
__int64 v12; // x26
void (__fastcall *v13)(__int64, __int64 *); // x27
__int64 v14; // x0
const cocos2d::CCPoint *v15; // x0
__int64 v16; // x0
__int64 v17; // x0
__int64 v18; // x0
__int64 v19; // x0
const cocos2d::CCPoint *v20; // x0
long double v21; // q0
__int64 v22; // x22
__int64 v24; // [xsp+70h] [xbp+70h] BYREF
_BYTE v25[8]; // [xsp+80h] [xbp+80h] BYREF
float v26; // [xsp+88h] [xbp+88h] BYREF
float v27; // [xsp+8Ch] [xbp+8Ch]
float v28[2]; // [xsp+90h] [xbp+90h] BYREF
__int64 v29; // [xsp+98h] [xbp+98h] BYREF
__int64 v30; // [xsp+A0h] [xbp+A0h] BYREF
v2 = a1 + 560;
if ( ControlMenuTouch::tracking((ControlMenuTouch *)(a1 + 560)) )
{
ControlMenuTouch::ended(v2);
}
else
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25);
if ( *(_DWORD *)(a1 + 432) == *(_DWORD *)(a2 + 56) )
{
v5 = *(__int16 *)(a1 + 436);
if ( v5 == 1 )
{
v12 = *(_QWORD *)(a1 + 440);
*(_DWORD *)(a1 + 432) = -1;
if ( v12 )
{
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 104LL);
v14 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, 1);
v15 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 192LL))(v14);
cocos2d::CCNode::convertToWorldSpace(&v30, (cocos2d::CCNode *)a1, v15);
v13(v12, &v30);
v16 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, 1);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v16 + 184LL))(v16, &unk_155E9F0);
v17 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 424), 0);
v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v17 + 192LL))(v17);
cocos2d::CCPoint::operator=(v25, v18);
GJTransformControl::updateButtons((GJTransformControl *)a1, 0, 1u);
*(_WORD *)(a1 + 436) = 0;
GJTransformControl::updateButtons((GJTransformControl *)a1, 0, 0);
v19 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 424), 0);
v20 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 192LL))(v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, v20);
cocos2d::CCPoint::operator-(&v29, v25, v28, v21);
v22 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 440) + 120LL))(*(_QWORD *)(a1 + 440));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, (const cocos2d::CCPoint *)&v29);
EditorUI::checkDiffAfterTransformAnchor(&v24, v22, &v30, *(_QWORD *)(a1 + 424));
GJTransformControl::updateButtons((GJTransformControl *)a1, 0, 1u);
GJTransformControl::updateButtons((GJTransformControl *)a1, 0, 0);
return _stack_chk_guard;
}
}
else if ( *(_WORD *)(a1 + 436) )
{
*(_DWORD *)(a1 + 432) = -1;
if ( v5 == 12 && *(_BYTE *)(a1 + 603) )
{
v6 = *(float *)(a1 + 608);
*(_WORD *)(a1 + 436) = 0;
GJTransformControl::applyFreeRotation((GJTransformControl *)a1, v6);
return _stack_chk_guard;
}
v7 = *(_QWORD *)(a1 + 440);
if ( v7 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 88LL))(v7);
if ( *(_BYTE *)(a1 + 628) && *(_QWORD *)(a1 + 440) )
{
v8 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, 6);
v9 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, v9);
v10 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, 9);
v11 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 192LL))(v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, v11);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v29,
v26 + (float)(*(float *)(a1 + 620) * (float)(v28[0] - v26)),
v27 + (float)(*(float *)(a1 + 624) * (float)(v28[1] - v27)));
cocos2d::CCNode::convertToWorldSpace(&v30, *(cocos2d::CCNode **)(a1 + 408), (const cocos2d::CCPoint *)&v29);
GJTransformControl::moveAnchorTo(a1, (const cocos2d::CCPoint *)&v30);
}
LOWORD(v5) = *(_WORD *)(a1 + 436);
}
if ( (unsigned __int16)(v5 - 10) <= 1u )
GJTransformControl::updateButtons((GJTransformControl *)a1, 0, 1u);
}
*(_WORD *)(a1 + 436) = 0;
GJTransformControl::updateButtons((GJTransformControl *)a1, 0, 0);
}
}
return _stack_chk_guard;
}