//
// DpadMenu::ccTouchBegan from 0x100189778 to 0x1001898c0 (328 bytes)
//
// 2 xrefs:
// > sub_100189958 @ 0x10018995c
// > ??> @ 0x1008e43d8
//
// 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 10:59:51 +0000
//
__int64 __fastcall DpadMenu::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
|| !(*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a1 + 1264LL))(a1) )
{
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 )
goto LABEL_7;
}
return 0;
}
LABEL_7:
cocos2d::CCTouch::getLocation(&v11, a2);
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 );
}
v8 = sub_100189968(a1, a2);
*(_QWORD *)(a1 + 432) = v8;
if ( !v8 )
return 0;
v9 = 1;
*(_DWORD *)(a1 + 428) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1016LL))(v8);
sub_1002AFE28(a1);
return v9;
}