//
// cocos2d::CCMenu::ccTouchBegan from 0x1002708f0 to 0x100270a3c (332 bytes)
//
// 4 xrefs:
// > sub_100270A80 @ 0x100270a84
// > SliderTouchLogic::ccTouchBegan @ 0x10038a3bc
// > CustomSFXRowMenu::ccTouchBegan @ 0x10038afb0
// > ??> @ 0x100917a80
//
// 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:01:46 +0000
//
__int64 __fastcall cocos2d::CCMenu::ccTouchBegan(__int64 a1, __int64 a2)
{
__int64 v4; // x21
__int64 v5; // x0
const void *v6; // x21
void *v7; // x0
__int64 v8; // x0
__int64 v9; // x20
__int64 v11; // [xsp+8h] [xbp-38h] BYREF
if ( *(_DWORD *)(a1 + 428) || *(_BYTE *)(a1 + 286) != 1 || *(_BYTE *)(a1 + 426) != 1 )
return 0;
v4 = *(_QWORD *)(a1 + 216);
if ( v4 )
{
while ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v4 + 352LL))(v4) )
{
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 512LL))(v4);
if ( !v4 )
{
cocos2d::CCTouch::getLocation(&v11, a2);
if ( a1 )
goto LABEL_10;
goto LABEL_15;
}
}
return 0;
}
cocos2d::CCTouch::getLocation(&v11, a2);
LABEL_10:
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 512LL))(a1);
if ( v5 )
{
v6 = (const void *)v5;
do
{
v7 = __dynamic_cast(
v6,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&off_1008E1400,
-2);
if ( v7 )
{
if ( !(*(unsigned int (__fastcall **)(void *, __int64 *))(*(_QWORD *)v7 + 16LL))(v7, &v11) )
return 0;
}
v6 = (const void *)(*(__int64 (__fastcall **)(const void *))(*(_QWORD *)v6 + 512LL))(v6);
}
while ( v6 );
}
LABEL_15:
v8 = cocos2d::CCMenu::itemForTouch_1(a1, a2);
*(_QWORD *)(a1 + 432) = v8;
if ( !v8 )
return 0;
v9 = 1;
*(_DWORD *)(a1 + 428) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1016LL))(v8);
return v9;
}