// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x1, %ecx
jne 0x22a99
movq %rsi, %r15
movq %r14, %rdi
callq 0xe85a
cmpl $0x0, 0xc8(%rax)
jg 0x22a99
cmpl $0x0, 0x124(%rax)
jg 0x22a99
leaq -0x38(%rbp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
movq $0x0, 0x10(%r12)
movq %r14, %rdi
callq 0xe85a
cmpb $0x1, 0x175(%rax)
jne 0x22afd
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22c58
testb %al, %al
jne 0x22b45
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22caa
testb %al, %al
jne 0x22b45
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22cfc
testb %al, %al
jne 0x22b45
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22d4e
jmp 0x22b45
xorl %eax, %eax
movl %eax, (%rbx)
movq %r14, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movl %eax, 0x18(%rbx)
movl %eax, 0x58(%rbx)
movq %rax, 0x60(%rbx)
movl %eax, 0x68(%rbx)
movq %rax, 0x70(%rbx)
movl %eax, 0x78(%rbx)
movq %rax, 0x80(%rbx)
movl %eax, 0x88(%rbx)
movq %rax, 0x90(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movb $0x0, 0x50(%rbx)
movl %eax, 0x98(%rbx)
movq %rax, 0xa0(%rbx)
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22c58
testb %al, %al
jne 0x22b45
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22caa
testb %al, %al
jne 0x22b45
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22cfc
testb %al, %al
jne 0x22b45
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x22da0
cmpq %r12, -0x38(%rbp)
je 0x22b77
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0xf4c2
leaq -0x38(%rbp), %rdi
callq 0x12a4c
movq -0x38(%rbp), %rsi
addq $0x10, %rsi
movl $0xa8, %edx
movq %rbx, %rdi
callq 0x93e0
jmp 0x22bcb
xorl %eax, %eax
movl %eax, (%rbx)
movq %r14, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movl %eax, 0x18(%rbx)
movl %eax, 0x58(%rbx)
movq %rax, 0x60(%rbx)
movl %eax, 0x68(%rbx)
movq %rax, 0x70(%rbx)
movl %eax, 0x78(%rbx)
movq %rax, 0x80(%rbx)
movl %eax, 0x88(%rbx)
movq %rax, 0x90(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movb $0x0, 0x50(%rbx)
movl %eax, 0x98(%rbx)
movq %rax, 0xa0(%rbx)
movq -0x38(%rbp), %rdi
cmpq %r12, %rdi
je 0x22aed
movq (%rdi), %r14
movl $0xb8, %esi
callq 0x94e0
movq %r14, %rdi
cmpq %r12, %r14
jne 0x22bd8
jmp 0x22aed
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r12, %rdi
je 0x22c13
movq (%rdi), %r14
movl $0xb8, %esi
callq 0x94e0
movq %r14, %rdi
cmpq %r12, %r14
jne 0x22bfe
movq %rbx, %rdi
callq 0x98b0
nop