//
// GJUINode::activeRangeTouchTest from 0x10004b040 to 0x10004b18c (332 bytes)
//
// 1 xrefs:
// > GJUINode::activeTouchTest @ 0x10004a78c
//
// 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
//
// local variable allocation has failed, the output may be wrong!
int __fastcall GJUINode::activeRangeTouchTest(GJUINode *a1, cocos2d::CCPoint a2)
{
float *v2; // x1
float *v3; // x20
__n128 v5; // q0
__n128 v6; // q1
float v7; // s8
float *v8; // x0
float32x2_t v9; // d0
float v10; // s2
int v11; // w20
float v12; // s0
float m_radius; // s1
float v14; // s2
float v15; // s1
float32x2_t v16; // d2
float32x2_t v17; // d3
float32x2_t v18; // d0
int8x8_t v20; // [xsp+8h] [xbp-38h] BYREF
v3 = v2;
v5.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCSprite *, __n128, __n128))a1->m_firstSprite->getPosition)(
a1->m_firstSprite,
*(__n128 *)&a2.x,
*(__n128 *)&a2.y);
v6.n128_f32[0] = v3[1] + 40.0;
sub_100022980(v5, v6, &v20);
v7 = *v3;
v8 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_firstSprite->getPosition)(a1->m_firstSprite);
v10 = vabds_f32(v7, *v8);
if ( v10 >= a1->m_deadzone )
{
v12 = v7 - *v8;
m_radius = a1->m_radius;
if ( v10 > m_radius )
{
v14 = *v3;
if ( v12 <= 0.0 )
v15 = m_radius + v14;
else
v15 = v14 - m_radius;
*(float *)v20.i32 = v15;
}
if ( v12 <= 0.0 )
v11 = 2;
else
v11 = 3;
}
else
{
v11 = 0;
}
v9.i32[0] = LODWORD(a1->m_rect.size.width);
v16.f32[0] = v9.f32[0] * 0.5;
v17.f32[0] = vmul_f32(v9, (float32x2_t)0xBF000000BF000000LL).f32[0];
v9.f32[1] = a1->m_rect.size.height * 0.5;
v17.i32[1] = vsub_f32((float32x2_t)vdup_n_s32(0x42200000u), v9).i32[1];
v16.f32[1] = v9.f32[1] + 40.0;
v18 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v16, (float32x2_t)v20), v20, (int8x8_t)v16);
v20 = vbsl_s8((int8x8_t)vcgt_f32(v18, v17), (int8x8_t)v18, (int8x8_t)v17);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_firstSprite->setVisible)(a1->m_firstSprite, 1);
((void (__fastcall *)(cocos2d::CCSprite *, int8x8_t *))a1->m_firstSprite->setPosition)(a1->m_firstSprite, &v20);
return v11;
}