//
// cocos2d::CCIMEDispatcher::attachDelegateWithIME from 0x1001d3a38 to 0x1001d3b10 (216 bytes)
//
// 1 xrefs:
// > cocos2d::CCIMEDelegate::attachWithIME @ 0x1001d3a34
//
// 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
//
bool __fastcall cocos2d::CCIMEDispatcher::attachDelegateWithIME(
cocos2d::CCIMEDispatcher *a1,
cocos2d::CCIMEDelegate *a2)
{
cocos2d::CCIMEDispatcher *v2; // x20
cocos2d::CCIMEDispatcher::Impl *m_pImpl; // x8
cocos2d::CCIMEDispatcher::Impl *v5; // x21
__int64 v6; // x0
__int64 v7; // x0
v2 = a1;
LOBYTE(a1) = 0;
if ( a2 )
{
m_pImpl = v2->m_pImpl;
if ( v2->m_pImpl )
{
v5 = v2->m_pImpl;
do
{
v5 = *((cocos2d::CCIMEDispatcher::Impl **)v5 + 1);
if ( v5 == m_pImpl )
{
LOBYTE(a1) = 0;
return (char)a1;
}
}
while ( *((cocos2d::CCIMEDelegate **)v5 + 2) != a2 );
v6 = *((_QWORD *)m_pImpl + 3);
if ( v6 )
{
LODWORD(a1) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 48LL))(v6);
if ( (_DWORD)a1 )
{
LODWORD(a1) = ((__int64 (__fastcall *)(cocos2d::CCIMEDelegate *))a2->canAttachWithIME)(a2);
if ( (_DWORD)a1 )
{
v7 = *((_QWORD *)v2->m_pImpl + 3);
*((_QWORD *)v2->m_pImpl + 3) = 0;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 56LL))(v7);
LABEL_12:
*((_QWORD *)v2->m_pImpl + 3) = *((_QWORD *)v5 + 2);
((void (__fastcall *)(cocos2d::CCIMEDelegate *))a2->didAttachWithIME)(a2);
LOBYTE(a1) = 1;
}
}
}
else
{
LODWORD(a1) = ((__int64 (__fastcall *)(cocos2d::CCIMEDelegate *))a2->canAttachWithIME)(a2);
if ( (_DWORD)a1 )
goto LABEL_12;
}
}
}
return (char)a1;
}