//
// cocos2d::extension::CCControl::addHandleOfControlEvent from 0x100352790 to 0x100352851 (193 bytes)
//
// 0 xrefs:
//
// 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::addHandleOfControlEvent(__int64 a1, int a2, int a3)
{
_QWORD *v4; // rax
_QWORD *v5; // r13
_QWORD *v6; // r15
_QWORD *v7; // rbx
__int64 v8; // rax
v4 = *(_QWORD **)(a1 + 456);
if ( v4 )
{
while ( 1 )
{
while ( 1 )
{
v6 = v4;
if ( *((_DWORD *)v4 + 7) <= a3 )
break;
v4 = (_QWORD *)*v4;
v5 = v6;
if ( !*v6 )
goto LABEL_8;
}
if ( *((_DWORD *)v4 + 7) >= a3 )
break;
v4 = (_QWORD *)v4[1];
if ( !v4 )
{
v5 = v6 + 1;
goto LABEL_8;
}
}
}
else
{
v5 = (_QWORD *)(a1 + 456);
v6 = (_QWORD *)(a1 + 456);
LABEL_8:
v7 = v6;
v6 = operator new(0x28u);
*((_DWORD *)v6 + 7) = a3;
*((_DWORD *)v6 + 8) = 0;
*(_OWORD *)v6 = 0;
v6[2] = v7;
*v5 = v6;
v8 = **(_QWORD **)(a1 + 448);
if ( v8 )
*(_QWORD *)(a1 + 448) = v8;
sub_100054DD0(*(__int64 **)(a1 + 456), v6);
++*(_QWORD *)(a1 + 464);
}
*((_DWORD *)v6 + 8) = a2;
}