//
// cocos2d::CCIMEDispatcher::sharedDispatcher from 0x1800b4d80 to 0x1800b4e47 (199 bytes)
//
// 16 xrefs:
// > cocos2d::CCEGLView::onGLFWCharCallback @ 0x18007756f
// > cocos2d::CCEGLView::onGLFWCharCallback @ 0x180077581
// > sub_1800775B0 @ 0x1800775c7
// > sub_1800775B0 @ 0x1800775d9
// > cocos2d::CCEGLView::performSafeClipboardPaste @ 0x180077eee
// > cocos2d::CCEGLView::performSafeClipboardPaste @ 0x180077fca
// > cocos2d::CCEGLView::pumpRawInput @ 0x1800783fb
// > cocos2d::CCEGLView::pumpRawInput @ 0x180078425
// > cocos2d::CCEGLView::pumpRawInput @ 0x180078438
// > cocos2d::CCEGLView::pumpRawInput @ 0x18007845d
// > cocos2d::CCIMEDelegate::CCIMEDelegate @ 0x1800b45f3
// > cocos2d::CCIMEDelegate::~CCIMEDelegate @ 0x1800b4693
// > cocos2d::CCIMEDelegate::attachWithIME @ 0x1800b49b9
// > cocos2d::CCIMEDelegate::detachWithIME @ 0x1800b4a3d
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b8a18
//
// 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
//
// Hidden C++ exception states: #wind=2
struct cocos2d::CCIMEDispatcher *__fastcall cocos2d::CCIMEDispatcher::sharedDispatcher()
{
_QWORD *v1; // rax
_QWORD *v2; // rbx
_QWORD *v3; // rax
if ( dword_1801A9AF8 <= *(_DWORD *)(*((_QWORD *)NtCurrentTeb()->ThreadLocalStoragePointer + (unsigned int)TlsIndex)
+ 4LL) )
return (struct cocos2d::CCIMEDispatcher *)&qword_1801A9AF0;
Init_thread_header(&dword_1801A9AF8);
if ( dword_1801A9AF8 != -1 )
return (struct cocos2d::CCIMEDispatcher *)&qword_1801A9AF0;
v1 = operator new(0x18u);
v2 = v1;
if ( v1 )
{
*v1 = 0;
v1[1] = 0;
v3 = operator new(0x18u);
*v3 = v3;
v3[1] = v3;
*v2 = v3;
}
else
{
v2 = nullptr;
}
qword_1801A9AF0 = v2;
v2[2] = 0;
atexit(sub_1800E3D60);
Init_thread_footer(&dword_1801A9AF8);
return (struct cocos2d::CCIMEDispatcher *)&qword_1801A9AF0;
}