// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x260, %rsp            # imm = 0x260
movq 0x20(%rdi), %rax
cmpb $0x1, 0x128(%rax)
jne 0x13b69
cmpb $0x0, 0x175(%rax)
jne 0x13b69
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 0x13b69
movq %rsi, %rbx
movq 0x8(%r14), %rcx
movl $0x6, -0x100(%rbp)
movq %rcx, -0xf8(%rbp)
andq $0x0, -0xf0(%rbp)
andl $0x0, -0xe8(%rbp)
andl $0x0, -0xa8(%rbp)
andq $0x0, -0xa0(%rbp)
andl $0x0, -0x98(%rbp)
andq $0x0, -0x90(%rbp)
andl $0x0, -0x88(%rbp)
andq $0x0, -0x80(%rbp)
andl $0x0, -0x78(%rbp)
andq $0x0, -0x70(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0xe0(%rbp)
movups %xmm0, -0xd0(%rbp)
movups %xmm0, -0xc0(%rbp)
movb $0x0, -0xb0(%rbp)
andl $0x0, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x10(%r14), %r15
movq 0x28(%r14), %rdi
callq 0x12338
decl %eax
cltq
imulq $0x178, %rax, %rax      # imm = 0x178
leaq (%r15,%rax), %rsi
addq $0x10d0, %rsi           # imm = 0x10D0
leaq -0x278(%rbp), %r15
movq %r15, %rdi
callq 0x12368
movsd 0x8(%r15), %xmm1
movsd 0x10(%r15), %xmm0
movapd %xmm1, %xmm2
subsd -0x30(%rbp), %xmm2
movapd %xmm0, %xmm3
subsd -0x38(%rbp), %xmm3
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm2
addsd %xmm3, %xmm2
sqrtsd %xmm2, %xmm2
andq $0x0, -0x40(%rbp)
movsd 0xb0(%r15), %xmm4
movsd 0x4407a(%rip), %xmm3    # 0x57998
ucomisd %xmm2, %xmm3
jbe 0x139b7
movsd %xmm4, -0x28(%rbp)
movsd -0x30(%rbp), %xmm2
subsd %xmm1, %xmm2
movsd -0x38(%rbp), %xmm1
subsd %xmm0, %xmm1
leaq -0x50(%rbp), %rdi
movsd %xmm2, (%rdi)
movsd %xmm1, 0x8(%rdi)
callq 0xcd30
movsd -0x28(%rbp), %xmm1
subsd %xmm0, %xmm1
movabsq $-0x3f99800000000000, %r12 # imm = 0xC066800000000000
leaq -0x50(%rbp), %r15
movq %r12, (%r15)
movsd %xmm0, -0x28(%rbp)
movapd %xmm1, %xmm0
movq %r15, %rdi
callq 0xd305
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
seta %al
leaq 0x44020(%rip), %rcx     # 0x579b0
movsd (%rcx,%rax,8), %xmm0
movq 0x20(%r14), %rax
subsd 0xb0(%rax), %xmm0
addsd -0x28(%rbp), %xmm0
movq %r12, (%r15)
leaq -0x50(%rbp), %rdi
callq 0xd305
movsd %xmm0, -0x40(%rbp)
movq 0x18(%r14), %r15
movabsq $0x3fe6666666666666, %rax # imm = 0x3FE6666666666666
leaq -0x50(%rbp), %rdi
movq %rax, (%rdi)
leaq -0x40(%rbp), %rsi
callq 0xd15b
movsd -0x30(%rbp), %xmm3
addsd %xmm0, %xmm3
movsd -0x38(%rbp), %xmm2
addsd %xmm1, %xmm2
movsd 0x8(%r15), %xmm0
subsd %xmm3, %xmm0
movsd 0x10(%r15), %xmm1
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x43f8d(%rip), %xmm1    # 0x579a0
ucomisd %xmm0, %xmm1
jbe 0x13b0a
movq 0x18(%r14), %rdi
pushq $0x1
popq %rsi
callq 0xd4c0
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq 0x20(%r14), %rdi
pushq $0x1
popq %rsi
callq 0xd4c0
movsd (%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movq 0x20(%r14), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movsd -0x28(%rbp), %xmm0
subsd -0x30(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
subsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd (%rax), %xmm1
mulsd 0x43f13(%rip), %xmm1    # 0x579a8
ucomisd %xmm0, %xmm1
jbe 0x13b3c
movl $0xa, -0x68(%rbp)
movabsq $0x3ff000064a9cdc44, %rax # imm = 0x3FF000064A9CDC44
movq %rax, -0xf0(%rbp)
callq 0x3db2c
leaq 0x46405(%rip), %rax     # 0x59ec8
movsd (%rax), %xmm0
mulsd 0x43d79(%rip), %xmm0    # 0x57848
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 0xcd30
leaq -0x100(%rbp), %rsi
movsd %xmm0, 0x20(%rsi)
leaq 0x48(%r14), %rdi
callq 0x10530
jmp 0x13b3c
leaq -0x100(%rbp), %rsi
movl $0xb, 0x98(%rsi)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x20(%rsi)
movabsq $0x3ff000064a9cdc44, %rax # imm = 0x3FF000064A9CDC44
movq %rax, 0x10(%rsi)
leaq 0x48(%r14), %rdi
callq 0x10530
leaq 0x48(%r14), %r15
cmpq %r15, 0x48(%r14)
je 0x13b5d
movq %r15, %rdi
callq 0x10370
movq (%r15), %rsi
addq $0x10, %rsi
movq %rbx, %rdi
callq 0x10530
leaq -0x278(%rbp), %rdi
callq 0xd716
addq $0x260, %rsp            # imm = 0x260
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13b85
jmp 0x13b85
jmp 0x13b85
jmp 0x13b85
jmp 0x13b85
jmp 0x13b85
movq %rax, %rbx
leaq -0x278(%rbp), %rdi
callq 0xd716
movq %rbx, %rdi
callq 0x98b0