//
// cocos2d::CCTouchDispatcher::forceAddHandler from 0x1004c7910 to 0x1004c79e0 (208 bytes)
//
// 0 xrefs:
//
// 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:31:08 +0000
//
__int64 __fastcall cocos2d::CCTouchDispatcher::forceAddHandler(__int64 a1, __int64 a2, __int64 a3)
{
unsigned int v3; // r8d
unsigned int *v4; // rax
__int64 *v5; // rbx
__int64 v6; // r14
int Priority; // r12d
int v8; // r13d
__int64 Delegate; // r14
__int64 result; // rax
unsigned __int64 v11; // [rsp+8h] [rbp-48h]
unsigned int v13; // [rsp+24h] [rbp-2Ch]
v3 = 0;
if ( a3 )
{
v4 = *(unsigned int **)(a3 + 56);
if ( *v4 )
{
v5 = *((__int64 **)v4 + 2);
v11 = (unsigned __int64)&v5[*v4 - 1];
v3 = 0;
do
{
v6 = *v5;
if ( !*v5 )
break;
v13 = v3;
Priority = cocos2d::CCTouchHandler::getPriority(v6);
v8 = cocos2d::CCTouchHandler::getPriority(a2);
Delegate = cocos2d::CCTouchHandler::getDelegate(v6);
result = cocos2d::CCTouchHandler::getDelegate(a2);
if ( Delegate == result )
return result;
v3 = (Priority < v8) + v13;
++v5;
}
while ( (unsigned __int64)v5 <= v11 );
}
}
return sub_1007FF110(a3, a2, v3);
}