//
// GJTransformControl::ccTouchEnded from 0x1401a7cb0 to 0x1401a7fc6 (790 bytes)
//
// 4 xrefs:
// > ??> @ 0x140750438
// > ??> @ 0x1408a0d68
// > ??> @ 0x1408a0d7c
// > ??> @ 0x140919c10
//
// This function is hookable on this platform (idp: pc, 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 11:27:51 +0000
//
__int64 __fastcall GJTransformControl::ccTouchEnded(__int64 a1, __int64 a2)
{
__int64 v2; // rbp
__int64 v5; // rcx
__int64 result; // rax
char v7; // di
__int16 v8; // ax
bool v9; // zf
struct cocos2d::CCObject *v10; // rax
__int64 v11; // rax
__int64 v12; // rax
struct cocos2d::CCObject *v13; // rax
struct cocos2d::CCObject *v14; // rax
__int64 v15; // rax
__int64 v16; // rcx
struct cocos2d::CCObject *v17; // rax
const struct cocos2d::CCPoint *v18; // rax
struct cocos2d::CCObject *v19; // rax
const struct cocos2d::CCPoint *v20; // rax
__int64 v21; // rax
__int16 v22; // ax
struct cocos2d::CCObject *v23; // rax
const struct cocos2d::CCPoint *v24; // rax
__int64 v25; // rdi
__int64 v26; // rax
__int64 v27; // rbx
__int64 v28; // rax
_BYTE v29[8]; // [rsp+20h] [rbp-38h] BYREF
_BYTE v30[8]; // [rsp+28h] [rbp-30h] BYREF
_BYTE v31[40]; // [rsp+30h] [rbp-28h] BYREF
float v32; // [rsp+60h] [rbp+8h] BYREF
float v33; // [rsp+64h] [rbp+Ch]
float v34; // [rsp+78h] [rbp+20h] BYREF
float v35; // [rsp+7Ch] [rbp+24h]
v2 = a1 - 320;
if ( *(_QWORD *)(a1 + 264) )
{
v5 = *(_QWORD *)(a1 + 264);
if ( v5 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v5 + 320) + 24LL))(v5 + 320);
*(_QWORD *)(a1 + 264) = 0;
return 0;
}
v7 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29);
result = *(unsigned int *)(a2 + 56);
if ( *(_DWORD *)(a1 + 112) != (_DWORD)result )
return result;
v8 = *(_WORD *)(a1 + 116);
if ( v8 == 1 )
{
v9 = *(_QWORD *)(a1 + 120) == 0;
*(_DWORD *)(a1 + 112) = -1;
if ( !v9 )
{
v10 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 192), 0);
v11 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v10 + 200LL))(v10);
cocos2d::CCNode::convertToWorldSpace(v2, &v32, v11);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 120) + 104LL))(*(_QWORD *)(a1 + 120), v12);
v13 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 192), 0);
(*(void (__fastcall **)(struct cocos2d::CCObject *, void *))(*(_QWORD *)v13 + 184LL))(v13, &unk_14090A6C8);
v7 = 1;
v14 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 104), 0);
v15 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v14 + 200LL))(v14);
cocos2d::CCPoint::operator=(v29, v15);
LABEL_20:
GJTransformControl::updateButtons(v2, 0, 1);
goto LABEL_21;
}
}
else if ( v8 )
{
*(_DWORD *)(a1 + 112) = -1;
if ( *(_BYTE *)(a1 + 283) && v8 == 12 )
{
*(_WORD *)(a1 + 116) = 0;
return GJTransformControl::applyFreeRotation(v2);
}
v16 = *(_QWORD *)(a1 + 120);
if ( v16 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v16 + 88LL))(v16);
if ( *(_BYTE *)(a1 + 308) && *(_QWORD *)(a1 + 120) )
{
v17 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 192), 5u);
v18 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v17 + 200LL))(v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, v18);
v19 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 192), 8u);
v20 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v19 + 200LL))(v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, v20);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v30,
(float)((float)(v32 - v34) * *(float *)(a1 + 300)) + v34,
(float)((float)(v33 - v35) * *(float *)(a1 + 304)) + v35);
cocos2d::CCNode::convertToWorldSpace(*(_QWORD *)(a1 + 88), v31, v30);
GJTransformControl::moveAnchorTo(v2, v21);
}
}
v22 = *(_WORD *)(a1 + 116);
if ( v22 == 10 || v22 == 11 )
goto LABEL_20;
LABEL_21:
*(_WORD *)(a1 + 116) = 0;
result = GJTransformControl::updateButtons(v2, 0, 0);
if ( v7 )
{
v23 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 104), 0);
v24 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v23 + 200LL))(v23);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, v24);
cocos2d::CCPoint::operator-(v29, &v34, &v32);
v25 = *(_QWORD *)(a1 + 104);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v31, (const struct cocos2d::CCPoint *)&v34);
v27 = v26;
v28 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 120) + 120LL))(*(_QWORD *)(a1 + 120));
EditorUI::checkDiffAfterTransformAnchor(v28, v30, v27, v25);
GJTransformControl::updateButtons(v2, 0, 1);
return GJTransformControl::updateButtons(v2, 0, 0);
}
return result;
}