//
// cocos2d::CCIMEDelegate::attachWithIME from 0x1004b50e0 to 0x1004b5204 (292 bytes)
//
// 5 xrefs:
// > cocos2d::CCTextFieldTTF::attachWithIME @ 0x1002688ed
// > sub_100268920 @ 0x100268926
// > ??> @ 0x100aba420
// > ??> @ 0x100b52938
// > ??> @ 0x100b57df0
//
// 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::CCIMEDelegate::attachWithIME(__int64 a1)
{
__int64 v2; // r14
__int64 v3; // rdi
__int64 v4; // rdi
_QWORD *v6; // rax
if ( !(_BYTE)byte_100BE41A0 && __cxa_guard_acquire(&byte_100BE41A0) )
{
v6 = operator new(0x20u);
*v6 = v6;
v6[1] = v6;
v6[2] = 0;
qword_100BE4198 = (__int64)v6;
v6[3] = 0;
__cxa_atexit(func, &qword_100BE4198, (void *)&_mh_execute_header);
__cxa_guard_release(&byte_100BE41A0);
}
if ( qword_100BE4198 != 0 && a1 != 0 )
{
v2 = qword_100BE4198;
do
{
v2 = *(_QWORD *)(v2 + 8);
if ( v2 == qword_100BE4198 )
return 0;
}
while ( *(_QWORD *)(v2 + 16) != a1 );
v3 = *(_QWORD *)(qword_100BE4198 + 24);
if ( !v3 )
{
if ( !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 32LL))(a1) )
return 0;
goto LABEL_11;
}
if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v3 + 48LL))(v3)
&& (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 32LL))(a1) )
{
v4 = *(_QWORD *)(qword_100BE4198 + 24);
*(_QWORD *)(qword_100BE4198 + 24) = 0;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 56LL))(v4);
LABEL_11:
*(_QWORD *)(qword_100BE4198 + 24) = *(_QWORD *)(v2 + 16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 40LL))(a1);
return 1;
}
}
return 0;
}