//
// sub_1800B6640 from 0x1800b6640 to 0x1800b66cd (141 bytes)
//
// 2 xrefs:
// > ??> @ 0x180106dd0
// > ??> @ 0x1801b8b5c
//
// 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
cocos2d::CCObject *__fastcall sub_1800B6640(cocos2d::CCObject *this, char a2)
{
_QWORD *v4; // rax
this->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCTouchScriptHandlerEntry::`vftable';
if ( *((_DWORD *)this + 14) )
{
v4 = qword_1801A9B00;
if ( !qword_1801A9B00 )
{
v4 = operator new(8u);
if ( v4 )
*v4 = 0;
qword_1801A9B00 = v4;
}
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*v4 + 24LL))(*v4, *((unsigned int *)this + 14));
*((_DWORD *)this + 14) = 0;
}
this->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCScriptHandlerEntry::`vftable';
cocos2d::CCObject::~CCObject(this);
if ( (a2 & 1) != 0 )
j_j_free_0(this);
return this;
}