//
// cocos2d::CCIMEDispatcher::attachDelegateWithIME from 0x1800b48e0 to 0x1800b49aa (202 bytes)
//
// 5 xrefs:
// > cocos2d::CCIMEDelegate::attachWithIME @ 0x1800b49c9
// > ??> @ 0x180141260
// > ??> @ 0x180141270
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b8928
//
// 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
//
__int64 __fastcall cocos2d::CCIMEDispatcher::attachDelegateWithIME(
cocos2d::CCIMEDispatcher *this,
struct cocos2d::CCIMEDelegate *a2)
{
unsigned __int8 v3; // si
cocos2d::CCIMEDispatcher::Impl *m_pImpl; // rcx
__int64 **v6; // rax
__int64 **v7; // rbx
__int64 v8; // rcx
__int64 v9; // rcx
v3 = 0;
m_pImpl = this->m_pImpl;
if ( m_pImpl )
{
if ( a2 )
{
v6 = *(__int64 ***)m_pImpl;
v7 = **(__int64 ****)m_pImpl;
if ( *v6 != (__int64 *)v6 )
{
while ( a2 != (struct cocos2d::CCIMEDelegate *)v7[2] )
{
v7 = (__int64 **)*v7;
if ( v7 == v6 )
return v3;
}
if ( v6 != v7 )
{
v8 = *((_QWORD *)m_pImpl + 2);
if ( v8 )
{
if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v8 + 40LL))(v8)
&& ((unsigned __int8 (__fastcall *)(struct cocos2d::CCIMEDelegate *))a2->canAttachWithIME)(a2) )
{
v9 = *((_QWORD *)this->m_pImpl + 2);
*((_QWORD *)this->m_pImpl + 2) = 0;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 48LL))(v9);
LABEL_13:
*((_QWORD *)this->m_pImpl + 2) = v7[2];
((void (__fastcall *)(struct cocos2d::CCIMEDelegate *))a2->didAttachWithIME)(a2);
return 1;
}
}
else if ( ((unsigned __int8 (__fastcall *)(struct cocos2d::CCIMEDelegate *))a2->canAttachWithIME)(a2) )
{
goto LABEL_13;
}
}
}
}
}
return v3;
}