//
// cocos2d::extension::CCControl::removeTargetWithActionForControlEvent from 0xa99b14 to 0xa99c34 (288 bytes)
//
// 10 xrefs:
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99ca8
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99cd4
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99cec
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99d0c
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99d2c
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99d4c
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99d6c
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99d8c
// > cocos2d::extension::CCControl::removeTargetWithActionForControlEvents @ 0xa99d9c
// > ??> @ 0xc2fe8
//
// 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
//
unsigned __int64 __fastcall cocos2d::extension::CCControl::removeTargetWithActionForControlEvent(
cocos2d::extension::CCControl *a1,
__int64 a2,
cocos2d::CCArray *a3,
__int64 a4,
unsigned int a5)
{
unsigned __int64 result; // x0
cocos2d::CCArray *v9; // x26
cocos2d::ccArray *v10; // x1
cocos2d::CCObject **arr; // x19
cocos2d::CCObject **v12; // x22
cocos2d::CCObject *v13; // x1
__int64 v14; // x2
result = (unsigned __int64)cocos2d::extension::CCControl::dispatchListforControlEvent(a1, a5);
v9 = (cocos2d::CCArray *)result;
if ( !a2 && !a3 && (a4 & 1) == 0 )
return cocos2d::CCArray::removeAllObjects((cocos2d::CCArray *)result);
if ( result )
{
v10 = *(cocos2d::ccArray **)(result + 56);
result = v10->num;
if ( (_DWORD)result )
{
arr = v10->arr;
v12 = &arr[(unsigned int)result - 1];
if ( arr <= v12 )
{
v13 = *arr;
if ( *arr )
{
while ( !a2 )
{
if ( a3 || (a4 & 1) != 0 )
goto LABEL_10;
LABEL_16:
result = cocos2d::CCArray::removeObject(v9, v13, 1);
LABEL_11:
if ( v12 >= ++arr )
{
v13 = *arr;
if ( *arr )
continue;
}
return result;
}
result = a2 == *(_QWORD *)&v13[1].m_nTag;
if ( !a3 && (a4 & 1) == 0 )
{
if ( a2 != *(_QWORD *)&v13[1].m_nTag )
goto LABEL_11;
goto LABEL_16;
}
if ( a2 != *(_QWORD *)&v13[1].m_nTag )
goto LABEL_11;
LABEL_10:
result = (unsigned __int64)v13[1].__vftable;
v14 = *(_QWORD *)&v13[1].m_uID;
if ( a3 != (cocos2d::CCArray *)result
|| a4 != v14 && (a3 || (((unsigned int)v14 | (unsigned int)a4) & 1) != 0) )
{
goto LABEL_11;
}
goto LABEL_16;
}
}
}
}
return result;
}