//
// GJScaleControl::ccTouchBegan from 0xbd015c to 0xbd0434 (728 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJScaleControl::ccTouchBegan @ 0xbd0438
// > ??> @ 0x104b90
// > ??> @ 0x14e2270
//
// 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:37 +0000
//
__int64 __fastcall GJScaleControl::ccTouchBegan(__int64 a1, cocos2d::CCTouch *a2, __int64 a3)
{
unsigned int v6; // w21
__int64 v8; // x25
long double v9; // q0
unsigned __int8 v10; // w0
Slider *v11; // x0
float Value; // s0
__int64 v13; // x0
int v14; // s0
__int64 v15; // x25
unsigned __int8 v16; // w0
Slider *v17; // x0
float v18; // s0
__int64 v19; // x0
int v20; // s0
__int64 v21; // x21
unsigned __int8 v22; // w0
__int64 v23; // x0
__int64 v24; // [xsp+50h] [xbp+50h] BYREF
_BYTE v25[8]; // [xsp+58h] [xbp+58h] BYREF
_BYTE v26[8]; // [xsp+60h] [xbp+60h] BYREF
__int64 v27; // [xsp+68h] [xbp+68h] BYREF
__int64 v28; // [xsp+70h] [xbp+70h] BYREF
if ( *(_DWORD *)(a1 + 432) != -1 )
return 0;
if ( (unsigned __int8)ControlMenuTouch::began((__int64 *)(a1 + 544), (__int64)a2, a3) )
return 1;
cocos2d::CCTouch::getLocation(&v24, a2);
if ( (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 488) + 352LL))(*(_QWORD *)(a1 + 488)) )
{
v8 = *(_QWORD *)(a1 + 488);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, (const cocos2d::CCPoint *)&v24);
if ( (unsigned __int8)CCTextInputNode::containsTouchPoint(v8, (const cocos2d::CCPoint *)v25) )
return 1;
}
if ( (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 496) + 352LL))(*(_QWORD *)(a1 + 496)) )
{
v15 = *(_QWORD *)(a1 + 496);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, (const cocos2d::CCPoint *)&v24);
if ( (unsigned __int8)CCTextInputNode::containsTouchPoint(v15, (const cocos2d::CCPoint *)v26) )
return 1;
}
if ( (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 504) + 352LL))(*(_QWORD *)(a1 + 504)) )
{
v21 = *(_QWORD *)(a1 + 504);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, (const cocos2d::CCPoint *)&v24);
if ( (unsigned __int8)CCTextInputNode::containsTouchPoint(v21, (const cocos2d::CCPoint *)&v28) )
return 1;
}
GJScaleControl::releaseInputFocus((GJScaleControl *)a1);
cocos2d::CCTouch::getLocation(&v27, a2);
cocos2d::CCNode::convertToNodeSpace(&v28, (cocos2d::CCNode *)a1, (const cocos2d::CCPoint *)&v27);
*(__n128 *)&v9 = cocos2d::CCPoint::operator=(&v27, &v28);
v10 = (*(__int64 (__fastcall **)(_QWORD, cocos2d::CCTouch *, __int64, long double))(**(_QWORD **)(a1 + 408) + 896LL))(
*(_QWORD *)(a1 + 408),
a2,
a3,
v9);
v6 = v10;
if ( v10 )
{
v11 = *(Slider **)(a1 + 408);
*(_DWORD *)(a1 + 432) = *((_DWORD *)a2 + 14);
Value = Slider::getValue(v11);
GJScaleControl::scaleFromValue((GJScaleControl *)a1, Value);
v13 = *(_QWORD *)(a1 + 576);
*(_DWORD *)(a1 + 436) = v14;
if ( v13 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v13 + 24LL))(v13);
*(_WORD *)(a1 + 458) = 0;
}
else
{
v16 = (*(__int64 (__fastcall **)(_QWORD, cocos2d::CCTouch *, __int64))(**(_QWORD **)(a1 + 416) + 896LL))(
*(_QWORD *)(a1 + 416),
a2,
a3);
v6 = v16;
if ( v16 )
{
v17 = *(Slider **)(a1 + 416);
*(_DWORD *)(a1 + 432) = *((_DWORD *)a2 + 14);
v18 = Slider::getValue(v17);
GJScaleControl::scaleFromValue((GJScaleControl *)a1, v18);
v19 = *(_QWORD *)(a1 + 576);
*(_DWORD *)(a1 + 440) = v20;
if ( v19 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v19 + 24LL))(v19);
*(_WORD *)(a1 + 458) = 1;
}
else
{
v22 = (*(__int64 (__fastcall **)(_QWORD, cocos2d::CCTouch *, __int64))(**(_QWORD **)(a1 + 424) + 896LL))(
*(_QWORD *)(a1 + 424),
a2,
a3);
v6 = v22;
if ( !v22 )
return 0;
v23 = *(_QWORD *)(a1 + 576);
*(_DWORD *)(a1 + 432) = *((_DWORD *)a2 + 14);
if ( v23 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v23 + 24LL))(v23);
*(_WORD *)(a1 + 458) = 2;
}
}
return v6;
}