//
// cocos2d::CCMenu::itemForTouch from 0x100270fa8 to 0x100271140 (408 bytes)
//
// 2 xrefs:
// > cocos2d::CCMenu::itemForTouch_1 @ 0x100270a54
// > cocos2d::CCMenu::itemForTouch_1 @ 0x100270a7c
//
// 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
//
float *__fastcall cocos2d::CCMenu::itemForTouch(__int64 a1, __int64 a2, int a3)
{
__int64 v5; // x0
__int64 v6; // x8
unsigned int *v7; // x9
__int64 v8; // x8
const void **v9; // x24
unsigned __int64 v10; // x25
float *v15; // x0
float *v16; // x23
__n128 v17; // q0
float v18; // s0
float64x2_t v21; // [xsp+0h] [xbp-90h]
float32x2_t v22; // [xsp+10h] [xbp-80h] BYREF
float32x2_t v23; // [xsp+18h] [xbp-78h]
__int64 v24; // [xsp+20h] [xbp-70h] BYREF
__int64 v25; // [xsp+28h] [xbp-68h] BYREF
cocos2d::CCTouch::getLocation(&v25, a2);
v5 = *(_QWORD *)(a1 + 208);
if ( v5 )
{
if ( (unsigned int)sub_1002E757C(v5) )
{
v6 = *(_QWORD *)(a1 + 208);
if ( v6 )
{
v7 = *(unsigned int **)(v6 + 56);
v8 = *v7;
if ( (_DWORD)v8 )
{
v9 = *((const void ***)v7 + 2);
v10 = (unsigned __int64)&v9[v8 - 1];
__asm { FMOV V0.2D, #-0.5 }
v21 = _Q0;
while ( *v9 )
{
v15 = (float *)__dynamic_cast(
*v9,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCMenuItem,
0);
if ( v15 )
{
v16 = v15;
if ( (*(unsigned int (__fastcall **)(float *))(*(_QWORD *)v15 + 352LL))(v15) )
{
if ( (*(unsigned int (__fastcall **)(float *))(*(_QWORD *)v16 + 1048LL))(v16) )
{
cocos2d::CCNode::convertToNodeSpace(&v24, v16, &v25, v17);
cocos2d::CCMenuItem::rect(v16, (float *)&v22);
sub_10002630C(&v22, &dbl_1009F57C0);
if ( a3 )
{
v18 = v16[93];
if ( v18 < 1.2 && v18 != 1.0 )
v18 = 1.2;
if ( v18 > 1.0 )
{
v22 = vcvt_f32_f64(vaddq_f64(vcvtq_f64_f32(v22), vmulq_f64(vmulq_n_f64(vcvtq_f64_f32(v23), v18 + -1.0), v21)));
v23 = vmul_n_f32(v23, v18);
}
}
if ( sub_1000265E4((float *)&v22, (float *)&v24) )
return v16;
}
}
}
if ( (unsigned __int64)++v9 > v10 )
return nullptr;
}
}
}
}
}
return nullptr;
}