//
// cocos2d::CCTouchDispatcher::forceRemoveDelegate from 0x1004c7b00 to 0x1004c7be9 (233 bytes)
//
// 2 xrefs:
// > cocos2d::CCTouchDispatcher::removeDelegate @ 0x1004c7c80
// > cocos2d::CCTouchDispatcher::touches @ 0x1004c841b
//
// 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
//
unsigned int *__fastcall cocos2d::CCTouchDispatcher::forceRemoveDelegate(__int64 a1, unsigned int *a2)
{
__int64 v2; // rax
unsigned int *v3; // rax
__int64 *v4; // r12
unsigned __int64 v5; // r13
__int64 v6; // r15
unsigned int *result; // rax
__int64 *v8; // r12
unsigned __int64 v9; // r13
__int64 v10; // r15
v2 = *(_QWORD *)(a1 + 72);
if ( v2 )
{
v3 = *(unsigned int **)(v2 + 56);
if ( *v3 )
{
v4 = *((__int64 **)v3 + 2);
v5 = (unsigned __int64)&v4[*v3 - 1];
do
{
v6 = *v4;
if ( !*v4 )
break;
if ( (unsigned int *)cocos2d::CCTouchHandler::getDelegate(*v4) == a2 )
{
sub_1007FF140(*(_QWORD *)(a1 + 72), v6, 1);
result = *(unsigned int **)(a1 + 64);
if ( result )
goto LABEL_8;
return result;
}
++v4;
}
while ( (unsigned __int64)v4 <= v5 );
}
}
result = *(unsigned int **)(a1 + 64);
if ( result )
{
LABEL_8:
result = *((unsigned int **)result + 7);
if ( *result )
{
v8 = *((__int64 **)result + 2);
v9 = (unsigned __int64)&v8[*result - 1];
do
{
v10 = *v8;
if ( !*v8 )
break;
result = (unsigned int *)cocos2d::CCTouchHandler::getDelegate(*v8);
if ( result == a2 )
return (unsigned int *)sub_1007FF140(*(_QWORD *)(a1 + 64), v10, 1);
++v8;
}
while ( (unsigned __int64)v8 <= v9 );
}
}
return result;
}