// File: /workspace/github_cpp_makefile_star2_O3/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 0x15da8
movl (%rax), %eax
orl $0x2, %eax
cmpl $0x7, %eax
je 0x1605b
movq 0x20(%r14), %rax
cmpb $0x1, 0x175(%rax)
jne 0x15dcc
testb $0x1, 0x138(%rax)
je 0x15dcc
movq 0x38(%r14), %rax
cmpl $0x0, 0x5c(%rax)
js 0x1606b
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
callq 0x49360
movq %rax, %r15
addq $0x38b0, %r15           # imm = 0x38B0
movq 0x48(%r14), %r12
callq 0x49360
movsd 0x40(%r12), %xmm1
movsd 0x48(%r12), %xmm0
subsd 0x38b0(%rax), %xmm1
subsd 0x38b8(%rax), %xmm0
movapd 0x531ff(%rip), %xmm4    # 0x69010
movapd %xmm1, %xmm2
andpd %xmm4, %xmm2
movsd 0x5321f(%rip), %xmm5    # 0x69040
ucomisd %xmm2, %xmm5
jbe 0x15e39
movapd %xmm0, %xmm3
andpd %xmm4, %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm3, %xmm5
ja 0x15e52
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x531fe(%rip), %xmm2    # 0x69048
divsd 0x531fe(%rip), %xmm2    # 0x69050
movups (%r15), %xmm0
leaq -0x110(%rbp), %r15
movaps %xmm0, (%r15)
movsd %xmm2, 0x10(%r15)
callq 0x49360
leaq 0x3870(%rax), %rdi
leaq -0x30(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x2976c
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 0x49360
movsd (%r12), %xmm0
movsd 0x3830(%rax), %xmm1
addsd 0x5316e(%rip), %xmm1    # 0x69078
ucomisd %xmm1, %xmm0
jb 0x15f5b
movsd 0x3838(%rax), %xmm1
addsd 0x53120(%rip), %xmm1    # 0x69040
ucomisd %xmm0, %xmm1
jb 0x15f5b
movsd -0x28(%rbp), %xmm0
movsd 0x3840(%rax), %xmm1
addsd 0x5313d(%rip), %xmm1    # 0x69078
ucomisd %xmm1, %xmm0
jb 0x15f5b
movsd 0x3848(%rax), %xmm1
addsd 0x530ef(%rip), %xmm1    # 0x69040
ucomisd %xmm0, %xmm1
jae 0x16128
callq 0x49360
movq %rax, %r12
addq $0x38b0, %r12           # imm = 0x38B0
movq 0x18(%r14), %r14
callq 0x49360
movsd 0x8(%r14), %xmm1
movsd 0x10(%r14), %xmm0
subsd 0x38b0(%rax), %xmm1
subsd 0x38b8(%rax), %xmm0
movapd %xmm1, %xmm2
movapd 0x53075(%rip), %xmm3    # 0x69010
andpd %xmm3, %xmm2
movsd 0x53099(%rip), %xmm4    # 0x69040
ucomisd %xmm2, %xmm4
jbe 0x15fbb
andpd %xmm0, %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm3, %xmm4
ja 0x15fd4
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x5307c(%rip), %xmm2    # 0x69048
divsd 0x5307c(%rip), %xmm2    # 0x69050
movups (%r12), %xmm0
leaq -0xf0(%rbp), %r14
movaps %xmm0, (%r14)
movsd %xmm2, 0x10(%r14)
callq 0x49360
leaq 0x3870(%rax), %rdi
leaq -0x30(%rbp), %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x2976c
callq 0x24814
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2488e
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 0x1604f
callq 0x24814
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2488e
movsd %xmm0, -0xc8(%rbp)
jmp 0x1602a
nop