// File: 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
subq $0xd0, %rsp
movb %r8b, %al
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x10e80
movsd %xmm0, -0x40(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x10aa0
movsd %xmm0, -0x48(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x110a0
movsd %xmm0, -0x68(%rbp)
movsd %xmm1, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x11170
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x11110
movsd %xmm0, -0x58(%rbp)
movsd %xmm1, -0x50(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
testb $0x1, -0x31(%rbp)
je 0xe319
movq -0x18(%rbp), %rdi
callq 0x11190
movsd %xmm0, -0xc8(%rbp)
jmp 0xe335
movq -0x18(%rbp), %rdi
callq 0x10a60
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x111b0
movsd %xmm0, -0xc8(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd -0xc8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x18(%rbp), %rdi
callq 0x11170
movsd (%rax), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x112c0
movsd %xmm0, -0x88(%rbp)
movsd %xmm1, -0x80(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10a80
movq %rax, %rdi
leaq -0x88(%rbp), %rsi
callq 0x11360
movsd %xmm0, -0xa0(%rbp)
movsd %xmm1, -0x98(%rbp)
movq -0x30(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x11360
movsd %xmm0, -0xb0(%rbp)
movsd %xmm1, -0xa8(%rbp)
movq -0x28(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xa8(%rbp), %rcx
movq %rcx, 0x8(%rax)
callq 0x855e0
movq %rax, %rdi
callq 0x113d0
movq %rax, %rsi
movq -0x30(%rbp), %rdi
callq 0x113f0
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)