//
// GJUINode::activeRangeTouchTest from 0x1004cb580 to 0x1004cb6cb (331 bytes)
//
// 3 xrefs:
// > UILayer::processUINodeTouch @ 0x1004c9f5f
// > GJUINode::touchTest @ 0x1004ca34b
// > GJUINode::activeTouchTest @ 0x1004ca499
//
// 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
//
int __fastcall GJUINode::activeRangeTouchTest(GJUINode *a1, cocos2d::CCPoint a2)
{
float *v2; // rsi
float *v3; // rax
float v4; // xmm2_4
float v5; // xmm2_4
float v6; // xmm1_4
int v7; // r14d
float m_radius; // xmm0_4
float v9; // xmm1_4
__m128 width_low; // xmm0
__m128 v11; // xmm1
__m128 v12; // xmm2
__m128 v13; // xmm3
double v15[4]; // [rsp+10h] [rbp-20h] BYREF
v3 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *, double))a1->m_firstSprite->getPosition)(
a1->m_firstSprite,
*(double *)&a2);
sub_10028CBE0((float *)v15, *v3, v2[1] + 40.0);
v4 = *v2;
v5 = v4 - *(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_firstSprite->getPosition)(a1->m_firstSprite);
v6 = fabs(v5);
v7 = 0;
if ( a1->m_deadzone <= v6 )
{
m_radius = a1->m_radius;
if ( v6 > m_radius )
{
v9 = *v2;
if ( v5 <= 0.0 )
*(float *)v15 = m_radius + v9;
else
*(float *)v15 = v9 - m_radius;
}
v7 = (v5 > 0.0) | 2;
}
width_low = (__m128)LODWORD(a1->m_rect.size.width);
v11 = (__m128)0x3F000000u;
v12 = width_low;
v12.f32[0] = width_low.f32[0] * 0.5;
v11.f32[0] = 0.5 * a1->m_rect.size.height;
v13 = (__m128)0x42200000u;
v13.f32[0] = v11.f32[0] + 40.0;
width_low.f32[0] = width_low.f32[0] * -0.5;
_mm_storel_ps(
v15,
_mm_max_ps(
_mm_min_ps((__m128)*(unsigned __int64 *)&v15[0], _mm_insert_ps(v12, v13, 16)),
_mm_blend_ps(_mm_sub_ps((__m128)xmmword_10081D8A0, _mm_moveldup_ps(v11)), width_low, 13)));
((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_firstSprite->setVisible)(a1->m_firstSprite, 1);
((void (__fastcall *)(cocos2d::CCSprite *, double *))a1->m_firstSprite->setPosition)(a1->m_firstSprite, v15);
return v7;
}