//
// cocos2d::CCMouseDispatcher::removeDelegate from 0x10059de50 to 0x10059defd (173 bytes)
//
// 2 xrefs:
// > cocos2d::CCLayer::setMouseEnabled @ 0x1004a9ebb
// > cocos2d::CCLayer::onExit @ 0x1004aa209
//
// 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:32:31 +0000
//
unsigned int *__fastcall cocos2d::CCMouseDispatcher::removeDelegate(__int64 a1, unsigned int *a2)
{
unsigned int *result; // rax
__int64 *v3; // r12
unsigned __int64 v4; // r13
__int64 v5; // r15
if ( a2 )
{
if ( *(_BYTE *)(a1 + 64) )
{
result = (unsigned int *)sub_100747970(*(_QWORD *)(a1 + 80), a2);
*(_BYTE *)(a1 + 66) = 1;
}
else
{
result = *(unsigned int **)(a1 + 56);
if ( result )
{
result = *((unsigned int **)result + 7);
if ( *result )
{
v3 = *((__int64 **)result + 2);
v4 = (unsigned __int64)&v3[*result - 1];
do
{
v5 = *v3;
if ( !*v3 )
break;
result = (unsigned int *)cocos2d::CCMouseHandler::getDelegate(*v3);
if ( result == a2 )
return (unsigned int *)sub_1007FF140(*(_QWORD *)(a1 + 56), v5, 1);
++v3;
}
while ( (unsigned __int64)v3 <= v4 );
}
}
}
}
return result;
}