//
// cocos2d::extension::CCControl::addHandleOfControlEvent from 0xd0be50 to 0xd0bf60 (272 bytes)
//
// 1 xrefs:
// > ??> @ 0xa34b0
//
// This function is hookable on this platform (idp: arm, 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 13:07:00 +0000
//
__int64 __fastcall cocos2d::extension::CCControl::addHandleOfControlEvent(
cocos2d::extension::CCControl *this,
int a2,
signed int a3)
{
__int64 **v4; // x22
__int64 v6; // x19
int v7; // w0
bool v8; // cc
__int64 v9; // x0
int v10; // w0
__int64 *v11; // x1
__int64 v12; // x0
char *v15; // [xsp+50h] [xbp+50h]
v4 = (__int64 **)((char *)this + 456);
v6 = *((_QWORD *)this + 57);
if ( v6 )
{
v7 = *(_DWORD *)(v6 + 28);
v8 = a3 <= v7;
if ( a3 >= v7 )
goto LABEL_5;
while ( 1 )
{
v9 = *(_QWORD *)v6;
if ( !*(_QWORD *)v6 )
break;
while ( 1 )
{
v6 = v9;
v10 = *(_DWORD *)(v9 + 28);
v8 = a3 <= v10;
if ( a3 < v10 )
break;
LABEL_5:
if ( v8 )
goto LABEL_12;
v9 = *(_QWORD *)(v6 + 8);
if ( !v9 )
{
v15 = (char *)v6;
v4 = (__int64 **)(v6 + 8);
goto LABEL_9;
}
}
}
v15 = (char *)v6;
v4 = (__int64 **)v6;
}
else
{
v15 = (char *)this + 456;
}
LABEL_9:
v6 = operator new(0x28u);
v11 = (__int64 *)v6;
*(_QWORD *)v6 = 0;
*(_QWORD *)(v6 + 28) = (unsigned int)a3;
*(_QWORD *)(v6 + 8) = 0;
*(_QWORD *)(v6 + 16) = v15;
*v4 = (__int64 *)v6;
v12 = **((_QWORD **)this + 56);
if ( v12 )
{
*((_QWORD *)this + 56) = v12;
v11 = *v4;
}
std::__tree_balance_after_insert *>(*((__int64 **)this + 57), v11);
++*((_QWORD *)this + 58);
LABEL_12:
*(_DWORD *)(v6 + 32) = a2;
return _stack_chk_guard;
}