//
// cocos2d::CCTouchDispatcher::removeDelegate from 0x1800b6d60 to 0x1800b6e1a (186 bytes)
//
// 8 xrefs:
// > cocos2d::CCLayer::onExit @ 0x18005254b
// > cocos2d::CCLayer::setTouchEnabled @ 0x180052d33
// > ??> @ 0x18014a224
// > ??> @ 0x18014a234
// > ??> @ 0x18014a250
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2994
// > ??> @ 0x1801c29a0
//
// 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 11:22:22 +0000
//
void __fastcall cocos2d::CCTouchDispatcher::removeDelegate(
cocos2d::CCTouchDispatcher *this,
struct cocos2d::CCTouchDelegate *a2)
{
__int64 v4; // rax
unsigned int *v5; // rbx
__int64 v6; // rax
cocos2d::CCNotificationObserver **v7; // rbx
cocos2d::CCNotificationObserver **i; // r14
struct cocos2d::CCObject *v9; // rdi
if ( a2 )
{
if ( *((_BYTE *)this + 80) )
{
v4 = *((_QWORD *)this + 11);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
v6 = *v5;
if ( (_DWORD)v6 )
{
v7 = *((cocos2d::CCNotificationObserver ***)v5 + 2);
for ( i = &v7[v6 - 1]; v7 <= i; ++v7 )
{
v9 = *v7;
if ( !*v7 )
break;
if ( cocos2d::CCNotificationObserver::getTarget(*v7) == a2 )
{
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 11), v9);
return;
}
}
}
}
sub_1800A1E00(*((_QWORD *)this + 12), (__int64)a2);
*((_BYTE *)this + 82) = 1;
}
else
{
cocos2d::CCTouchDispatcher::forceRemoveDelegate(this, a2);
}
}
}