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

  if (mpWorldState->GetPlayMode() < PM_Our_Mode &&
      mpWorldState->GetPlayMode() > PM_Play_On) {
    eva = Min(2.0, eva);
  }

  if (eva < FLOAT_EPS) {
    if (strategy.IsBallFree() && mpWorldState->GetPlayMode() == PM_Play_On) {
      if (mpBallState->GetVelDelay() <=
          mpWorldState->CurrentTime() -
              strategy.GetLastBallFreeTime()) { //球free后曾看到过球速
        //在球即将不再free时要看球,其他可以不看,但上限是3个周期,其间可以收集些别的信息
        eva =
            Max(Min(strategy.IsMyControl() ? double(strategy.GetMyInterCycle())
                                           : strategy.GetBallFreeCycleLeft(),
                    3.0),
                1.0);
      } else { //球free后还未看到过球速
        eva = 1.0;
        SetForceSeeBall();
      }
    } else if (strategy.IsTmControl()) {
      double ball_dis = (mPreBallPos - mPreSelfPos).Mod();
      eva = ball_dis / 20.0 + 1.0;
      eva = Max(eva, 3.0);
    } else {
      double ball_dis = (mPreBallPos - mPreSelfPos).Mod();
      eva = ball_dis / 20.0;
      eva = Max(eva, 2.0);
    }
  }

  mVisualRequest.GetOfBall().mFreq = Min(mVisualRequest.GetOfBall().mFreq, eva);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x8(%rax), %rdi
callq 0x14050
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x15, %eax
jge 0xa6593
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x1, %eax
jle 0xa6593
movsd 0x1af38(%rip), %xmm0    # 0xc14b0
movsd %xmm0, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x12a60
movsd (%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0x1aa6d(%rip), %xmm0    # 0xc1008
ucomisd -0x10(%rbp), %xmm0
jbe 0xa67b7
movq -0x18(%rbp), %rdi
callq 0x406c0
testb $0x1, %al
jne 0xa65b8
jmp 0xa66c0
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x1, %eax
jne 0xa66c0
movq -0x80(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x28a30
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, -0x84(%rbp)
movq 0x10(%rax), %rdi
callq 0x12100
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa94e0
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x9ed10
movl %eax, %ecx
movl -0x84(%rbp), %eax
cmpl %ecx, %eax
jg 0xa66a5
movq -0x18(%rbp), %rdi
callq 0x88c40
testb $0x1, %al
jne 0xa662e
jmp 0xa6645
movq -0x18(%rbp), %rdi
callq 0x1b490
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x98(%rbp)
jmp 0xa665a
movq -0x18(%rbp), %rdi
callq 0xa93a0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x1b549(%rip), %xmm0    # 0xc1bb8
movsd %xmm0, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x12a60
movq %rax, %rdi
movsd 0x1a984(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x12a90
movsd (%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0xa66bb
movq -0x80(%rbp), %rdi
movsd 0x1a95f(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x10(%rbp)
callq 0xa6810
jmp 0xa67b5
movq -0x18(%rbp), %rdi
callq 0xa9460
testb $0x1, %al
jne 0xa66cf
jmp 0xa6748
movq -0x80(%rbp), %rsi
movq %rsi, %rdi
addq $0x650, %rdi            # imm = 0x650
addq $0x660, %rsi            # imm = 0x660
callq 0x110a0
movsd %xmm0, -0x50(%rbp)
movsd %xmm1, -0x48(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd 0x1c7aa(%rip), %xmm1    # 0xc2eb8
divsd %xmm1, %xmm0
movsd 0x1a8f6(%rip), %xmm1    # 0xc1010
addsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0x1b48d(%rip), %xmm0    # 0xc1bb8
movsd %xmm0, -0x58(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x12a90
movsd (%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0xa67b3
movq -0x80(%rbp), %rsi
movq %rsi, %rdi
addq $0x650, %rdi            # imm = 0x650
addq $0x660, %rsi            # imm = 0x660
callq 0x110a0
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movsd 0x1c731(%rip), %xmm1    # 0xc2eb8
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0x1ad18(%rip), %xmm0    # 0xc14b0
movsd %xmm0, -0x78(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x12a90
movsd (%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0xa67b5
jmp 0xa67b7
movq -0x80(%rbp), %rdi
addq $0x30, %rdi
callq 0xa8ef0
movq %rax, %rdi
addq $0x18, %rdi
leaq -0x10(%rbp), %rsi
callq 0x12a60
movq -0x80(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
addq $0x30, %rdi
callq 0xa8ef0
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, 0x18(%rax)
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)