// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r8
leaq 0x30(%rdi), %r14
movq 0x18(%rdi), %rax
movsd 0x20(%rax), %xmm0
ucomisd 0xd453(%rip), %xmm0     # 0x57040
seta 0x40(%rdi)
movq %rdi, -0x38(%rbp)
jbe 0x49c52
movsd 0x650(%r8), %xmm0
movsd 0x658(%r8), %xmm1
subsd 0x660(%r8), %xmm0
subsd 0x668(%r8), %xmm1
movsd %xmm0, 0x30(%r8)
movsd %xmm1, 0x38(%r8)
movl 0x18(%rax), %eax
movl %eax, 0x44(%r8)
movq %r14, %rdi
callq 0x4bd38
movq -0x38(%rbp), %r8
movsd 0xd3fe(%rip), %xmm0     # 0x57040
ucomisd 0x50(%r8), %xmm0
jbe 0x49c52
movb $0x1, 0x5f0(%r8)
movq 0x10(%r8), %rax
movl 0x1c(%rax), %ecx
addl $-0xf, %ecx
cmpl $0x2, %ecx
jae 0x49d20
movslq 0x2114(%rax), %rcx
testq %rcx, %rcx
je 0x49e4c
movl %ecx, %edx
negl %edx
leal 0xb(%rcx), %esi
testl %ecx, %ecx
cmovleq %rdx, %rsi
shlq $0x6, %rsi
addq %rsi, %r14
movq %r14, -0x30(%rbp)
imulq $0x178, %rcx, %rcx      # imm = 0x178
cmpb $0x1, 0x106a(%rcx,%rax)
jne 0x49e47
leaq (%rcx,%rax), %rdi
addq $0xf58, %rdi            # imm = 0xF58
pushq $0x1
popq %rsi
movq %r8, %rbx
callq 0xd4c0
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
subsd 0x660(%rbx), %xmm0
subsd 0x668(%rbx), %xmm1
movsd %xmm0, (%r14)
movsd %xmm1, 0x8(%r14)
movb $0x1, 0x10(%r14)
movq 0x30(%r14), %rax
movl 0x18(%rax), %eax
movl %eax, 0x14(%r14)
movq %r14, %rdi
callq 0x4bd38
movsd 0xd344(%rip), %xmm0     # 0x57040
ucomisd 0x20(%r14), %xmm0
jbe 0x49e4c
addq $0x608, %rbx            # imm = 0x608
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x4c188
jmp 0x49e4c
leaq 0x608(%r8), %rax
movq %rax, -0x40(%rbp)
leaq 0x5b0(%r8), %r13
leaq -0x290(%r8), %r12
pushq $-0xb
popq %r15
movq $-0x10f8, %r14          # imm = 0xEF08
movl $0x2092, %ebx           # imm = 0x2092
testq %r15, %r15
je 0x49e29
cmpq $0xc, %r15
je 0x49e4c
movq 0x20(%r8), %rax
cmpl 0x11c(%rax), %r15d
je 0x49e29
movq %r12, %rax
testq %r15, %r15
cmovsq %r13, %rax
movq %rax, -0x30(%rbp)
movq 0x10(%r8), %rdi
jle 0x49d9b
movb 0x112(%rdi,%r14), %al
movb %al, 0x10(%r12)
testb %al, %al
je 0x49e29
addq %r14, %rdi
jmp 0x49dc0
movb (%rdi,%rbx), %cl
movb %cl, 0x10(%rax)
testb %cl, %cl
je 0x49e29
addq $0x10d0, %rdi           # imm = 0x10D0
movq %r15, %rax
notq %rax
imulq $0x178, %rax, %rax      # imm = 0x178
addq %rax, %rdi
pushq $0x1
popq %rsi
callq 0xd4c0
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movq -0x38(%rbp), %rax
subsd 0x660(%rax), %xmm0
subsd 0x668(%rax), %xmm1
movq -0x30(%rbp), %rdi
movsd %xmm0, (%rdi)
movsd %xmm1, 0x8(%rdi)
movq 0x30(%rdi), %rax
movl 0x18(%rax), %eax
movl %eax, 0x14(%rdi)
callq 0x4bd38
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %rax
movsd 0xd22f(%rip), %xmm0     # 0x57040
ucomisd 0x20(%rax), %xmm0
jbe 0x49e29
movq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4c188
movq -0x38(%rbp), %r8
incq %r15
addq $-0x40, %r13
addq $0x40, %r12
addq $0x178, %r14            # imm = 0x178
addq $-0x178, %rbx           # imm = 0xFE88
jmp 0x49d49
movb $0x0, 0x10(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop