// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorFormation.cpp
// Function: BehaviorFormationPlanner::Plan(std::__cxx11::list<ActiveBehavior, std::allocator<ActiveBehavior>>&)
void BehaviorFormationPlanner::Plan(std::list<ActiveBehavior> &behavior_list) {
  ActiveBehavior formation(mAgent, BT_Formation);

  formation.mBuffer = 1.0;
  formation.mPower = mSelfState.CorrectDashPowerForStamina(
      ServerParam::instance().maxDashPower());
  formation.mTarget = mAnalyser.mHome[mSelfState.GetUnum()];
  if (formation.mTarget.X() < mSelfState.GetPos().X() &&
      mAgent.GetFormation().GetMyRole().mLineType == LT_Forward) {
    formation.mPower = mSelfState.CorrectDashPowerForStamina(
                           ServerParam::instance().maxDashPower()) /
                       2;
  }

  if (mAgent.GetFormation().GetMyRole().mLineType == LT_Defender) {
    formation.mTarget.SetX(Min(0.0, formation.mTarget.X()));
    if (mBallState.GetPos().X() < -25) {
      Unum goalie = mWorldState.GetTeammateGoalieUnum();
      Vector gpos = mWorldState.GetTeammate(goalie).GetPos();
      Vector left = (ServerParam::instance().ourLeftGoalPost() + gpos) / 2;
      Vector right = (ServerParam::instance().ourRightGoalPost() + gpos) / 2;
      Line l(gpos, mBallState.GetPos());
      if (l.IsPointInSameSide(left, ServerParam::instance().ourGoal())) {
        const std::vector<Unum> &t2t =
            mPositionInfo.GetClosePlayerToPoint(left, goalie);
        if (t2t[0] == mSelfState.GetUnum()) {
          formation.mTarget = left;
        } else if (mPositionInfo.GetClosePlayerToPoint(right, t2t[0])[0] ==
                   mSelfState.GetUnum()) {
          formation.mTarget = right;
        } else if (mPositionInfo.GetClosePlayerToPoint(right, t2t[0])[0] ==
                       goalie &&
                   mPositionInfo.GetClosePlayerToPoint(right, t2t[0])[1] ==
                       mSelfState.GetUnum()) {
          formation.mTarget = right;
        }
      } else {
        const std::vector<Unum> &t2t =
            mPositionInfo.GetClosePlayerToPoint(right, goalie);
        if (t2t[0] == mSelfState.GetUnum()) {
          formation.mTarget = right;
        } else if (mPositionInfo.GetClosePlayerToPoint(left, t2t[0])[0] ==
                   mSelfState.GetUnum()) {
          formation.mTarget = left;
        } else if (mPositionInfo.GetClosePlayerToPoint(left, t2t[0])[0] ==
                       goalie &&
                   mPositionInfo.GetClosePlayerToPoint(right, t2t[0])[1] ==
                       mSelfState.GetUnum()) {
          formation.mTarget = left;
        }
      }
    }
    formation.mEvaluation =
        Evaluation::instance().EvaluatePosition(formation.mTarget, true);
  }

  else
    formation.mEvaluation =
        Evaluation::instance().EvaluatePosition(formation.mTarget, false);

  behavior_list.push_back(formation);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x238(%rbp)
movq 0x8(%rax), %rsi
leaq -0xb8(%rbp), %rdi
movl $0xa, %edx
xorl %ecx, %ecx
callq 0x1b4d0
movq -0x238(%rbp), %rax
movsd 0xa2d6c(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x18(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0x248(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12b60
movq -0x248(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x7c940
movq -0x238(%rbp), %rax
movsd %xmm0, -0x80(%rbp)
movq 0x48(%rax), %rcx
addq $0x50, %rcx
movq %rcx, -0x240(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movq -0x240(%rbp), %rdi
movl %eax, -0xbc(%rbp)
leaq -0xbc(%rbp), %rsi
callq 0x140a0
movq (%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
leaq -0xb8(%rbp), %rdi
addq $0x28, %rdi
callq 0x176f0
movq %rax, %rcx
movq -0x238(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x230(%rbp)
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x176f0
movsd -0x230(%rbp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1e3ce
movq -0x238(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1a4c0
movq %rax, %rdi
callq 0x3d5f0
cmpl $0x3, 0x8(%rax)
jne 0x1e3ce
movq -0x238(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x250(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12b60
movq -0x250(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x7c940
movsd 0xa30eb(%rip), %xmm1    # 0xc14b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x238(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1a4c0
movq %rax, %rdi
callq 0x3d5f0
cmpl $0x1, 0x8(%rax)
jne 0x1ec7e
leaq -0xb8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x258(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xc8(%rbp)
leaq -0xb8(%rbp), %rdi
addq $0x28, %rdi
callq 0x176f0
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x12a60
movq -0x258(%rbp), %rdi
movq %rax, %rsi
callq 0x1ee90
movq -0x238(%rbp), %rax
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x176f0
movsd 0xa33b9(%rip), %xmm0    # 0xc1818
ucomisd (%rax), %xmm0
jbe 0x1ec57
movq -0x238(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1eeb0
movl %eax, %ecx
movq -0x238(%rbp), %rax
movl %ecx, -0xcc(%rbp)
movq 0x10(%rax), %rdi
leaq -0xcc(%rbp), %rsi
callq 0x12520
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq (%rax), %rcx
movq %rcx, -0xe0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xd8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x1eed0
movq %rax, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x11360
movsd %xmm0, -0x100(%rbp)
movsd %xmm1, -0xf8(%rbp)
leaq -0x100(%rbp), %rdi
movsd 0xa2fbc(%rip), %xmm0    # 0xc14b0
callq 0x1eef0
movsd %xmm0, -0xf0(%rbp)
movsd %xmm1, -0xe8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x1efa0
movq %rax, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x11360
movsd %xmm0, -0x120(%rbp)
movsd %xmm1, -0x118(%rbp)
leaq -0x120(%rbp), %rdi
movsd 0xa2f6c(%rip), %xmm0    # 0xc14b0
callq 0x1eef0
movq -0x238(%rbp), %rax
movsd %xmm0, -0x110(%rbp)
movsd %xmm1, -0x108(%rbp)
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdx
leaq -0x138(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x1efc0
callq 0x855e0
movq %rax, %rdi
callq 0x1f240
movq %rax, %rdx
leaq -0x138(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1f130
testb $0x1, %al
jne 0x1e5af
jmp 0x1e905
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rsi
leaq -0x158(%rbp), %rdi
movq %rdi, -0x268(%rbp)
leaq -0xf0(%rbp), %rdx
leaq -0xcc(%rbp), %rcx
callq 0x7ff30
movq -0x268(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq %rax, %rcx
movq -0x238(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x260(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, -0x25c(%rbp)
jmp 0x1e61c
movl -0x260(%rbp), %eax
movl -0x25c(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1e664
movq -0xf0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1e8e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
jmp 0x1e8f4
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x270(%rbp)
movq -0x140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq -0x270(%rbp), %rsi
movq %rax, %rcx
leaq -0x180(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x7ff30
jmp 0x1e6a5
xorl %eax, %eax
movl %eax, %esi
leaq -0x180(%rbp), %rdi
callq 0x1f260
movq %rax, %rcx
movq -0x238(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x278(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, -0x274(%rbp)
jmp 0x1e6d8
leaq -0x180(%rbp), %rdi
callq 0x1f280
movl -0x274(%rbp), %ecx
movl -0x278(%rbp), %eax
cmpl %ecx, %eax
jne 0x1e738
movq -0x110(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1e8e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x1f280
jmp 0x1e8f4
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x280(%rbp)
movq -0x140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq -0x280(%rbp), %rsi
movq %rax, %rcx
movb $0x0, -0x1b1(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x7ff30
jmp 0x1e780
leaq -0x198(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f260
movl (%rax), %ecx
xorl %eax, %eax
cmpl -0xcc(%rbp), %ecx
movb %al, -0x281(%rbp)
jne 0x1e839
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x290(%rbp)
movq -0x140(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq -0x290(%rbp), %rsi
movq %rax, %rcx
leaq -0x1b0(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x7ff30
jmp 0x1e7e7
movb $0x1, -0x1b1(%rbp)
leaq -0x1b0(%rbp), %rdi
movl $0x1, %esi
callq 0x1f260
movq %rax, %rcx
movq -0x238(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x298(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, -0x294(%rbp)
jmp 0x1e822
movl -0x298(%rbp), %eax
movl -0x294(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x281(%rbp)
movb -0x281(%rbp), %al
movb %al, -0x299(%rbp)
testb $0x1, -0x1b1(%rbp)
jne 0x1e850
jmp 0x1e85c
leaq -0x1b0(%rbp), %rdi
callq 0x1f280
leaq -0x198(%rbp), %rdi
callq 0x1f280
movb -0x299(%rbp), %al
testb $0x1, %al
jne 0x1e874
jmp 0x1e8df
movq -0x110(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1e8df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
jmp 0x1e8d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
testb $0x1, -0x1b1(%rbp)
jne 0x1e8c3
jmp 0x1e8cf
leaq -0x1b0(%rbp), %rdi
callq 0x1f280
jmp 0x1e8d1
leaq -0x198(%rbp), %rdi
callq 0x1f280
jmp 0x1e8f4
jmp 0x1e8e1
jmp 0x1e8e3
leaq -0x158(%rbp), %rdi
callq 0x1f280
jmp 0x1ec55
leaq -0x158(%rbp), %rdi
callq 0x1f280
jmp 0x1ecb9
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rsi
leaq -0x1d8(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
leaq -0x110(%rbp), %rdx
leaq -0xcc(%rbp), %rcx
callq 0x7ff30
movq -0x2b0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq %rax, %rcx
movq -0x238(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x2a4(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, -0x2a0(%rbp)
jmp 0x1e972
movl -0x2a4(%rbp), %eax
movl -0x2a0(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1e9ba
movq -0x110(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1ec39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
jmp 0x1ec47
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x2b8(%rbp)
movq -0x1c0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq -0x2b8(%rbp), %rsi
movq %rax, %rcx
leaq -0x1f0(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x7ff30
jmp 0x1e9fb
xorl %eax, %eax
movl %eax, %esi
leaq -0x1f0(%rbp), %rdi
callq 0x1f260
movq %rax, %rcx
movq -0x238(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x2c0(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, -0x2bc(%rbp)
jmp 0x1ea2e
leaq -0x1f0(%rbp), %rdi
callq 0x1f280
movl -0x2bc(%rbp), %ecx
movl -0x2c0(%rbp), %eax
cmpl %ecx, %eax
jne 0x1ea8e
movq -0xf0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1ec37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x1f280
jmp 0x1ec47
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x2c8(%rbp)
movq -0x1c0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq -0x2c8(%rbp), %rsi
movq %rax, %rcx
movb $0x0, -0x221(%rbp)
leaq -0x208(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x7ff30
jmp 0x1ead6
leaq -0x208(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f260
movl (%rax), %ecx
xorl %eax, %eax
cmpl -0xcc(%rbp), %ecx
movb %al, -0x2c9(%rbp)
jne 0x1eb8f
movq -0x238(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x2d8(%rbp)
movq -0x1c0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b610
movq -0x2d8(%rbp), %rsi
movq %rax, %rcx
leaq -0x220(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x7ff30
jmp 0x1eb3d
movb $0x1, -0x221(%rbp)
leaq -0x220(%rbp), %rdi
movl $0x1, %esi
callq 0x1f260
movq %rax, %rcx
movq -0x238(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x2e0(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, -0x2dc(%rbp)
jmp 0x1eb78
movl -0x2e0(%rbp), %eax
movl -0x2dc(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x2c9(%rbp)
movb -0x2c9(%rbp), %al
movb %al, -0x2e1(%rbp)
testb $0x1, -0x221(%rbp)
jne 0x1eba6
jmp 0x1ebb2
leaq -0x220(%rbp), %rdi
callq 0x1f280
leaq -0x208(%rbp), %rdi
callq 0x1f280
movb -0x2e1(%rbp), %al
testb $0x1, %al
jne 0x1ebca
jmp 0x1ec35
movq -0xf0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1ec35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
jmp 0x1ec27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x160(%rbp)
movl %eax, -0x164(%rbp)
testb $0x1, -0x221(%rbp)
jne 0x1ec19
jmp 0x1ec25
leaq -0x220(%rbp), %rdi
callq 0x1f280
jmp 0x1ec27
leaq -0x208(%rbp), %rdi
callq 0x1f280
jmp 0x1ec47
jmp 0x1ec37
jmp 0x1ec39
leaq -0x1d8(%rbp), %rdi
callq 0x1f280
jmp 0x1ec55
leaq -0x1d8(%rbp), %rdi
callq 0x1f280
jmp 0x1ecb9
jmp 0x1ec57
callq 0x38230
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
addq $0x28, %rsi
movl $0x1, %edx
callq 0x382c0
movsd %xmm0, -0xa8(%rbp)
jmp 0x1eca0
callq 0x38230
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
addq $0x28, %rsi
xorl %edx, %edx
callq 0x382c0
movsd %xmm0, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x189a0
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0x160(%rbp), %rdi
callq 0xaa60
nopw %cs:(%rax,%rax)
nop