//
// cocos2d::CCIMEDispatcher::addDelegate from 0xb2f624 to 0xb2f6a8 (132 bytes)
//
// 2 xrefs:
// > cocos2d::CCIMEDelegate::CCIMEDelegate @ 0xb2fc90
// > ??> @ 0x4f800
//
// 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 cocos2d::CCIMEDispatcher::addDelegate(cocos2d::CCIMEDispatcher *a1, cocos2d::CCIMEDelegate *a2)
{
cocos2d::CCIMEDispatcher::Impl *m_pImpl; // x3
cocos2d::CCIMEDelegate **v3; // x0
_QWORD *v5; // x0
if ( a2 )
{
m_pImpl = a1->m_pImpl;
if ( a1->m_pImpl )
{
if ( m_pImpl != *(cocos2d::CCIMEDispatcher::Impl **)m_pImpl )
{
if ( *(cocos2d::CCIMEDelegate **)(*(_QWORD *)m_pImpl + 16LL) == a2 )
return;
v3 = *(cocos2d::CCIMEDelegate ***)m_pImpl;
while ( 1 )
{
v3 = (cocos2d::CCIMEDelegate **)*v3;
if ( m_pImpl == (cocos2d::CCIMEDispatcher::Impl *)v3 )
break;
if ( v3[2] == a2 )
return;
}
}
v5 = (_QWORD *)operator new(0x18u);
v5[2] = a2;
*v5 = 0;
v5[1] = 0;
sub_CD8D88();
}
}
}