//
// PlayerObject::limitDashRotation from 0x1003fe2f0 to 0x1003fe49e (430 bytes)
//
// 0 xrefs:
//
// 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:30:01 +0000
//
_BOOL8 __fastcall PlayerObject::limitDashRotation(__int64 a1, float *a2)
{
float v2; // xmm0_4
__m128 v3; // xmm1
float v4; // xmm2_4
_BOOL8 result; // rax
__m128 v6; // xmm2
float v7; // xmm1_4
__m128 v8; // rt1
__m128 v9; // xmm3
__m128 v10; // xmm2
float v11; // xmm1_4
float v12; // xmm0_4
if ( *(_BYTE *)(a1 + 2427) )
{
v2 = -90.0;
if ( !*(_BYTE *)(a1 + 2426) )
goto LABEL_6;
goto LABEL_5;
}
v2 = 0.0;
if ( *(_BYTE *)(a1 + 2426) )
LABEL_5:
v2 = v2 + 180.0;
LABEL_6:
v3 = (__m128)*(unsigned int *)a2;
if ( v2 == 0.0 )
goto LABEL_12;
v3.f32[0] = v3.f32[0] + v2;
*a2 = v3.f32[0];
if ( v3.f32[0] <= 180.0 )
{
if ( v3.f32[0] >= -180.0 )
goto LABEL_12;
v4 = 360.0;
}
else
{
v4 = -360.0;
}
v3.f32[0] = v3.f32[0] + v4;
*a2 = v3.f32[0];
LABEL_12:
if ( fabs(v3.f32[0]) > 90.0 )
{
result = v3.f32[0] > 0.0;
v6 = (__m128)*((unsigned int *)&unk_100A09CC8 + result);
v6.f32[0] = v6.f32[0] - v3.f32[0];
*a2 = v6.f32[0];
if ( v6.f32[0] <= 180.0 )
{
if ( v6.f32[0] >= -180.0 )
{
LABEL_18:
v3 = v6;
goto LABEL_19;
}
v7 = 360.0;
}
else
{
v7 = -360.0;
}
v6.f32[0] = v6.f32[0] + v7;
*a2 = v6.f32[0];
goto LABEL_18;
}
LABEL_19:
if ( v3.f32[0] > 70.0 || v3.f32[0] < -70.0 )
{
if ( v3.f32[0] <= 0.0 )
{
result = v3.f32[0] > -180.0;
v3 = _mm_cmplt_ss(v3, (__m128)0x428C0000u);
v3.i32[0] = _mm_andnot_ps(v3, (__m128)0x428C0000u).u32[0] | dword_100A09CD0[result] & v3.i32[0];
}
else
{
v8.i32[0] = 1127481344;
v9 = _mm_cmplt_ss(v3, v8);
v10 = _mm_cmplt_ss((__m128)0x428C0000u, v3);
v3.i32[0] = _mm_andnot_ps(v10, (__m128)0xC28C0000).u32[0]
| (_mm_andnot_ps(v9, (__m128)0xC28C0000).u32[0] | v9.i32[0] & 0x428C0000) & v10.i32[0];
}
*a2 = v3.f32[0];
}
if ( v2 != 0.0 )
{
v11 = v3.f32[0] - v2;
*a2 = v11;
if ( v11 <= 180.0 )
{
if ( v11 >= -180.0 )
return result;
v12 = 360.0;
}
else
{
v12 = -360.0;
}
*a2 = v11 + v12;
}
return result;
}