//
// cocos2d::CCMenu::itemForTouch from 0x7dc134 to 0x7dc2a0 (364 bytes)
//
// 2 xrefs:
// > cocos2d::CCMenu::itemForTouch @ 0x7dc2bc
// > cocos2d::CCMenu::itemForTouch @ 0x7dc2cc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:00:45 +0000
//
float *__fastcall cocos2d::CCMenu::itemForTouch(cocos2d::CCMenu *this, cocos2d::CCTouch *a2, int a3)
{
cocos2d::CCArray *v4; // r0
int v5; // r3
_DWORD *v6; // r3
int v7; // r4
const void **v8; // r3
unsigned int v9; // r9
const void **v10; // r10
const void *v12; // r0
const void *v13; // t1
float *v14; // r0
float *v15; // r4
float v16; // s11
double v17; // d4
float v18; // s14
float v19; // s14
_BYTE v21[8]; // [sp+Ch] [bp+0h] BYREF
_BYTE v22[8]; // [sp+14h] [bp+8h] BYREF
float v23; // [sp+1Ch] [bp+10h] BYREF
float v24; // [sp+20h] [bp+14h]
float v25; // [sp+24h] [bp+18h]
float v26; // [sp+28h] [bp+1Ch]
cocos2d::CCTouch::getLocation((cocos2d::CCTouch *)v21);
v4 = *((cocos2d::CCArray **)this + 48);
if ( v4 )
{
if ( cocos2d::CCArray::count(v4) )
{
v5 = *((_DWORD *)this + 48);
if ( v5 )
{
v6 = *(_DWORD **)(v5 + 52);
if ( *v6 )
{
v7 = *v6 + 0x40000000;
v8 = (const void **)v6[3];
v9 = (unsigned int)&v8[v7 - 1];
v10 = v8;
while ( 1 )
{
do
{
if ( (unsigned int)v10 > v9 )
return nullptr;
v13 = *v10++;
v12 = v13;
if ( !v13 )
return nullptr;
v14 = (float *)_dynamic_cast(
v12,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCMenuItem,
0);
v15 = v14;
}
while ( !v14
|| !(*(int (__fastcall **)(float *))(*(_DWORD *)v14 + 176))(v14)
|| !(*(int (__fastcall **)(float *))(*(_DWORD *)v15 + 524))(v15) );
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v22, (const cocos2d::CCPoint *)v15, (int)v21);
cocos2d::CCMenuItem::rect((cocos2d::CCMenuItem *)&v23);
cocos2d::CCPoint::operator=(&v23, flt_D2F40C);
if ( a3 )
{
v16 = v15[74];
if ( v16 != 1.0 )
{
if ( v16 < 1.2 )
{
v16 = 1.2;
}
else if ( v16 <= 1.0 )
{
goto LABEL_20;
}
v17 = v16 - 1.0;
v18 = v23 - v25 * v17 * 0.5;
v23 = v18;
v25 = v25 * v16;
v19 = v24 - v26 * v17 * 0.5;
v26 = v26 * v16;
v24 = v19;
}
}
LABEL_20:
if ( cocos2d::CCRect::containsPoint((cocos2d::CCRect *)&v23, (const cocos2d::CCPoint *)v22) )
return v15;
}
}
}
}
}
return nullptr;
}