//
// cocos2d::extension::CCControlSwitch::ccTouchCancelled from 0xd11c34 to 0xd11d04 (208 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'cocos2d::extension::CCControlSwitch::ccTouchCancelled @ 0xd11d08
// > ??> @ 0xfaa98
// > ??> @ 0x150d288
//
// This function is hookable on this platform (idp: arm, 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 13:07:03 +0000
//
__int64 __fastcall cocos2d::extension::CCControlSwitch::ccTouchCancelled(__int64 a1, cocos2d::CCTouch *a2)
{
float v4; // s8
float *v5; // x0
__int64 v6; // [xsp+30h] [xbp+30h] BYREF
cocos2d::extension::CCControlSwitch::locationFromTouch((cocos2d::extension::CCControlSwitch *)a1, a2, &v6);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(*(_QWORD *)(a1 + 472) + 656LL) + 960LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 472) + 656LL),
&unk_11A60B8);
if ( *(_BYTE *)(a1 + 484) )
{
v4 = *(float *)&v6;
v5 = (float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 472) + 328LL))(*(_QWORD *)(a1 + 472));
cocos2d::extension::CCControlSwitch::setOn((cocos2d::extension::CCControlSwitch *)a1, v4 >= (float)(*v5 * 0.5), 1);
}
else
{
cocos2d::extension::CCControlSwitch::setOn((cocos2d::extension::CCControlSwitch *)a1, *(_BYTE *)(a1 + 485) ^ 1, 1);
}
return _stack_chk_guard;
}