// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorShoot.cpp
// Function: BehaviorShootPlanner::Plan(std::__cxx11::list<ActiveBehavior, std::allocator<ActiveBehavior>>&)
void BehaviorShootPlanner::Plan(list<ActiveBehavior> &behavior_list) {
  if (!mSelfState.IsKickable())
    return;

  if (mWorldState.GetPlayMode() == PM_Our_Foul_Charge_Kick ||
      mWorldState.GetPlayMode() == PM_Our_Back_Pass_Kick ||
      mWorldState.GetPlayMode() == PM_Our_Indirect_Free_Kick ||
      (mWorldState.GetLastPlayMode() == PM_Our_Indirect_Free_Kick &&
       mAgent.IsLastActiveBehaviorInActOf(
           BT_Pass))) // Indircet后传球保持不射门，至少跑位后上个动作会改
  {
    return;
  }

  if (mSelfState.GetPos().X() >
      ServerParam::instance().pitchRectanglar().Right() -
          PlayerParam::instance().shootMaxDistance()) {
    AngleDeg left =
        (ServerParam::instance().oppLeftGoalPost() - mSelfState.GetPos()).Dir();
    AngleDeg right =
        (ServerParam::instance().oppRightGoalPost() - mSelfState.GetPos())
            .Dir();
    Vector target;
    AngleDeg interval;
    Line c(ServerParam::instance().oppLeftGoalPost(),
           ServerParam::instance().oppRightGoalPost());
    AngleDeg shootDir =
        mPositionInfo.GetShootAngle(left, right, mSelfState, interval);
    if (interval < mSelfState.GetRandAngle(
                       ServerParam::instance().maxPower(),
                       ServerParam::instance().ballSpeedMax(), mBallState) *
                       3) {
      return;
    }

    Ray f(mSelfState.GetPos(), shootDir);
    c.Intersection(f, target);
    if (Tackler::instance().CanTackleToDir(mAgent, shootDir) &&
        Tackler::instance().GetBallVelAfterTackle(mAgent, shootDir).Mod() >
            ServerParam::instance().ballSpeedMax() - 0.05) {
      ActiveBehavior shoot(mAgent, BT_Shoot, BDT_Shoot_Tackle);
      shoot.mTarget = target;
      shoot.mAngle = shootDir;
      shoot.mEvaluation = 2.0 + FLOAT_EPS;
      behavior_list.push_back(shoot);
    }

    else {
      ActiveBehavior shoot(mAgent, BT_Shoot);
      shoot.mTarget = target;
      shoot.mEvaluation = 2.0 + FLOAT_EPS;

      behavior_list.push_back(shoot);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x208(%rbp)
movq 0x20(%rax), %rdi
callq 0x10ef0
testb $0x1, %al
jne 0x277c0
jmp 0x27bfa
movq -0x208(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xd, %eax
je 0x2782f
movq -0x208(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xa, %eax
je 0x2782f
movq -0x208(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x7, %eax
je 0x2782f
movq -0x208(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x27300
cmpl $0x7, %eax
jne 0x27834
movq -0x208(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x7, %esi
callq 0x18520
testb $0x1, %al
jne 0x2782f
jmp 0x27834
jmp 0x27bfa
movq -0x208(%rbp), %rax
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd %xmm0, -0x210(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x1d830
movq %rax, %rdi
callq 0x218c0
movsd (%rax), %xmm0
movsd %xmm0, -0x218(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x27dd0
movsd -0x218(%rbp), %xmm1
movsd -0x210(%rbp), %xmm0
subsd (%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x27bfa
callq 0x855e0
movq %rax, %rdi
callq 0x27df0
movq %rax, %rcx
movq -0x208(%rbp), %rax
movq %rcx, -0x248(%rbp)
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x248(%rbp), %rdi
movq %rax, %rsi
callq 0x110a0
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x20(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x10520
movsd %xmm0, -0x18(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x27e10
movq %rax, %rcx
movq -0x208(%rbp), %rax
movq %rcx, -0x240(%rbp)
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x240(%rbp), %rdi
movq %rax, %rsi
callq 0x110a0
movsd %xmm0, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10520
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x11a10
callq 0x855e0
movq %rax, %rdi
callq 0x27df0
movq %rax, -0x238(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x27e10
movq -0x238(%rbp), %rsi
movq %rax, %rdx
leaq -0x80(%rbp), %rdi
callq 0x1efc0
movq -0x208(%rbp), %rax
movq 0x28(%rax), %rdi
movsd -0x18(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movq 0x20(%rax), %rsi
leaq -0x68(%rbp), %rdx
callq 0x7f240
movq -0x208(%rbp), %rax
movsd %xmm0, -0x88(%rbp)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0x230(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x10f10
movq %rax, -0x228(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x23d60
movq -0x230(%rbp), %rdi
movq -0x228(%rbp), %rsi
movq %rax, %rdx
movq -0x208(%rbp), %rax
movq 0x18(%rax), %rcx
callq 0x7cae0
movsd -0x220(%rbp), %xmm1
movsd 0x9a17c(%rip), %xmm2    # 0xc1bb8
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x27a4b
jmp 0x27bfa
movq -0x208(%rbp), %rax
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x1fde0
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x47af0
callq 0x8b3f0
movq %rax, %rdi
movq -0x208(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x88(%rbp), %rdx
callq 0x8c210
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x249(%rbp)
jne 0x27ab9
jmp 0x27b2f
callq 0x8b3f0
movq %rax, %rdi
movq -0x208(%rbp), %rax
movq 0x8(%rax), %rsi
movsd -0x88(%rbp), %xmm0
callq 0x8ba70
movsd %xmm0, -0xb0(%rbp)
movsd %xmm1, -0xa8(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0x258(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x23d60
movsd -0x258(%rbp), %xmm0
movsd (%rax), %xmm1
movsd 0x9a3ba(%rip), %xmm2    # 0xc1ed8
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x249(%rbp)
movb -0x249(%rbp), %al
testb $0x1, %al
jne 0x27b3b
jmp 0x27ba4
movq -0x208(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x158(%rbp), %rdi
movl $0x8, %edx
movl $0x9, %ecx
callq 0x1b4d0
movq -0x50(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x128(%rbp)
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
movsd 0x9a356(%rip), %xmm0    # 0xc1ee0
movsd %xmm0, -0x148(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x189a0
jmp 0x27bf8
movq -0x208(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x200(%rbp), %rdi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x1b4d0
movq -0x50(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movsd 0x9a300(%rip), %xmm0    # 0xc1ee0
movsd %xmm0, -0x1f0(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x189a0
jmp 0x27bfa
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)