//
// cocos2d::CCTouchHandler::handlerWithDelegate from 0x1800b7a60 to 0x1800b7b4e (238 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2ab4
//
// 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 11:22:22 +0000
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCTouchHandler *__fastcall cocos2d::CCTouchHandler::handlerWithDelegate(
struct cocos2d::CCTouchDelegate *a1,
int a2)
{
__int64 v4; // rbx
bool (__fastcall *v5)(cocos2d::CCTouchHandler *__hidden, struct cocos2d::CCTouchDelegate *, int); // r9
cocos2d::CCObject *v6; // rax
v4 = sub_1800E4AC0(0x48u);
if ( v4 )
{
*(_OWORD *)v4 = 0;
*(_OWORD *)(v4 + 16) = 0;
*(_OWORD *)(v4 + 32) = 0;
*(_OWORD *)(v4 + 48) = 0;
*(_QWORD *)(v4 + 64) = 0;
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v4);
*(_QWORD *)v4 = &cocos2d::CCTouchHandler::`vftable';
}
else
{
v4 = 0;
}
if ( !v4 )
return (struct cocos2d::CCTouchHandler *)v4;
v5 = *(bool (__fastcall **)(cocos2d::CCTouchHandler *__hidden, struct cocos2d::CCTouchDelegate *, int))(*(_QWORD *)v4 + 72LL);
if ( v5 == cocos2d::CCTouchHandler::initWithDelegate )
{
*(_QWORD *)(v4 + 56) = a1;
v6 = (cocos2d::CCObject *)_RTDynamicCast(
a1,
0,
&cocos2d::CCTouchDelegate `RTTI Type Descriptor',
&cocos2d::CCObject `RTTI Type Descriptor',
0);
cocos2d::CCObject::retain(v6);
*(_DWORD *)(v4 + 64) = a2;
*(_DWORD *)(v4 + 68) = 0;
LABEL_8:
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v4);
return (struct cocos2d::CCTouchHandler *)v4;
}
if ( v5((cocos2d::CCTouchHandler *)v4, a1, a2) )
goto LABEL_8;
cocos2d::CCObject::release((cocos2d::CCObject *)v4);
return nullptr;
}