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

  AtomicAction a;
  a.mType = CT_Kick;
  a.mKickVel = (mKickTarget - ball_pos).SetLength(mKickSpeed) -
               ball_vel; /** 希望kicker产生的球速 */
  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
movl %r9d, -0x30(%rbp)
movq %r8, %r13
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
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 0x2b45d8(%r12), %xmm2
movsd 0x2b45e0(%r12), %xmm0
subsd (%r14), %xmm2
subsd 0x8(%r14), %xmm0
movsd %xmm0, -0x50(%rbp)
mulsd %xmm0, %xmm0
movsd %xmm2, -0x40(%rbp)
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jb 0x3098c
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x309a3
movapd %xmm2, %xmm0
movsd %xmm2, -0x38(%rbp)
callq 0x93c0
movsd -0x38(%rbp), %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
xorpd %xmm0, %xmm0
jbe 0x309ef
movsd 0x2b45d0(%r12), %xmm3
ucomisd %xmm0, %xmm2
jb 0x309c6
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x309d9
movapd %xmm2, %xmm0
movsd %xmm3, -0x38(%rbp)
callq 0x93c0
movsd -0x38(%rbp), %xmm3
divsd %xmm0, %xmm3
movsd -0x40(%rbp), %xmm1
mulsd %xmm3, %xmm1
movsd -0x50(%rbp), %xmm0
mulsd %xmm3, %xmm0
subsd (%r13), %xmm1
subsd 0x8(%r13), %xmm0
movsd %xmm1, -0x40(%rbp)
movsd %xmm1, 0x8(%rbx)
movsd %xmm0, 0x10(%rbx)
cmpb $0x0, -0x30(%rbp)
je 0x30a25
movq %r15, %rdi
callq 0xe85a
movsd 0x130(%rax), %xmm0
jmp 0x30b29
movslq 0x2b4580(%r12), %r15
movq %r14, %rdi
callq 0xe804
andpd 0x3a5d3(%rip), %xmm0    # 0x6b010
movapd %xmm0, -0x50(%rbp)
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x30a69
sqrtsd %xmm0, %xmm0
jmp 0x30a6e
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 0x3a5e3(%rip), %xmm0    # 0x6b0a8
movapd -0x50(%rbp), %xmm2
mulsd %xmm0, %xmm2
divsd 0x3a58a(%rip), %xmm2    # 0x6b060
movsd 0x3068(%rax,%r14), %xmm1
movsd %xmm1, -0x38(%rbp)
addsd 0x3a56b(%rip), %xmm2    # 0x6b058
movapd %xmm2, -0x50(%rbp)
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
callq 0x450ba
movapd -0x50(%rbp), %xmm0
movq 0x5c38(%rax), %rax
movsd -0x30(%rbp), %xmm1
divsd 0x3040(%rax,%r14), %xmm1
subsd %xmm1, %xmm0
mulsd -0x38(%rbp), %xmm0
xorpd %xmm3, %xmm3
xorl %eax, %eax
ucomisd %xmm3, %xmm0
setae %al
movapd 0x3a4d2(%rip), %xmm1    # 0x6b010
andpd %xmm0, %xmm1
leaq 0x3ba77(%rip), %rcx     # 0x6c5c0
movsd (%rcx,%rax,8), %xmm2
cmpltsd 0x3a4e9(%rip), %xmm1    # 0x6b040
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movsd -0x40(%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 0x30b97
sqrtsd %xmm0, %xmm0
jmp 0x30b9c
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