// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorMark.cpp
// Function: BehaviorMarkPlanner::Plan(std::__cxx11::list<ActiveBehavior, std::allocator<ActiveBehavior>>&)
void BehaviorMarkPlanner::Plan(std::list<ActiveBehavior> &behavior_list) {
  Unum closest_opp =
      mPositionInfo.GetClosestOpponentToTeammate(mSelfState.GetUnum());
  Unum closest_tm = mPositionInfo.GetClosestTeammateToOpponent(closest_opp);

  if (closest_opp && closest_tm && closest_tm == mSelfState.GetUnum()) {
    ActiveBehavior mark(mAgent, BT_Mark);

    Vector ballPos = mBallState.GetPos();
    AngleDeg b2o =
        (mBallState.GetPos() - mWorldState.GetOpponent(closest_opp).GetPos())
            .Dir();
    mark.mBuffer = mSelfState.GetKickableArea();
    mark.mPower = mSelfState.CorrectDashPowerForStamina(
        ServerParam::instance().maxDashPower());
    mark.mTarget = mWorldState.GetOpponent(closest_opp).GetPos() +
                   Polar2Vector(mark.mBuffer, b2o);
    mark.mEvaluation =
        Evaluation::instance().EvaluatePosition(mark.mTarget, false);
    if (mAgent.GetFormation().GetMyRole().mLineType == LT_Defender) {
      mark.mEvaluation =
          Evaluation::instance().EvaluatePosition(mark.mTarget, true);
    }

    behavior_list.push_back(mark);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rdi
movl 0x11c(%rax), %esi
callq 0x17e14
movl %eax, %r15d
movq 0x28(%r14), %rdi
movl %eax, %esi
callq 0x17e46
testl %r15d, %r15d
sete %cl
testl %eax, %eax
sete %dl
orb %cl, %dl
jne 0x17c95
movq 0x20(%r14), %rdi
cmpl 0x11c(%rdi), %eax
jne 0x17c95
movq %rbx, -0x40(%rbp)
movq 0x8(%r14), %rax
movl $0xc, -0xe8(%rbp)
movq %rax, -0xe0(%rbp)
xorl %eax, %eax
movq %rax, -0xd8(%rbp)
movl %eax, -0xd0(%rbp)
movl %eax, -0x90(%rbp)
movq %rax, -0x88(%rbp)
movl %eax, -0x80(%rbp)
movq %rax, -0x78(%rbp)
movl %eax, -0x70(%rbp)
movq %rax, -0x68(%rbp)
movl %eax, -0x60(%rbp)
movq %rax, -0x58(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0xc8(%rbp)
movups %xmm0, -0xb8(%rbp)
movups %xmm0, -0xa8(%rbp)
movb $0x0, -0x98(%rbp)
movl %eax, -0x50(%rbp)
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
decl %r15d
movslq %r15d, %rdx
imulq $0x178, %rdx, %rbx      # imm = 0x178
movsd 0x8(%rcx), %xmm1
movsd 0x10(%rcx), %xmm0
subsd 0x10d8(%rax,%rbx), %xmm1
subsd 0x10e0(%rax,%rbx), %xmm0
movapd 0x514e9(%rip), %xmm2    # 0x69010
movapd %xmm1, %xmm4
andpd %xmm2, %xmm4
movsd 0x51509(%rip), %xmm3    # 0x69040
ucomisd %xmm4, %xmm3
jbe 0x17b4b
andpd %xmm0, %xmm2
xorpd %xmm4, %xmm4
ucomisd %xmm2, %xmm3
ja 0x17b70
callq 0x90d0
movapd %xmm0, %xmm4
mulsd 0x514ec(%rip), %xmm4    # 0x69048
movsd 0x514ec(%rip), %xmm0    # 0x69050
divsd %xmm0, %xmm4
mulsd %xmm0, %xmm4
movq 0x20(%r14), %rdi
movsd %xmm4, -0x30(%rbp)
movq (%rdi), %rax
callq *0x10(%rax)
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0xc0(%rbp), %rax
movsd %xmm0, 0x78(%rax)
movq %rax, %r15
movq 0x20(%r14), %r12
callq 0x49360
movsd 0x33c0(%rax), %xmm0
movq %r12, %rdi
callq 0x45d84
movsd %xmm0, 0x10(%r15)
movq 0x10(%r14), %r15
movsd -0x30(%rbp), %xmm0
divsd 0x51485(%rip), %xmm0    # 0x69048
leaq -0xf8(%rbp), %r12
leaq -0xf0(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%r13), %xmm0
movsd -0x38(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd (%r12), %xmm1
addsd 0x10d8(%r15,%rbx), %xmm0
addsd 0x10e0(%r15,%rbx), %xmm1
leaq -0xc0(%rbp), %rbx
movsd %xmm0, (%rbx)
movsd %xmm1, 0x8(%rbx)
callq 0x24814
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2488e
movsd %xmm0, -0x18(%rbx)
movq 0x8(%r14), %rdi
callq 0x13432
movq %rax, %rdi
callq 0x266bc
cmpl $0x1, 0x8(%rax)
jne 0x17c60
callq 0x24814
movq %rax, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x2488e
movsd %xmm0, -0xd8(%rbp)
movl $0xb8, %edi
callq 0x94c0
movq %rax, %r14
leaq 0x10(%rax), %rdi
leaq -0xe8(%rbp), %rsi
movl $0xa8, %edx
callq 0x93e0
movq %r14, %rdi
movq -0x40(%rbp), %rbx
movq %rbx, %rsi
callq 0x90b0
incq 0x10(%rbx)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop