// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/VisualSystem.cpp
// Function: VisualSystem::DoInfoGatherForBallFree()
void VisualSystem::DoInfoGatherForBallFree() {
  const Strategy &strategy = mpAgent->GetStrategy();

  double
      ball_free_cyc_left; // ball free cycle
                          // left,这里是经过调整的有概率意义的freecyc,不同于StrategyInfo里的那个值
  const double rate = 0.6; //可以认为是调整值符合真实值的成功率
  double my_int_cycle, tm_int_cycle, opp_int_cycle;

  my_int_cycle = strategy.GetMyInterCycle();
  tm_int_cycle = strategy.GetMinTmInterCycle() * rate +
                 strategy.GetSureTmInterCycle() * (1 - rate);
  opp_int_cycle = strategy.GetMinOppInterCycle() * rate +
                  strategy.GetSureOppInterCycle() * (1 - rate);

  ball_free_cyc_left = Min(tm_int_cycle, opp_int_cycle);
  ball_free_cyc_left = Min(my_int_cycle, ball_free_cyc_left);

  if (opp_int_cycle < ball_free_cyc_left + 2 && ball_free_cyc_left > 3) {
    ball_free_cyc_left -= 1;
  }

  std::vector<OrderedIT>::const_iterator it;
  const std::vector<OrderedIT> &OIT = mpInfoState->GetInterceptInfo().GetOIT();

  if (strategy.IsMyControl() &&
      mpAgent->GetFormation()
              .GetTeammateRoleType(mpSelfState->GetUnum())
              .mLineType != LT_Defender &&
      ball_free_cyc_left < 6 && ball_free_cyc_left > 2) {
    RaiseBall(1.0);
  } else {
    RaiseBall();
  }

  if (!strategy.IsMyControl()) { //自己不用拿球
    int eva = 3;
    for (it = OIT.begin(); it != OIT.end(); ++it) {
      if (it->mpInterceptInfo->mMinCycle > 50)
        break;
      RaisePlayer(it->mUnum, eva++);
    }
  } else { //自己需要拿球
    RaiseBall(2.0);
    int eva = 3;
    for (it = OIT.begin(); it != OIT.end(); ++it) {
      if (it->mpInterceptInfo->mMinCycle > 50)
        break;
      if (it->mUnum == mpSelfState->GetUnum())
        continue;
      RaisePlayer(it->mUnum, ++eva);
      if (mpWorldState->GetPlayer(it->mUnum).GetPosDelay() >
          it->mpInterceptInfo->mMinCycle) {
        mHighPriorityPlayerSet.insert(GetVisualRequest(it->mUnum));
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0xdd50
movq %rax, %r15
movl 0x64(%rax), %eax
movl %eax, -0x30(%rbp)
movl 0x68(%r15), %eax
movl %eax, -0x38(%rbp)
movl 0x7c(%r15), %eax
movl %eax, -0x34(%rbp)
movl 0x6c(%r15), %r12d
movl 0x80(%r15), %r13d
movq 0x28(%rbx), %rdi
callq 0x24506
movq %rax, %r14
movq %r15, %rdi
callq 0x3fb02
testb %al, %al
je 0x4aa0b
movq 0x8(%rbx), %rdi
callq 0x10dfe
movq 0x20(%rbx), %rcx
movslq 0x11c(%rcx), %rcx
movq 0x10(%rax), %rax
movslq 0x350(%rax,%rcx,4), %rcx
shlq $0x4, %rcx
cmpl $0x1, 0x58(%rcx,%rax)
je 0x4aa0b
cvtsi2sd %r12d, %xmm0
cvtsi2sd %r13d, %xmm1
movsd 0xf49c(%rip), %xmm2     # 0x59e08
mulsd %xmm2, %xmm1
movsd 0xd018(%rip), %xmm3     # 0x57990
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
cvtsi2sdl -0x38(%rbp), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm3, %xmm1
addsd %xmm4, %xmm1
movapd %xmm0, %xmm2
minsd %xmm1, %xmm2
cvtsi2sdl -0x30(%rbp), %xmm1
minsd %xmm1, %xmm2
movsd 0xcda9(%rip), %xmm1     # 0x57758
addsd %xmm2, %xmm1
movsd 0xc6b5(%rip), %xmm3     # 0x57070
addsd %xmm2, %xmm3
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm3
andnpd %xmm2, %xmm0
orpd %xmm3, %xmm0
movsd 0xd218(%rip), %xmm1     # 0x57bf0
cmpltsd %xmm2, %xmm1
andpd %xmm1, %xmm0
andnpd %xmm2, %xmm1
orpd %xmm0, %xmm1
movsd 0xf47f(%rip), %xmm0     # 0x59e70
ucomisd %xmm1, %xmm0
jbe 0x4aa0b
ucomisd 0xcd59(%rip), %xmm1     # 0x57758
jbe 0x4aa0b
movsd 0xc63f(%rip), %xmm0     # 0x57048
jmp 0x4aa0f
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x4a2ce
movq %r15, %rdi
callq 0x3fb02
testb %al, %al
je 0x4aaff
movsd 0xcd29(%rip), %xmm0     # 0x57758
movq %rbx, %rdi
callq 0x4a2ce
movq 0xc80(%r14), %r13
leaq 0x608(%rbx), %r15
leaq 0x30(%rbx), %rax
movq %rax, -0x30(%rbp)
pushq $0x3
popq %r12
cmpq 0xc88(%r14), %r13
je 0x4ab36
movq (%r13), %rax
cmpl $0x32, 0x74(%rax)
jg 0x4ab36
movl 0x8(%r13), %esi
movq 0x20(%rbx), %rax
cmpl 0x11c(%rax), %esi
je 0x4aaf6
incl %r12d
cvtsi2sd %r12d, %xmm0
movq %rbx, %rdi
callq 0x4a0b4
movq 0x10(%rbx), %rcx
movslq 0x8(%r13), %rax
testq %rax, %rax
jle 0x4aaaf
leal -0x1(%rax), %edx
imulq $0x178, %rdx, %rdx      # imm = 0x178
addq %rdx, %rcx
addq $0xa8, %rcx
jmp 0x4aac7
movl %eax, %edx
notl %edx
movslq %edx, %rdx
imulq $0x178, %rdx, %rdx      # imm = 0x178
addq %rdx, %rcx
addq $0x10d0, %rcx           # imm = 0x10D0
movl 0x18(%rcx), %ecx
movq (%r13), %rdx
cmpl 0x74(%rdx), %ecx
jle 0x4aaf6
pushq $0xb
popq %rcx
subl %eax, %ecx
testl %eax, %eax
cmovnsq %rax, %rcx
shlq $0x6, %rcx
addq -0x30(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movq %r15, %rdi
leaq -0x40(%rbp), %rsi
callq 0x4c31a
addq $0x10, %r13
jmp 0x4aa51
movq 0xc80(%r14), %r15
pushq $0x3
popq %r12
cmpq 0xc88(%r14), %r15
je 0x4ab36
movq (%r15), %rax
cmpl $0x32, 0x74(%rax)
jg 0x4ab36
movl 0x8(%r15), %esi
cvtsi2sd %r12d, %xmm0
incl %r12d
movq %rbx, %rdi
callq 0x4a0b4
addq $0x10, %r15
jmp 0x4ab0a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop