//
// cocos2d::CCTouchDispatcher::forceRemoveDelegate from 0xdb1aac to 0xdb1bb0 (260 bytes)
//
// 3 xrefs:
// > cocos2d::CCTouchDispatcher::removeDelegate @ 0xdb1dc4
// > cocos2d::CCTouchDispatcher::touches @ 0xdb1ea4
// > ??> @ 0x5c5f0
//
// 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 13:08:39 +0000
//
__int64 __fastcall cocos2d::CCTouchDispatcher::forceRemoveDelegate(
cocos2d::CCTouchDispatcher *this,
cocos2d::CCTouchDelegate *a2)
{
__int64 v4; // x0
unsigned int *v5; // x1
cocos2d::CCObject **v6; // x19
__int64 v7; // x0
char *v8; // x21
cocos2d::CCObject *v9; // x20
cocos2d::CCTouchHandler *v10; // x0
__int64 result; // x0
unsigned int *v12; // x1
cocos2d::CCObject **v13; // x19
char *v14; // x21
cocos2d::CCObject *v15; // x20
cocos2d::CCTouchHandler *v16; // x0
v4 = *((_QWORD *)this + 9);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
if ( *v5 )
{
v6 = *((cocos2d::CCObject ***)v5 + 2);
v7 = 8LL * *v5 - 8;
v8 = (char *)v6 + v7;
if ( v6 <= (cocos2d::CCObject **)((char *)v6 + v7) )
{
do
{
v9 = *v6;
if ( !*v6 )
break;
v10 = *v6++;
if ( a2 == (cocos2d::CCTouchDelegate *)cocos2d::CCTouchHandler::getDelegate(v10) )
{
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 9), v9);
break;
}
}
while ( v8 >= (char *)v6 );
}
}
}
result = *((_QWORD *)this + 8);
if ( result )
{
v12 = *(unsigned int **)(result + 56);
result = *v12;
if ( (_DWORD)result )
{
v13 = *((cocos2d::CCObject ***)v12 + 2);
result = 8LL * (unsigned int)result - 8;
v14 = (char *)v13 + result;
if ( v13 <= (cocos2d::CCObject **)((char *)v13 + result) )
{
do
{
v15 = *v13;
if ( !*v13 )
break;
v16 = *v13++;
result = cocos2d::CCTouchHandler::getDelegate(v16);
if ( a2 == (cocos2d::CCTouchDelegate *)result )
return cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 8), v15);
}
while ( v14 >= (char *)v13 );
}
}
}
return result;
}