//
// cocos2d::ccpIntersectPoint from 0x100341ce0 to 0x100341df6 (278 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::updateGroundShadows @ 0x1000f10fb
// > GJBaseGameLayer::updateGroundShadows @ 0x1000f1125
// > GJBaseGameLayer::updateGroundShadows @ 0x1000f1149
// > GJBaseGameLayer::updateGroundShadows @ 0x1000f116d
//
// 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:28:44 +0000
//
double *__fastcall cocos2d::ccpIntersectPoint(double *a1, float *a2, float *a3, float *a4, float *a5)
{
float v5; // xmm1_4
float v6; // xmm4_4
__m128 v7; // xmm7
float v8; // 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
v5 = *a2;
if ( *a2 == *a3 && a2[1] == a3[1] )
goto LABEL_10;
v6 = *a4;
v7 = (__m128)*(unsigned int *)a5;
if ( *a4 != v7.f32[0] )
{
v9 = a5[1];
v8 = a4[1];
LABEL_7:
v10 = *a3 - v5;
v11 = a2[1];
v12 = a3[1] - v11;
v13 = v7.f32[0] - v6;
v14 = v9 - v8;
v15 = v5 - v6;
v16 = v11 - v8;
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_1002782A0(a1);
_mm_storel_ps(
a1,
_mm_add_ps(
_mm_mul_ps(_mm_moveldup_ps(v7), _mm_sub_ps((__m128)*(unsigned __int64 *)a3, (__m128)*(unsigned __int64 *)a2)),
(__m128)*(unsigned __int64 *)a2));
return a1;
}
v8 = a4[1];
v9 = a5[1];
if ( v8 != v9 )
goto LABEL_7;
LABEL_10:
sub_1002782D0(a1, &qword_100BE2DD0);
return a1;
}