// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/VisualSystem.cpp
// Function: VisualSystem::EvaluateVisualRequest()
void VisualSystem::EvaluateVisualRequest() {
  {
    VisualRequest *vr = &mVisualRequest.GetOfBall();
    vr->mValid = mpBallState->GetPosConf() > FLOAT_EPS;

    if (vr->mValid) {
      vr->mPrePos = mPreBallPos - mPreSelfPos;
      vr->mCycleDelay = mpBallState->GetPosDelay();

      vr->UpdateEvaluation();

      if (vr->mConf < FLOAT_EPS) {
        mForceToSeeObject.GetOfBall() = true;
      }
    }
  }

  PlayMode play_mode = mpWorldState->GetPlayMode();

  if (play_mode == PM_Our_Penalty_Ready || play_mode == PM_Our_Penalty_Taken) {
    const int goalie = mpWorldState->GetOpponentGoalieUnum();
    if (!goalie)
      return;

    VisualRequest *vr = &mVisualRequest.GetOfOpponent(goalie);

    if (mpWorldState->GetOpponent(goalie).IsAlive()) {
      vr->mPrePos =
          mpWorldState->Opponent(goalie).GetPredictedPos(1) - mPreSelfPos;
      vr->mValid = true;
      vr->mCycleDelay = vr->mpObject->GetPosDelay();

      vr->UpdateEvaluation();

      if (vr->mConf < FLOAT_EPS) {
        mHighPriorityPlayerSet.insert(vr);
      }
    } else {
      vr->mValid = false;
    }
  } else {
    for (int i = -TEAMSIZE; i <= TEAMSIZE; ++i) {
      if (!i || i == mpSelfState->GetUnum())
        continue;

      VisualRequest *vr = &mVisualRequest[i];
      vr->mValid = mpWorldState->GetPlayer(i).IsAlive();

      if (vr->mValid) {
        vr->mPrePos =
            mpWorldState->GetPlayer(i).GetPredictedPos() - mPreSelfPos;
        vr->mCycleDelay = vr->mpObject->GetPosDelay();

        vr->UpdateEvaluation();

        if (vr->mConf < FLOAT_EPS) {
          mHighPriorityPlayerSet.insert(vr);
        }
      }
    }
  }
}

