// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/VisualSystem.cpp
// Function: VisualSystem::DoVisualExecute()
void VisualSystem::DoVisualExecute() {
  mBestVisualAction.mDir = GetNormalizeAngleDeg(mBestVisualAction.mDir);

  AngleDeg finalnec = GetNormalizeAngleDeg(
      mBestVisualAction.mDir -
      mPreBodyDir); //最后要看的方向与当前（或者说执行过本周期动作后，如turn）身体正对方向的夹角，即最后的neckrelangle。

  if (fabs(finalnec) > ServerParam::instance().maxNeckAngle()) {
    if (mCanTurn) {
      if (finalnec < 0.0) {
        mpAgent->Turn(finalnec - ServerParam::instance().minNeckAngle());
        mpAgent->TurnNeck(ServerParam::instance().minNeckMoment());
      } else {
        mpAgent->Turn(finalnec - ServerParam::instance().maxNeckAngle());
        mpAgent->TurnNeck(ServerParam::instance().maxNeckMoment());
      }
    } else {
      if (finalnec < 0.0) {
        mpAgent->TurnNeck(ServerParam::instance().minNeckMoment());
      } else {
        mpAgent->TurnNeck(ServerParam::instance().maxNeckMoment());
      }
    }
  } else {
    finalnec -= mpSelfState->GetNeckDir();
    mpAgent->TurnNeck(finalnec);
  }

  if (mViewWidth != mpSelfState->GetViewWidth()) {
    mpAgent->ChangeView(mViewWidth);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movsd 0x670(%rdi), %xmm3
movsd 0x1003a(%rip), %xmm0    # 0x69060
ucomisd %xmm3, %xmm0
jbe 0x59040
movsd 0x1003c(%rip), %xmm1    # 0x69070
addsd %xmm1, %xmm3
ucomisd %xmm3, %xmm0
ja 0x59034
jmp 0x59064
ucomisd 0x10000(%rip), %xmm3    # 0x69048
jb 0x59064
movsd 0x10016(%rip), %xmm1    # 0x69068
movsd 0xffee(%rip), %xmm2     # 0x69048
addsd %xmm1, %xmm3
ucomisd %xmm2, %xmm3
jae 0x5905a
movsd %xmm3, 0x670(%rbx)
subsd 0x648(%rbx), %xmm3
ucomisd %xmm3, %xmm0
jbe 0x5908e
movsd 0xffee(%rip), %xmm1     # 0x69070
addsd %xmm1, %xmm3
ucomisd %xmm3, %xmm0
ja 0x59082
jmp 0x590b2
ucomisd 0xffb2(%rip), %xmm3     # 0x69048
jb 0x590b2
movsd 0xffc8(%rip), %xmm0     # 0x69068
movsd 0xffa0(%rip), %xmm1     # 0x69048
addsd %xmm0, %xmm3
ucomisd %xmm1, %xmm3
jae 0x590a8
movapd %xmm3, -0x30(%rbp)
movapd 0xff51(%rip), %xmm0     # 0x69010
andpd %xmm3, %xmm0
movapd %xmm0, -0x40(%rbp)
callq 0x49360
movapd -0x40(%rbp), %xmm0
ucomisd 0x3160(%rax), %xmm0
jbe 0x59132
movb 0x63c(%rbx), %r15b
movq 0x8(%rbx), %r14
callq 0x49360
xorpd %xmm0, %xmm0
cmpb $0x1, %r15b
jne 0x59175
movapd -0x30(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x59186
subsd 0x3168(%rax), %xmm1
movapd %xmm1, -0x30(%rbp)
movq %r14, %rdi
callq 0xee28
movq %rax, %rdi
movapd -0x30(%rbp), %xmm0
callq 0xbb88
movq 0x8(%rbx), %r14
callq 0x49360
jmp 0x5917c
movq 0x20(%rbx), %r15
callq 0x49360
movq %rax, %r14
callq 0x49360
movsd 0x98(%r15), %xmm0
maxsd 0x3168(%r14), %xmm0
movsd 0x3160(%rax), %xmm1
minsd %xmm0, %xmm1
movapd -0x30(%rbp), %xmm0
subsd %xmm1, %xmm0
movapd %xmm0, -0x30(%rbp)
movq 0x8(%rbx), %r14
jmp 0x591be
ucomisd -0x30(%rbp), %xmm0
jbe 0x591b1
movsd 0x3158(%rax), %xmm0
jmp 0x591b9
subsd 0x3160(%rax), %xmm1
movapd %xmm1, -0x30(%rbp)
movq %r14, %rdi
callq 0xee28
movq %rax, %rdi
movapd -0x30(%rbp), %xmm0
callq 0xbb88
movq 0x8(%rbx), %r14
callq 0x49360
movsd 0x3150(%rax), %xmm0
movapd %xmm0, -0x30(%rbp)
movq %r14, %rdi
callq 0xee28
movq %rax, %rdi
movaps -0x30(%rbp), %xmm0
callq 0xc038
movl 0x640(%rbx), %r14d
movq 0x20(%rbx), %rax
cmpl 0x118(%rax), %r14d
jne 0x591f1
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
callq 0xee28
movq %rax, %rdi
movl %r14d, %esi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xc672
nop