// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorHold.cpp
// Function: BehaviorHoldPlanner::Plan(std::__cxx11::list<ActiveBehavior, std::allocator<ActiveBehavior>>&)
void BehaviorHoldPlanner::Plan(std::list<ActiveBehavior> &behavior_list) {
  if (!mSelfState.IsKickable())
    return;
  if (mSelfState.IsGoalie())
    return;
  if (mStrategy.GetSureOppInterCycle() <= 2 &&
      mStrategy.GetSureOppInterCycle() != 0) {

    ActiveBehavior hold(mAgent, BT_Hold);
    double dDist;
    Vector posAgent = mSelfState.GetPos();
    PlayerState objOpp =
        mWorldState.GetOpponent(mPositionInfo.GetClosestOpponentToBall());
    Vector posOpp = objOpp.GetPos();
    dDist = (posOpp - posAgent).Mod();
    AngleDeg angOpp = objOpp.GetBodyDir();
    AngleDeg ang = 0.0;

    if (dDist < 5) {
      ang = (posAgent - posOpp).Dir();
      int iSign = (GetNormalizeAngleDeg(angOpp - ang)) > 0 ? -1 : 1;
      ang += iSign * 45 - mSelfState.GetBodyDir();
      ang = GetNormalizeAngleDeg(ang);
    }

    if (mBallState.GetPos().Dist(posAgent + Polar2Vector(0.7, ang)) < 0.3) {

      Vector posBallPred = mBallState.GetPredictedPos(1);
      Vector posPred = mSelfState.GetPredictedPos(1);
      if (posPred.Dist(posBallPred) < 0.85 * mSelfState.GetKickableArea()) {
        hold.mDetailType = BDT_Hold_Turn;
        hold.mEvaluation = 1.0 + FLOAT_EPS;
        hold.mAngle = (Vector(ServerParam::instance().PITCH_LENGTH / 2.0, 0.0) -
                       mSelfState.GetPos())
                          .Dir();
        mActiveBehaviorList.push_back(hold);
      }
    } else {
      hold.mDetailType = BDT_Hold_Kick;
      hold.mAngle = ang;
      hold.mEvaluation = 1.0 + FLOAT_EPS;
      mActiveBehaviorList.push_back(hold);
    }

    if (!mActiveBehaviorList.empty()) {
      mActiveBehaviorList.sort(std::greater<ActiveBehavior>());
      behavior_list.push_back(mActiveBehaviorList.front());
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq 0x20(%rdi), %rax
cmpb $0x1, 0x128(%rax)
jne 0x16b1a
cmpb $0x0, 0x175(%rax)
jne 0x16b1a
movq %rdi, %r14
movq 0x38(%rdi), %rcx
movl 0x80(%rcx), %ecx
cmpl $0x3, %ecx
setge %dl
testl %ecx, %ecx
sete %cl
orb %dl, %cl
jne 0x16b1a
movq %rsi, -0x60(%rbp)
movq 0x8(%r14), %rcx
movl $0x6, -0x108(%rbp)
movq %rcx, -0x100(%rbp)
xorl %r13d, %r13d
movq %r13, -0xf8(%rbp)
movl %r13d, -0xf0(%rbp)
movl %r13d, -0xb0(%rbp)
movq %r13, -0xa8(%rbp)
movl %r13d, -0xa0(%rbp)
movq %r13, -0x98(%rbp)
movl %r13d, -0x90(%rbp)
movq %r13, -0x88(%rbp)
movl %r13d, -0x80(%rbp)
movq %r13, -0x78(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0xe8(%rbp)
movups %xmm0, -0xd8(%rbp)
movups %xmm0, -0xc8(%rbp)
movb $0x0, -0xb8(%rbp)
movl %r13d, -0x70(%rbp)
movq %r13, -0x68(%rbp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq 0x10(%r14), %r15
movq %r15, -0x30(%rbp)
movq 0x28(%r14), %rdi
callq 0x14f02
decl %eax
cltq
imulq $0x178, %rax, %rbx      # imm = 0x178
leaq (%r15,%rbx), %r12
addq $0x10d0, %r12           # imm = 0x10D0
leaq -0x288(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x14fbe
leaq 0x6c899(%rip), %rax     # 0x82e68
movq %rax, (%r15)
movups 0x78(%r12), %xmm0
movups 0x88(%r12), %xmm1
movups %xmm0, 0x78(%r15)
movups %xmm1, 0x88(%r15)
movsd 0x98(%r12), %xmm0
movsd %xmm0, 0x98(%r15)
movl 0xa0(%r12), %eax
movl %eax, 0xa0(%r15)
movsd 0xa8(%r12), %xmm0
movsd %xmm0, 0xa8(%r15)
movsd 0xb0(%r12), %xmm5
movsd %xmm5, 0xb0(%r15)
movl 0xb8(%r12), %eax
movl %eax, 0xb8(%r15)
movsd 0xc0(%r12), %xmm0
movsd %xmm0, 0xc0(%r15)
movq 0xc8(%r12), %rax
movq %rax, 0xc8(%r15)
movq %r13, 0xe0(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%r15)
movups 0xd0(%r12), %xmm0
movups %xmm0, 0xd0(%r15)
movq 0xe0(%r12), %rax
movq %rax, 0xe0(%r15)
movl 0xe8(%r12), %eax
movl %eax, 0xe8(%r15)
movsd 0xf0(%r12), %xmm0
movsd %xmm0, 0xf0(%r15)
movb $0x3f, 0xf8(%r15)
movl %r13d, 0xfc(%r15)
movq 0xf8(%r12), %rax
movq %rax, 0xf8(%r15)
movl 0x100(%r12), %eax
movl %eax, 0x100(%r15)
movsd 0x108(%r12), %xmm0
movsd %xmm0, 0x108(%r15)
leaq -0x178(%rbp), %rax
movq -0x30(%rbp), %rcx
leaq 0x11e0(%rcx,%rbx), %rdx
movl $0xc, %ecx
movq %rax, %rdi
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0x60(%rdx), %ecx
movl 0x63(%rdx), %edx
movl %ecx, 0x60(%rax)
movl %edx, 0x63(%rax)
movsd 0x8(%r15), %xmm0
movsd 0x10(%r15), %xmm2
movapd %xmm0, %xmm1
subsd -0x38(%rbp), %xmm1
movapd %xmm2, %xmm3
subsd -0x40(%rbp), %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm1, %xmm1
addsd %xmm3, %xmm1
sqrtsd %xmm1, %xmm1
xorpd %xmm4, %xmm4
movsd 0x53266(%rip), %xmm3    # 0x699c8
ucomisd %xmm1, %xmm3
jbe 0x1687e
movsd -0x38(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
subsd %xmm2, %xmm0
movapd 0x5288a(%rip), %xmm2    # 0x69010
movapd %xmm1, %xmm4
andpd %xmm2, %xmm4
movsd 0x528aa(%rip), %xmm3    # 0x69040
ucomisd %xmm4, %xmm3
jbe 0x167aa
andpd %xmm0, %xmm2
xorpd %xmm4, %xmm4
ucomisd %xmm2, %xmm3
ja 0x167cd
movsd %xmm5, -0x30(%rbp)
callq 0x90d0
movsd -0x30(%rbp), %xmm5
movapd %xmm0, %xmm4
mulsd 0x52883(%rip), %xmm4    # 0x69048
divsd 0x52883(%rip), %xmm4    # 0x69050
subsd %xmm4, %xmm5
movsd 0x52887(%rip), %xmm0    # 0x69060
ucomisd %xmm5, %xmm0
jbe 0x167f3
movsd 0x52889(%rip), %xmm1    # 0x69070
addsd %xmm1, %xmm5
ucomisd %xmm5, %xmm0
ja 0x167e7
jmp 0x16817
ucomisd 0x5284d(%rip), %xmm5    # 0x69048
jb 0x16817
movsd 0x52863(%rip), %xmm1    # 0x69068
movsd 0x5283b(%rip), %xmm2    # 0x69048
addsd %xmm1, %xmm5
ucomisd %xmm2, %xmm5
jae 0x1680d
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm5
seta %al
leaq 0x531c5(%rip), %rcx     # 0x699f0
movsd (%rcx,%rax,8), %xmm1
movq 0x20(%r14), %rax
subsd 0xb0(%rax), %xmm1
addsd %xmm1, %xmm4
ucomisd %xmm4, %xmm0
jbe 0x1685a
movsd 0x52822(%rip), %xmm1    # 0x69070
addsd %xmm1, %xmm4
ucomisd %xmm4, %xmm0
ja 0x1684e
jmp 0x1687e
ucomisd 0x527e6(%rip), %xmm4    # 0x69048
jb 0x1687e
movsd 0x527fc(%rip), %xmm0    # 0x69068
movsd 0x527d4(%rip), %xmm1    # 0x69048
addsd %xmm0, %xmm4
ucomisd %xmm1, %xmm4
jae 0x16874
movsd %xmm4, -0x30(%rbp)
movq 0x18(%r14), %rbx
movsd 0x527c1(%rip), %xmm0    # 0x69050
mulsd %xmm4, %xmm0
divsd 0x527ad(%rip), %xmm0    # 0x69048
leaq -0x50(%rbp), %r15
leaq -0x110(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x92d0
movsd 0x53117(%rip), %xmm0    # 0x699d0
movsd (%r12), %xmm1
mulsd %xmm0, %xmm1
mulsd (%r15), %xmm0
movsd -0x38(%rbp), %xmm3
addsd %xmm1, %xmm3
movsd -0x40(%rbp), %xmm2
addsd %xmm0, %xmm2
movsd 0x8(%rbx), %xmm0
subsd %xmm3, %xmm0
movsd 0x10(%rbx), %xmm1
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x530d4(%rip), %xmm1    # 0x699d8
ucomisd %xmm0, %xmm1
jbe 0x16a51
movq 0x18(%r14), %rax
movq 0x68(%rax), %r15
movl $0x1, -0x50(%rbp)
movl $0x1, %ebx
cmpl $0x0, 0x668(%r15)
movl $0x1, %eax
jg 0x16941
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0xef58
movslq -0x50(%rbp), %rax
shlq $0x4, %rax
movsd 0x8(%r15,%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x10(%r15,%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq 0x20(%r14), %rdi
movq 0x68(%rdi), %r15
movl $0x1, -0x50(%rbp)
cmpl $0x0, 0x668(%r15)
jg 0x1698a
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0xef58
movslq -0x50(%rbp), %rbx
movq 0x20(%r14), %rdi
shlq $0x4, %rbx
movsd 0x8(%r15,%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x10(%r15,%rbx), %xmm0
movsd %xmm0, -0x58(%rbp)
movq (%rdi), %rax
callq *0x10(%rax)
movsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
subsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd (%rax), %xmm1
mulsd 0x53004(%rip), %xmm1    # 0x699e0
ucomisd %xmm0, %xmm1
jbe 0x16aae
movl $0xa, -0x70(%rbp)
movabsq $0x3ff000064a9cdc44, %rax # imm = 0x3FF000064A9CDC44
movq %rax, -0xf8(%rbp)
callq 0x49360
leaq 0x554de(%rip), %rax     # 0x6bee8
movsd (%rax), %xmm0
mulsd 0x52e62(%rip), %xmm0    # 0x69878
movq 0x20(%r14), %rax
subsd 0x8(%rax), %xmm0
xorpd %xmm1, %xmm1
subsd 0x10(%rax), %xmm1
leaq -0x50(%rbp), %rdi
movsd %xmm0, (%rdi)
movsd %xmm1, 0x8(%rdi)
callq 0xe702
leaq -0x108(%rbp), %rsi
movsd %xmm0, 0x20(%rsi)
leaq 0x48(%r14), %rdi
callq 0x16cca
jmp 0x16aae
movl $0xb, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
movabsq $0x3ff000064a9cdc44, %rax # imm = 0x3FF000064A9CDC44
movq %rax, -0xf8(%rbp)
movl $0xb8, %edi
callq 0x94c0
movq %rax, %r15
leaq 0x48(%r14), %r12
movq %rax, %rdi
addq $0x10, %rdi
leaq -0x108(%rbp), %rsi
movl $0xa8, %edx
callq 0x93e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x90b0
incq 0x58(%r14)
leaq 0x48(%r14), %r15
cmpq %r15, 0x48(%r14)
je 0x16afb
movq %r15, %rdi
callq 0x12934
movq (%r15), %r14
movl $0xb8, %edi
callq 0x94c0
movq %rax, %r15
addq $0x10, %r14
movq %rax, %rdi
addq $0x10, %rdi
movl $0xa8, %edx
movq %r14, %rsi
callq 0x93e0
movq %r15, %rdi
movq -0x60(%rbp), %rbx
movq %rbx, %rsi
callq 0x90b0
incq 0x10(%rbx)
leaq 0x6b8ce(%rip), %rax     # 0x823d0
movq %rax, -0x288(%rbp)
movq -0x220(%rbp), %rdi
movl $0x670, %esi            # imm = 0x670
callq 0x94e0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16b34
jmp 0x16b34
jmp 0x16b34
jmp 0x16b34
movq %rax, %rbx
leaq 0x6b892(%rip), %rax     # 0x823d0
movq %rax, -0x288(%rbp)
movq -0x220(%rbp), %rdi
movl $0x670, %esi            # imm = 0x670
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0