//
// cocos2d::extension::CCControl::removeTargetWithActionForControlEvent from 0x1001a5d70 to 0x1001a5e78 (264 bytes)
//
// 1 xrefs:
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0x1001a5d48
//
// 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
//
double __fastcall cocos2d::extension::CCControl::removeTargetWithActionForControlEvent(
__int64 a1,
__int64 a2,
unsigned __int64 a3,
__int64 a4,
unsigned int a5)
{
cocos2d::CCObject *v8; // x0
double result; // d0
cocos2d::CCObject *v10; // x22
cocos2d::CCObject_vtbl *v11; // x9
__int64 copyWithZone_low; // x8
void (__cdecl *v13)(cocos2d::CCObject *__hidden); // x23
unsigned __int64 v14; // x24
__int64 v15; // x25
_QWORD *v16; // x1
__int64 v17; // x8
__int64 v18; // x8
unsigned __int64 v19; // x8
bool v20; // zf
char v21; // w8
v8 = cocos2d::extension::CCControl::dispatchListforControlEvent(a1, a5);
v10 = v8;
if ( a2 || a4 & 1 | a3 )
{
if ( v8 )
{
v11 = v8[1].__vftable;
copyWithZone_low = LODWORD(v11->copyWithZone);
if ( (_DWORD)copyWithZone_low )
{
v13 = v11->~CCObject_0;
v14 = (unsigned __int64)v13 + 8 * copyWithZone_low - 8;
v15 = a4 & 1 | a3;
while ( 1 )
{
v16 = *(_QWORD **)v13;
if ( !*(_QWORD *)v13 )
return result;
if ( !a2 )
break;
v17 = v16[9];
if ( !v15 )
{
if ( v17 != a2 )
goto LABEL_21;
goto LABEL_20;
}
if ( v17 == a2 )
goto LABEL_12;
LABEL_21:
v13 = (void (__cdecl *)(cocos2d::CCObject *__hidden))((char *)v13 + 8);
if ( (unsigned __int64)v13 > v14 )
return result;
}
if ( v15 )
{
LABEL_12:
v18 = v16[8];
v20 = a4 == v18;
v19 = ((unsigned __int8)v18 | (unsigned __int8)a4) & 1 | a3;
v20 = v20 || v19 == 0;
v21 = v20;
if ( a3 != v16[7] || (v21 & 1) == 0 )
goto LABEL_21;
}
LABEL_20:
sub_10024A444(v10, v16, 1);
goto LABEL_21;
}
}
}
else
{
*(_QWORD *)&result = sub_10024A45C(v8).n128_u64[0];
}
return result;
}