//
// PlayerObject::redirectDash from 0x100410ac0 to 0x100410c71 (433 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::teleportPlayer @ 0x10012102b
//
// 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
//
void __fastcall PlayerObject::redirectDash(PlayerObject *a1, float a2)
{
float m_dashX; // xmm0_4
float m_dashY; // xmm1_4
float v4; // xmm0_4
__m128 v5; // xmm0
float v6; // xmm3_4
int v7; // ecx
char m_isSideways; // al
int v9; // edx
int v10; // ecx
float v11; // xmm2_4
float v12; // xmm0_4
double v13; // [rsp-30h] [rbp-30h] BYREF
float v14; // [rsp-28h] [rbp-28h]
unsigned __int64 v15; // [rsp-24h] [rbp-24h] BYREF
float v16; // [rsp-1Ch] [rbp-1Ch]
if ( a1->m_isDashing )
{
v16 = a2;
m_dashX = a1->m_dashX;
m_dashY = a1->m_dashY;
sub_10028CBE0((float *)&v15, m_dashX, m_dashY);
v16 = v16 * 0.017453292;
v4 = atan2f(*((float *)&v15 + 1), *(float *)&v15);
v5.i64[1] = 0;
v5.f32[0] = GJBaseGameLayer::convertToClosestDirection(v16 - v4, 3.1415927);
if ( v5.f32[0] != 0.0 )
{
*(__float2 *)v5.f32 = __sincosf_stret(v5.f32[0]);
v6 = _mm_movehdup_ps(v5).f32[0];
sub_10028CBE0(
(float *)&v13,
(float)(*(float *)&v15 * v6) - (float)(v5.f32[0] * *((float *)&v15 + 1)),
(float)(*((float *)&v15 + 1) * v6) + (float)(v5.f32[0] * *(float *)&v15));
sub_10028CC90(&v15, &v13);
}
v16 = *((float *)&v15 + 1);
LODWORD(v14) = v15;
v7 = (int)(float)(atan2f(*((float *)&v15 + 1), *(float *)&v15) * -57.29578);
m_isSideways = a1->m_isSideways;
v9 = v7 - 90;
if ( !m_isSideways )
v9 = v7;
v10 = v9 % 360 + 360;
if ( v9 % 360 >= 0 )
v10 = v9 % 360;
a1->m_dashAngle = (double)-v10;
if ( m_isSideways == 1 )
{
v11 = v16;
v15 = __PAIR64__(LODWORD(v14), LODWORD(v16));
v12 = v14;
}
else
{
v12 = v16;
v11 = v14;
}
a1->m_dashX = v11;
a1->m_dashY = v12;
if ( v11 >= 0.0 )
{
if ( v11 <= 0.0 )
{
LABEL_15:
PlayerObject::updateDashArt(a1);
return;
}
}
else
{
m_isSideways ^= 1u;
}
PlayerObject::doReversePlayer(a1, m_isSideways);
goto LABEL_15;
}
}