// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/Simulator.cpp
// Function: Simulator::Player::Dash(double, int)
void Simulator::Player::Dash(double power, int dir_idx) {
  power = GetNormalizeDashPower(power);

  AngleDeg dir = Dasher::DASH_DIR[dir_idx];
  double dir_rate = Dasher::DIR_RATE[dir_idx];
  ;

  bool back_dash = power < 0.0;

  double power_need = (back_dash ? power * -2.0 : power);
  power_need = std::min(
      power_need,
      mStamina +
          PlayerParam::instance().HeteroPlayer(mPlayerType).extraStamina());
  mStamina = std::max(0.0, mStamina - power_need);

  power = (back_dash ? power_need / -2.0 : power_need);

  double acc = std::fabs(
      mEffort * power * dir_rate *
      PlayerParam::instance().HeteroPlayer(mPlayerType).dashPowerRate());

  if (back_dash) {
    dir += 180.0;
  }

  mVel += Polar2Vector(acc, GetNormalizeAngleDeg(mBodyDir + dir));
  Step();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl %esi, %r14d
movsd %xmm0, -0x30(%rbp)
movq %rdi, %rbx
callq 0x4a75c
movq %rax, %r15
callq 0x4a75c
movsd 0x33c0(%rax), %xmm0
movsd -0x30(%rbp), %xmm1
maxsd 0x33c8(%r15), %xmm1
minsd %xmm1, %xmm0
movslq %r14d, %rax
leaq 0x41c13(%rip), %rcx     # 0x8de18
movsd (%rcx,%rax,8), %xmm1
movapd %xmm1, -0x60(%rbp)
leaq 0x41c62(%rip), %rcx     # 0x8de78
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movapd %xmm0, -0x50(%rbp)
ja 0x4c22c
movsd %xmm0, -0x20(%rbp)
jmp 0x4c23d
movsd 0x1ee4c(%rip), %xmm1    # 0x6b080
mulsd %xmm0, %xmm1
movsd %xmm1, -0x20(%rbp)
movsd (%rcx,%rax,8), %xmm0
movaps %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x28(%rbx), %xmm0
movapd %xmm0, -0x40(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movapd -0x40(%rbp), %xmm1
addsd 0x3050(%rax,%rcx), %xmm1
minsd -0x20(%rbp), %xmm1
xorps %xmm0, %xmm0
cvtsi2sdl 0x28(%rbx), %xmm0
movapd %xmm1, -0x40(%rbp)
subsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
maxsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x28(%rbx)
movsd 0x30(%rbx), %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd 0x1ed82(%rip), %xmm1    # 0x6b048
movapd -0x60(%rbp), %xmm2
addsd %xmm2, %xmm1
movapd -0x50(%rbp), %xmm4
movapd %xmm4, %xmm0
cmpltsd 0x1edaf(%rip), %xmm0    # 0x6b090
andpd %xmm0, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
addsd 0x20(%rbx), %xmm0
movsd 0x3030(%rax,%rcx), %xmm1
movsd 0x1ed5d(%rip), %xmm2    # 0x6b060
ucomisd %xmm0, %xmm2
jbe 0x4c31d
movsd 0x1ed5f(%rip), %xmm3    # 0x6b070
addsd %xmm3, %xmm0
ucomisd %xmm0, %xmm2
ja 0x4c311
jmp 0x4c341
ucomisd 0x1ed23(%rip), %xmm0    # 0x6b048
jb 0x4c341
movsd 0x1ed39(%rip), %xmm2    # 0x6b068
movsd 0x1ed11(%rip), %xmm3    # 0x6b048
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jae 0x4c337
movsd 0x1ed3f(%rip), %xmm2    # 0x6b088
movapd -0x40(%rbp), %xmm5
mulsd %xmm5, %xmm2
xorpd %xmm3, %xmm3
cmpltsd %xmm3, %xmm4
andpd %xmm4, %xmm2
andnpd %xmm5, %xmm4
orpd %xmm2, %xmm4
movsd -0x20(%rbp), %xmm2
mulsd %xmm4, %xmm2
movapd -0x30(%rbp), %xmm3
mulsd %xmm2, %xmm3
mulsd %xmm1, %xmm3
andpd 0x1ec8b(%rip), %xmm3    # 0x6b010
movapd %xmm3, -0x30(%rbp)
mulsd 0x1ecbe(%rip), %xmm0    # 0x6b050
divsd 0x1ecae(%rip), %xmm0    # 0x6b048
leaq -0x70(%rbp), %r14
leaq -0x68(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x92d0
movsd (%r15), %xmm0
movapd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd (%r14), %xmm1
addsd 0x10(%rbx), %xmm0
movsd %xmm0, 0x10(%rbx)
addsd 0x18(%rbx), %xmm1
movsd %xmm1, 0x18(%rbx)
movq %rbx, %rdi
callq 0x4c4d2
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop