//
// cocos2d::extension::CCControl::removeTargetWithActionForControlEvent from 0x5a0b90 to 0x5a0c30 (160 bytes)
//
// 1 xrefs:
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0x5a0c5a
//
// 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
//
cocos2d::CCArray *__fastcall cocos2d::extension::CCControl::removeTargetWithActionForControlEvent(
cocos2d::extension::CCControl *a1,
int a2,
cocos2d::CCObject_vtbl *a3,
int a4,
intptr_t a5)
{
cocos2d::CCArray *result; // r0
cocos2d::CCArray *v9; // r9
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r4
cocos2d::CCObject **v12; // r5
cocos2d::CCObject *v13; // r1
cocos2d::CCObject *v14; // t1
_BOOL4 v15; // r3
unsigned int m_uID; // r3
result = (cocos2d::CCArray *)cocos2d::extension::CCControl::dispatchListforControlEvent(a1, a5);
v9 = result;
if ( !a2 && !a3 && (a4 & 1) == 0 )
return (cocos2d::CCArray *)cocos2d::CCArray::removeAllObjects(result);
if ( result )
{
data = result->data;
if ( data->num )
{
arr = data->arr;
v12 = &arr[data->num] + 0x3FFFFFFF;
while ( 1 )
{
if ( arr > v12 )
return result;
v14 = *arr++;
v13 = v14;
if ( !v14 )
return result;
if ( a2 )
{
v15 = a2 == v13[1].m_nLuaID;
if ( !a3 )
goto LABEL_12;
LABEL_13:
if ( v15 )
goto LABEL_14;
}
else if ( a3 )
{
LABEL_14:
m_uID = v13[1].m_uID;
if ( a3 == v13[1].__vftable && (a4 == m_uID || !a3 && ((m_uID | a4) & 1) == 0) )
LABEL_20:
result = (cocos2d::CCArray *)cocos2d::CCArray::removeObject(v9, v13, 1);
}
else
{
v15 = 1;
LABEL_12:
if ( (a4 & 1) != 0 )
goto LABEL_13;
if ( v15 )
goto LABEL_20;
}
}
}
}
return result;
}