// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/Kicker.cpp
// Function: Kicker::GetOneKickAction(Agent const&, Vector const&, Vector const&, Vector const&, bool)
AtomicAction Kicker::GetOneKickAction(const Agent &agent,
                                      const Vector &ball_pos,
                                      const Vector &ball_vel,
                                      const Vector &target, bool is_self) {
  UpdateKickData(agent);

  AtomicAction a;
  a.mType = CT_Kick;
  a.mKickVel = (target - ball_pos) - ball_vel;
  a.mKickVel =
      a.mKickVel / (is_self ? agent.GetSelf().GetKickRate()
                            : GetKickRate(ball_pos, mInput.mPlayerType));
  a.mSucceed = (a.mKickVel.Mod() < ServerParam::instance().maxPower());
  return a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r13
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, -0x30(%rbp)
movq %rdx, %rsi
callq 0x2d494
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r15)
movq $0x0, 0x28(%r15)
movq %r15, -0x80(%rbp)
movl $0x6, 0x4(%r15)
movsd (%r13), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0x8(%r13), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd (%r14), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x8(%r14), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd (%rbx), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x50(%rbp)
cmpb $0x0, 0x10(%rbp)
je 0x30ad1
movq -0x30(%rbp), %rdi
callq 0xe75a
movsd 0x130(%rax), %xmm4
jmp 0x30bc1
movslq 0x2b4580(%r12), %rbx
movq %r14, %rdi
callq 0xe702
andpd 0x38527(%rip), %xmm0    # 0x69010
movapd %xmm0, -0x40(%rbp)
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x43dce
movq 0x5c38(%rax), %rax
imulq $0x3700, %rbx, %rbx     # imm = 0x3700
movsd -0x30(%rbp), %xmm0
subsd 0x3038(%rax,%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x49360
movsd -0x30(%rbp), %xmm0
subsd 0x30d8(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x43dce
movq 0x5c38(%rax), %rax
movsd 0x38549(%rip), %xmm0    # 0x690a8
movapd -0x40(%rbp), %xmm1
mulsd %xmm0, %xmm1
divsd 0x384f0(%rip), %xmm1    # 0x69060
movsd 0x3068(%rax,%rbx), %xmm2
movsd %xmm2, -0x48(%rbp)
addsd 0x384d2(%rip), %xmm1    # 0x69058
movapd %xmm1, -0x40(%rbp)
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0x43dce
movapd -0x40(%rbp), %xmm4
movq 0x5c38(%rax), %rax
movsd -0x30(%rbp), %xmm0
divsd 0x3040(%rax,%rbx), %xmm0
subsd %xmm0, %xmm4
mulsd -0x48(%rbp), %xmm4
movsd -0x70(%rbp), %xmm3
subsd -0x58(%rbp), %xmm3
subsd -0x50(%rbp), %xmm3
movsd -0x78(%rbp), %xmm2
subsd -0x68(%rbp), %xmm2
subsd -0x60(%rbp), %xmm2
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd %xmm0, %xmm4
setae %al
movapd 0x3841c(%rip), %xmm0    # 0x69010
andpd %xmm4, %xmm0
leaq 0x399b1(%rip), %rcx     # 0x6a5b0
cmpltsd 0x38438(%rip), %xmm0    # 0x69040
movsd (%rcx,%rax,8), %xmm1
andpd %xmm0, %xmm1
andnpd %xmm4, %xmm0
orpd %xmm1, %xmm0
divsd %xmm0, %xmm2
divsd %xmm0, %xmm3
movq -0x80(%rbp), %rbx
movsd %xmm2, 0x8(%rbx)
movsd %xmm3, 0x10(%rbx)
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm2
addsd %xmm3, %xmm2
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x49360
movsd 0x3130(%rax), %xmm0
ucomisd -0x30(%rbp), %xmm0
seta (%rbx)
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq