//
// UIOptionsLayer::ccTouchBegan from 0xa2ee94 to 0xa2effc (360 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'UIOptionsLayer::ccTouchBegan @ 0xa2f000
// > ??> @ 0x9dd80
// > ??> @ 0x14842a0
//
// 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 12:59:46 +0000
//
__int64 __fastcall UIOptionsLayer::ccTouchBegan(cocos2d::CCNode *a1, cocos2d::CCTouch *this)
{
int v4; // w19
int v5; // w22
cocos2d::CCNode *Node; // x20
long double v7; // q0
__int64 v8; // x0
long double v9; // q0
int v11; // w0
__int64 v12; // [xsp+60h] [xbp+60h] BYREF
__int64 v13; // [xsp+68h] [xbp+68h] BYREF
__int64 v14; // [xsp+70h] [xbp+70h] BYREF
v4 = 0;
cocos2d::CCTouch::getLocation(&v12, this);
cocos2d::CCNode::convertToNodeSpace(&v13, a1, (const cocos2d::CCPoint *)&v12);
if ( *((_BYTE *)a1 + 1012) )
v5 = 4;
else
v5 = 1;
while ( 1 )
{
Node = (cocos2d::CCNode *)UIOptionsLayer::getNode(a1, v4);
if ( (*(unsigned __int8 (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)Node + 352LL))(Node) )
{
cocos2d::CCNode::convertToNodeSpace(&v14, Node, (const cocos2d::CCPoint *)&v12);
if ( (unsigned int)GJUINode::touchTest(Node, (const cocos2d::CCPoint *)&v14) )
break;
}
if ( ++v4 == v5 )
return 1;
}
if ( *((_BYTE *)a1 + 1012) )
{
v11 = (*(__int64 (__fastcall **)(cocos2d::CCNode *))(*(_QWORD *)Node + 64LL))(Node);
UIOptionsLayer::toggleUIGroup(a1, v11);
}
*((_DWORD *)Node + 88) = *((_DWORD *)this + 14);
*(__n128 *)&v7 = cocos2d::CCPoint::operator=((char *)Node + 364, &v13);
v8 = (*(__int64 (__fastcall **)(cocos2d::CCNode *, long double))(*(_QWORD *)Node + 192LL))(Node, v7);
cocos2d::CCPoint::operator-(&v14, &v13, v8, v9);
cocos2d::CCPoint::operator=((char *)Node + 356, &v14);
return 1;
}