// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq 0x8(%rdi), %rax
movl $0x3, -0xd0(%rbp)
movq %rax, -0xc8(%rbp)
xorl %eax, %eax
movq %rax, -0xc0(%rbp)
movl %eax, -0xb8(%rbp)
movl %eax, -0x78(%rbp)
movq %rax, -0x70(%rbp)
movl %eax, -0x68(%rbp)
movq %rax, -0x60(%rbp)
movl %eax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movl %eax, -0x48(%rbp)
movq %rax, -0x40(%rbp)
xorpd %xmm0, %xmm0
movupd %xmm0, -0xb0(%rbp)
movupd %xmm0, -0xa0(%rbp)
movupd %xmm0, -0x90(%rbp)
movb $0x0, -0x80(%rbp)
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x30(%rbp)
movq 0x10(%rdi), %rax
movl 0x1c(%rax), %eax
cmpl $0x1, %eax
je 0x1aef4
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x16, %eax
jne 0x1ad22
leaq -0xa8(%rbp), %r15
movl $0xf, 0x70(%r15)
movq 0x40(%r14), %rax
movq 0x10(%rax), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x18(%rax)
movq 0x10(%r14), %rcx
movq 0x20(%r14), %rdx
movl 0x11c(%rdx), %esi
xorl %edx, %edx
cmpl $0x0, 0x18(%rcx)
sete %dl
movq %rax, %rdi
callq 0x2904a
movups (%rax), %xmm0
movups %xmm0, (%r15)
movq 0x20(%r14), %rax
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
subsd 0x8(%rax), %xmm0
subsd 0x10(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x4ebb7(%rip), %xmm1    # 0x69878
ucomisd %xmm0, %xmm1
jbe 0x1acce
movl $0x10, -0x38(%rbp)
callq 0x24814
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2488e
leaq -0xd0(%rbp), %r14
movsd %xmm0, 0x10(%r14)
movl $0xb8, %edi
callq 0x94c0
movq %rax, %r15
leaq 0x10(%rax), %rdi
movl $0xa8, %edx
movq %r14, %rsi
callq 0x93e0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x90b0
incq 0x10(%rbx)
jmp 0x1aef4
cmpl $0x14, %eax
jg 0x1aef4
movq 0x28(%r14), %rdi
callq 0x13ab2
movq 0x20(%r14), %rcx
cmpl 0x11c(%rcx), %eax
jne 0x1aef4
cmpb $0x0, 0x128(%rcx)
je 0x1adb3
movq 0x38(%r14), %rax
movb $0x1, 0xa8(%rax)
movq 0x10(%r14), %rax
cmpl $0x16, 0x20(%rax)
je 0x1aef4
movl 0x10(%rax), %edx
subl 0x24(%rax), %edx
cmpl $0x13, %edx
jg 0x1ae15
leaq -0xa8(%rbp), %r14
movl $0x10, 0x70(%r14)
callq 0x24814
movq %rax, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x2488e
movsd %xmm0, -0x18(%r14)
leaq -0xd0(%rbp), %rsi
movq %rbx, %rdi
callq 0x16cca
jmp 0x1aef4
leaq -0xa8(%rbp), %r15
movl $0x11, 0x70(%r15)
movq 0x18(%r14), %rax
movupd 0x8(%rax), %xmm0
movupd %xmm0, (%r15)
callq 0x24814
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2488e
movsd %xmm0, -0x18(%r15)
movl $0xb8, %edi
callq 0x94c0
movq %rax, %r14
leaq 0x10(%rax), %rdi
leaq -0xd0(%rbp), %rsi
movl $0xa8, %edx
callq 0x93e0
movq %r14, %rdi
jmp 0x1ad11
cmpl $0x14, %edx
jne 0x1aef4
cmpb $0x1, 0x175(%rcx)
jne 0x1aef4
movl $0xf, -0x38(%rbp)
movq 0x28(%r14), %rdi
callq 0x470bc
movq (%rax), %r15
movq 0x28(%r14), %rdi
callq 0x470bc
cmpq %rax, %r15
je 0x1aef4
movq 0x10(%r14), %rax
movslq 0x10(%r15), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
movsd -0xc8(%rax,%rcx), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x49360
movsd -0x28(%rbp), %xmm0
ucomisd 0x3838(%rax), %xmm0
jbe 0x1aeec
movq 0x10(%r14), %r12
movq 0x28(%r14), %rdi
movl 0x10(%r15), %esi
callq 0x17e14
decl %eax
cltq
imulq $0x178, %rax, %rax      # imm = 0x178
movq 0x10(%r14), %rcx
movslq 0x10(%r15), %rdx
movsd 0x10d8(%r12,%rax), %xmm0
movsd 0x10e0(%r12,%rax), %xmm1
imulq $0x178, %rdx, %rax      # imm = 0x178
subsd -0xc8(%rax,%rcx), %xmm0
subsd -0xc0(%rax,%rcx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
ucomisd 0x4e16e(%rip), %xmm0    # 0x69058
jae 0x1af04
movq (%r15), %r15
jmp 0x1ae3e
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x49360
movsd 0x3840(%rax), %xmm0
addsd 0x4e13f(%rip), %xmm0    # 0x69058
movsd %xmm0, -0x28(%rbp)
movq 0x10(%r14), %r14
movslq 0x10(%r15), %r15
callq 0x49360
movsd 0x3848(%rax), %xmm1
addsd 0x4e15d(%rip), %xmm1    # 0x69098
imulq $0x178, %r15, %rax      # imm = 0x178
movsd -0xc0(%r14,%rax), %xmm0
maxsd -0x28(%rbp), %xmm0
minsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
callq 0x49360
movsd 0x4e131(%rip), %xmm0    # 0x69098
addsd 0x3838(%rax), %xmm0
leaq -0xa8(%rbp), %r14
movsd %xmm0, (%r14)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x8(%r14)
jmp 0x1ad84
nop