//
// PlayerObject::redirectDash from 0x100225b50 to 0x100225cbc (364 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::teleportPlayer @ 0x1001e421c
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall PlayerObject::redirectDash(PlayerObject *a1, float a2)
{
__int64 v2; // x29
__int64 v3; // x30
__n128 v4; // q1
__int64 v5; // d8
__int64 v6; // d9
__n128 v9; // q0
float v10; // s0
float v11; // s0
__n128 v12; // q1
__n128 v13; // q0
float v14; // s8
float v15; // s9
int v16; // w8
_BOOL4 m_isSideways; // w1
float v18; // s0
double v19; // [xsp+0h] [xbp-40h] BYREF
_QWORD v20[7]; // [xsp+8h] [xbp-38h] BYREF
__float2 v21; // 0:kr00_8.8
if ( a1->m_isDashing )
{
v20[1] = v6;
v20[2] = v5;
v20[5] = v2;
v20[6] = v3;
v9.n128_u64[0] = *(_QWORD *)&a1->m_dashX;
v9.n128_f32[0] = v9.n128_f64[0];
v4.n128_u64[0] = *(_QWORD *)&a1->m_dashY;
v4.n128_f32[0] = v4.n128_f64[0];
sub_100022980(v9, v4, v20);
v10 = atan2f(*((float *)v20 + 1), *(float *)v20);
v11 = GJBaseGameLayer::convertToClosestDirection((float)(a2 * 0.017453) - v10, 3.1416);
if ( v11 != 0.0 )
{
v21 = __sincosf_stret(v11);
v12.n128_f32[0] = (float)(v21.__sinval * *(float *)v20) + (float)(*((float *)v20 + 1) * v21.__cosval);
v13.n128_f32[0] = (float)(*(float *)v20 * v21.__cosval) - (float)(*((float *)v20 + 1) * v21.__sinval);
sub_100022980(v13, v12, &v19);
sub_1000229D0(v20, &v19);
}
v14 = *((float *)v20 + 1);
v15 = *(float *)v20;
v16 = (int)(float)(atan2f(*((float *)v20 + 1), *(float *)v20) * -57.296);
m_isSideways = a1->m_isSideways;
if ( a1->m_isSideways )
v16 -= 90;
a1->m_dashAngle = (double)-(v16 % 360 + (v16 % 360 < 0 ? 0x168 : 0));
if ( m_isSideways )
{
v20[0] = __PAIR64__(LODWORD(v15), LODWORD(v14));
v18 = v15;
}
else
{
v18 = v14;
v14 = v15;
}
a1->m_dashX = v14;
a1->m_dashY = v18;
if ( v14 >= 0.0 )
{
if ( v14 <= 0.0 )
{
LABEL_13:
PlayerObject::updateDashArt(a1);
return;
}
}
else
{
LOBYTE(m_isSideways) = !m_isSideways;
}
PlayerObject::doReversePlayer(a1, m_isSideways);
goto LABEL_13;
}
}