// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: Formation::GetTeammateExpectedGoaliePos(Vector, double)
Vector Formation::GetTeammateExpectedGoaliePos(Vector bp, double run) {
  const WorldState &world_state = mAgent.GetWorldState();

  Vector gPos;
  int Uncyc;
  if (world_state.GetTeammateGoalieUnum() == 0 ||
      world_state.GetTeammate(world_state.GetTeammateGoalieUnum())
              .GetPosConf() < FLOAT_EPS) { //取守门员的位置以及没有见到的周期
    gPos = Vector(ServerParam::instance().PITCH_LENGTH / 2.0, 0.0); // 估值而已

    Vector p[2];
    double dist[2];
    p[0] = Vector(ServerParam::instance().PITCH_LENGTH / 2.0,
                  -ServerParam::instance().goalWidth() / 2.0 + 0.1); // top
    p[1] = Vector(ServerParam::instance().PITCH_LENGTH / 2.0,
                  ServerParam::instance().goalWidth() / 2.0 - 0.1); // down
    dist[0] = bp.Dist(p[0]);
    dist[1] = bp.Dist(p[1]);
    Uncyc = (int)(Min(dist[0], dist[1]) / 5.0);
  } else {
    gPos =
        world_state.GetTeammate(world_state.GetTeammateGoalieUnum()).GetPos();
    Uncyc = world_state.GetTeammate(world_state.GetTeammateGoalieUnum())
                .GetPosDelay();
  }

  return mpTeammateFormation->GetExpectedGoaliePos(bp, run, gPos, Uncyc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movsd %xmm0, -0x58(%rbp)
movsd %xmm1, -0x50(%rbp)
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rax
xorpd %xmm3, %xmm3
movapd %xmm3, -0x30(%rbp)
movslq 0x2110(%rax), %rcx
testq %rcx, %rcx
je 0x26f11
imulq $0x178, %rcx, %rcx      # imm = 0x178
movsd 0x4413e(%rip), %xmm3    # 0x6b040
ucomisd -0xb0(%rcx,%rax), %xmm3
jbe 0x27035
movsd %xmm2, -0x10(%rbp)
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x18(%rbp)
callq 0x4a75c
leaq 0x46fec(%rip), %rax     # 0x6df18
movsd (%rax), %xmm0
mulsd 0x44940(%rip), %xmm0    # 0x6b878
movsd %xmm0, -0x40(%rbp)
movsd %xmm0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
callq 0x4a75c
callq 0x4a75c
movsd 0x3008(%rax), %xmm0
mulsd 0x44914(%rip), %xmm0    # 0x6b878
movsd 0x45664(%rip), %xmm1    # 0x6c5d0
subsd %xmm0, %xmm1
movsd %xmm1, -0x38(%rbp)
callq 0x4a75c
callq 0x4a75c
movsd -0x18(%rbp), %xmm2
movsd -0x8(%rbp), %xmm1
movsd 0x448e7(%rip), %xmm0    # 0x6b878
mulsd 0x3008(%rax), %xmm0
addsd 0x45637(%rip), %xmm0    # 0x6c5d8
movsd %xmm0, -0x48(%rbp)
subsd -0x40(%rbp), %xmm1
movapd %xmm2, %xmm0
subsd -0x38(%rbp), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm0
jb 0x26fd3
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x26fef
movsd %xmm1, -0x8(%rbp)
callq 0x93c0
xorpd %xmm4, %xmm4
movsd -0x18(%rbp), %xmm2
movsd -0x8(%rbp), %xmm1
movapd %xmm0, %xmm3
subsd -0x48(%rbp), %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm1
ucomisd %xmm4, %xmm1
jb 0x2700b
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
jmp 0x2701e
movapd %xmm1, %xmm0
movsd %xmm3, -0x8(%rbp)
callq 0x93c0
movsd -0x8(%rbp), %xmm3
movsd -0x10(%rbp), %xmm2
minsd %xmm3, %xmm0
divsd 0x44999(%rip), %xmm0    # 0x6b9c8
cvttsd2si %xmm0, %ecx
jmp 0x2704a
addq %rcx, %rax
addq $-0xc8, %rax
movupd (%rax), %xmm0
movapd %xmm0, -0x30(%rbp)
movl 0x10(%rax), %ecx
leaq -0x58(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movaps %xmm2, %xmm0
callq 0x253e2
addq $0x60, %rsp
popq %rbp
retq