//
// cocos2d::extension::CCControl::sendActionsForControlEvents from 0x100351980 to 0x100351b68 (488 bytes)
//
// 10 xrefs:
// > ??> @ 0x100915a58
// > ??> @ 0x100916130
// > ??> @ 0x100916958
// > ??> @ 0x100917038
// > ??> @ 0x100917f98
// > ??> @ 0x10091b4a0
// > ??> @ 0x100924b58
// > ??> @ 0x100926fc0
// > ??> @ 0x1009287a0
// > ??> @ 0x100947878
//
// 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::sendActionsForControlEvents(
cocos2d::extension::CCControl *a1,
unsigned int a2)
{
unsigned int v4; // r15d
cocos2d::CCObject *v5; // r13
cocos2d::CCScriptEngineManager *v6; // rax
unsigned int v7; // eax
cocos2d::CCDictionary *m_pDispatchTable; // rdi
intptr_t v9; // r12
cocos2d::CCObject *v10; // rax
cocos2d::CCObject_vtbl *v11; // rax
__int64 copyWithZone_low; // rcx
cocos2d::CCObject *v13; // r13
cocos2d::extension::CCInvocation **v14; // r12
unsigned __int64 v15; // r13
std::__tree_end_node *>::pointer left; // rcx
std::__compressed_pair *>> *v17; // rax
unsigned int v18; // r13d
__int64 v19; // r12
__int64 v20; // rax
__int16 v21[8]; // [rsp+8h] [rbp-58h] BYREF
void *__p; // [rsp+18h] [rbp-48h]
__int64 (__fastcall **v23)(); // [rsp+20h] [rbp-40h]
int v24; // [rsp+28h] [rbp-38h]
unsigned int v25; // [rsp+2Ch] [rbp-34h]
std::__compressed_pair *>> *p_pair1; // [rsp+30h] [rbp-30h]
p_pair1 = &a1->m_mapHandleOfControlEvent.__tree_.__pair1_;
v4 = 0;
v23 = off_1008B8348;
do
{
v7 = 1 << v4;
if ( !_bittest((const int *)&a2, v4) )
goto LABEL_3;
m_pDispatchTable = a1->m_pDispatchTable;
v24 = 1 << v4;
v9 = v7;
v10 = cocos2d::CCDictionary::objectForKey(m_pDispatchTable, v7);
if ( v10 )
{
v11 = v10[1].__vftable;
copyWithZone_low = LODWORD(v11->copyWithZone);
if ( !LODWORD(v11->copyWithZone) )
goto LABEL_13;
}
else
{
v13 = (cocos2d::CCObject *)sub_10071FD00(1);
cocos2d::CCDictionary::setObject(a1->m_pDispatchTable, v13, v9);
if ( !v13 )
goto LABEL_13;
v11 = v13[1].__vftable;
copyWithZone_low = LODWORD(v11->copyWithZone);
if ( !LODWORD(v11->copyWithZone) )
goto LABEL_13;
}
v14 = (cocos2d::extension::CCInvocation **)v11->~CCObject_0;
v15 = (unsigned __int64)&v14[copyWithZone_low - 1];
do
{
if ( !*v14 )
break;
cocos2d::extension::CCInvocation::invoke(*v14++, a1);
}
while ( (unsigned __int64)v14 <= v15 );
LABEL_13:
if ( a1->m_eScriptType )
{
left = p_pair1->__value_.__left_;
if ( p_pair1->__value_.__left_ )
{
v17 = p_pair1;
do
{
if ( *((_DWORD *)left + 7) >= (signed int)a2 )
v17 = (std::__compressed_pair *>> *)left;
left = *((std::__tree_end_node *>::pointer *)left
+ (*((_DWORD *)left + 7) < (int)a2));
}
while ( left );
if ( v17 != p_pair1 && SHIDWORD(v17[3].__value_.__left_) <= (signed int)a2 )
{
v18 = (unsigned int)v17[4].__value_.__left_;
if ( v18 != -1 )
{
v19 = sub_10071FD00(3);
v21[0] = 0;
v20 = sub_1007AB360(v21);
sub_10071FCD0(v19, v20);
v25 = v18;
if ( (v21[0] & 1) != 0 )
operator delete(__p);
sub_10071FCD0(v19, a1);
v5 = (cocos2d::CCObject *)operator new(0x40u);
cocos2d::CCObject::CCObject(v5);
v5->__vftable = (cocos2d::CCObject_vtbl *)v23;
LODWORD(v5[1].__vftable) = v24;
cocos2d::CCObject::autorelease(v5);
sub_10071FCD0(v19, v5);
v6 = cocos2d::CCScriptEngineManager::sharedManager();
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)v6 + 152LL))(*(_QWORD *)v6, v25, v19);
}
}
}
}
LABEL_3:
++v4;
}
while ( v4 != 9 );
}