//
// cocos2d::extension::CCControl::removeHandleOfControlEvent from 0x180004ca0 to 0x180004d4a (170 bytes)
//
// 2 xrefs:
// > ??> @ 0x18002fdf8
// > ??> @ 0x1800494d4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall cocos2d::extension::CCControl::removeHandleOfControlEvent(cocos2d::extension::CCControl *this, int a2)
{
char *v2; // r9
__int64 *v3; // r8
__int64 *v4; // rax
__int64 *v5; // rcx
__int64 *j; // r8
__int64 *v7; // rdx
__int64 *i; // rcx
void *v9; // rax
v2 = (char *)this + 456;
v3 = *((__int64 **)this + 57);
v4 = v3;
v5 = (__int64 *)v3[1];
while ( !*((_BYTE *)v5 + 25) )
{
if ( *((_DWORD *)v5 + 7) >= a2 )
{
v4 = v5;
v5 = (__int64 *)*v5;
}
else
{
v5 = (__int64 *)v5[2];
}
}
if ( !*((_BYTE *)v4 + 25) && a2 >= *((_DWORD *)v4 + 7) && v3 != v4 )
{
j = (__int64 *)v4[2];
v7 = v4;
if ( *((_BYTE *)j + 25) )
{
for ( i = (__int64 *)v4[1]; !*((_BYTE *)i + 25); i = (__int64 *)i[1] )
{
if ( v4 != (__int64 *)i[2] )
break;
v4 = i;
}
}
else
{
for ( j = (__int64 *)*j; !*((_BYTE *)j + 25); j = (__int64 *)*j )
;
}
v9 = (void *)sub_180005000(v2, v7, j);
j_j_free(v9);
}
}