//
// CCTextInputNode::ccTouchBegan from 0x1001fefa8 to 0x1001ff160 (440 bytes)
//
// 2 xrefs:
// > sub_1001FF1B4 @ 0x1001ff1b8
// > ??> @ 0x1008f5478
//
// 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 11:00:44 +0000
//
__int64 __fastcall CCTextInputNode::ccTouchBegan(__int64 a1, __int64 a2)
{
__int64 v4; // x0
const void *v5; // x21
void *v6; // x0
__n128 v7; // q0
__int64 v8; // x0
double v9; // d0
__int64 v10; // x20
__int64 v11; // x0
double v12; // d0
_QWORD v14[2]; // [xsp+0h] [xbp-50h] BYREF
__int64 v15; // [xsp+10h] [xbp-40h] BYREF
__int64 v16; // [xsp+18h] [xbp-38h] BYREF
if ( !(unsigned int)CCTextInputNode::isVisibleInTree(a1) )
return 0;
cocos2d::CCTouch::getLocation(&v16, a2);
if ( a1 )
{
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 512LL))(a1);
if ( v4 )
{
v5 = (const void *)v4;
do
{
v6 = __dynamic_cast(
v5,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&off_1008E1400,
-2);
if ( v6 )
{
if ( !(*(unsigned int (__fastcall **)(void *, __int64 *))(*(_QWORD *)v6 + 16LL))(v6, &v16) )
return 0;
}
v5 = (const void *)(*(__int64 (__fastcall **)(const void *))(*(_QWORD *)v5 + 512LL))(v5);
}
while ( v5 );
}
}
v7.n128_f64[0] = sub_1000262F4(v14, (double *)&v16);
if ( !CCTextInputNode::containsTouchPoint(a1, (__int64)v14, v7) )
{
if ( *(_BYTE *)(a1 + 460) == 1 && *(_BYTE *)(a1 + 626) == 1 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1160LL))(a1, 0);
return 0;
}
v8 = *(_QWORD *)(a1 + 640);
if ( !v8 )
{
v11 = *(_QWORD *)(a1 + 584);
if ( !v11 || (*(unsigned int (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 40LL))(v11, a1) )
{
v10 = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1160LL))(a1, 1);
sub_1000262F4(&v15, (double *)&v16);
sub_1000264D4(v14, (__int64)&unk_1009F48A0);
CCTextInputNode::updateCursorPosition(a1, (float *)&v15);
v12 = sub_1000262F4(v14, (double *)&v16);
CCTextInputNode::armHold(a1, v14, v12);
return v10;
}
return 0;
}
sub_100525210(v8, a2);
v9 = sub_1000262F4(v14, (double *)&v16);
CCTextInputNode::armHold(a1, v14, v9);
return 1;
}