// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorGoalie.cpp
// Function: BehaviorGoaliePlanner::Plan(std::__cxx11::list<ActiveBehavior, std::allocator<ActiveBehavior>>&)
void BehaviorGoaliePlanner::Plan(std::list<ActiveBehavior> &behavior_list) {
  if (mAgent.IsLastActiveBehaviorInActOf(BT_Pass) ||
      mAgent.IsLastActiveBehaviorInActOf(BT_Dribble))
    return;

  if (mSelfState.IsBallCatchable() && mStrategy.IsLastOppControl()) {
    ActiveBehavior catchball(mAgent, BT_Goalie, BDT_Goalie_Catch);

    catchball.mEvaluation = 1.0 + FLOAT_EPS;

    behavior_list.push_back(catchball);
  } else {
    Vector target;
    Ray ball_ray(
        ServerParam::instance().ourGoal(),
        (mAnalyser.mLightHouse - ServerParam::instance().ourGoal()).Dir());
    ServerParam::instance().ourGoalArea().Intersection(ball_ray, target);

    ActiveBehavior position(mAgent, BT_Goalie, BDT_Goalie_Position);

    position.mTarget = target;
    if (ServerParam::instance().ourPenaltyArea().IsWithin(target)) {
      position.mEvaluation =
          Evaluation::instance().EvaluatePosition(position.mTarget, false);
    } else {
      Ray ball_ray(
          ServerParam::instance().ourGoal(),
          (mBallState.GetPos() - ServerParam::instance().ourGoal()).Dir());
      ServerParam::instance().ourGoalArea().Intersection(ball_ray, target);
      position.mEvaluation =
          Evaluation::instance().EvaluatePosition(position.mTarget, false);
      position.mTarget = target;
    }
    behavior_list.push_back(position);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq 0xc0(%r15), %rax
testq %rax, %rax
je 0x15ff1
cmpl $0x7, (%rax)
je 0x162a4
testq %rax, %rax
je 0x15ff1
cmpl $0x5, (%rax)
je 0x162a4
movq 0x20(%r14), %rax
cmpb $0x1, 0x175(%rax)
jne 0x16015
testb $0x1, 0x138(%rax)
je 0x16015
movq 0x38(%r14), %rax
cmpl $0x0, 0x5c(%rax)
js 0x162b4
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
callq 0x4a75c
movq %rax, %r15
addq $0x38b0, %r15           # imm = 0x38B0
movq 0x48(%r14), %r12
callq 0x4a75c
movsd 0x40(%r12), %xmm1
movsd 0x48(%r12), %xmm0
subsd 0x38b0(%rax), %xmm1
subsd 0x38b8(%rax), %xmm0
movapd 0x54fb6(%rip), %xmm4    # 0x6b010
movapd %xmm1, %xmm2
andpd %xmm4, %xmm2
movsd 0x54fd6(%rip), %xmm5    # 0x6b040
ucomisd %xmm2, %xmm5
jbe 0x16082
movapd %xmm0, %xmm3
andpd %xmm4, %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm3, %xmm5
ja 0x1609b
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x54fb5(%rip), %xmm2    # 0x6b048
divsd 0x54fb5(%rip), %xmm2    # 0x6b050
movups (%r15), %xmm0
leaq -0x110(%rbp), %r15
movaps %xmm0, (%r15)
movsd %xmm2, 0x10(%r15)
callq 0x4a75c
leaq 0x3870(%rax), %rdi
leaq -0x30(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x2a010
movq 0x8(%r14), %rax
leaq -0xb0(%rbp), %r15
movl $0x2, -0x28(%r15)
movq %rax, -0x20(%r15)
xorl %eax, %eax
movq %rax, -0x18(%r15)
movl %eax, -0x10(%r15)
movl %eax, 0x30(%r15)
movq %rax, 0x38(%r15)
movl %eax, 0x40(%r15)
movq %rax, 0x48(%r15)
movl %eax, 0x50(%r15)
movq %rax, 0x58(%r15)
movl %eax, 0x60(%r15)
movq %rax, 0x68(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movups %xmm0, -0x8(%r15)
movups %xmm0, 0x18(%r15)
movb $0x0, 0x28(%r15)
movl $0xc, 0x70(%r15)
movq %rax, 0x78(%r15)
movaps (%r12), %xmm0
movups %xmm0, (%r15)
callq 0x4a75c
movsd (%r12), %xmm0
movsd 0x3830(%rax), %xmm1
addsd 0x54f25(%rip), %xmm1    # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x161a4
movsd 0x3838(%rax), %xmm1
addsd 0x54ed7(%rip), %xmm1    # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x161a4
movsd -0x28(%rbp), %xmm0
movsd 0x3840(%rax), %xmm1
addsd 0x54ef4(%rip), %xmm1    # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x161a4
movsd 0x3848(%rax), %xmm1
addsd 0x54ea6(%rip), %xmm1    # 0x6b040
ucomisd %xmm0, %xmm1
jae 0x16371
callq 0x4a75c
movq %rax, %r12
addq $0x38b0, %r12           # imm = 0x38B0
movq 0x18(%r14), %r14
callq 0x4a75c
movsd 0x8(%r14), %xmm1
movsd 0x10(%r14), %xmm0
subsd 0x38b0(%rax), %xmm1
subsd 0x38b8(%rax), %xmm0
movapd %xmm1, %xmm2
movapd 0x54e2c(%rip), %xmm3    # 0x6b010
andpd %xmm3, %xmm2
movsd 0x54e50(%rip), %xmm4    # 0x6b040
ucomisd %xmm2, %xmm4
jbe 0x16204
andpd %xmm0, %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm3, %xmm4
ja 0x1621d
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x54e33(%rip), %xmm2    # 0x6b048
divsd 0x54e33(%rip), %xmm2    # 0x6b050
movups (%r12), %xmm0
leaq -0xf0(%rbp), %r14
movaps %xmm0, (%r14)
movsd %xmm2, 0x10(%r14)
callq 0x4a75c
leaq 0x3870(%rax), %rdi
leaq -0x30(%rbp), %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x2a010
callq 0x24ed2
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x24f4c
movsd %xmm0, -0xc8(%rbp)
movapd (%r12), %xmm0
movupd %xmm0, (%r15)
movl $0xb8, %edi
callq 0x94c0
movq %rax, %r14
leaq 0x10(%rax), %rdi
leaq -0xd8(%rbp), %rsi
movl $0xa8, %edx
callq 0x93e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x90b0
incq 0x10(%rbx)
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
movups %xmm0, -0xb4(%rbp)
movups %xmm0, -0xc4(%rbp)
movups %xmm0, -0xd4(%rbp)
movb $0x0, -0xa4(%rbp)
movl $0xb8, %edi
callq 0x94c0
movl $0x2, 0x10(%rax)
movq %r15, 0x18(%rax)
movabsq $0x3ff000064a9cdc44, %rcx # imm = 0x3FF000064A9CDC44
movq %rcx, 0x20(%rax)
xorl %ecx, %ecx
movl %ecx, 0x28(%rax)
movupd -0xd8(%rbp), %xmm0
movupd -0xc8(%rbp), %xmm1
movupd -0xb8(%rbp), %xmm2
movupd %xmm0, 0x2c(%rax)
movupd %xmm1, 0x3c(%rax)
movupd %xmm2, 0x4c(%rax)
movq -0xab(%rbp), %rdx
movq %rdx, 0x59(%rax)
movl %ecx, 0x68(%rax)
movq %rcx, 0x70(%rax)
movl %ecx, 0x78(%rax)
movq %rcx, 0x80(%rax)
movl %ecx, 0x88(%rax)
movq %rcx, 0x90(%rax)
movl %ecx, 0x98(%rax)
movq %rcx, 0xa0(%rax)
movl $0xd, 0xa8(%rax)
movq %rcx, 0xb0(%rax)
movq %rax, %rdi
jmp 0x16298
callq 0x24ed2
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x24f4c
movsd %xmm0, -0xc8(%rbp)
jmp 0x16273