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

  Vector gPos;
  int Uncyc;
  if (world_state.GetOpponentGoalieUnum() == 0 ||
      world_state.GetOpponent(world_state.GetOpponentGoalieUnum())
              .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.GetOpponent(world_state.GetOpponentGoalieUnum()).GetPos();
    Uncyc = world_state.GetOpponent(world_state.GetOpponentGoalieUnum())
                .GetPosDelay();
  }

  return mpOpponentFormation->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 0x2114(%rax), %rcx
testq %rcx, %rcx
je 0x272a3
imulq $0x178, %rcx, %rcx      # imm = 0x178
movsd 0x43dac(%rip), %xmm3    # 0x6b040
ucomisd 0xf78(%rcx,%rax), %xmm3
jbe 0x273c7
movsd %xmm2, -0x10(%rbp)
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x18(%rbp)
callq 0x4a75c
leaq 0x46c5a(%rip), %rax     # 0x6df18
movsd (%rax), %xmm0
mulsd 0x445ae(%rip), %xmm0    # 0x6b878
movsd %xmm0, -0x40(%rbp)
movsd %xmm0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
callq 0x4a75c
callq 0x4a75c
movsd 0x3008(%rax), %xmm0
mulsd 0x44582(%rip), %xmm0    # 0x6b878
movsd 0x452d2(%rip), %xmm1    # 0x6c5d0
subsd %xmm0, %xmm1
movsd %xmm1, -0x38(%rbp)
callq 0x4a75c
callq 0x4a75c
movsd -0x18(%rbp), %xmm2
movsd -0x8(%rbp), %xmm1
movsd 0x44555(%rip), %xmm0    # 0x6b878
mulsd 0x3008(%rax), %xmm0
addsd 0x452a5(%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 0x27365
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x27381
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 0x2739d
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
jmp 0x273b0
movapd %xmm1, %xmm0
movsd %xmm3, -0x8(%rbp)
callq 0x93c0
movsd -0x8(%rbp), %xmm3
movsd -0x10(%rbp), %xmm2
minsd %xmm3, %xmm0
divsd 0x44607(%rip), %xmm0    # 0x6b9c8
cvttsd2si %xmm0, %ecx
jmp 0x273dc
addq %rcx, %rax
addq $0xf60, %rax            # imm = 0xF60
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