//
// cocos2d::CCIMEDispatcher::attachDelegateWithIME from 0x1004b5220 to 0x1004b52c1 (161 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: pc, 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 12:31:00 +0000
//
char __fastcall cocos2d::CCIMEDispatcher::attachDelegateWithIME(__int64 *a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // rbx
__int64 v5; // rdi
__int64 v6; // rdi
v2 = *a1;
if ( *a1 == 0 || a2 == 0 )
return 0;
v3 = *a1;
do
{
v3 = *(_QWORD *)(v3 + 8);
if ( v3 == v2 )
return 0;
}
while ( *(_QWORD *)(v3 + 16) != a2 );
v5 = *(_QWORD *)(v2 + 24);
if ( v5 )
{
if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v5 + 48LL))(v5)
&& (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a2 + 32LL))(a2) )
{
v6 = *(_QWORD *)(*a1 + 24);
*(_QWORD *)(*a1 + 24) = 0;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 56LL))(v6);
LABEL_11:
*(_QWORD *)(*a1 + 24) = *(_QWORD *)(v3 + 16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 40LL))(a2);
return 1;
}
}
else if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a2 + 32LL))(a2) )
{
goto LABEL_11;
}
return 0;
}