// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movq %r9, %r13
movq %r8, %r15
movq %rcx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, -0x30(%rbp)
movq %rdx, %rsi
callq 0x2de9c
movb $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rbx)
movups %xmm0, 0x14(%rbx)
movups %xmm0, 0x20(%rbx)
movl $0x6, 0x4(%rbx)
movsd (%r13), %xmm1
movsd 0x8(%r13), %xmm0
subsd (%r14), %xmm1
subsd 0x8(%r14), %xmm0
subsd (%r15), %xmm1
subsd 0x8(%r15), %xmm0
movsd %xmm1, -0x50(%rbp)
movsd %xmm1, 0x8(%rbx)
movsd %xmm0, 0x10(%rbx)
cmpb $0x0, 0x10(%rbp)
je 0x31673
movq -0x30(%rbp), %rdi
callq 0xe85a
movsd 0x130(%rax), %xmm0
jmp 0x31777
movslq 0x2b4580(%r12), %r15
movq %r14, %rdi
callq 0xe804
andpd 0x39985(%rip), %xmm0    # 0x6b010
movapd %xmm0, -0x40(%rbp)
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x316b7
sqrtsd %xmm0, %xmm0
jmp 0x316bc
callq 0x93c0
movsd %xmm0, -0x30(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
imulq $0x3700, %r15, %r14     # imm = 0x3700
movsd -0x30(%rbp), %xmm0
subsd 0x3038(%rax,%r14), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x4a75c
movsd -0x30(%rbp), %xmm0
subsd 0x30d8(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movsd 0x39995(%rip), %xmm0    # 0x6b0a8
movapd -0x40(%rbp), %xmm2
mulsd %xmm0, %xmm2
divsd 0x3993c(%rip), %xmm2    # 0x6b060
movsd 0x3068(%rax,%r14), %xmm1
movsd %xmm1, -0x48(%rbp)
addsd 0x3991d(%rip), %xmm2    # 0x6b058
movapd %xmm2, -0x40(%rbp)
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0x450ba
movapd -0x40(%rbp), %xmm0
movq 0x5c38(%rax), %rax
movsd -0x30(%rbp), %xmm1
divsd 0x3040(%rax,%r14), %xmm1
subsd %xmm1, %xmm0
mulsd -0x48(%rbp), %xmm0
xorpd %xmm3, %xmm3
xorl %eax, %eax
ucomisd %xmm3, %xmm0
setae %al
movapd 0x39884(%rip), %xmm1    # 0x6b010
andpd %xmm0, %xmm1
leaq 0x3ae29(%rip), %rcx     # 0x6c5c0
movsd (%rcx,%rax,8), %xmm2
cmpltsd 0x3989b(%rip), %xmm1    # 0x6b040
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movsd -0x50(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd 0x10(%rbx), %xmm2
divsd %xmm1, %xmm2
movsd %xmm0, 0x8(%rbx)
movsd %xmm2, 0x10(%rbx)
mulsd %xmm2, %xmm2
mulsd %xmm0, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jb 0x317e5
sqrtsd %xmm0, %xmm0
jmp 0x317ea
callq 0x93c0
movsd %xmm0, -0x30(%rbp)
callq 0x4a75c
movsd 0x3130(%rax), %xmm0
ucomisd -0x30(%rbp), %xmm0
seta (%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq