// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq 0x20(%rdi), %rax
cmpb $0x1, 0x128(%rax)
jne 0x1b329
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rcx
movl 0x1c(%rcx), %edx
cmpl $0xd, %edx
ja 0x1b339
movl $0x2480, %esi           # imm = 0x2480
btl %edx, %esi
jae 0x1b339
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x7, 0x20(%rcx)
jne 0x1b354
movq 0x8(%r14), %rcx
movq 0xc0(%rcx), %rcx
testq %rcx, %rcx
je 0x1b354
cmpl $0x7, (%rcx)
je 0x1b329
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x49360
movsd 0x37f8(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x43dce
movsd -0x30(%rbp), %xmm1
subsd 0x5c70(%rax), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1b329
callq 0x49360
movq 0x20(%r14), %rcx
movsd 0x3930(%rax), %xmm1
movsd 0x3938(%rax), %xmm0
subsd 0x8(%rcx), %xmm1
subsd 0x10(%rcx), %xmm0
movapd 0x4dc58(%rip), %xmm3    # 0x69010
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
movsd 0x4dc78(%rip), %xmm4    # 0x69040
ucomisd %xmm2, %xmm4
jbe 0x1b3e0
movapd %xmm0, %xmm2
andpd %xmm3, %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm2, %xmm4
ja 0x1b3f9
callq 0x90d0
movapd %xmm0, %xmm3
mulsd 0x4dc57(%rip), %xmm3    # 0x69048
divsd 0x4dc57(%rip), %xmm3    # 0x69050
movsd %xmm3, -0x28(%rbp)
callq 0x49360
movapd 0x4dc05(%rip), %xmm4    # 0x69010
movsd 0x4dc2d(%rip), %xmm3    # 0x69040
movq 0x20(%r14), %rcx
movsd 0x3940(%rax), %xmm1
movsd 0x3948(%rax), %xmm0
subsd 0x8(%rcx), %xmm1
subsd 0x10(%rcx), %xmm0
movapd %xmm1, %xmm2
andpd %xmm4, %xmm2
ucomisd %xmm2, %xmm3
jbe 0x1b44d
andpd %xmm0, %xmm4
xorpd %xmm2, %xmm2
ucomisd %xmm4, %xmm3
ja 0x1b466
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x4dbea(%rip), %xmm2    # 0x69048
divsd 0x4dbea(%rip), %xmm2    # 0x69050
movsd %xmm2, -0x30(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x50(%rbp)
callq 0x49360
movq %rax, %r15
callq 0x49360
movsd 0x3930(%r15), %xmm4
movsd 0x3940(%rax), %xmm2
movapd %xmm4, %xmm1
subsd %xmm2, %xmm1
andpd 0x4db6e(%rip), %xmm1    # 0x69010
movsd 0x4db96(%rip), %xmm0    # 0x69040
ucomisd %xmm1, %xmm0
jbe 0x1b4c6
xorpd 0x4db68(%rip), %xmm4    # 0x69020
xorpd %xmm2, %xmm2
movsd 0x4db94(%rip), %xmm1    # 0x69058
jmp 0x1b4f7
movsd 0x3948(%rax), %xmm1
movsd 0x3938(%r15), %xmm3
subsd %xmm3, %xmm1
subsd %xmm4, %xmm2
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm4
subsd %xmm4, %xmm3
movsd 0x4dba5(%rip), %xmm2    # 0x69098
movapd %xmm3, %xmm4
movsd -0x28(%rbp), %xmm0
movsd %xmm1, -0x68(%rbp)
movsd %xmm2, -0x60(%rbp)
movsd %xmm4, -0x58(%rbp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
leaq -0x70(%rbp), %r15
movsd -0x30(%rbp), %xmm1
movq %r15, %rdx
callq 0x47240
movsd %xmm0, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movsd (%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
movq 0x20(%r14), %r15
callq 0x49360
leaq 0x3130(%rax), %r12
callq 0x49360
leaq 0x30f8(%rax), %rdx
movq 0x18(%r14), %rcx
movq %r15, %rdi
movq %r12, %rsi
callq 0x45eec
mulsd 0x4e6b5(%rip), %xmm0    # 0x69c20
ucomisd -0x28(%rbp), %xmm0
ja 0x1b329
movq 0x20(%r14), %rax
movups 0x8(%rax), %xmm0
leaq -0x90(%rbp), %rsi
movaps %xmm0, (%rsi)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x10(%rsi)
leaq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x29634
callq 0x4c9fe
movq 0x8(%r14), %rsi
leaq -0x38(%rbp), %rdx
movq %rax, %rdi
callq 0x4d640
testb %al, %al
je 0x1b679
callq 0x4c9fe
movq 0x8(%r14), %rsi
movsd -0x38(%rbp), %xmm0
movq %rax, %rdi
callq 0x4cfe2
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x49360
movsd 0x30f8(%rax), %xmm0
addsd 0x4e954(%rip), %xmm0    # 0x69f50
movsd -0x28(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1b679
movq 0x8(%r14), %rax
leaq -0x138(%rbp), %rsi
movl $0x8, (%rsi)
movq %rax, 0x8(%rsi)
xorl %eax, %eax
movl %eax, 0x18(%rsi)
movl %eax, 0x58(%rsi)
movq %rax, 0x60(%rsi)
movl %eax, 0x68(%rsi)
movq %rax, 0x70(%rsi)
movl %eax, 0x78(%rsi)
movq %rax, 0x80(%rsi)
movl %eax, 0x88(%rsi)
movq %rax, 0x90(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rsi)
movupd %xmm0, 0x41(%rsi)
movl $0x9, 0x98(%rsi)
movq %rax, 0xa0(%rsi)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x28(%rsi)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x20(%rsi)
jmp 0x1b6e6
movq 0x8(%r14), %rax
leaq -0x138(%rbp), %rsi
movl $0x8, (%rsi)
movq %rax, 0x8(%rsi)
xorl %eax, %eax
movl %eax, 0x18(%rsi)
movl %eax, 0x58(%rsi)
movq %rax, 0x60(%rsi)
movl %eax, 0x68(%rsi)
movq %rax, 0x70(%rsi)
movl %eax, 0x78(%rsi)
movq %rax, 0x80(%rsi)
movl %eax, 0x88(%rsi)
movq %rax, 0x90(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rsi)
movupd %xmm0, 0x20(%rsi)
movupd %xmm0, 0x40(%rsi)
movb $0x0, 0x50(%rsi)
movl %eax, 0x98(%rsi)
movq %rax, 0xa0(%rsi)
movapd -0x50(%rbp), %xmm0
movupd %xmm0, 0x28(%rsi)
movabsq $0x40000003254e6e22, %rax # imm = 0x40000003254E6E22
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
callq 0x16cca
jmp 0x1b329
nop