//
// cocos2d::extension::CCControl::removeTargetWithActionForControlEvent from 0x180004800 to 0x1800048ed (237 bytes)
//
// 2 xrefs:
// > ??> @ 0x18002fdf8
// > ??> @ 0x180049420
//
// 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::removeTargetWithActionForControlEvent(
__int64 a1,
__int64 a2,
__int64 a3,
unsigned int a4)
{
struct cocos2d::CCObject *v8; // rbp
unsigned int *v9; // rbx
__int64 v10; // rax
struct cocos2d::CCObject **v11; // rbx
struct cocos2d::CCObject **v12; // r14
struct cocos2d::CCObject *v13; // rdx
bool v14; // al
v8 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 448), (int)a4);
if ( !v8 )
{
v8 = cocos2d::CCArray::createWithCapacity(1u);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 448), v8, a4);
}
if ( !a2 && !a3 )
{
cocos2d::CCArray::removeAllObjects(v8);
return;
}
if ( v8 )
{
v9 = *((unsigned int **)v8 + 7);
v10 = *v9;
if ( (_DWORD)v10 )
{
v11 = *((struct cocos2d::CCObject ***)v9 + 2);
v12 = &v11[v10 - 1];
if ( v11 <= v12 )
{
while ( 1 )
{
v13 = *v11;
if ( !*v11 )
return;
v14 = 1;
if ( a2 )
v14 = a2 == *((_QWORD *)v13 + 8);
if ( a3 )
break;
if ( v14 )
goto LABEL_17;
LABEL_18:
if ( ++v11 > v12 )
return;
}
if ( !v14 || a3 != *((_QWORD *)v13 + 7) )
goto LABEL_18;
LABEL_17:
cocos2d::CCArray::removeObject(v8, v13, 1);
goto LABEL_18;
}
}
}
}