//
// cocos2d::CCIMEDispatcher::attachDelegateWithIME from 0xda0a2c to 0xda0b34 (264 bytes)
//
// 2 xrefs:
// > cocos2d::CCIMEDelegate::attachWithIME @ 0xda0f94
// > ??> @ 0xf5e48
//
// 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::attachDelegateWithIME(
cocos2d::CCIMEDispatcher *this,
cocos2d::CCIMEDelegate *a2)
{
__int64 v2; // x3
__int64 v3; // x19
__int64 v5; // x0
__int64 v8; // x1
__int64 v9; // x1
cocos2d::CCIMEDelegate *v10; // x0
__int64 v11; // x2
v2 = *(_QWORD *)this;
if ( !a2 )
return 0;
if ( !v2 )
return 0;
v3 = *(_QWORD *)(v2 + 8);
if ( v2 == v3 )
return 0;
while ( a2 != *(cocos2d::CCIMEDelegate **)(v3 + 16) )
{
v3 = *(_QWORD *)(v3 + 8);
if ( v2 == v3 )
return 0;
}
v5 = *(_QWORD *)(v2 + 24);
if ( !v5 )
{
if ( (*(unsigned __int8 (__fastcall **)(cocos2d::CCIMEDelegate *))(*(_QWORD *)a2 + 32LL))(a2) )
{
v9 = *(_QWORD *)this;
v10 = a2;
v11 = *(_QWORD *)(v3 + 16);
goto LABEL_12;
}
return 0;
}
if ( !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v5 + 48LL))(v5)
|| !(*(unsigned __int8 (__fastcall **)(cocos2d::CCIMEDelegate *))(*(_QWORD *)a2 + 32LL))(a2) )
{
return 0;
}
v8 = *(_QWORD *)(*(_QWORD *)this + 24LL);
*(_QWORD *)(*(_QWORD *)this + 24LL) = 0;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 56LL))(v8);
v9 = *(_QWORD *)this;
v10 = a2;
v11 = *(_QWORD *)(v3 + 16);
LABEL_12:
*(_QWORD *)(v9 + 24) = v11;
(*(void (__fastcall **)(cocos2d::CCIMEDelegate *))(*(_QWORD *)a2 + 40LL))(v10);
return 1;
}