// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorSetplay.cpp
// Function: BehaviorSetplayPlanner::Plan(std::__cxx11::list<ActiveBehavior, std::allocator<ActiveBehavior>>&)
void BehaviorSetplayPlanner::Plan(std::list<ActiveBehavior> &behavior_list) {
  ActiveBehavior setplay(mAgent, BT_Setplay);

  setplay.mBuffer = 0.5;

  if (mWorldState.GetPlayMode() != PM_Play_On) {
    if (mWorldState.GetPlayMode() == PM_Before_Kick_Off) {
      setplay.mDetailType = BDT_Setplay_Move;
      setplay.mTarget = TeammateFormationTactic(KickOffPosition)(
          mSelfState.GetUnum(), mWorldState.GetKickOffMode() == KO_Ours);

      if (setplay.mTarget.Dist(mSelfState.GetPos()) < setplay.mBuffer) {
        setplay.mDetailType = BDT_Setplay_Scan;
      }

      setplay.mEvaluation =
          Evaluation::instance().EvaluatePosition(setplay.mTarget, true);

      behavior_list.push_back(setplay);
    } else if (mWorldState.GetPlayMode() < PM_Our_Mode) {
      if (mPositionInfo.GetClosestTeammateToBall() == mSelfState.GetUnum()) {
        if (!mSelfState.IsKickable()) {
          setplay.mDetailType = BDT_Setplay_GetBall;
          setplay.mTarget = mBallState.GetPos();
          setplay.mEvaluation =
              Evaluation::instance().EvaluatePosition(setplay.mTarget, true);

          behavior_list.push_back(setplay);
        } else {
          mStrategy.SetForbidenDribble(true); //禁止带球

          if (mWorldState.GetLastPlayMode() != PM_Before_Kick_Off) {
            if (mWorldState.CurrentTime().T() -
                    mWorldState.GetPlayModeTime().T() <
                20) {
              setplay.mDetailType = BDT_Setplay_Scan;
              setplay.mEvaluation = Evaluation::instance().EvaluatePosition(
                  setplay.mTarget, true);

              behavior_list.push_back(setplay);
            } else if (mWorldState.CurrentTime().T() -
                               mWorldState.GetPlayModeTime().T() ==
                           20 &&
                       mSelfState.IsGoalie()) {
              setplay.mDetailType = BDT_Setplay_Move;
              for (list<KeyPlayerInfo>::const_iterator it =
                       mPositionInfo.GetXSortTeammate().begin();
                   it != mPositionInfo.GetXSortTeammate().end(); ++it) {
                if (mWorldState.GetTeammate((*it).mUnum).GetPos().X() >
                        ServerParam::instance().ourPenaltyArea().Right() &&
                    (mWorldState
                         .GetOpponent(
                             mPositionInfo.GetClosestOpponentToTeammate(
                                 (*it).mUnum))
                         .GetPos() -
                     mWorldState.GetTeammate((*it).mUnum).GetPos())
                            .Mod() >= 1.0) {
                  double y = MinMax(
                      ServerParam::instance().ourPenaltyArea().Top() + 1,
                      mWorldState.GetTeammate((*it).mUnum).GetPos().Y(),
                      ServerParam::instance().ourPenaltyArea().Bottom() - 1);
                  setplay.mTarget = Vector(
                      ServerParam::instance().ourPenaltyArea().Right() - 1, y);
                  setplay.mEvaluation = Evaluation::instance().EvaluatePosition(
                      setplay.mTarget, true);
                  behavior_list.push_back(setplay);
                  break;
                }
              }
            }
          }
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x120(%rbp)
movq 0x8(%rax), %rsi
leaq -0xb8(%rbp), %rdi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x1b4d0
movq -0x120(%rbp), %rax
movsd 0x9a66c(%rip), %xmm0    # 0xc1020
movsd %xmm0, -0x18(%rbp)
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x1, %eax
je 0x2702d
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x16, %eax
jne 0x26ae9
movq -0x120(%rbp), %rax
movl $0xf, -0x20(%rbp)
movq 0x40(%rax), %rdi
xorl %esi, %esi
callq 0x27280
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0x138(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x120(%rbp), %rax
movl %ecx, -0x12c(%rbp)
movq 0x10(%rax), %rdi
callq 0x272b0
movq -0x138(%rbp), %rdi
movl -0x12c(%rbp), %esi
cmpl $0x0, %eax
sete %al
movzbl %al, %edx
andl $0x1, %edx
callq 0x46f00
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
movq 0x8(%rcx), %rcx
movq %rcx, -0x88(%rbp)
leaq -0xb8(%rbp), %rcx
addq $0x28, %rcx
movq %rcx, -0x128(%rbp)
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x1d6d0
movaps %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x26aaf
movl $0x10, -0x20(%rbp)
callq 0x38230
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
addq $0x28, %rsi
movl $0x1, %edx
callq 0x382c0
movsd %xmm0, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x189a0
jmp 0x2702b
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x15, %eax
jge 0x27029
movq -0x120(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1b410
movl %eax, %ecx
movq -0x120(%rbp), %rax
movl %ecx, -0x13c(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movl -0x13c(%rbp), %eax
cmpl %ecx, %eax
jne 0x27027
movq -0x120(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x10ef0
testb $0x1, %al
jne 0x26bb8
movq -0x120(%rbp), %rax
movl $0x11, -0x20(%rbp)
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq (%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x38230
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
addq $0x28, %rsi
movl $0x1, %edx
callq 0x382c0
movsd %xmm0, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x189a0
jmp 0x27025
movq -0x120(%rbp), %rax
movq 0x38(%rax), %rdi
movb $0x1, -0xb9(%rbp)
leaq -0xb9(%rbp), %rsi
callq 0x272d0
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x27300
cmpl $0x16, %eax
je 0x27023
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12100
movq %rax, %rdi
callq 0x13040
movl %eax, %ecx
movq -0x120(%rbp), %rax
movl %ecx, -0x140(%rbp)
movq 0x10(%rax), %rdi
callq 0x253d0
movq %rax, %rdi
callq 0x13040
movl %eax, %ecx
movl -0x140(%rbp), %eax
subl %ecx, %eax
cmpl $0x14, %eax
jge 0x26c77
movl $0x10, -0x20(%rbp)
callq 0x38230
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
addq $0x28, %rsi
movl $0x1, %edx
callq 0x382c0
movsd %xmm0, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x189a0
jmp 0x27021
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12100
movq %rax, %rdi
callq 0x13040
movl %eax, %ecx
movq -0x120(%rbp), %rax
movl %ecx, -0x144(%rbp)
movq 0x10(%rax), %rdi
callq 0x253d0
movq %rax, %rdi
callq 0x13040
movl %eax, %ecx
movl -0x144(%rbp), %eax
subl %ecx, %eax
cmpl $0x14, %eax
jne 0x2701f
movq -0x120(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x1d780
testb $0x1, %al
jne 0x26cdb
jmp 0x2701f
movq -0x120(%rbp), %rax
movl $0xf, -0x20(%rbp)
movq 0x28(%rax), %rdi
callq 0x7f020
movq %rax, %rdi
callq 0x27320
movq %rax, -0xc8(%rbp)
movq -0x120(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x7f020
movq %rax, %rdi
callq 0x27380
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x27350
testb $0x1, %al
jne 0x26d3c
jmp 0x2701d
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x158(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x273b0
movq -0x158(%rbp), %rdi
movq %rax, %rsi
callq 0x12520
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd %xmm0, -0x150(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x1fe50
movq %rax, %rdi
callq 0x218c0
movsd -0x150(%rbp), %xmm0
movq %rax, %rcx
xorl %eax, %eax
ucomisd (%rcx), %xmm0
movb %al, -0x145(%rbp)
jbe 0x26e9a
movq -0x120(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x170(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x178(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x273b0
movq -0x178(%rbp), %rdi
movl (%rax), %esi
callq 0x22160
movq -0x170(%rbp), %rdi
movl %eax, -0xe4(%rbp)
leaq -0xe4(%rbp), %rsi
callq 0x1d480
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0x160(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x168(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x273b0
movq -0x168(%rbp), %rdi
movq %rax, %rsi
callq 0x12520
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x160(%rbp), %rdi
movq %rax, %rsi
callq 0x110a0
movsd %xmm0, -0xe0(%rbp)
movsd %xmm1, -0xd8(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x104e0
movsd 0x9a183(%rip), %xmm1    # 0xc1010
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x145(%rbp)
movb -0x145(%rbp), %al
testb $0x1, %al
jne 0x26ea9
jmp 0x2700a
callq 0x855e0
movq %rax, %rdi
callq 0x1fe50
movq %rax, %rdi
callq 0x23f40
movq %rax, %rcx
movq -0x120(%rbp), %rax
movsd 0x9a140(%rip), %xmm0    # 0xc1010
addsd (%rcx), %xmm0
movsd %xmm0, -0xf8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x188(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x273b0
movq -0x188(%rbp), %rdi
movq %rax, %rsi
callq 0x12520
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x17700
movq %rax, -0x180(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x1fe50
movq %rax, %rdi
callq 0x23f60
movq -0x180(%rbp), %rsi
movsd (%rax), %xmm0
movsd 0x9a0cb(%rip), %xmm1    # 0xc1010
subsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rdx
callq 0x12a20
movsd (%rax), %xmm0
movsd %xmm0, -0xf0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x1fe50
movq %rax, %rdi
callq 0x218c0
movsd (%rax), %xmm0
movsd 0x9a07f(%rip), %xmm1    # 0xc1010
subsd %xmm1, %xmm0
movsd %xmm0, -0x118(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x11a10
movq -0x110(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x38230
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
addq $0x28, %rsi
movl $0x1, %edx
callq 0x382c0
movsd %xmm0, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x189a0
jmp 0x2701d
jmp 0x2700c
leaq -0xc8(%rbp), %rdi
callq 0x273e0
jmp 0x26d01
jmp 0x2701f
jmp 0x27021
jmp 0x27023
jmp 0x27025
jmp 0x27027
jmp 0x27029
jmp 0x2702b
jmp 0x2702d
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw %cs:(%rax,%rax)