//
// cocos2d::CCTouchDispatcher::removeDelegate from 0x1001cdc80 to 0x1001cdcfc (124 bytes)
//
// 2 xrefs:
// > cocos2d::CCLayer::setTouchEnabled @ 0x1001c7134
// > cocos2d::CCLayer::onExit @ 0x1001c76f4
//
// 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::removeDelegate(__int64 result, __int64 a2)
{
__int64 v3; // x19
__int64 Handler; // x0
if ( a2 )
{
v3 = result;
if ( (*(_BYTE *)(result + 80) & 1) != 0 )
{
Handler = cocos2d::CCTouchDispatcher::findHandler();
if ( Handler )
{
return sub_1002E765C(*(_QWORD *)(v3 + 88), Handler, 1);
}
else
{
result = sub_1003F34F8(*(_QWORD *)(v3 + 96), a2);
*(_BYTE *)(v3 + 82) = 1;
}
}
else
{
return cocos2d::CCTouchDispatcher::forceRemoveDelegate(result, a2);
}
}
return result;
}