// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/ActionEffector.cpp
// Function: ActionEffector::ComputeInfoAfterKick(double, double, PlayerState const&, BallState const&, Vector&, Vector&, bool)
void ActionEffector::ComputeInfoAfterKick(const double kick_power,
                                          const double kick_angle,
                                          const PlayerState &player_state,
                                          const BallState &ball_state,
                                          Vector &ball_pos, Vector &ball_vel,
                                          bool is_self) {
  double power = GetNormalizeKickPower(kick_power);
  double dir = GetNormalizeMoment(kick_angle);

  Vector ball_2_player = (ball_state.GetPos() - player_state.GetPos())
                             .Rotate(-player_state.GetBodyDir());
  double eff_power =
      power * (is_self
                   ? player_state.GetKickRate()
                   : GetKickRate(ball_2_player, player_state.GetPlayerType()));
  Vector accel = Polar2Vector(eff_power, player_state.GetBodyDir() + dir);

  ball_vel = ball_state.GetVel() + accel;
  ball_pos = ball_state.GetPos() + ball_vel;
  ball_vel *= ServerParam::instance().ballDecay();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r8d, %r13d
movq %rcx, %rbx
movq %rdx, -0xa0(%rbp)
movq %rsi, %r15
movq %rdi, %r12
movsd %xmm1, -0x90(%rbp)
movsd %xmm0, -0x98(%rbp)
callq 0x49360
movq %rax, %r14
callq 0x49360
movsd 0x3138(%r14), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd 0x3130(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x49360
movq %rax, %r14
callq 0x49360
movsd 0x3148(%r14), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0x3140(%rax), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x8(%r15), %xmm0
subsd 0x8(%r12), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x10(%r15), %xmm0
subsd 0x10(%r12), %xmm0
movapd %xmm0, -0x50(%rbp)
movsd 0xb0(%r12), %xmm0
mulsd 0x5c2f7(%rip), %xmm0    # 0x690a0
divsd 0x5c297(%rip), %xmm0    # 0x69048
leaq -0x68(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x92d0
testl %r13d, %r13d
je 0xcdd2
movsd 0x130(%r12), %xmm2
jmp 0xcf52
movsd -0x68(%rbp), %xmm0
movsd -0x60(%rbp), %xmm2
movsd -0x40(%rbp), %xmm3
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm3
movapd -0x50(%rbp), %xmm4
mulsd %xmm4, %xmm0
mulsd %xmm2, %xmm1
subsd %xmm0, %xmm1
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
movslq 0x114(%r12), %r14
movapd 0x5c1fe(%rip), %xmm3    # 0x69010
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
movsd 0x5c21e(%rip), %xmm5    # 0x69040
ucomisd %xmm2, %xmm5
jbe 0xce36
andpd %xmm4, %xmm3
xorpd %xmm0, %xmm0
ucomisd %xmm3, %xmm5
ja 0xce63
movapd %xmm4, %xmm0
movapd %xmm4, -0x50(%rbp)
movapd %xmm1, -0x40(%rbp)
callq 0x90d0
movapd -0x40(%rbp), %xmm1
movapd -0x50(%rbp), %xmm4
mulsd 0x5c1ed(%rip), %xmm0    # 0x69048
divsd 0x5c1ed(%rip), %xmm0    # 0x69050
andpd 0x5c1a5(%rip), %xmm0    # 0x69010
movapd %xmm0, -0x50(%rbp)
mulsd %xmm4, %xmm4
mulsd %xmm1, %xmm1
addsd %xmm4, %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x43dce
movq 0x5c38(%rax), %rax
imulq $0x3700, %r14, %r14     # imm = 0x3700
movsd -0x40(%rbp), %xmm0
subsd 0x3038(%rax,%r14), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x49360
movsd -0x40(%rbp), %xmm0
subsd 0x30d8(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x43dce
movq 0x5c38(%rax), %rax
movsd 0x5c1ce(%rip), %xmm0    # 0x690a8
movapd -0x50(%rbp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, -0x50(%rbp)
movapd -0x50(%rbp), %xmm1
divsd 0x5c16b(%rip), %xmm1    # 0x69060
movapd %xmm1, -0x50(%rbp)
movsd 0x3068(%rax,%r14), %xmm1
movsd %xmm1, -0x70(%rbp)
movapd -0x50(%rbp), %xmm1
addsd 0x5c142(%rip), %xmm1    # 0x69058
movapd %xmm1, -0x50(%rbp)
movsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x40(%rbp)
callq 0x43dce
movapd -0x50(%rbp), %xmm2
movq 0x5c38(%rax), %rax
movsd -0x40(%rbp), %xmm0
divsd 0x3040(%rax,%r14), %xmm0
subsd %xmm0, %xmm2
mulsd -0x70(%rbp), %xmm2
movsd -0x90(%rbp), %xmm1
maxsd -0x78(%rbp), %xmm1
movsd -0x88(%rbp), %xmm0
minsd %xmm1, %xmm0
movsd -0x98(%rbp), %xmm1
maxsd -0x80(%rbp), %xmm1
movsd -0x58(%rbp), %xmm3
minsd %xmm1, %xmm3
mulsd %xmm2, %xmm3
movsd %xmm3, -0x58(%rbp)
addsd 0xb0(%r12), %xmm0
mulsd 0x5c0b4(%rip), %xmm0    # 0x69050
divsd 0x5c0a4(%rip), %xmm0    # 0x69048
leaq -0x68(%rbp), %r14
leaq -0x60(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x92d0
movsd (%r12), %xmm0
movsd -0x58(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd (%r14), %xmm1
addsd 0x30(%r15), %xmm0
addsd 0x38(%r15), %xmm1
movsd %xmm0, (%rbx)
movsd %xmm1, 0x8(%rbx)
addsd 0x8(%r15), %xmm0
addsd 0x10(%r15), %xmm1
movq -0xa0(%rbp), %rax
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
callq 0x49360
movsd 0x30e0(%rax), %xmm0
mulsd (%rbx), %xmm0
movsd %xmm0, (%rbx)
movsd 0x30e0(%rax), %xmm0
mulsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq