// File: 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
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x88(%rbp)
addq $0x30, %rdi
callq 0xa8ef0
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x10(%rbp)
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x1d930
movsd (%rax), %xmm0
movsd 0x1b43e(%rip), %xmm1    # 0xc1008
ucomisd %xmm1, %xmm0
seta %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x10(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0xa5c74
movq -0x88(%rbp), %rsi
movq %rsi, %rdi
addq $0x650, %rdi            # imm = 0x650
addq $0x660, %rsi            # imm = 0x660
callq 0x110a0
movq -0x88(%rbp), %rax
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movq %rdx, (%rcx)
movq -0x18(%rbp), %rdx
movq %rdx, 0x8(%rcx)
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x1ddd0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rdi
callq 0xa9080
movq -0x10(%rbp), %rax
movsd 0x1b3b3(%rip), %xmm0    # 0xc1008
ucomisd 0x20(%rax), %xmm0
jbe 0xa5c72
movq -0x88(%rbp), %rdi
addq $0x5f0, %rdi            # imm = 0x5F0
callq 0xa9140
movb $0x1, (%rax)
jmp 0xa5c74
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
movl %eax, -0x24(%rbp)
cmpl $0xf, -0x24(%rbp)
je 0xa5c97
cmpl $0x10, -0x24(%rbp)
jne 0xa5db4
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x25310
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0xa5cb5
jmp 0xa5f02
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
leaq -0x28(%rbp), %rsi
callq 0xa8f50
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq 0x10(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1d480
movq %rax, %rdi
callq 0x23f20
testb $0x1, %al
jne 0xa5cf5
jmp 0xa5da7
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5c5b0
movq %rax, %rdi
movl $0x1, %esi
callq 0x11fc0
movq -0x88(%rbp), %rsi
movq %rax, %rdi
addq $0x660, %rsi            # imm = 0x660
callq 0x110a0
movsd %xmm0, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
addq $0x8, %rdi
callq 0x1ddd0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x30(%rbp), %rdi
callq 0xa9080
movq -0x30(%rbp), %rax
movsd 0x1b288(%rip), %xmm0    # 0xc1008
ucomisd 0x20(%rax), %xmm0
jbe 0xa5da5
movq -0x88(%rbp), %rdi
addq $0x608, %rdi            # imm = 0x608
leaq -0x30(%rbp), %rsi
callq 0xa9170
movq %rax, -0x50(%rbp)
movb %dl, -0x48(%rbp)
jmp 0xa5daf
movq -0x30(%rbp), %rax
movb $0x0, 0x10(%rax)
jmp 0xa5f02
movl $0xfffffff5, -0x54(%rbp) # imm = 0xFFFFFFF5
cmpl $0xb, -0x54(%rbp)
jg 0xa5f00
cmpl $0x0, -0x54(%rbp)
je 0xa5df0
movq -0x88(%rbp), %rax
movl -0x54(%rbp), %ecx
movl %ecx, -0x8c(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movl -0x8c(%rbp), %eax
cmpl %ecx, %eax
jne 0xa5df5
jmp 0xa5ef2
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
leaq -0x54(%rbp), %rsi
callq 0xa8fa0
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x60(%rbp)
movq 0x10(%rax), %rdi
leaq -0x54(%rbp), %rsi
callq 0x23eb0
movq %rax, %rdi
callq 0x23f20
movb %al, %cl
movq -0x60(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x10(%rax)
movq -0x60(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0xa5ef0
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x54(%rbp), %rsi
callq 0x23eb0
movq %rax, %rdi
movl $0x1, %esi
callq 0x11fc0
movq -0x88(%rbp), %rsi
movq %rax, %rdi
addq $0x660, %rsi            # imm = 0x660
callq 0x110a0
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
movq 0x30(%rax), %rdi
addq $0x8, %rdi
callq 0x1ddd0
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x60(%rbp), %rdi
callq 0xa9080
movq -0x60(%rbp), %rax
movsd 0x1b13f(%rip), %xmm0    # 0xc1008
ucomisd 0x20(%rax), %xmm0
jbe 0xa5eee
movq -0x88(%rbp), %rdi
addq $0x608, %rdi            # imm = 0x608
leaq -0x60(%rbp), %rsi
callq 0xa9170
movq %rax, -0x80(%rbp)
movb %dl, -0x78(%rbp)
jmp 0xa5ef0
jmp 0xa5ef2
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xa5dbb
jmp 0xa5f02
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)