//
// cocos2d::CCIMEDelegate::detachWithIME from 0x1004b52d0 to 0x1004b539b (203 bytes)
//
// 5 xrefs:
// > cocos2d::CCTextFieldTTF::detachWithIME @ 0x10026896d
// > sub_1002689A0 @ 0x1002689a6
// > ??> @ 0x100aba428
// > ??> @ 0x100b52940
// > ??> @ 0x100b57df8
//
// 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::detachWithIME(__int64 a1)
{
_QWORD *v2; // rax
if ( !(_BYTE)byte_100BE41A0 && __cxa_guard_acquire(&byte_100BE41A0) )
{
v2 = operator new(0x20u);
*v2 = v2;
v2[1] = v2;
v2[2] = 0;
qword_100BE4198 = (__int64)v2;
v2[3] = 0;
__cxa_atexit(func, &qword_100BE4198, (void *)&_mh_execute_header);
__cxa_guard_release(&byte_100BE41A0);
}
if ( qword_100BE4198 == 0
|| a1 == 0
|| *(_QWORD *)(qword_100BE4198 + 24) != a1
|| !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 48LL))(a1) )
{
return 0;
}
*(_QWORD *)(qword_100BE4198 + 24) = 0;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 56LL))(a1);
return 1;
}