// File: /workspace/github_cpp_makefile_star2_O1/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 0xf5c4
movq %rax, %r14
movq 0x8(%rbx), %rdi
movb 0x63c(%rbx), %r15b
callq 0xef28
movb 0xe90(%rax), %al
testb %r15b, %r15b
je 0x58cf9
testb %al, %al
jne 0x58cf5
cmpb $0x1, 0x638(%rbx)
jne 0x58d0e
xorl %eax, %eax
jmp 0x58d08
testb %al, %al
jne 0x58d0e
movb $0x1, %al
cmpb $0x0, 0x638(%rbx)
jne 0x58d0e
movb %al, 0x63c(%rbx)
movq 0x20(%rbx), %rax
cmpl $0x0, 0xc8(%rax)
jg 0x58d24
cmpl $0x0, 0x124(%rax)
jle 0x58d2b
movb $0x0, 0x63c(%rbx)
movq %rbx, %rdi
callq 0x5b19e
movq 0x10(%rbx), %rax
movl 0x1c(%rax), %ecx
leal -0xf(%rcx), %edx
cmpl $0x1, %edx
ja 0x58d6f
xorl %esi, %esi
subl 0x2114(%rax), %esi
movsd 0x12306(%rip), %xmm0    # 0x6b058
movq %rbx, %rdi
callq 0x58f34
xorps %xmm0, %xmm0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x59178
cmpl $0x25, %ecx
jl 0x58df0
movq 0x28(%rbx), %rdi
callq 0x2adf8
movq %rax, %rdi
callq 0x5b240
movsd 0x12e93(%rip), %xmm1    # 0x6bc20
ucomisd %xmm0, %xmm1
jbe 0x58df0
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
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x58dcb
sqrtsd %xmm0, %xmm0
jmp 0x58dd0
callq 0x93c0
movsd 0x141d0(%rip), %xmm1    # 0x6cfa8
ucomisd %xmm0, %xmm1
jbe 0x58df0
movq 0x18(%rbx), %rax
cmpl $0x2, 0x18(%rax)
jl 0x58df0
movq %rbx, %rdi
callq 0x592c4
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x2adf8
movsd -0x20(%rbp), %xmm0
subsd 0x17a0(%rax), %xmm0
ucomisd 0x134fc(%rip), %xmm0    # 0x6c318
jbe 0x58e51
movq 0x28(%rbx), %rdi
callq 0x2adf8
cmpl $0x0, 0x1798(%rax)
je 0x58e51
movq 0x28(%rbx), %rdi
callq 0x2adf8
xorl %esi, %esi
subl 0x1798(%rax), %esi
movsd 0x12937(%rip), %xmm0    # 0x6b780
movq %rbx, %rdi
callq 0x58f34
movq 0x20(%rbx), %rax
cmpb $0x1, 0x175(%rax)
jne 0x58e7e
movq %r14, %rdi
callq 0x4c97e
testb %al, %al
jne 0x58ecc
movq 0x10(%rbx), %rax
cmpl $0x5, 0x1c(%rax)
je 0x58ecc
movq %rbx, %rdi
callq 0x597d2
jmp 0x58ed4
cmpb $0x1, 0x41(%r14)
jne 0x58eb7
cmpl $0x0, 0x48(%r14)
je 0x58eb7
movq 0x8(%rbx), %rdi
callq 0x1356e
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 0x58efb
movl 0xa4(%r14), %eax
testl %eax, %eax
je 0x58f29
cmpl $0x1, %eax
je 0x58f1f
cmpl $0x2, %eax
jne 0x58ed4
movq %rbx, %rdi
callq 0x59372
movq 0x10(%rbx), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x58ee9
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 0x598a0
cmpl $0x3, 0x44(%r14)
jg 0x58f15
movq %r14, %rdi
callq 0x4c97e
testb %al, %al
je 0x58eb7
cmpl $0x4, 0x64(%r14)
jl 0x58eb7
movq %rbx, %rdi
callq 0x598a0
jmp 0x58ed4
movq %rbx, %rdi
callq 0x5a214
jmp 0x58ed4
movq %rbx, %rdi
callq 0x59b42
jmp 0x58ed4
nop