// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Strategy.cpp
// Function: Strategy::GetTeammateSBSPPosition(int, Vector const&)
Vector Strategy::GetTeammateSBSPPosition(Unum t, const Vector &ballpos) {
  Vector position;

  if (mController > 0 || (mController == 0 && mBallInterPos.X() > 10.0)) {
    position = mAgent.GetFormation().GetTeammateFormationPoint(t, mController,
                                                               ballpos);
  } else {
    position = mAgent.GetFormation().GetTeammateFormationPoint(t);
  }

  double x =
      Min(position.X(), mInfoState.GetPositionInfo().GetTeammateOffsideLine() -
                            PlayerParam::instance().AtPointBuffer());
  if (mAgent.GetFormation().GetTeammateRoleType(t).mLineType ==
      LT_Defender) { //后卫不过中场，便于回防
    position.SetX(Min(0.0, x));
  } else if (mAgent.GetFormation().GetTeammateRoleType(t).mLineType ==
             LT_Forward) { //前锋不回场，便于进攻…………
    position.SetX(Max(-1.0, x));
  } else
    position.SetX(x);

  return position;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x11a10
movq -0x90(%rbp), %rax
cmpl $0x0, 0x48(%rax)
jg 0x8a895
movq -0x90(%rbp), %rax
cmpl $0x0, 0x48(%rax)
jne 0x8a8f3
movq -0x90(%rbp), %rdi
addq $0x90, %rdi
callq 0x176f0
movsd (%rax), %xmm0
movsd 0x36e69(%rip), %xmm1    # 0xc16f8
ucomisd %xmm1, %xmm0
jbe 0x8a8f3
movq -0x90(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1a4c0
movq %rax, %rdi
movq -0x90(%rbp), %rax
movl -0x1c(%rbp), %esi
movl 0x48(%rax), %edx
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x58(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
callq 0x3dca0
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8a930
movq -0x90(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1a4c0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
movsd 0x37057(%rip), %xmm0    # 0xc1968
callq 0x3d6c0
movsd %xmm0, -0x68(%rbp)
movsd %xmm1, -0x60(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x176f0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0x98(%rbp)
movq 0x30(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x26500
movsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x32ac0
movsd -0xa0(%rbp), %xmm0
movq -0x98(%rbp), %rdi
subsd (%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
leaq -0x78(%rbp), %rsi
callq 0x12a60
movq %rax, %rcx
movq -0x90(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x70(%rbp)
movq 0x10(%rax), %rdi
callq 0x1a4c0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x29570
cmpl $0x1, 0x8(%rax)
jne 0x8a9e5
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x12a60
movq %rax, %rsi
leaq -0x10(%rbp), %rdi
callq 0x1ee90
jmp 0x8aa43
movq -0x90(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1a4c0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x29570
cmpl $0x3, 0x8(%rax)
jne 0x8aa34
movsd 0x36e1a(%rip), %xmm0    # 0xc1828
movsd %xmm0, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x12a90
movq %rax, %rsi
leaq -0x10(%rbp), %rdi
callq 0x1ee90
jmp 0x8aa41
leaq -0x10(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1ee90
jmp 0x8aa43
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)