//
// GJUINode::touchTest from 0x1004c5920 to 0x1004c5a64 (324 bytes)
//
// 2 xrefs:
// > UIOptionsLayer::ccTouchBegan @ 0x1002a2c2d
// > UILayer::processUINodeTouch @ 0x1004c56e0
//
// 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 12:31:07 +0000
//
unsigned __int64 __fastcall GJUINode::touchTest(__int64 a1, float *a2)
{
bool v2; // cl
unsigned __int64 result; // rax
__int64 v4; // r14
unsigned __int64 v5; // [rsp+0h] [rbp-40h] BYREF
__int64 v6; // [rsp+8h] [rbp-38h] BYREF
unsigned __int64 v7[6]; // [rsp+10h] [rbp-30h] BYREF
v2 = sub_100278940((float *)(a1 + 336), a2);
result = 0;
if ( v2 )
{
result = 1;
if ( !*(_BYTE *)(a1 + 386) )
{
if ( *(_BYTE *)(a1 + 381) == 1 && (*(_BYTE *)(a1 + 382) || !*(_BYTE *)(a1 + 383)) )
{
sub_1002782D0(&v5, a2);
v4 = *(_QWORD *)(a1 + 320);
sub_100278250((float *)v7, 0.0, 40.0);
sub_100278350((double *)&v6, &v5, v7);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v4 + 184LL))(v4, &v6);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 320) + 344LL))(*(_QWORD *)(a1 + 320), 1);
*(_BYTE *)(a1 + 383) = 1;
return 5;
}
else
{
sub_1002782D0(v7, a2);
if ( *(_BYTE *)(a1 + 381) )
{
sub_1002782D0(&v6, v7);
return GJUINode::activeRangeTouchTest(a1, &v6);
}
else
{
result = 5;
if ( *(float *)(a1 + 376) <= fabs(*(float *)v7) )
return ((LODWORD(v7[0]) | 0x300000000LL) - (unsigned __int64)COERCE_UNSIGNED_INT(0.0)) >> 32;
}
}
}
}
return result;
}