//
// cocos2d::ccpIntersectPoint from 0x1003565d0 to 0x1003566e6 (278 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::updateGroundShadows @ 0x100114e5b
// > GJBaseGameLayer::updateGroundShadows @ 0x100114e85
// > GJBaseGameLayer::updateGroundShadows @ 0x100114ea9
// > GJBaseGameLayer::updateGroundShadows @ 0x100114ecd
//
// 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
//
cocos2d::CCPoint __fastcall cocos2d::ccpIntersectPoint(
const cocos2d::CCPoint *a1,
const cocos2d::CCPoint *a2,
const cocos2d::CCPoint *a3,
const cocos2d::CCPoint *a4)
{
float *v4; // r8
float x; // xmm1_4
float v6; // xmm4_4
__m128 v7; // xmm7
float y; // xmm6_4
float v9; // xmm2_4
float v10; // xmm0_4
float v11; // xmm3_4
float v12; // xmm5_4
float v13; // xmm7_4
float v14; // xmm2_4
float v15; // xmm1_4
float v16; // xmm3_4
float v17; // xmm6_4
float v18; // xmm2_4
__m128 v19; // xmm0
x = a2->x;
if ( a2->x == a3->x && a2->y == a3->y )
goto LABEL_10;
v6 = a4->x;
v7 = (__m128)*(unsigned int *)v4;
if ( a4->x != v7.f32[0] )
{
v9 = v4[1];
y = a4->y;
LABEL_7:
v10 = a3->x - x;
v11 = a2->y;
v12 = a3->y - v11;
v13 = v7.f32[0] - v6;
v14 = v9 - y;
v15 = x - v6;
v16 = v11 - y;
v17 = v15 * v14;
v18 = (float)(v14 * v10) - (float)(v12 * v13);
v7.f32[0] = (float)(v13 * v16) - v17;
if ( v18 == 0.0 )
{
if ( v7.f32[0] != 0.0 && (float)((float)(v10 * v16) - (float)(v15 * v12)) != 0.0 )
goto LABEL_10;
}
else
{
v7.f32[0] = v7.f32[0] / v18;
}
sub_10028CC30(a1);
v19 = (__m128)*a2;
_mm_storel_ps(
(double *)a1,
_mm_add_ps(_mm_mul_ps(_mm_moveldup_ps(v7), _mm_sub_ps((__m128)*(_QWORD *)a3, v19)), v19));
return *(cocos2d::CCPoint *)v19.f32;
}
y = a4->y;
v9 = v4[1];
if ( y != v9 )
goto LABEL_7;
LABEL_10:
*(double *)v19.i64 = sub_10028CC60(a1, &dbl_1009A0B50);
return *(cocos2d::CCPoint *)v19.f32;
}