//
// cocos2d::extension::CCControl::sendActionsForControlEvents from 0x180003df0 to 0x18000402c (572 bytes)
//
// 12 xrefs:
// > ??> @ 0x180026048
// > ??> @ 0x180026668
// > ??> @ 0x180026be8
// > ??> @ 0x180027320
// > ??> @ 0x1800278f0
// > ??> @ 0x180027ef8
// > ??> @ 0x1800284c8
// > ??> @ 0x180028ab8
// > ??> @ 0x180029100
// > ??> @ 0x18002a5e0
// > ??> @ 0x180032408
// > ??> @ 0x18004b33c
//
// 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:15:35 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::extension::CCControl::sendActionsForControlEvents(cocos2d::CCDictionary **this, int a2)
{
int v4; // r15d
__m128i si128; // xmm6
int v6; // r14d
struct cocos2d::CCObject *v7; // rbx
unsigned int *v8; // rbx
__int64 v9; // rax
__int64 *v10; // rbx
__int64 *i; // rdi
__int64 v12; // r8
__int64 v13; // rcx
void (__fastcall *v14)(__int64, cocos2d::CCDictionary **, _QWORD); // rax
__int64 *v15; // rdx
__int64 *v16; // rax
__int64 *j; // rcx
unsigned int v18; // ebx
cocos2d::CCArray *v19; // rdi
struct cocos2d::CCObject *v20; // rax
void *v21; // rcx
struct cocos2d::CCObject *v22; // rax
_QWORD *v23; // rax
__int128 v24; // [rsp+30h] [rbp-58h] BYREF
__m128i v25; // [rsp+40h] [rbp-48h]
v4 = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_18002BCB0);
do
{
v6 = 1 << v4;
if ( ((1 << v4) & a2) != 0 )
{
v7 = cocos2d::CCDictionary::objectForKey(*(this + 56), v6);
if ( v7
|| (v7 = cocos2d::CCArray::createWithCapacity(1u),
cocos2d::CCDictionary::setObject(*(this + 56), v7, (unsigned int)v6),
v7) )
{
v8 = *((unsigned int **)v7 + 7);
v9 = *v8;
if ( (_DWORD)v9 )
{
v10 = *((__int64 **)v8 + 2);
for ( i = &v10[v9 - 1]; v10 <= i; ++v10 )
{
v12 = *v10;
if ( !*v10 )
break;
v13 = *(_QWORD *)(v12 + 64);
if ( v13 )
{
v14 = *(void (__fastcall **)(__int64, cocos2d::CCDictionary **, _QWORD))(v12 + 56);
if ( v14 )
v14(v13, this, *(unsigned int *)(v12 + 72));
}
}
}
}
if ( *((_DWORD *)this + 75) )
{
v15 = (__int64 *)*(this + 57);
v16 = (__int64 *)v15[1];
for ( j = v15; !*((_BYTE *)v16 + 25); v16 = (__int64 *)*v16 )
{
if ( *((_DWORD *)v16 + 7) >= a2 )
j = v16;
else
v16 += 2;
}
if ( !*((_BYTE *)j + 25) && a2 >= *((_DWORD *)j + 7) && v15 != j )
{
v18 = *((_DWORD *)j + 8);
if ( v18 != -1 )
{
v19 = cocos2d::CCArray::createWithCapacity(3u);
v24 = 0;
v25 = si128;
LOBYTE(v24) = 0;
v20 = (struct cocos2d::CCObject *)cocos2d::CCString::create(&v24);
cocos2d::CCArray::addObject(v19, v20);
if ( v25.m128i_i64[1] > 0xFuLL )
{
v21 = (void *)v24;
if ( (unsigned __int64)(v25.m128i_i64[1] + 1) >= 0x1000 )
{
v21 = *(void **)(v24 - 8);
if ( (unsigned __int64)(v24 - (_QWORD)v21 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v21);
}
cocos2d::CCArray::addObject(v19, (struct cocos2d::CCObject *)this);
v22 = cocos2d::CCInteger::create(v6);
cocos2d::CCArray::addObject(v19, v22);
v23 = (_QWORD *)cocos2d::CCScriptEngineManager::sharedManager();
(*(void (__fastcall **)(_QWORD, _QWORD, cocos2d::CCArray *))(*(_QWORD *)*v23 + 144LL))(*v23, v18, v19);
}
}
}
}
++v4;
}
while ( v4 < 9 );
}