// File: 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
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq 0x8(%rax), %rdi
callq 0x14050
movq %rax, -0x10(%rbp)
movsd 0x1aab9(%rip), %xmm0    # 0xc1968
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1b490
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x218e0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1b4b0
movsd -0xa0(%rbp), %xmm0
cvtsi2sd %eax, %xmm1
movsd 0x1d098(%rip), %xmm2    # 0xc3f90
mulsd %xmm2, %xmm1
movsd 0x1aa64(%rip), %xmm2    # 0xc1968
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa93c0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20a40
movsd -0x98(%rbp), %xmm0
cvtsi2sd %eax, %xmm1
movsd 0x1d04d(%rip), %xmm2    # 0xc3f90
mulsd %xmm2, %xmm1
movsd 0x1aa19(%rip), %xmm2    # 0xc1968
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x12a60
movsd (%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x12a60
movsd (%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x38(%rbp), %xmm1
movsd 0x1a51b(%rip), %xmm0    # 0xc14b0
addsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa6fc9
movsd -0x18(%rbp), %xmm0
movsd 0x1ac0b(%rip), %xmm1    # 0xc1bb8
ucomisd %xmm1, %xmm0
jbe 0xa6fc9
movsd -0x18(%rbp), %xmm0
movsd 0x1a050(%rip), %xmm1    # 0xc1010
subsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x8b150
movq -0xa8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x495c0
movq %rax, %rdi
callq 0x8b130
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x88c40
testb $0x1, %al
jne 0xa6ffd
jmp 0xa7073
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1a4c0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movq %rcx, -0xb0(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movq -0xb0(%rbp), %rdi
movl %eax, %esi
callq 0x29570
cmpl $0x1, 0x8(%rax)
je 0xa7073
movsd 0x1b085(%rip), %xmm0    # 0xc20c8
ucomisd -0x18(%rbp), %xmm0
jbe 0xa7073
movsd -0x18(%rbp), %xmm0
movsd 0x1a459(%rip), %xmm1    # 0xc14b0
ucomisd %xmm1, %xmm0
jbe 0xa7073
movq -0xa8(%rbp), %rdi
movsd 0x19fa4(%rip), %xmm0    # 0xc1010
callq 0xa6520
jmp 0xa7082
movq -0xa8(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xa6520
movq -0x10(%rbp), %rdi
callq 0x88c40
testb $0x1, %al
jne 0xa711a
movl $0x3, -0x4c(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8b1a0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8b170
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0xa70cf
jmp 0xa7115
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq (%rax), %rax
cmpl $0x32, 0x74(%rax)
jle 0xa70e3
jmp 0xa7115
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq -0xa8(%rbp), %rdi
movl 0x8(%rax), %esi
movl -0x4c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x4c(%rbp)
cvtsi2sd %eax, %xmm0
callq 0xa62a0
leaq -0x40(%rbp), %rdi
callq 0x8b230
jmp 0xa70af
jmp 0xa7298
movq -0xa8(%rbp), %rdi
movsd 0x1a387(%rip), %xmm0    # 0xc14b0
callq 0xa6520
movl $0x3, -0x64(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8b1a0
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8b170
movq %rax, -0x78(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0xa716d
jmp 0xa7296
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq (%rax), %rax
cmpl $0x32, 0x74(%rax)
jle 0xa7184
jmp 0xa7296
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movl 0x8(%rcx), %ecx
movl %ecx, -0xb4(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movl -0xb4(%rbp), %eax
cmpl %ecx, %eax
jne 0xa71ba
jmp 0xa7288
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq -0xa8(%rbp), %rdi
movl 0x8(%rax), %esi
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
cvtsi2sd %eax, %xmm0
callq 0xa62a0
movq -0xa8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x23eb0
movq %rax, %rdi
addq $0x8, %rdi
callq 0x1ddd0
movl %eax, -0xb8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq %rax, %rcx
movl -0xb8(%rbp), %eax
movq (%rcx), %rcx
cmpl 0x74(%rcx), %eax
jle 0xa7286
movq -0xa8(%rbp), %rax
addq $0x608, %rax            # imm = 0x608
movq %rax, -0xc8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x8b210
movq -0xa8(%rbp), %rdi
movl 0x8(%rax), %esi
callq 0xa9430
movq -0xc8(%rbp), %rdi
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rsi
callq 0xa93e0
movq %rax, -0x90(%rbp)
movb %dl, -0x88(%rbp)
jmp 0xa7288
leaq -0x40(%rbp), %rdi
callq 0x8b230
jmp 0xa714a
jmp 0xa7298
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)