// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x8(%rax), %rdi
callq 0x14050
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, -0x10(%rbp)
testb $0x1, 0x63c(%rax)
jne 0xa5f7d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x123a0
movq %rax, %rdi
callq 0xa91c0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xa5f7b
movq -0x18(%rbp), %rax
testb $0x1, 0x638(%rax)
jne 0xa5f7b
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x25530
jmp 0xa5fb0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x123a0
movq %rax, %rdi
callq 0xa91c0
testb $0x1, %al
jne 0xa5fa3
movq -0x18(%rbp), %rax
testb $0x1, 0x638(%rax)
je 0xa5fae
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x25530
jmp 0xa5fb0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x332f0
testb $0x1, %al
jne 0xa5fc3
jmp 0xa5fce
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x25530
movq -0x18(%rbp), %rdi
callq 0xa91e0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0xf, %eax
je 0xa5ffb
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x10, %eax
jne 0xa602e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x25310
movq -0x18(%rbp), %rdi
xorl %esi, %esi
subl %eax, %esi
movsd 0x1aff8(%rip), %xmm0    # 0xc1010
callq 0xa62a0
movq -0x18(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xa6520
jmp 0xa629a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x24, %eax
jle 0xa60cf
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0xa92e0
movaps %xmm0, %xmm1
movsd 0x1bb54(%rip), %xmm0    # 0xc1bb8
ucomisd %xmm1, %xmm0
jbe 0xa60cf
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x1d6d0
movaps %xmm0, %xmm1
movsd 0x1ce0e(%rip), %xmm0    # 0xc2eb8
ucomisd %xmm1, %xmm0
jbe 0xa60cf
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
addq $0x8, %rdi
callq 0x1ddd0
cmpl $0x1, %eax
jle 0xa60cf
movq -0x18(%rbp), %rdi
callq 0xa6810
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rdi
callq 0x176f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x28(%rbp)
movq 0x28(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x26500
movsd -0x28(%rbp), %xmm0
subsd (%rax), %xmm0
movsd 0x1f576(%rip), %xmm1    # 0xc5690
ucomisd %xmm1, %xmm0
jbe 0xa6164
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x26520
cmpl $0x0, (%rax)
je 0xa6164
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x26520
movq -0x18(%rbp), %rdi
xorl %esi, %esi
subl (%rax), %esi
movsd 0x1b351(%rip), %xmm0    # 0xc14b0
callq 0xa62a0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x1d780
testb $0x1, %al
jne 0xa6177
jmp 0xa61af
movq -0x10(%rbp), %rdi
callq 0x88c40
testb $0x1, %al
jne 0xa6196
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x5, %eax
jne 0xa61a1
movq -0x18(%rbp), %rdi
callq 0xa6890
jmp 0xa61aa
movq -0x18(%rbp), %rdi
callq 0xa6d70
jmp 0xa627f
movq -0x10(%rbp), %rdi
callq 0x406c0
testb $0x1, %al
jne 0xa61be
jmp 0xa6234
movq -0x10(%rbp), %rdi
callq 0xa9380
cmpl $0x0, %eax
je 0xa6234
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1a4c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq 0x20(%rax), %rdi
callq 0x1b470
movq -0x30(%rbp), %rdi
movl %eax, %esi
callq 0x29570
cmpl $0x1, 0x8(%rax)
je 0xa6234
movq -0x10(%rbp), %rdi
callq 0xa93a0
cmpl $0x3, %eax
jg 0xa6229
movq -0x10(%rbp), %rdi
callq 0x88c40
testb $0x1, %al
jne 0xa621b
jmp 0xa6234
movq -0x10(%rbp), %rdi
callq 0x1b490
cmpl $0x3, %eax
jle 0xa6234
movq -0x18(%rbp), %rdi
callq 0xa6e80
jmp 0xa627d
movq -0x10(%rbp), %rdi
callq 0x406a0
movl (%rax), %eax
movl %eax, -0x34(%rbp)
testl %eax, %eax
je 0xa6267
jmp 0xa6248
movl -0x34(%rbp), %eax
subl $0x1, %eax
je 0xa6272
jmp 0xa6252
movl -0x34(%rbp), %eax
subl $0x2, %eax
jne 0xa627b
jmp 0xa625c
movq -0x18(%rbp), %rdi
callq 0xa6890
jmp 0xa627b
movq -0x18(%rbp), %rdi
callq 0xa72b0
jmp 0xa627b
movq -0x18(%rbp), %rdi
callq 0xa7b50
jmp 0xa627d
jmp 0xa627f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x10ed0
cmpl $0x1, %eax
je 0xa629a
movq -0x18(%rbp), %rdi
callq 0xa6e80
addq $0x40, %rsp
popq %rbp
retq