//
// cocos2d::CCIMEDispatcher::addDelegate from 0xda09a4 to 0xda0a2c (136 bytes)
//
// 2 xrefs:
// > cocos2d::CCIMEDelegate::CCIMEDelegate @ 0xda1018
// > ??> @ 0x6f148
//
// 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:08:29 +0000
//
__int64 **__fastcall cocos2d::CCIMEDispatcher::addDelegate(__int64 **this, cocos2d::CCIMEDelegate *a2)
{
__int64 *v2; // x19
__int64 **v4; // x0
__int64 *v5; // x1
if ( a2 )
{
v2 = *this;
if ( *this )
{
this = (__int64 **)v2[1];
if ( v2 == (__int64 *)this )
{
LABEL_8:
v4 = (__int64 **)operator new(0x18u);
v4[2] = (__int64 *)a2;
*v4 = v2;
v5 = (__int64 *)v2[1];
v4[1] = v5;
*v5 = (__int64)v4;
v2[1] = (__int64)v4;
this = (__int64 **)(v2[2] + 1);
v2[2] = (__int64)this;
}
else
{
while ( *(this + 2) != (__int64 *)a2 )
{
this = (__int64 **)*(this + 1);
if ( v2 == (__int64 *)this )
goto LABEL_8;
}
}
}
}
return this;
}