// Assembly:
movq 0x18(%rdi), %rax
movsd 0x20(%rax), %xmm0
ucomisd 0x12723(%rip), %xmm0    # 0x6b040
seta 0x40(%rdi)
jbe 0x589b4
movsd 0x650(%rdi), %xmm0
subsd 0x660(%rdi), %xmm0
movsd 0x658(%rdi), %xmm1
subsd 0x668(%rdi), %xmm1
movsd %xmm0, 0x30(%rdi)
movsd %xmm1, 0x38(%rdi)
movl 0x18(%rax), %eax
movl %eax, 0x44(%rdi)
movsd 0x48(%rdi), %xmm0
movsd 0x126f4(%rip), %xmm1    # 0x6b058
maxsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rdi)
cvtsi2sd %eax, %xmm2
divsd %xmm0, %xmm2
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
xorpd %xmm2, %xmm2
maxsd %xmm0, %xmm2
movsd %xmm2, 0x50(%rdi)
subsd %xmm2, %xmm1
movsd 0x137a2(%rip), %xmm0    # 0x6c138
maxsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rdi)
movsd 0x12699(%rip), %xmm0    # 0x6b040
ucomisd %xmm2, %xmm0
jbe 0x589b4
movb $0x1, 0x5f0(%rdi)
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %rax
movl 0x1c(%rax), %ecx
addl $-0xf, %ecx
cmpl $0x2, %ecx
movq %rdi, -0x40(%rbp)
jae 0x58a4f
movslq 0x2114(%rax), %rcx
testq %rcx, %rcx
je 0x58ca1
leaq 0x30(%rdi), %rsi
movq %rcx, %r8
negq %r8
movq %rcx, %rdx
addq $0xb, %rdx
testl %ecx, %ecx
cmovleq %r8, %rdx
shlq $0x6, %rdx
addq %rsi, %rdx
movq %rdx, -0x38(%rbp)
decl %ecx
movslq %ecx, %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
cmpb $0x1, 0x11e2(%rax,%rcx)
jne 0x58bdb
addq %rcx, %rax
addq $0x10d0, %rax           # imm = 0x10D0
movq 0x68(%rax), %r14
movl $0x1, -0x2c(%rbp)
cmpl $0x0, 0x668(%r14)
jle 0x58be4
addq $0x18, %r14
jmp 0x58c05
leaq 0x608(%rdi), %rax
movq %rax, -0x50(%rbp)
leaq -0x290(%rdi), %r15
leaq 0x5b0(%rdi), %r12
movq $-0xb, %r14
movl $0x1f80, %ebx           # imm = 0x1F80
movq $-0x10f8, %r13          # imm = 0xEF08
testq %r14, %r14
je 0x58bb3
movq 0x20(%rdi), %rax
cmpl 0x11c(%rax), %r14d
je 0x58bb3
testq %r14, %r14
movq %r15, %rcx
cmovsq %r12, %rcx
movq %rcx, -0x38(%rbp)
movq %rbx, %rdx
cmovgq %r13, %rdx
movq 0x10(%rdi), %rax
movb 0x112(%rax,%rdx), %dl
movb %dl, 0x10(%rcx)
cmpb $0x1, %dl
jne 0x58bb3
testq %r14, %r14
movq %rbx, %rcx
cmovgq %r13, %rcx
movq 0x68(%rax,%rcx), %rax
movl $0x1, -0x2c(%rbp)
cmpl $0x0, 0x668(%rax)
jle 0x58ae6
addq $0x18, %rax
jmp 0x58b15
movq %rax, %rdi
leaq -0x2c(%rbp), %rsi
movq %rax, -0x48(%rbp)
callq 0xf062
movq -0x40(%rbp), %rdi
movslq -0x2c(%rbp), %rax
shlq $0x4, %rax
movq -0x48(%rbp), %rcx
addq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x48(%rbp)
movq -0x48(%rbp), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
subsd 0x660(%rdi), %xmm0
subsd 0x668(%rdi), %xmm1
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
movq 0x30(%rax), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x14(%rax)
movsd 0x18(%rax), %xmm0
movsd 0x12506(%rip), %xmm2    # 0x6b058
maxsd %xmm2, %xmm0
movsd %xmm0, 0x18(%rax)
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
divsd %xmm0, %xmm1
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
maxsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rax)
movapd %xmm2, %xmm0
subsd %xmm1, %xmm0
movsd 0x135ad(%rip), %xmm2    # 0x6c138
maxsd %xmm0, %xmm2
movsd %xmm2, 0x28(%rax)
movsd 0x124a4(%rip), %xmm0    # 0x6b040
ucomisd %xmm1, %xmm0
jbe 0x58bb3
movq -0x50(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5b656
movq -0x40(%rbp), %rdi
incq %r14
addq $-0x178, %rbx           # imm = 0xFE88
addq $0x178, %r13            # imm = 0x178
addq $0x40, %r15
addq $-0x40, %r12
cmpq $0xc, %r14
jne 0x58a7b
jmp 0x58ca1
movb $0x0, 0x10(%rdx)
jmp 0x58ca1
leaq -0x2c(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xf062
movq -0x40(%rbp), %rdi
movslq (%r15), %rax
shlq $0x4, %rax
addq %rax, %r14
addq $0x8, %r14
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
subsd 0x660(%rdi), %xmm0
subsd 0x668(%rdi), %xmm1
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
movb $0x1, 0x10(%rax)
movq 0x30(%rax), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x14(%rax)
movsd 0x18(%rax), %xmm0
movsd 0x12410(%rip), %xmm1    # 0x6b058
maxsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rax)
cvtsi2sd %ecx, %xmm2
divsd %xmm0, %xmm2
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
xorpd %xmm2, %xmm2
maxsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rax)
subsd %xmm2, %xmm1
movsd 0x134be(%rip), %xmm0    # 0x6c138
maxsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rax)
movsd 0x123b5(%rip), %xmm0    # 0x6b040
ucomisd %xmm2, %xmm0
jbe 0x58ca1
addq $0x608, %rdi            # imm = 0x608
leaq -0x38(%rbp), %rsi
callq 0x5b656
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq