//
// cocos2d::CCTouchDispatcher::findHandler_1 from 0x1001cddac to 0x1001cde6c (192 bytes)
//
// 3 xrefs:
// > sub_100155E94 @ 0x100155ebc
// > sub_1001FEF4C @ 0x1001fef70
// > sub_10039BEA0 @ 0x10039bec8
//
// 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:00:21 +0000
//
__int64 __fastcall cocos2d::CCTouchDispatcher::findHandler_1(__int64 a1, __int64 a2)
{
__int64 v4; // x8
unsigned int *v5; // x9
__int64 v6; // x8
__int64 *v7; // x22
unsigned __int64 v8; // x23
__int64 v9; // x21
__int64 v10; // x8
unsigned int *v11; // x9
__int64 v12; // x8
__int64 *v13; // x20
unsigned __int64 v14; // x22
v4 = *(_QWORD *)(a1 + 64);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
v6 = *v5;
if ( (_DWORD)v6 )
{
v7 = *((__int64 **)v5 + 2);
v8 = (unsigned __int64)&v7[v6 - 1];
do
{
v9 = *v7;
if ( !*v7 )
break;
if ( cocos2d::CCTouchHandler::getDelegate(*v7) == a2 )
return v9;
++v7;
}
while ( (unsigned __int64)v7 <= v8 );
}
}
v10 = *(_QWORD *)(a1 + 72);
if ( !v10 )
return 0;
v11 = *(unsigned int **)(v10 + 56);
v12 = *v11;
if ( !(_DWORD)v12 )
return 0;
v13 = *((__int64 **)v11 + 2);
v14 = (unsigned __int64)&v13[v12 - 1];
while ( 1 )
{
v9 = *v13;
if ( !*v13 || cocos2d::CCTouchHandler::getDelegate(*v13) == a2 )
break;
if ( (unsigned __int64)++v13 > v14 )
return 0;
}
return v9;
}