// File: /workspace/github_cpp_makefile_star2_O1/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)
movl %eax, -0x38(%rbp)
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x30(%rbp)
movq 0x10(%rdi), %rax
movl 0x1c(%rax), %eax
cmpl $0x1, %eax
je 0x1b12f
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x16, %eax
jne 0x1b02f
movl $0xf, -0x38(%rbp)
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 0x298b0
movups (%rax), %xmm0
movups %xmm0, -0xa8(%rbp)
movq 0x20(%r14), %rax
movsd -0xa8(%rbp), %xmm0
movsd -0xa0(%rbp), %xmm1
subsd 0x8(%rax), %xmm0
subsd 0x10(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1b0c1
sqrtsd %xmm0, %xmm0
jmp 0x1b0c6
cmpl $0x14, %eax
jg 0x1b12f
movq 0x28(%r14), %rdi
callq 0x13c00
movq 0x20(%r14), %rcx
cmpl 0x11c(%rcx), %eax
jne 0x1b12f
cmpb $0x0, 0x128(%rcx)
je 0x1b13f
movq 0x38(%r14), %rax
movb $0x1, 0xa8(%rax)
movq 0x10(%r14), %rax
cmpl $0x16, 0x20(%rax)
je 0x1b12f
movl 0x10(%rax), %edx
subl 0x24(%rax), %edx
cmpl $0x13, %edx
jg 0x1b19e
leaq -0xa8(%rbp), %r14
movl $0x10, 0x70(%r14)
callq 0x24ed2
movq %rax, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x24f4c
movsd %xmm0, -0x18(%r14)
leaq -0xd0(%rbp), %rsi
movq %rbx, %rdi
callq 0x16f62
jmp 0x1b12f
callq 0x93c0
leaq -0xa8(%rbp), %r14
movsd 0x78(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1b0e0
movl $0x10, -0x38(%rbp)
callq 0x24ed2
movq %rax, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x24f4c
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)
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq -0xa8(%rbp), %r15
movl $0x11, 0x70(%r15)
movq 0x18(%r14), %rax
movupd 0x8(%rax), %xmm0
movupd %xmm0, (%r15)
callq 0x24ed2
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x24f4c
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 0x1b123
cmpl $0x14, %edx
jne 0x1b12f
cmpb $0x1, 0x175(%rcx)
jne 0x1b12f
movl $0xf, -0x38(%rbp)
movq 0x28(%r14), %rdi
callq 0x484c0
movq (%rax), %r15
movq 0x28(%r14), %rdi
callq 0x484c0
cmpq %rax, %r15
je 0x1b12f
movq 0x10(%r14), %rax
movslq 0x10(%r15), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
movsd -0xc8(%rax,%rcx), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
ucomisd 0x3838(%rax), %xmm0
jbe 0x1b27e
movq 0x10(%r14), %r12
movq 0x28(%r14), %rdi
movl 0x10(%r15), %esi
callq 0x180de
decl %eax
cltq
imulq $0x178, %rax, %rax      # imm = 0x178
movq 0x10(%r14), %rcx
movslq 0x10(%r15), %rdx
movsd 0x10d8(%r12,%rax), %xmm0
imulq $0x178, %rdx, %rdx      # imm = 0x178
subsd -0xc8(%rdx,%rcx), %xmm0
movsd 0x10e0(%r12,%rax), %xmm1
subsd -0xc0(%rdx,%rcx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x4fe29(%rip), %xmm0    # 0x6b090
jb 0x1b26f
sqrtsd %xmm0, %xmm0
jmp 0x1b274
callq 0x93c0
ucomisd 0x4fddc(%rip), %xmm0    # 0x6b058
jae 0x1b286
movq (%r15), %r15
jmp 0x1b1bf
callq 0x4a75c
movsd 0x3840(%rax), %xmm0
addsd 0x4fdbd(%rip), %xmm0    # 0x6b058
movsd %xmm0, -0x28(%rbp)
movq 0x10(%r14), %r14
movslq 0x10(%r15), %r15
callq 0x4a75c
movsd 0x3848(%rax), %xmm1
addsd 0x4fddb(%rip), %xmm1    # 0x6b098
imulq $0x178, %r15, %rax      # imm = 0x178
movsd -0xc0(%r14,%rax), %xmm0
maxsd -0x28(%rbp), %xmm0
minsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
callq 0x4a75c
movsd 0x4fdaf(%rip), %xmm0    # 0x6b098
addsd 0x3838(%rax), %xmm0
leaq -0xa8(%rbp), %r14
movsd %xmm0, (%r14)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x8(%r14)
jmp 0x1b095
nop