// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/ActionEffector.h
// Function: GetDashDirRate(double)
inline double GetDashDirRate(double dir) {
  dir = GetNormalizeAngleDeg(dir);

  if (ServerParam::instance().dashAngleStep() < FLOAT_EPS) {
    // players can dash in any direction.
  } else {
    // The dash direction is discretized by server::dash_angle_step
    dir = ServerParam::instance().dashAngleStep() *
          Rint(dir / ServerParam::instance().dashAngleStep());
  }

  double dir_rate = (std::fabs(dir) > 90.0
                         ? ServerParam::instance().backDashRate() -
                               ((ServerParam::instance().backDashRate() -
                                 ServerParam::instance().sideDashRate()) *
                                (1.0 - (std::fabs(dir) - 90.0) / 90.0))
                         : ServerParam::instance().sideDashRate() +
                               ((1.0 - ServerParam::instance().sideDashRate()) *
                                (1.0 - std::fabs(dir) / 90.0)));
  dir_rate = MinMax(0.0, dir_rate, 1.0);

  return dir_rate;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
movsd 0xafbd6(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x116b0
movsd %xmm0, -0x8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10b90
movsd 0xafb86(%rip), %xmm0    # 0xc1008
ucomisd (%rax), %xmm0
jbe 0x1148a
jmp 0x114df
callq 0x855e0
movq %rax, %rdi
callq 0x10b90
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10b90
movsd -0x40(%rbp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x10bb0
movaps %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
movaps 0xafb75(%rip), %xmm1    # 0xc1060
pand %xmm1, %xmm0
movsd 0xafb49(%rip), %xmm1    # 0xc1040
ucomisd %xmm1, %xmm0
jbe 0x115a2
callq 0x855e0
movq %rax, %rdi
callq 0x12f80
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12f80
movsd (%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12fa0
movsd -0x58(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
subsd (%rax), %xmm0
movsd -0x8(%rbp), %xmm3
movaps 0xafb0c(%rip), %xmm2    # 0xc1060
pand %xmm2, %xmm3
movsd 0xafae0(%rip), %xmm2    # 0xc1040
subsd %xmm2, %xmm3
movsd 0xafad4(%rip), %xmm2    # 0xc1040
divsd %xmm2, %xmm3
movsd 0xafa98(%rip), %xmm2    # 0xc1010
subsd %xmm3, %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x1160b
callq 0x855e0
movq %rax, %rdi
callq 0x12fa0
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12fa0
movsd -0x60(%rbp), %xmm1
movsd 0xafa3e(%rip), %xmm0    # 0xc1010
subsd (%rax), %xmm0
movsd -0x8(%rbp), %xmm3
movaps 0xafa7e(%rip), %xmm2    # 0xc1060
pand %xmm2, %xmm3
movsd 0xafa52(%rip), %xmm2    # 0xc1040
divsd %xmm2, %xmm3
movsd 0xafa16(%rip), %xmm2    # 0xc1010
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0xaf9eb(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x12a20
movsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
addq $0x60, %rsp
popq %rbp
retq
nop