// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/VisualSystem.cpp
// Function: VisualSystem::DealWithSpecialObjects()
void VisualSystem::DealWithSpecialObjects() {
  static const double buffer = 0.25;
  static const int object_count = TEAMSIZE * 2 + 1;

  static const double high_priority_multi = object_count * 0.5;
  static const double force_to_see_player_multi =
      object_count * high_priority_multi;
  static const double force_to_see_ball_multi =
      object_count * force_to_see_player_multi;

  if (!mHighPriorityPlayerSet.empty()) {
    for (std::set<VisualRequest *>::iterator it =
             mHighPriorityPlayerSet.begin();
         it != mHighPriorityPlayerSet.end(); ++it) {
      if (!(*it)->mValid)
        continue;
      (*it)->mScore = (*it)->Multi() * (mForceToSeeObject[(*it)->mUnum]
                                            ? force_to_see_player_multi
                                            : high_priority_multi);

      if ((*it)->mpObject->GetPosConf() > 0.9 &&
          (*it)->PreDistance() <
              ServerParam::instance().visibleDistance() - buffer) {
        SetCritical(true);
      }
    }
  }

  if (mForceToSeeObject[0] && mVisualRequest[0].mValid) {
    if (mpBallState->GetPosConf() > 0.9 &&
        mVisualRequest[0].PreDistance() <
            ServerParam::instance().visibleDistance() - buffer) {
      if (mpBallState->GetPosDelay() == 0) {
        mVisualRequest[0].mScore = FLOAT_EPS; // just sense it
      }

      SetCritical(true);
    } else {
      mVisualRequest[0].mScore =
          mVisualRequest[0].Multi() * force_to_see_ball_multi;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x608, %rdi            # imm = 0x608
callq 0xa9600
testb $0x1, %al
jne 0xa51a9
movq -0x38(%rbp), %rdi
addq $0x608, %rdi            # imm = 0x608
callq 0xa9620
movq %rax, -0x10(%rbp)
movq -0x38(%rbp), %rdi
addq $0x608, %rdi            # imm = 0x608
callq 0xa9680
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa9650
testb $0x1, %al
jne 0xa5079
jmp 0xa51a7
leaq -0x10(%rbp), %rdi
callq 0xa96b0
movq (%rax), %rax
testb $0x1, 0x10(%rax)
jne 0xa5090
jmp 0xa5199
leaq -0x10(%rbp), %rdi
callq 0xa96b0
movq (%rax), %rdi
callq 0xa96d0
movq -0x38(%rbp), %rax
movsd %xmm0, -0x58(%rbp)
addq $0x5f0, %rax            # imm = 0x5F0
movq %rax, -0x50(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xa96b0
movq -0x50(%rbp), %rdi
movq (%rax), %rsi
addq $0x38, %rsi
callq 0xa96f0
movb (%rax), %al
movsd 0x205a1(%rip), %xmm0    # 0xc5678
movsd 0x205a1(%rip), %xmm1    # 0xc5680
movsd %xmm1, -0x48(%rbp)
testb $0x1, %al
movsd %xmm0, -0x40(%rbp)
jne 0xa50f7
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x58(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
leaq -0x10(%rbp), %rdi
callq 0xa96b0
movsd -0x60(%rbp), %xmm0
movq (%rax), %rax
movsd %xmm0, 0x28(%rax)
leaq -0x10(%rbp), %rdi
callq 0xa96b0
movq (%rax), %rax
movq 0x30(%rax), %rdi
addq $0x8, %rdi
callq 0x1d930
movsd (%rax), %xmm0
movsd 0x1d723(%rip), %xmm1    # 0xc2868
ucomisd %xmm1, %xmm0
jbe 0xa5197
leaq -0x10(%rbp), %rdi
callq 0xa96b0
movq (%rax), %rdi
callq 0xa9760
movsd %xmm0, -0x68(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b250
movsd -0x68(%rbp), %xmm1
movsd (%rax), %xmm0
movsd 0x1beb9(%rip), %xmm2    # 0xc1038
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa5197
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0xa9780
jmp 0xa5199
leaq -0x10(%rbp), %rdi
callq 0xa97b0
jmp 0xa504f
jmp 0xa51a9
movq -0x38(%rbp), %rdi
addq $0x5f0, %rdi            # imm = 0x5F0
movl $0x0, -0x1c(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0xa96f0
movq %rax, %rcx
xorl %eax, %eax
testb $0x1, (%rcx)
movb %al, -0x69(%rbp)
je 0xa51ef
movq -0x38(%rbp), %rdi
addq $0x30, %rdi
movl $0x0, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0xa8fa0
movb 0x10(%rax), %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0xa51fb
jmp 0xa531d
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x1d930
movsd (%rax), %xmm0
xorl %eax, %eax
movsd 0x1d64e(%rip), %xmm1    # 0xc2868
ucomisd %xmm1, %xmm0
movb %al, -0x6a(%rbp)
jbe 0xa5274
movq -0x38(%rbp), %rdi
addq $0x30, %rdi
movl $0x0, -0x24(%rbp)
leaq -0x24(%rbp), %rsi
callq 0xa8fa0
movq %rax, %rdi
callq 0xa9760
movsd %xmm0, -0x78(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b250
movsd -0x78(%rbp), %xmm1
movsd (%rax), %xmm0
movsd 0x1bdd2(%rip), %xmm2    # 0xc1038
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
seta %al
movb %al, -0x6a(%rbp)
movb -0x6a(%rbp), %al
testb $0x1, %al
jne 0xa527d
jmp 0xa52c8
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x1ddd0
cmpl $0x0, %eax
jne 0xa52b8
movq -0x38(%rbp), %rdi
addq $0x30, %rdi
movl $0x0, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0xa8fa0
movsd 0x1bd55(%rip), %xmm0    # 0xc1008
movsd %xmm0, 0x28(%rax)
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0xa9780
jmp 0xa531b
movq -0x38(%rbp), %rdi
addq $0x30, %rdi
movl $0x0, -0x2c(%rbp)
leaq -0x2c(%rbp), %rsi
callq 0xa8fa0
movq %rax, %rdi
callq 0xa96d0
movq -0x38(%rbp), %rdi
movsd 0x20394(%rip), %xmm1    # 0xc5688
mulsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
addq $0x30, %rdi
movl $0x0, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
callq 0xa8fa0
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x28(%rax)
jmp 0xa531d
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)