// File: /workspace/github_cpp_makefile_star2_O2/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 0x1746f
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rcx
movl 0x1c(%rcx), %edx
cmpl $0xd, %edx
ja 0x1747f
movl $0x2480, %esi           # imm = 0x2480
btl %edx, %esi
jae 0x1747f
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x7, 0x20(%rcx)
jne 0x1749a
movq 0x8(%r14), %rcx
movq 0xc0(%rcx), %rcx
testq %rcx, %rcx
je 0x1749a
cmpl $0x7, (%rcx)
je 0x1746f
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x3db2c
movsd 0x37f8(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x38d94
movsd -0x30(%rbp), %xmm1
subsd 0x5c70(%rax), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1746f
callq 0x3db2c
movq 0x20(%r14), %rcx
movsd 0x3930(%rax), %xmm0
movsd 0x3938(%rax), %xmm1
subsd 0x8(%rcx), %xmm0
subsd 0x10(%rcx), %xmm1
leaq -0x138(%rbp), %r15
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
movq %r15, %rdi
callq 0xcd30
movsd %xmm0, -0x28(%rbp)
callq 0x3db2c
movq 0x20(%r14), %rcx
movsd 0x3940(%rax), %xmm0
movsd 0x3948(%rax), %xmm1
subsd 0x8(%rcx), %xmm0
subsd 0x10(%rcx), %xmm1
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
leaq -0x138(%rbp), %rdi
callq 0xcd30
movsd %xmm0, -0x30(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x50(%rbp)
callq 0x3db2c
leaq 0x3930(%rax), %r15
callq 0x3db2c
leaq 0x3940(%rax), %rdx
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x12e9a
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
leaq -0x58(%rbp), %r15
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movq %r15, %rdx
callq 0x3bc38
movsd %xmm0, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movsd (%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
movq 0x20(%r14), %r15
callq 0x3db2c
leaq 0x3130(%rax), %r12
callq 0x3db2c
leaq 0x30f8(%rax), %rdx
movq 0x18(%r14), %rcx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3a99c
mulsd 0x4060a(%rip), %xmm0    # 0x57bf0
ucomisd -0x28(%rbp), %xmm0
ja 0x1746f
movq 0x20(%r14), %rax
movups 0x8(%rax), %xmm0
leaq -0x90(%rbp), %rsi
movaps %xmm0, (%rsi)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x10(%rsi)
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x23916
callq 0x40e2a
movq 0x8(%r14), %rsi
leaq -0x38(%rbp), %rdx
movq %rax, %rdi
callq 0x41620
testb %al, %al
je 0x176fc
callq 0x40e2a
movq 0x8(%r14), %rsi
movsd -0x38(%rbp), %xmm0
movq %rax, %rdi
callq 0x4120e
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x3db2c
movsd 0x30f8(%rax), %xmm0
addsd 0x40899(%rip), %xmm0    # 0x57f10
movsd -0x28(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x176fc
movq 0x8(%r14), %rax
leaq -0x138(%rbp), %rsi
movl $0x8, (%rsi)
movq %rax, 0x8(%rsi)
andl $0x0, 0x18(%rsi)
andl $0x0, 0x58(%rsi)
andq $0x0, 0x60(%rsi)
andl $0x0, 0x68(%rsi)
andq $0x0, 0x70(%rsi)
andl $0x0, 0x78(%rsi)
andq $0x0, 0x80(%rsi)
andl $0x0, 0x88(%rsi)
andq $0x0, 0x90(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rsi)
movupd %xmm0, 0x41(%rsi)
movl $0x9, 0x98(%rsi)
andq $0x0, 0xa0(%rsi)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x28(%rsi)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x20(%rsi)
jmp 0x17772
movq 0x8(%r14), %rax
leaq -0x138(%rbp), %rsi
movl $0x8, (%rsi)
movq %rax, 0x8(%rsi)
andl $0x0, 0x18(%rsi)
andl $0x0, 0x58(%rsi)
andq $0x0, 0x60(%rsi)
andl $0x0, 0x68(%rsi)
andq $0x0, 0x70(%rsi)
andl $0x0, 0x78(%rsi)
andq $0x0, 0x80(%rsi)
andl $0x0, 0x88(%rsi)
andq $0x0, 0x90(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rsi)
movupd %xmm0, 0x20(%rsi)
movupd %xmm0, 0x40(%rsi)
movb $0x0, 0x50(%rsi)
andl $0x0, 0x98(%rsi)
andq $0x0, 0xa0(%rsi)
movapd -0x50(%rbp), %xmm0
movupd %xmm0, 0x28(%rsi)
movabsq $0x40000003254e6e22, %rax # imm = 0x40000003254E6E22
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
callq 0x10530
jmp 0x1746f
nop