// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x630(%rdi)
je 0x584a4
movq 0x620(%rbx), %r14
leaq 0x610(%rbx), %r15
cmpq %r15, %r14
je 0x584a4
movq 0x20(%r14), %rax
cmpb $0x1, 0x10(%rax)
jne 0x58490
movsd 0x28(%rax), %xmm0
movslq 0x38(%rax), %rcx
movl $0xb, %edx
subq %rcx, %rdx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
addsd 0x12c50(%rip), %xmm0    # 0x6b058
cmpb $0x0, 0x5f0(%rbx,%rdx)
movsd 0x17208(%rip), %xmm1    # 0x6f620
jne 0x58422
movsd 0x17206(%rip), %xmm1    # 0x6f628
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rax)
movq 0x30(%rax), %rcx
movsd 0x20(%rcx), %xmm0
ucomisd 0x16704(%rip), %xmm0    # 0x6eb40
jbe 0x58490
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x12c35(%rip), %xmm0    # 0x6b090
jb 0x58463
sqrtsd %xmm0, %xmm0
jmp 0x58468
callq 0x93c0
movsd %xmm0, -0x20(%rbp)
callq 0x4a75c
movsd 0x3178(%rax), %xmm0
addsd 0x158d6(%rip), %xmm0    # 0x6dd58
ucomisd -0x20(%rbp), %xmm0
jbe 0x58490
movb $0x1, 0x638(%rbx)
movq %r14, %rdi
callq 0x9570
movq %rax, %r14
cmpq %r15, %rax
jne 0x583da
cmpb $0x1, 0x5f0(%rbx)
jne 0x58555
cmpb $0x1, 0x40(%rbx)
jne 0x58555
movq 0x18(%rbx), %rax
movsd 0x20(%rax), %xmm0
ucomisd 0x16674(%rip), %xmm0    # 0x6eb40
jbe 0x5853b
movsd 0x30(%rbx), %xmm0
movsd 0x38(%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x584f4
sqrtsd %xmm0, %xmm0
jmp 0x584f9
callq 0x93c0
movsd %xmm0, -0x20(%rbp)
callq 0x4a75c
movsd 0x3178(%rax), %xmm0
addsd 0x15845(%rip), %xmm0    # 0x6dd58
ucomisd -0x20(%rbp), %xmm0
jbe 0x5853b
movq 0x18(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jne 0x58532
movabsq $0x3ed92a737110e454, %rax # imm = 0x3ED92A737110E454
movq %rax, 0x58(%rbx)
movb $0x1, 0x638(%rbx)
jmp 0x58555
movsd 0x58(%rbx), %xmm0
addsd 0x12b10(%rip), %xmm0    # 0x6b058
mulsd 0x170e0(%rip), %xmm0    # 0x6f630
movsd %xmm0, 0x58(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq