// File: /workspace/github_cpp_makefile_star2_O1/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 0x4a75c
movq %rax, %r14
callq 0x4a75c
movsd 0x3138(%r14), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd 0x3130(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x4a75c
movq %rax, %r14
callq 0x4a75c
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, -0x50(%rbp)
movsd 0x10(%r15), %xmm0
subsd 0x10(%r12), %xmm0
movapd %xmm0, -0x40(%rbp)
movsd 0xb0(%r12), %xmm0
mulsd 0x5e227(%rip), %xmm0    # 0x6b0a0
divsd 0x5e1c7(%rip), %xmm0    # 0x6b048
leaq -0x68(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x92d0
testl %r13d, %r13d
je 0xcea2
movsd 0x130(%r12), %xmm2
jmp 0xd027
movsd -0x68(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
movsd -0x50(%rbp), %xmm2
movapd %xmm2, %xmm5
mulsd %xmm0, %xmm2
movapd -0x40(%rbp), %xmm4
mulsd %xmm4, %xmm0
mulsd %xmm1, %xmm5
subsd %xmm0, %xmm5
mulsd %xmm1, %xmm4
addsd %xmm2, %xmm4
movslq 0x114(%r12), %r14
movapd 0x5e12e(%rip), %xmm3    # 0x6b010
movapd %xmm5, %xmm2
andpd %xmm3, %xmm2
movsd 0x5e14e(%rip), %xmm1    # 0x6b040
ucomisd %xmm2, %xmm1
jbe 0xcf06
andpd %xmm4, %xmm3
xorpd %xmm0, %xmm0
ucomisd %xmm3, %xmm1
ja 0xcf37
movapd %xmm4, %xmm0
movapd %xmm5, %xmm1
movapd %xmm4, -0x40(%rbp)
movapd %xmm5, -0x50(%rbp)
callq 0x90d0
movapd -0x50(%rbp), %xmm5
movapd -0x40(%rbp), %xmm4
mulsd 0x5e119(%rip), %xmm0    # 0x6b048
divsd 0x5e119(%rip), %xmm0    # 0x6b050
andpd 0x5e0d1(%rip), %xmm0    # 0x6b010
movapd %xmm0, -0x50(%rbp)
mulsd %xmm4, %xmm4
mulsd %xmm5, %xmm5
addsd %xmm4, %xmm5
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm5
jb 0xcf63
xorps %xmm0, %xmm0
sqrtsd %xmm5, %xmm0
jmp 0xcf6c
movapd %xmm5, %xmm0
callq 0x93c0
movsd %xmm0, -0x40(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
imulq $0x3700, %r14, %r14     # imm = 0x3700
movsd -0x40(%rbp), %xmm0
subsd 0x3038(%rax,%r14), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x4a75c
movsd -0x40(%rbp), %xmm0
subsd 0x30d8(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movsd 0x5e0e5(%rip), %xmm0    # 0x6b0a8
movapd -0x50(%rbp), %xmm2
mulsd %xmm0, %xmm2
divsd 0x5e08c(%rip), %xmm2    # 0x6b060
movsd 0x3068(%rax,%r14), %xmm1
movsd %xmm1, -0x70(%rbp)
addsd 0x5e06d(%rip), %xmm2    # 0x6b058
movapd %xmm2, -0x50(%rbp)
movsd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x40(%rbp)
callq 0x450ba
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 0x5dfdf(%rip), %xmm0    # 0x6b050
divsd 0x5dfcf(%rip), %xmm0    # 0x6b048
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 0x4a75c
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
nop