//
// cocos2d::CCMenu::ccTouchBegan from 0x100873ce0 to 0x100873e34 (340 bytes)
//
// 5 xrefs:
// > SliderTouchLogic::ccTouchBegan @ 0x1002eed65
// > sub_1002EEE10 @ 0x1002eee31
// > CustomSFXRowMenu::ccTouchBegan @ 0x1006b5234
// > sub_100873E80 @ 0x100873e8c
// > ??> @ 0x100ba08f8
//
// 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 12:36:52 +0000
//
char __fastcall cocos2d::CCMenu::ccTouchBegan(__int64 a1, __int64 a2)
{
__int64 v2; // r14
__int64 v4; // rax
const void *v5; // r15
void *v6; // rax
__int64 v7; // rax
__int64 v8; // [rsp-40h] [rbp-40h] BYREF
__int64 v9; // [rsp-38h] [rbp-38h]
if ( *(_DWORD *)(a1 + 428) || *(_BYTE *)(a1 + 286) != 1 || *(_BYTE *)(a1 + 426) != 1 )
return 0;
v2 = *(_QWORD *)(a1 + 216);
v9 = a2;
if ( v2 )
{
while ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v2 + 352LL))(v2) )
{
v2 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 512LL))(v2);
if ( !v2 )
{
cocos2d::CCTouch::getLocation((__int64)&v8, v9);
if ( a1 )
goto LABEL_11;
goto LABEL_17;
}
}
return 0;
}
cocos2d::CCTouch::getLocation((__int64)&v8, a2);
LABEL_11:
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 *)&`typeinfo for'cocos2d::CCTouchClipper,
-2);
if ( v6 )
{
if ( !(*(unsigned __int8 (__fastcall **)(void *, __int64 *))(*(_QWORD *)v6 + 16LL))(v6, &v8) )
return 0;
}
v5 = (const void *)(*(__int64 (__fastcall **)(const void *))(*(_QWORD *)v5 + 512LL))(v5);
}
while ( v5 );
}
LABEL_17:
v7 = cocos2d::CCMenu::itemForTouch(a1, v9, 0);
if ( v7 )
{
*(_QWORD *)(a1 + 432) = v7;
LABEL_20:
*(_DWORD *)(a1 + 428) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 1016LL))(v7);
return 1;
}
v7 = cocos2d::CCMenu::itemForTouch(a1, v9, 1);
*(_QWORD *)(a1 + 432) = v7;
if ( v7 )
goto LABEL_20;
return 0;
}