// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/DecisionTree.cpp
// Function: DecisionTree::Search(Agent&, int)
ActiveBehavior DecisionTree::Search(Agent &agent, int step) {
  if (step == 1) {
    if (agent.GetSelf().IsIdling()) {
      return ActiveBehavior(agent, BT_None);
    }

    std::list<ActiveBehavior> active_behavior_list;

    if (agent.GetSelf().IsGoalie()) {
      MutexPlan<BehaviorPenaltyPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorSetplayPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorAttackPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorGoaliePlanner>(agent, active_behavior_list);
    } else {
      MutexPlan<BehaviorPenaltyPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorSetplayPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorAttackPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorDefensePlanner>(agent, active_behavior_list);
    }

    if (!active_behavior_list.empty()) {
      return GetBestActiveBehavior(agent, active_behavior_list);
    } else {
      return ActiveBehavior(agent, BT_None);
    }
  } else {
    return ActiveBehavior(agent, BT_None);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x58(%rbp)
movq %rdi, -0x50(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0x33261
movq -0x10(%rbp), %rdi
callq 0x10590
movq %rax, %rdi
callq 0x332f0
testb $0x1, %al
jne 0x330c4
jmp 0x330da
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x1b4d0
jmp 0x33272
leaq -0x30(%rbp), %rdi
callq 0x18b50
movq -0x10(%rbp), %rdi
callq 0x10590
movq %rax, -0x60(%rbp)
jmp 0x330f2
movq -0x60(%rbp), %rdi
callq 0x1d780
movb %al, -0x61(%rbp)
jmp 0x33100
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x3310c
jmp 0x3319d
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x33330
movb %al, -0x62(%rbp)
jmp 0x33122
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x3317e
jmp 0x3312b
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x333b0
movb %al, -0x63(%rbp)
jmp 0x33141
movb -0x63(%rbp), %al
testb $0x1, %al
jne 0x3317e
jmp 0x3314a
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x33430
movb %al, -0x64(%rbp)
jmp 0x33160
movb -0x64(%rbp), %al
testb $0x1, %al
jne 0x3317e
jmp 0x33169
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x334b0
jmp 0x3317c
jmp 0x3317e
jmp 0x3320f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x18c40
jmp 0x3327c
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x33330
movb %al, -0x65(%rbp)
jmp 0x331b3
movb -0x65(%rbp), %al
testb $0x1, %al
jne 0x3320f
jmp 0x331bc
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x333b0
movb %al, -0x66(%rbp)
jmp 0x331d2
movb -0x66(%rbp), %al
testb $0x1, %al
jne 0x3320f
jmp 0x331db
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x33430
movb %al, -0x67(%rbp)
jmp 0x331f1
movb -0x67(%rbp), %al
testb $0x1, %al
jne 0x3320f
jmp 0x331fa
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x33540
jmp 0x3320d
jmp 0x3320f
leaq -0x30(%rbp), %rdi
callq 0x18580
testb $0x1, %al
jne 0x3323c
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x33290
jmp 0x33233
movl $0x1, -0x40(%rbp)
jmp 0x33256
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x1b4d0
jmp 0x3324f
movl $0x1, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x18c40
jmp 0x33272
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x1b4d0
movq -0x50(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xaa60
nopw %cs:(%rax,%rax)