// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rdi
movl 0x11c(%rax), %esi
callq 0x180de
movl %eax, %r15d
movq 0x28(%r14), %rdi
movl %eax, %esi
callq 0x18110
testl %r15d, %r15d
sete %cl
testl %eax, %eax
sete %dl
orb %cl, %dl
jne 0x17f5f
movq 0x20(%r14), %rcx
cmpl 0x11c(%rcx), %eax
jne 0x17f5f
movq %rbx, -0x38(%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 %rax, -0x48(%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 0x53211(%rip), %xmm2    # 0x6b010
movapd %xmm1, %xmm4
andpd %xmm2, %xmm4
movsd 0x53231(%rip), %xmm3    # 0x6b040
ucomisd %xmm4, %xmm3
jbe 0x17e23
andpd %xmm0, %xmm2
xorpd %xmm4, %xmm4
ucomisd %xmm2, %xmm3
ja 0x17e44
callq 0x90d0
movapd %xmm0, %xmm4
mulsd 0x53214(%rip), %xmm4    # 0x6b048
movsd 0x53214(%rip), %xmm0    # 0x6b050
divsd %xmm0, %xmm4
mulsd %xmm0, %xmm4
movsd %xmm4, -0x30(%rbp)
movq 0x20(%r14), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movsd (%rax), %xmm0
leaq -0xc0(%rbp), %r15
movsd %xmm0, 0x78(%r15)
movq 0x20(%r14), %r12
callq 0x4a75c
movsd 0x33c0(%rax), %xmm0
movq %r12, %rdi
callq 0x470e2
movsd %xmm0, 0x10(%r15)
movq 0x10(%r14), %r12
movsd -0x30(%rbp), %xmm0
divsd 0x531b4(%rip), %xmm0    # 0x6b048
leaq -0x40(%rbp), %rdi
leaq -0xf0(%rbp), %r13
movq %r13, %rsi
callq 0x92d0
movsd 0x78(%r15), %xmm0
movsd (%r13), %xmm1
mulsd %xmm0, %xmm1
leaq -0x40(%rbp), %rax
mulsd (%rax), %xmm0
addsd 0x10d8(%r12,%rbx), %xmm1
addsd 0x10e0(%r12,%rbx), %xmm0
movsd %xmm1, (%r15)
movsd %xmm0, 0x8(%r15)
callq 0x24ed2
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x24f4c
movsd %xmm0, -0x18(%r15)
movq 0x8(%r14), %rdi
callq 0x1356e
movq %rax, %rdi
callq 0x26e20
cmpl $0x1, 0x8(%rax)
jne 0x17f2a
callq 0x24ed2
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x24f4c
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 -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0x90b0
incq 0x10(%rbx)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop