//
// cocos2d::extension::CCControlSwitch::ccTouchBegan from 0x18000cff0 to 0x18000d0e5 (245 bytes)
//
// 3 xrefs:
// > ??> @ 0x180026650
// > ??> @ 0x18002fdf8
// > ??> @ 0x180049dc8
//
// 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
//
char __fastcall cocos2d::extension::CCControlSwitch::ccTouchBegan(
cocos2d::extension::CCControlSwitch *this,
struct cocos2d::CCTouch *a2,
struct cocos2d::CCEvent *a3)
{
char *v3; // rbx
__int64 v6; // rax
__int64 v7; // rax
float v9; // [rsp+30h] [rbp+8h] BYREF
char v10; // [rsp+48h] [rbp+20h] BYREF
v3 = (char *)this - 320;
if ( !(*(unsigned __int8 (__fastcall **)(char *, struct cocos2d::CCTouch *, struct cocos2d::CCEvent *))(*((_QWORD *)this - 40) + 1104LL))(
(char *)this - 320,
a2,
a3)
|| !(*(unsigned __int8 (__fastcall **)(char *))(*(_QWORD *)v3 + 1024LL))(v3)
|| !(*(unsigned __int8 (__fastcall **)(char *))(*(_QWORD *)v3 + 328LL))(v3) )
{
return 0;
}
*((_BYTE *)this + 164) = 0;
cocos2d::CCTouch::getLocation(a2);
v6 = cocos2d::CCNode::convertToNodeSpace(v3, &v10, &v9);
cocos2d::CCPoint::operator=(&v9, v6);
v7 = *((_QWORD *)this + 19);
*((float *)this + 40) = v9 - *(float *)(v7 + 608);
(**(void (__fastcall ***)(__int64, void *))(*(_QWORD *)(v7 + 656) + 320LL))(
*(_QWORD *)(v7 + 656) + 320LL,
&unk_1800234BC);
sub_18000C670(*((_QWORD *)this + 19));
return 1;
}