//
// cocos2d::extension::CCControl::addHandleOfControlEvent from 0x7a6ba4 to 0x7a6c46 (162 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:59:58 +0000
//
_DWORD *__fastcall cocos2d::extension::CCControl::addHandleOfControlEvent(_DWORD *this, int a2, signed int a3)
{
_DWORD *v4; // r6
_DWORD *v6; // r3
signed int v7; // r2
_DWORD *v8; // r4
_DWORD *v9; // r4
_DWORD *v10; // r5
_DWORD *v11; // r0
int v12; // r3
int v13; // r3
_DWORD v14[3]; // [sp+0h] [bp-Ch] BYREF
v14[0] = this;
v14[1] = a2;
v14[2] = a3;
v4 = this;
v6 = (_DWORD *)*(this + 87);
if ( v6 )
{
while ( 1 )
{
v7 = v6[4];
if ( a3 >= v7 )
{
if ( v7 >= a3 )
{
v14[0] = v6;
v9 = v14;
goto LABEL_11;
}
v8 = (_DWORD *)v6[1];
if ( !v8 )
{
v14[0] = v6;
v9 = v6 + 1;
goto LABEL_11;
}
}
else
{
v8 = (_DWORD *)*v6;
if ( !*v6 )
{
v14[0] = v6;
v9 = v6;
goto LABEL_11;
}
}
v6 = v8;
}
}
v9 = this + 87;
v14[0] = this + 87;
LABEL_11:
v10 = (_DWORD *)*v9;
if ( !*v9 )
{
v11 = (_DWORD *)operator new(0x18u);
v11[5] = 0;
v10 = v11;
*v11 = 0;
v11[1] = 0;
v12 = v14[0];
v11[4] = a3;
v11[2] = v12;
*v9 = v11;
v13 = *(_DWORD *)v4[86];
if ( v13 )
v4[86] = v13;
this = std::__tree_balance_after_insert *>((_DWORD *)v4[87], (_DWORD *)*v9);
++v4[88];
}
v10[5] = a2;
return this;
}