// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x38(%rdi), %rsi
callq 0xf4b0
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 0x2a4f2
movq %rax, %r14
movq %r15, %rdi
callq 0x4b51a
testb %al, %al
je 0x58180
movq 0x8(%rbx), %rdi
callq 0x13432
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 0x58180
cvtsi2sd %r12d, %xmm0
cvtsi2sd %r13d, %xmm1
movsd 0x13d64(%rip), %xmm2    # 0x6be28
mulsd %xmm2, %xmm1
movsd 0x118f0(%rip), %xmm3    # 0x699c0
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl -0x38(%rbp), %xmm1
cvtsi2sdl -0x34(%rbp), %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm3, %xmm1
addsd %xmm4, %xmm1
movapd %xmm0, %xmm2
minsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsi2sdl -0x30(%rbp), %xmm1
minsd %xmm1, %xmm2
movsd 0x11673(%rip), %xmm1    # 0x69780
addsd %xmm2, %xmm1
movsd 0x10f7f(%rip), %xmm3    # 0x69098
addsd %xmm2, %xmm3
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm3
andnpd %xmm2, %xmm0
orpd %xmm3, %xmm0
movsd 0x11aea(%rip), %xmm1    # 0x69c20
cmpltsd %xmm2, %xmm1
andpd %xmm1, %xmm0
andnpd %xmm2, %xmm1
orpd %xmm0, %xmm1
movsd 0x13d41(%rip), %xmm0    # 0x6be90
ucomisd %xmm1, %xmm0
jbe 0x58180
ucomisd 0x11623(%rip), %xmm1    # 0x69780
jbe 0x58180
movq 0x8(%rbx), %rdi
leaq 0x38(%rdi), %rsi
callq 0xf4b0
movsd 0x10ee4(%rip), %xmm0    # 0x69058
minsd 0x48(%rbx), %xmm0
movsd %xmm0, 0x48(%rbx)
jmp 0x5818c
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x57908
movq %r15, %rdi
callq 0x4b51a
testb %al, %al
je 0x58285
movsd 0x115dc(%rip), %xmm0    # 0x69780
movq %rbx, %rdi
callq 0x57908
movq 0xc80(%r14), %r13
cmpq 0xc88(%r14), %r13
je 0x582c8
leaq 0x608(%rbx), %r15
leaq 0x30(%rbx), %rax
movq %rax, -0x30(%rbp)
movl $0x3, %r12d
movq (%r13), %rax
cmpl $0x32, 0x74(%rax)
jg 0x582c8
movl 0x8(%r13), %esi
movq 0x20(%rbx), %rax
cmpl 0x11c(%rax), %esi
je 0x58272
incl %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movq %rbx, %rdi
callq 0x576ea
movq 0x10(%rbx), %rcx
movslq 0x8(%r13), %rax
testq %rax, %rax
jle 0x58229
leal -0x1(%rax), %edx
imulq $0x178, %rdx, %rdx      # imm = 0x178
addq %rdx, %rcx
addq $0xa8, %rcx
jmp 0x58241
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 0x58272
movl $0xb, %ecx
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 0x59ed6
addq $0x10, %r13
cmpq 0xc88(%r14), %r13
jne 0x581d5
jmp 0x582c8
movq 0xc80(%r14), %r15
cmpq 0xc88(%r14), %r15
je 0x582c8
movl $0x3, %r12d
movq (%r15), %rax
cmpl $0x32, 0x74(%rax)
jg 0x582c8
movl 0x8(%r15), %esi
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
incl %r12d
movq %rbx, %rdi
callq 0x576ea
addq $0x10, %r15
cmpq 0xc88(%r14), %r15
jne 0x5829b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop