// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x630(%rdi)
je 0x4982b
movq 0x620(%rbx), %r14
leaq 0x610(%rbx), %r15
pushq $0xb
popq %r12
cmpq %r15, %r14
je 0x4982b
movq 0x20(%r14), %rax
cmpb $0x1, 0x10(%rax)
jne 0x4981b
movsd 0x28(%rax), %xmm0
movslq 0x38(%rax), %rcx
movl %r12d, %edx
subl %ecx, %edx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
addsd 0xd8a4(%rip), %xmm0     # 0x57048
cmpb $0x0, 0x5f0(%rbx,%rdx)
movsd 0x11e0c(%rip), %xmm1    # 0x5b5c0
jne 0x497be
movsd 0x11e0a(%rip), %xmm1    # 0x5b5c8
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rax)
movq 0x30(%rax), %rcx
movsd 0x20(%rcx), %xmm0
ucomisd 0x11318(%rip), %xmm0    # 0x5aaf0
jbe 0x4981b
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x3db2c
movsd 0x3178(%rax), %xmm0
addsd 0x104fb(%rip), %xmm0    # 0x59d08
ucomisd -0x28(%rbp), %xmm0
jbe 0x4981b
movb $0x1, 0x638(%rbx)
movq %r14, %rdi
callq 0x9560
movq %rax, %r14
jmp 0x49770
cmpb $0x1, 0x5f0(%rbx)
jne 0x498cb
cmpb $0x1, 0x40(%rbx)
jne 0x498cb
movq 0x18(%rbx), %rax
movsd 0x20(%rax), %xmm0
ucomisd 0x1129d(%rip), %xmm0    # 0x5aaf0
jbe 0x498b1
movsd 0x30(%rbx), %xmm0
movsd 0x38(%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x3db2c
movsd 0x3178(%rax), %xmm0
addsd 0x1047f(%rip), %xmm0    # 0x59d08
ucomisd -0x28(%rbp), %xmm0
jbe 0x498b1
movq 0x18(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jne 0x498a8
movabsq $0x3ed92a737110e454, %rax # imm = 0x3ED92A737110E454
movq %rax, 0x58(%rbx)
movb $0x1, 0x638(%rbx)
jmp 0x498cb
movsd 0x58(%rbx), %xmm0
addsd 0xd78a(%rip), %xmm0     # 0x57048
mulsd 0x11d0a(%rip), %xmm0    # 0x5b5d0
movsd %xmm0, 0x58(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq