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

  if (!mCanTurn) {
    if (mpAgent->GetActionEffector().IsMutex() == false && !mIsCritical) {
      SetCanTurn(true);
    }
  } else {
    if (mpAgent->GetActionEffector().IsMutex() || mIsCritical) {
      SetCanTurn(false);
    }
  }

  if (mpSelfState->IsIdling()) {
    SetCanTurn(false);
  }

  UpdatePredictInfo();

  if (mpWorldState->GetPlayMode() == PM_Our_Penalty_Ready || mpWorldState
                                                                     ->GetPlayMode() ==
                                                                 PM_Our_Penalty_Taken /*|| mpWorldState->GetPlayMode() == PM_Our_Penalty_Setup*/) {
    RaisePlayer(-mpWorldState->GetOpponentGoalieUnum(), 1.0);
    RaiseBall();
    return;
  }

  if (mpWorldState->GetPlayMode() > PM_Opp_Mode &&
      mpInfoState->GetPositionInfo().GetClosestOpponentDistToBall() < 3.0 &&
      mpBallState->GetPos().Dist(mpSelfState->GetPos()) < 20.0 &&
      mpBallState->GetPosDelay() > 1) {
    SetForceSeeBall(); //关注对手发球
  }

  if (mpSelfState->GetPos().X() -
              mpInfoState->GetPositionInfo().GetTeammateOffsideLine() >
          -5.0 &&
      mpInfoState->GetPositionInfo().GetTeammateOffsideLineOpp() !=
          Unum_Unknown) { // offside look
    RaisePlayer(-mpInfoState->GetPositionInfo().GetTeammateOffsideLineOpp(),
                2.0);
  }

  if (mpSelfState->IsGoalie()) {
    if (strategy.IsMyControl() ||
        mpWorldState->GetPlayMode() == PM_Our_Goal_Kick) {
      DoInfoGatherForDefense();
    } else {
      DoInfoGatherForGoalie();
    }
  } else {
    if (strategy.IsBallFree() && strategy.GetController() != 0 &&
        mpAgent->GetFormation()
                .GetTeammateRoleType(mpSelfState->GetUnum())
                .mLineType != LT_Defender &&
        (strategy.GetBallFreeCycleLeft() > 3 ||
         (strategy.IsMyControl() && strategy.GetMyInterCycle() > 3))) {
      DoInfoGatherForBallFree();
    } else {
      switch (strategy.GetSituation()) {
      case ST_Defense:
        DoInfoGatherForDefense();
        break;
      case ST_Forward_Attack:
        DoInfoGatherForFastForward();
        break;
      case ST_Penalty_Attack:
        DoInfoGatherForPenaltyAttack();
        break;
      }
    }
  }

  if (mpWorldState->GetPlayMode() != PM_Play_On) {
    DoInfoGatherForBallFree();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0xdd50
movq %rax, %r14
movq 0x8(%rbx), %rdi
movb 0x63c(%rbx), %r15b
callq 0xd670
movb 0xe90(%rax), %al
testb %r15b, %r15b
je 0x49ea1
testb %al, %al
jne 0x49e9d
cmpb $0x1, 0x638(%rbx)
jne 0x49eb6
xorl %eax, %eax
jmp 0x49eb0
testb %al, %al
jne 0x49eb6
movb $0x1, %al
cmpb $0x0, 0x638(%rbx)
jne 0x49eb6
movb %al, 0x63c(%rbx)
movq 0x20(%rbx), %rax
cmpl $0x0, 0xc8(%rax)
jg 0x49ecc
cmpl $0x0, 0x124(%rax)
jle 0x49ed3
movb $0x0, 0x63c(%rbx)
movq %rbx, %rdi
callq 0x4bd88
movq 0x10(%rbx), %rax
movl 0x1c(%rax), %ecx
leal -0xf(%rcx), %edx
cmpl $0x1, %edx
ja 0x49f17
xorl %esi, %esi
subl 0x2114(%rax), %esi
movsd 0xd14e(%rip), %xmm0     # 0x57048
movq %rbx, %rdi
callq 0x4a0b4
xorps %xmm0, %xmm0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4a2ce
cmpl $0x25, %ecx
jl 0x49f70
movq 0x28(%rbx), %rdi
callq 0x244e8
movq %rax, %rdi
callq 0x4be12
movsd 0xdcbb(%rip), %xmm1     # 0x57bf0
ucomisd %xmm0, %xmm1
jbe 0x49f70
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rdi
addq $0x8, %rsi
callq 0x2198a
movsd 0xf000(%rip), %xmm1     # 0x58f58
ucomisd %xmm0, %xmm1
jbe 0x49f70
movq 0x18(%rbx), %rax
cmpl $0x2, 0x18(%rax)
jl 0x49f70
movq %rbx, %rdi
callq 0x4a404
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x244e8
movsd -0x20(%rbp), %xmm0
subsd 0x17a0(%rax), %xmm0
ucomisd 0xe32c(%rip), %xmm0     # 0x582c8
jbe 0x49fd1
movq 0x28(%rbx), %rdi
callq 0x244e8
cmpl $0x0, 0x1798(%rax)
je 0x49fd1
movq 0x28(%rbx), %rdi
callq 0x244e8
xorl %esi, %esi
subl 0x1798(%rax), %esi
movsd 0xd78f(%rip), %xmm0     # 0x57758
movq %rbx, %rdi
callq 0x4a0b4
movq 0x20(%rbx), %rax
cmpb $0x1, 0x175(%rax)
jne 0x49ffe
movq %r14, %rdi
callq 0x3fb02
testb %al, %al
jne 0x4a04c
movq 0x10(%rbx), %rax
cmpl $0x5, 0x1c(%rax)
je 0x4a04c
movq %rbx, %rdi
callq 0x4a808
jmp 0x4a054
cmpb $0x1, 0x41(%r14)
jne 0x4a037
cmpl $0x0, 0x48(%r14)
je 0x4a037
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)
jne 0x4a07b
movl 0xa4(%r14), %eax
testl %eax, %eax
je 0x4a0a9
cmpl $0x1, %eax
je 0x4a09f
cmpl $0x2, %eax
jne 0x4a054
movq %rbx, %rdi
callq 0x4a45c
movq 0x10(%rbx), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x4a069
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4a8d0
cmpl $0x3, 0x44(%r14)
jg 0x4a095
movq %r14, %rdi
callq 0x3fb02
testb %al, %al
je 0x4a037
cmpl $0x4, 0x64(%r14)
jl 0x4a037
movq %rbx, %rdi
callq 0x4a8d0
jmp 0x4a054
movq %rbx, %rdi
callq 0x4b114
jmp 0x4a054
movq %rbx, %rdi
callq 0x4ab46
jmp 0x4a054
nop