//
// cocos2d::CCPoint::normalize from 0x18000ccb0 to 0x18000cd3f (143 bytes)
//
// 3 xrefs:
// > cocos2d::ccpNormalize @ 0x180094152
// > ??> @ 0x1801438a8
// > ??> @ 0x1801ade64
//
// 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
//
__int64 __fastcall cocos2d::CCPoint::normalize(cocos2d::CCPoint *this, __int64 a2)
{
float x; // xmm6_4
float y; // xmm7_4
float v5; // xmm1_4
float v6; // xmm0_4
x = this->x;
y = this->y;
v5 = (float)(x * x) + (float)(y * y);
if ( v5 < 0.0 )
v6 = sqrtf(v5);
else
v6 = fsqrt(v5);
if ( v6 == 0.0 )
{
*(_QWORD *)a2 = 1065353216;
return a2;
}
else
{
*(float *)a2 = x / v6;
*(float *)(a2 + 4) = y / v6;
return a2;
}
}