// File: /workspace/github_cpp_makefile_star2_O1/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 0x1b6ad
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rcx
movl 0x1c(%rcx), %edx
cmpl $0xd, %edx
ja 0x1b6bd
movl $0x2480, %esi           # imm = 0x2480
btl %edx, %esi
jae 0x1b6bd
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x7, 0x20(%rcx)
jne 0x1b6d8
movq 0x8(%r14), %rcx
movq 0xc0(%rcx), %rcx
testq %rcx, %rcx
je 0x1b6d8
cmpl $0x7, (%rcx)
je 0x1b6ad
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd 0x37f8(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x450ba
movsd -0x30(%rbp), %xmm1
subsd 0x5c70(%rax), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1b6ad
callq 0x4a75c
movq 0x20(%r14), %rcx
movsd 0x3930(%rax), %xmm1
movsd 0x3938(%rax), %xmm0
subsd 0x8(%rcx), %xmm1
subsd 0x10(%rcx), %xmm0
movapd 0x4f8d4(%rip), %xmm3    # 0x6b010
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
movsd 0x4f8f4(%rip), %xmm4    # 0x6b040
ucomisd %xmm2, %xmm4
jbe 0x1b764
movapd %xmm0, %xmm2
andpd %xmm3, %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm2, %xmm4
ja 0x1b77d
callq 0x90d0
movapd %xmm0, %xmm3
mulsd 0x4f8d3(%rip), %xmm3    # 0x6b048
divsd 0x4f8d3(%rip), %xmm3    # 0x6b050
movsd %xmm3, -0x28(%rbp)
callq 0x4a75c
movapd 0x4f881(%rip), %xmm4    # 0x6b010
movsd 0x4f8a9(%rip), %xmm3    # 0x6b040
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 0x1b7d1
andpd %xmm0, %xmm4
xorpd %xmm2, %xmm2
ucomisd %xmm4, %xmm3
ja 0x1b7ea
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x4f866(%rip), %xmm2    # 0x6b048
divsd 0x4f866(%rip), %xmm2    # 0x6b050
movsd %xmm2, -0x30(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x50(%rbp)
callq 0x4a75c
movq %rax, %r15
callq 0x4a75c
movsd 0x3930(%r15), %xmm4
movsd 0x3940(%rax), %xmm1
movapd %xmm4, %xmm2
subsd %xmm1, %xmm2
andpd 0x4f7ea(%rip), %xmm2    # 0x6b010
movsd 0x4f812(%rip), %xmm0    # 0x6b040
ucomisd %xmm2, %xmm0
jbe 0x1b854
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
xorpd 0x4f7ce(%rip), %xmm4    # 0x6b020
jmp 0x1b890
movsd 0x3948(%rax), %xmm2
movsd 0x3938(%r15), %xmm3
subsd %xmm3, %xmm2
subsd %xmm4, %xmm1
divsd %xmm1, %xmm2
movsd %xmm2, -0x68(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x60(%rbp)
mulsd %xmm4, %xmm2
subsd %xmm2, %xmm3
movapd %xmm3, %xmm4
movsd -0x28(%rbp), %xmm0
movsd %xmm4, -0x58(%rbp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
leaq -0x70(%rbp), %r15
movsd -0x30(%rbp), %xmm1
movq %r15, %rdx
callq 0x48644
movsd %xmm0, -0x38(%rbp)
movsd (%r15), %xmm0
movsd %xmm0, -0x28(%rbp)
movq 0x20(%r14), %r15
callq 0x4a75c
leaq 0x3130(%rax), %r12
callq 0x4a75c
leaq 0x30f8(%rax), %rdx
movq 0x18(%r14), %rcx
movq %r15, %rdi
movq %r12, %rsi
callq 0x4724a
mulsd 0x5032b(%rip), %xmm0    # 0x6bc20
ucomisd -0x28(%rbp), %xmm0
ja 0x1b6ad
movq 0x20(%r14), %rax
xorpd %xmm0, %xmm0
leaq -0x90(%rbp), %rsi
movapd %xmm0, (%rsi)
movups 0x8(%rax), %xmm0
movaps %xmm0, (%rsi)
leaq -0x38(%rbp), %r15
movsd (%r15), %xmm0
movsd %xmm0, 0x10(%rsi)
leaq -0x68(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x29ecc
callq 0x4df3a
movq 0x8(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x4ecac
testb %al, %al
je 0x1ba2c
callq 0x4df3a
movq 0x8(%r14), %rsi
movsd -0x38(%rbp), %xmm0
movq %rax, %rdi
callq 0x4e614
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1b983
sqrtsd %xmm0, %xmm0
jmp 0x1b988
callq 0x93c0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd 0x30f8(%rax), %xmm0
addsd 0x505ae(%rip), %xmm0    # 0x6bf50
movsd -0x28(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1ba2c
movq 0x8(%r14), %rax
leaq -0x138(%rbp), %rsi
movl $0x8, (%rsi)
movq %rax, 0x8(%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rsi)
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 $0x9, 0x98(%rsi)
movq %rax, 0xa0(%rsi)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x28(%rsi)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x20(%rsi)
jmp 0x1ba9d
movq 0x8(%r14), %rax
leaq -0x138(%rbp), %rsi
movl $0x8, (%rsi)
movq %rax, 0x8(%rsi)
xorl %eax, %eax
movq %rax, 0x10(%rsi)
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 0x16f62
jmp 0x1b6ad