// File: /workspace/github_cpp_makefile_star2_O3/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 0x11f51(%rip), %xmm0    # 0x69040
seta 0x40(%rdi)
jbe 0x57186
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 0x11f22(%rip), %xmm1    # 0x69058
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 0x12fd0(%rip), %xmm0    # 0x6a138
maxsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rdi)
movsd 0x11ec7(%rip), %xmm0    # 0x69040
ucomisd %xmm2, %xmm0
jbe 0x57186
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 0x572d0
movslq 0x2114(%rax), %rcx
testq %rcx, %rcx
je 0x5746c
leaq 0x30(%rdi), %rdx
movl %ecx, %esi
negl %esi
leal 0xb(%rcx), %ebx
testl %ecx, %ecx
cmovleq %rsi, %rbx
shlq $0x6, %rbx
addq %rdx, %rbx
movq %rbx, -0x38(%rbp)
imulq $0x178, %rcx, %rcx      # imm = 0x178
cmpb $0x1, 0x106a(%rcx,%rax)
jne 0x57468
addq %rcx, %rax
addq $0xf58, %rax            # imm = 0xF58
movq 0x68(%rax), %r14
movl $0x1, -0x2c(%rbp)
movl $0x1, %eax
cmpl $0x0, 0x668(%r14)
jg 0x57228
leaq -0x2c(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xef58
movq -0x40(%rbp), %rdi
movslq (%r15), %rax
shlq $0x4, %rax
movsd 0x8(%r14,%rax), %xmm0
subsd 0x660(%rdi), %xmm0
movsd 0x10(%r14,%rax), %xmm1
subsd 0x668(%rdi), %xmm1
movsd %xmm0, (%rbx)
movsd %xmm1, 0x8(%rbx)
movb $0x1, 0x10(%rbx)
movq 0x30(%rbx), %rax
movl 0x18(%rax), %eax
movl %eax, 0x14(%rbx)
movsd 0x18(%rbx), %xmm0
movsd 0x11dea(%rip), %xmm1    # 0x69058
maxsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rbx)
cvtsi2sd %eax, %xmm2
divsd %xmm0, %xmm2
movapd %xmm1, %xmm0
subsd %xmm2, %xmm0
xorpd %xmm2, %xmm2
maxsd %xmm0, %xmm2
movsd %xmm2, 0x20(%rbx)
subsd %xmm2, %xmm1
movsd 0x12e98(%rip), %xmm0    # 0x6a138
maxsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rbx)
movsd 0x11d8f(%rip), %xmm0    # 0x69040
ucomisd %xmm2, %xmm0
jbe 0x5746c
addq $0x608, %rdi            # imm = 0x608
leaq -0x38(%rbp), %rsi
callq 0x59db4
jmp 0x5746c
leaq 0x608(%rdi), %rax
movq %rax, -0x48(%rbp)
leaq -0x290(%rdi), %r15
leaq 0x5b0(%rdi), %r12
movq $-0xb, %r14
movl $0x1f80, %ebx           # imm = 0x1F80
movq $-0xfe6, %r13           # imm = 0xF01A
testq %r14, %r14
je 0x57443
movq 0x20(%rdi), %rax
cmpl 0x11c(%rax), %r14d
je 0x57443
movq %r15, %rax
testq %r14, %r14
cmovsq %r12, %rax
movq %rax, -0x38(%rbp)
movq 0x10(%rdi), %rcx
jle 0x57351
movb (%rcx,%r13), %dl
movb %dl, 0x10(%r15)
testb %dl, %dl
je 0x57443
addq $0xa8, %rcx
leaq -0x1(%r14), %rdx
imulq $0x178, %rdx, %rdx      # imm = 0x178
addq %rcx, %rdx
jmp 0x57369
movb 0x112(%rcx,%rbx), %dl
movb %dl, 0x10(%rax)
testb %dl, %dl
je 0x57443
addq %rbx, %rcx
movq %rcx, %rdx
movq 0x68(%rdx), %rdx
movl $0x1, -0x2c(%rbp)
movl $0x1, %ecx
cmpl $0x0, 0x668(%rdx)
jg 0x573a2
movq %rdx, %rdi
leaq -0x2c(%rbp), %rsi
movq %rdx, -0x50(%rbp)
callq 0xef58
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rdi
movslq -0x2c(%rbp), %rcx
movq -0x38(%rbp), %rax
shlq $0x4, %rcx
movsd 0x8(%rdx,%rcx), %xmm0
movsd 0x10(%rdx,%rcx), %xmm1
subsd 0x660(%rdi), %xmm0
subsd 0x668(%rdi), %xmm1
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
movq 0x30(%rax), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x14(%rax)
movsd 0x18(%rax), %xmm0
movsd 0x11c76(%rip), %xmm2    # 0x69058
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 0x12d1d(%rip), %xmm2    # 0x6a138
maxsd %xmm0, %xmm2
movsd %xmm2, 0x28(%rax)
movsd 0x11c14(%rip), %xmm0    # 0x69040
ucomisd %xmm1, %xmm0
jbe 0x57443
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x59db4
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 0x572fc
jmp 0x5746c
movb $0x0, 0x10(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop