//
// cocos2d::extension::CCControl::addTargetWithActionForControlEvents from 0x10033d340 to 0x10033d788 (1096 bytes)
//
// 10 xrefs:
// > ??> @ 0x100b1d8b0
// > ??> @ 0x100b1dfa8
// > ??> @ 0x100b1e7f0
// > ??> @ 0x100b1eef0
// > ??> @ 0x100b1fea0
// > ??> @ 0x100b23648
// > ??> @ 0x100b2d128
// > ??> @ 0x100b2f660
// > ??> @ 0x100b30f00
// > ??> @ 0x100b52690
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:28:42 +0000
//
void __fastcall cocos2d::extension::CCControl::addTargetWithActionForControlEvents(
__int64 a1,
__int64 a2,
__int64 a3,
__int64 a4,
__int16 a5)
{
__int64 v6; // r15
__int64 v7; // r14
__int64 v8; // r15
__int64 v9; // r14
__int64 v10; // rax
__int64 v11; // r15
__int64 v12; // r14
__int64 v13; // rax
__int64 v14; // r15
__int64 v15; // r14
__int64 v16; // rax
__int64 v17; // r15
__int64 v18; // r14
__int64 v19; // rax
__int64 v20; // r15
__int64 v21; // r14
__int64 v22; // rax
__int64 v23; // r15
__int64 v24; // r14
__int64 v25; // rax
__int64 v26; // r15
__int64 v27; // r14
__int64 v28; // rax
__int64 v29; // r15
__int64 v30; // r14
__int64 v31; // rax
__int64 v32; // r15
v6 = a4;
if ( (a5 & 1) != 0 )
{
v7 = cocos2d::extension::CCInvocation::create(a2, a3, a4, 1);
v8 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 1);
if ( !v8 )
{
v8 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v8, 1);
}
sub_1007FEBF0(v8, v7);
v6 = a4;
if ( (a5 & 2) == 0 )
{
LABEL_3:
if ( (a5 & 4) == 0 )
goto LABEL_4;
goto LABEL_17;
}
}
else if ( (a5 & 2) == 0 )
{
goto LABEL_3;
}
v9 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 2);
v10 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 2);
if ( !v10 )
{
v11 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v11, 2);
v10 = v11;
v6 = a4;
}
sub_1007FEBF0(v10, v9);
if ( (a5 & 4) == 0 )
{
LABEL_4:
if ( (a5 & 8) == 0 )
goto LABEL_5;
goto LABEL_20;
}
LABEL_17:
v12 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 4);
v13 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 4);
if ( !v13 )
{
v14 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v14, 4);
v13 = v14;
v6 = a4;
}
sub_1007FEBF0(v13, v12);
if ( (a5 & 8) == 0 )
{
LABEL_5:
if ( (a5 & 0x10) == 0 )
goto LABEL_6;
goto LABEL_23;
}
LABEL_20:
v15 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 8);
v16 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 8);
if ( !v16 )
{
v17 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v17, 8);
v16 = v17;
v6 = a4;
}
sub_1007FEBF0(v16, v15);
if ( (a5 & 0x10) == 0 )
{
LABEL_6:
if ( (a5 & 0x20) == 0 )
goto LABEL_7;
goto LABEL_26;
}
LABEL_23:
v18 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 16);
v19 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 16);
if ( !v19 )
{
v20 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v20, 16);
v19 = v20;
v6 = a4;
}
sub_1007FEBF0(v19, v18);
if ( (a5 & 0x20) == 0 )
{
LABEL_7:
if ( (a5 & 0x40) == 0 )
goto LABEL_8;
goto LABEL_29;
}
LABEL_26:
v21 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 32);
v22 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 32);
if ( !v22 )
{
v23 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v23, 32);
v22 = v23;
v6 = a4;
}
sub_1007FEBF0(v22, v21);
if ( (a5 & 0x40) == 0 )
{
LABEL_8:
if ( (a5 & 0x80u) == 0 )
goto LABEL_9;
goto LABEL_32;
}
LABEL_29:
v24 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 64);
v25 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 64);
if ( !v25 )
{
v26 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v26, 64);
v25 = v26;
v6 = a4;
}
sub_1007FEBF0(v25, v24);
if ( (a5 & 0x80u) == 0 )
{
LABEL_9:
if ( (a5 & 0x100) == 0 )
return;
goto LABEL_35;
}
LABEL_32:
v27 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 128);
v28 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 128);
if ( !v28 )
{
v29 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v29, 128);
v28 = v29;
v6 = a4;
}
sub_1007FEBF0(v28, v27);
if ( (a5 & 0x100) != 0 )
{
LABEL_35:
v30 = cocos2d::extension::CCInvocation::create(a2, a3, v6, 256);
v31 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 440), 256);
if ( !v31 )
{
v32 = sub_1007FEC20(1);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 440), v32, 256);
v31 = v32;
}
sub_1007FEBF0(v31, v30);
}
}