// File: /workspace/github_cpp_makefile_star2_O1/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 0x16dad
cmpb $0x0, 0x175(%rax)
jne 0x16dad
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 0x16dad
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, -0x40(%rbp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x10(%r14), %r15
movq %r15, -0x38(%rbp)
movq 0x28(%r14), %rdi
callq 0x150fe
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 0x151ba
leaq 0x6f5b1(%rip), %rax     # 0x85dc8
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), %xmm0
movsd %xmm0, 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 -0x38(%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), %xmm3
movsd 0x10(%r15), %xmm2
movapd %xmm3, %xmm0
subsd -0x40(%rbp), %xmm0
movapd %xmm2, %xmm1
subsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm0
jb 0x169aa
sqrtsd %xmm0, %xmm0
jmp 0x169c7
movsd %xmm2, -0x38(%rbp)
movsd %xmm3, -0x58(%rbp)
callq 0x93c0
movsd -0x58(%rbp), %xmm3
movsd -0x38(%rbp), %xmm2
xorpd %xmm4, %xmm4
movsd 0x54ff9(%rip), %xmm1    # 0x6b9c8
ucomisd %xmm0, %xmm1
jbe 0x16af3
movsd -0x1d8(%rbp), %xmm5
movsd -0x40(%rbp), %xmm1
subsd %xmm3, %xmm1
movsd -0x30(%rbp), %xmm0
subsd %xmm2, %xmm0
movapd 0x54615(%rip), %xmm2    # 0x6b010
movapd %xmm1, %xmm4
andpd %xmm2, %xmm4
movsd 0x54635(%rip), %xmm3    # 0x6b040
ucomisd %xmm4, %xmm3
jbe 0x16a1f
andpd %xmm0, %xmm2
xorpd %xmm4, %xmm4
ucomisd %xmm2, %xmm3
ja 0x16a42
movsd %xmm5, -0x38(%rbp)
callq 0x90d0
movsd -0x38(%rbp), %xmm5
movapd %xmm0, %xmm4
mulsd 0x5460e(%rip), %xmm4    # 0x6b048
divsd 0x5460e(%rip), %xmm4    # 0x6b050
subsd %xmm4, %xmm5
movsd 0x54612(%rip), %xmm0    # 0x6b060
ucomisd %xmm5, %xmm0
jbe 0x16a68
movsd 0x54614(%rip), %xmm1    # 0x6b070
addsd %xmm1, %xmm5
ucomisd %xmm5, %xmm0
ja 0x16a5c
jmp 0x16a8c
ucomisd 0x545d8(%rip), %xmm5    # 0x6b048
jb 0x16a8c
movsd 0x545ee(%rip), %xmm1    # 0x6b068
movsd 0x545c6(%rip), %xmm2    # 0x6b048
addsd %xmm1, %xmm5
ucomisd %xmm2, %xmm5
jae 0x16a82
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm5
seta %al
leaq 0x54f50(%rip), %rcx     # 0x6b9f0
movsd (%rcx,%rax,8), %xmm1
movq 0x20(%r14), %rax
subsd 0xb0(%rax), %xmm1
addsd %xmm1, %xmm4
ucomisd %xmm4, %xmm0
jbe 0x16acf
movsd 0x545ad(%rip), %xmm1    # 0x6b070
addsd %xmm1, %xmm4
ucomisd %xmm4, %xmm0
ja 0x16ac3
jmp 0x16af3
ucomisd 0x54571(%rip), %xmm4    # 0x6b048
jb 0x16af3
movsd 0x54587(%rip), %xmm0    # 0x6b068
movsd 0x5455f(%rip), %xmm1    # 0x6b048
addsd %xmm0, %xmm4
ucomisd %xmm1, %xmm4
jae 0x16ae9
movq 0x18(%r14), %rbx
movsd 0x54551(%rip), %xmm0    # 0x6b050
movsd %xmm4, -0x38(%rbp)
mulsd %xmm4, %xmm0
divsd 0x54538(%rip), %xmm0    # 0x6b048
leaq -0x50(%rbp), %r15
leaq -0x110(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x92d0
movsd 0x54ea2(%rip), %xmm0    # 0x6b9d0
movsd (%r12), %xmm1
mulsd %xmm0, %xmm1
mulsd (%r15), %xmm0
movsd -0x40(%rbp), %xmm3
addsd %xmm1, %xmm3
movsd -0x30(%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
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x16b7d
sqrtsd %xmm0, %xmm0
jmp 0x16b82
callq 0x93c0
movsd 0x54e4e(%rip), %xmm1    # 0x6b9d8
ucomisd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
jbe 0x16bb4
movq 0x18(%r14), %rax
movq 0x68(%rax), %r15
movl $0x1, -0x50(%rbp)
cmpl $0x0, 0x668(%r15)
jle 0x16c11
addq $0x18, %r15
jmp 0x16c2c
movl $0xb, -0x70(%rbp)
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)
jmp 0x16d3c
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0xf062
movslq -0x50(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r15
addq $0x8, %r15
movsd (%r15), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x8(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x20(%r14), %rax
movq 0x68(%rax), %r15
movl $0x1, -0x50(%rbp)
cmpl $0x0, 0x668(%r15)
jle 0x16c60
addq $0x18, %r15
jmp 0x16c7b
leaq -0x50(%rbp), %rsi
movq %r15, %rdi
callq 0xf062
movslq -0x50(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r15
addq $0x8, %r15
movsd (%r15), %xmm0
subsd -0x40(%rbp), %xmm0
movsd 0x8(%r15), %xmm1
subsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x16cac
sqrtsd %xmm0, %xmm0
jmp 0x16cb1
callq 0x93c0
movsd %xmm0, -0x30(%rbp)
movq 0x20(%r14), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movsd (%rax), %xmm0
mulsd 0x54d14(%rip), %xmm0    # 0x6b9e0
ucomisd -0x30(%rbp), %xmm0
jbe 0x16d3c
movl $0xa, -0x70(%rbp)
movabsq $0x3ff000064a9cdc44, %rax # imm = 0x3FF000064A9CDC44
movq %rax, -0xf8(%rbp)
callq 0x4a75c
leaq 0x57221(%rip), %rax     # 0x6df18
movsd (%rax), %xmm0
mulsd 0x54b75(%rip), %xmm0    # 0x6b878
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 0xe804
leaq -0x108(%rbp), %rsi
movsd %xmm0, 0x20(%rsi)
leaq 0x48(%r14), %rdi
callq 0x16f62
leaq 0x48(%r14), %r15
cmpq %r15, 0x48(%r14)
je 0x16d89
movq %r15, %rdi
callq 0x12a4c
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 0x6e520(%rip), %rax     # 0x852b0
movq %rax, -0x288(%rbp)
movq -0x220(%rbp), %rdi
testq %rdi, %rdi
je 0x16dad
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 0x16dc7
jmp 0x16dc7
jmp 0x16dc7
jmp 0x16dc7
movq %rax, %rbx
leaq 0x6e4df(%rip), %rax     # 0x852b0
movq %rax, -0x288(%rbp)
movq -0x220(%rbp), %rdi
testq %rdi, %rdi
je 0x16dee
movl $0x670, %esi            # imm = 0x670
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0