//
// PlayerObject::boostPlayer from 0x100406530 to 0x1004066dc (428 bytes)
//
// 2 xrefs:
// > PlayerObject::postCollision @ 0x100404c17
// > PlayerObject::postCollision @ 0x100405ecd
//
// 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::boostPlayer(PlayerObject *a1, float a2)
{
__m128d v2; // xmm1
double v4; // xmm0_8
__m128d v5; // xmm3
GJSpiderSprite *m_spiderSprite; // rdi
double *v7; // rax
__m128 v8; // rt1
__int64 v9; // rax
float v10; // xmm0_4
std::string v11; // [rsp+0h] [rbp-20h] BYREF
a1->m_maybeIsBoosted = 1;
a1->m_isOnGround2 = 0;
a1->m_isOnGround = 0;
a1->m_shouldTryPlacingCheckpoint = 1;
a1->m_isAccelerating = 1;
v2.f64[0] = a2;
v4 = _mm_cvtepi32_pd(_mm_cvttps_epi32(*(__m128 *)&a2)).f64[0];
if ( v4 == v2.f64[0] )
{
a1->m_yVelocity = v2.f64[0];
if ( a1->m_isDashing )
goto LABEL_15;
}
else
{
v2.f64[0] = (v2.f64[0] - v4) * 1000.0;
v5 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v2), (__m128d)xmmword_100816960);
v5.f64[0] = v5.f64[0] + v2.f64[0];
a1->m_yVelocity = _mm_round_sd((__m128d)0LL, v5, 11).f64[0] / 1000.0 + v4;
if ( a1->m_isDashing )
goto LABEL_15;
}
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing || a1->m_isBall || a1->m_isRobot || a1->m_isSpider )
{
if ( a1->m_isSpider )
{
m_spiderSprite = a1->m_spiderSprite;
v11.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)18;
strcpy(v11.__r_.__value_.__s.__data_, "fall_loop");
CCAnimatedSprite::tweenToAnimation((__int64)m_spiderSprite, &v11, (__m128)0x3DCCCCCDu);
if ( (*(_BYTE *)&v11.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v11.__r_.__value_.__l.__data_);
}
}
else
{
a1->m_isBallRotating = 0;
v8.i32[0] = LODWORD(a1->m_vehicleSize);
v9 = _mm_cvtsi128_si32((__m128i)_mm_cmpeq_ss((__m128)0x3F800000u, v8)) & 1;
if ( a1->m_isUpsideDown )
v10 = 180.0;
else
v10 = -180.0;
a1->m_rotationSpeed = v10 / flt_10081B6E0[v9];
*(_WORD *)&a1->m_isRotating = 1;
}
LABEL_15:
v7 = (double *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
sub_10028CC90(&a1->m_lastGroundedPos, v7);
}