// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x38(%rdi), %rsi
callq 0xf4b0
movq %rax, %r14
movq 0x8(%rbx), %rdi
movb 0x63c(%rbx), %r15b
callq 0xee28
movb 0xe90(%rax), %al
testb %r15b, %r15b
je 0x574c5
testb %al, %al
jne 0x574c1
cmpb $0x1, 0x638(%rbx)
jne 0x574da
xorl %eax, %eax
jmp 0x574d4
testb %al, %al
jne 0x574da
movb $0x1, %al
cmpb $0x0, 0x638(%rbx)
jne 0x574da
movb %al, 0x63c(%rbx)
movq 0x20(%rbx), %rax
cmpl $0x0, 0xc8(%rax)
jg 0x574f0
cmpl $0x0, 0x124(%rax)
jle 0x574f7
movb $0x0, 0x63c(%rbx)
movq %rbx, %rdi
callq 0x59914
movq 0x10(%rbx), %rax
movl 0x1c(%rax), %ecx
leal -0xf(%rcx), %edx
cmpl $0x1, %edx
ja 0x5753b
xorl %esi, %esi
subl 0x2114(%rax), %esi
movsd 0x11b3a(%rip), %xmm0    # 0x69058
movq %rbx, %rdi
callq 0x576ea
xorps %xmm0, %xmm0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x57908
cmpl $0x25, %ecx
jl 0x575a7
movq 0x28(%rbx), %rdi
callq 0x2a4b4
movq %rax, %rdi
callq 0x599b6
movsd 0x126c7(%rip), %xmm1    # 0x69c20
ucomisd %xmm0, %xmm1
jbe 0x575a7
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
movsd 0x8(%rax), %xmm0
movsd 0x10(%rax), %xmm1
subsd 0x8(%rcx), %xmm0
subsd 0x10(%rcx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x13a05(%rip), %xmm1    # 0x6af98
ucomisd %xmm0, %xmm1
jbe 0x575a7
cmpl $0x2, 0x18(%rax)
jl 0x575a7
movq %rbx, %rdi
callq 0x57a48
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x2a4b4
movsd -0x20(%rbp), %xmm0
subsd 0x17a0(%rax), %xmm0
ucomisd 0x12d35(%rip), %xmm0    # 0x6a308
jbe 0x57608
movq 0x28(%rbx), %rdi
callq 0x2a4b4
cmpl $0x0, 0x1798(%rax)
je 0x57608
movq 0x28(%rbx), %rdi
callq 0x2a4b4
xorl %esi, %esi
subl 0x1798(%rax), %esi
movsd 0x12180(%rip), %xmm0    # 0x69780
movq %rbx, %rdi
callq 0x576ea
movq 0x20(%rbx), %rax
cmpb $0x1, 0x175(%rax)
jne 0x57635
movq %r14, %rdi
callq 0x4b51a
testb %al, %al
jne 0x57683
movq 0x10(%rbx), %rax
cmpl $0x5, 0x1c(%rax)
je 0x57683
movq %rbx, %rdi
callq 0x57f56
jmp 0x5768b
cmpb $0x1, 0x41(%r14)
jne 0x5766e
cmpl $0x0, 0x48(%r14)
je 0x5766e
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)
jne 0x576b2
movl 0xa4(%r14), %eax
testl %eax, %eax
je 0x576e0
cmpl $0x1, %eax
je 0x576d6
cmpl $0x2, %eax
jne 0x5768b
movq %rbx, %rdi
callq 0x57af6
movq 0x10(%rbx), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x576a0
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 0x58024
cmpl $0x3, 0x44(%r14)
jg 0x576cc
movq %r14, %rdi
callq 0x4b51a
testb %al, %al
je 0x5766e
cmpl $0x4, 0x64(%r14)
jl 0x5766e
movq %rbx, %rdi
callq 0x58024
jmp 0x5768b
movq %rbx, %rdi
callq 0x589aa
jmp 0x5768b
movq %rbx, %rdi
callq 0x582d8
jmp 0x5768b