// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/WorldState.cpp
// Function: WorldStateUpdater::UpdateSelfSense()
void WorldStateUpdater::UpdateSelfSense() {
  SelfState().UpdateNeckDir(PlayerParam::instance().ConvertAngle(
      mpObserver->Sense().GetNeckDir())); //这个即使没有视觉也要更新

  SelfState().UpdateStamina(mpObserver->Sense().GetStamina()); //更新体力
  SelfState().UpdateEffort(mpObserver->Sense().GetEffort());   //更新effort
  SelfState().UpdateCapacity(
      mpObserver->Sense().GetCapacity()); //更新就体力容量

  // update recovery
  double buff = Min(SelfState().GetRecovery() * SelfState().GetStaminaIncMax(),
                    SelfState().GetCapacity());
  buff = ((int)(buff * 100)) / 100.0; //精度设置为0.01 太精确了会影响计算
  if (mpObserver->CurrentTime().T() > 0 &&
      mpObserver->Sense().GetStamina() - buff <
          ServerParam::instance().staminaMax() *
              ServerParam::instance().recoverDecThr()) {
    double recovery =
        SelfState().GetRecovery() - ServerParam::instance().recoverDec();
    if (recovery < ServerParam::instance().recoverMin()) {
      recovery = ServerParam::instance().recoverMin();
    }

    if (mpObserver->CurrentTime().T() % ServerParam::instance().halfTime() ==
            0 &&
        ServerParam::instance().nrNormalHalfs() >= 0 &&
        mpObserver->CurrentTime().T() <
            ServerParam::instance().halfTime() *
                ServerParam::instance().nrNormalHalfs()) {
      recovery = 1.0;
    }

    SelfState().UpdateRecovery(recovery);
  }

  //更新自己的tackleban
  SelfState().UpdateTackleBan(mpObserver->Sense().GetTackleExpires());
  SelfState().UpdateFoulChargedCycle(mpObserver->Sense().GetFoulChargedCycle());

  //更新自己的catchban 暂时没有

  //更新自己的armpoint
  if (mpObserver->Sense().GetArmMovableBan() > 0) {
    SelfState().UpdateArmPoint(mpObserver->Sense().GetArmTargetDir(), 0, 1,
                               mpObserver->Sense().GetArmTargetDist(),
                               mpObserver->Sense().GetArmMovableBan(),
                               mpObserver->Sense().GetArmExpires());
  } else {
    SelfState().UpdateArmPoint(
        mpObserver->Sense().GetArmTargetDir(), SelfState().GetArmPointDelay(),
        SelfState().GetArmPointConf(), mpObserver->Sense().GetArmTargetDist(),
        mpObserver->Sense().GetArmMovableBan(),
        mpObserver->Sense().GetArmExpires());
  }

  //更新自己的FocusOn
  SelfState().UpdateFocusOn(mpObserver->Sense().GetFocusSide(),
                            mpObserver->Sense().GetFocusUnum());

  //更新自己的视角
  SelfState().UpdateViewWidth(mpObserver->Sense().GetViewWidth());

  SelfState().UpdateCardType(mpObserver->Sense().GetCardType());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movslq 0x14(%rdi), %rax
movq 0x8(%rdi), %r14
imulq $0x178, %rax, %r15      # imm = 0x178
callq 0x450ba
movq (%rbx), %rax
movsd 0x150(%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x63ac1
addsd 0x7db9(%rip), %xmm0     # 0x6b878
jmp 0x63acf
ucomisd %xmm0, %xmm1
jbe 0x63acf
addsd 0x75b9(%rip), %xmm0     # 0x6b088
leaq (%r15,%r14), %rcx
addq $-0xd0, %rcx
movsd 0x757e(%rip), %xmm2     # 0x6b060
ucomisd %xmm0, %xmm2
jbe 0x63afc
movsd 0x7580(%rip), %xmm1     # 0x6b070
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm2
ja 0x63af0
jmp 0x63b20
ucomisd 0x7544(%rip), %xmm0     # 0x6b048
jb 0x63b20
movsd 0x755a(%rip), %xmm1     # 0x6b068
movsd 0x7532(%rip), %xmm2     # 0x6b048
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x63b16
movsd %xmm0, 0x98(%rcx)
movl $0x0, 0xa0(%rcx)
movabsq $0x3ff0000000000000, %r15 # imm = 0x3FF0000000000000
movq %r15, 0xa8(%rcx)
movslq 0x14(%rbx), %rcx
movq 0x8(%rbx), %r14
imulq $0x178, %rcx, %r12      # imm = 0x178
movsd 0x128(%rax), %xmm0
movsd %xmm0, -0x58(%r12,%r14)
movsd 0x130(%rax), %xmm0
movsd %xmm0, -0x50(%r12,%r14)
movsd 0x138(%rax), %xmm0
movsd %xmm0, -0x48(%r12,%r14)
movsd -0x40(%r12,%r14), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x450ba
movq (%rbx), %rcx
cmpl $0x0, 0xc(%rcx)
jle 0x63cce
leaq (%r12,%r14), %rdx
addq $-0xd0, %rdx
movq 0x8(%rbx), %rsi
movslq 0x14(%rbx), %rdi
imulq $0x178, %rdi, %rdi      # imm = 0x178
movq 0x5c38(%rax), %rax
movslq 0x114(%rdx), %rdx
imulq $0x3700, %rdx, %rdx     # imm = 0x3700
movsd -0x28(%rbp), %xmm1
mulsd 0x3018(%rax,%rdx), %xmm1
movsd -0x48(%rsi,%rdi), %xmm0
minsd %xmm1, %xmm0
movsd 0x7b44(%rip), %xmm1     # 0x6b730
mulsd %xmm1, %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
divsd %xmm1, %xmm0
movsd 0x128(%rcx), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
callq 0x4a75c
movsd 0x3048(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x4a75c
movsd -0x30(%rbp), %xmm0
mulsd 0x3060(%rax), %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x63cce
movslq 0x14(%rbx), %rax
movq 0x8(%rbx), %rcx
imulq $0x178, %rax, %rax      # imm = 0x178
movsd -0x40(%rcx,%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd -0x28(%rbp), %xmm0
subsd 0x3070(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x4a75c
movsd 0x3068(%rax), %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x63c93
callq 0x4a75c
movsd 0x3068(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq (%rbx), %rax
movl 0xc(%rax), %r14d
callq 0x4a75c
movq %rax, %rcx
movl %r14d, %eax
cltd
idivl 0x3238(%rcx)
testl %edx, %edx
je 0x63e83
movslq 0x14(%rbx), %rax
movq 0x8(%rbx), %rcx
imulq $0x178, %rax, %rax      # imm = 0x178
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x40(%rcx,%rax)
movslq 0x14(%rbx), %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
imulq $0x178, %rdx, %rdx      # imm = 0x178
addq %rax, %rdx
addq $-0xd0, %rdx
addq $0xa8, %rax
movl 0x1a0(%rcx), %esi
movl %esi, 0xc8(%rdx)
movl 0x1ac(%rcx), %esi
movl %esi, 0x124(%rdx)
movl 0x178(%rcx), %edi
movl 0x17c(%rcx), %esi
movsd 0x188(%rcx), %xmm0
movsd 0x180(%rcx), %xmm1
testl %edi, %edi
movsd 0x7332(%rip), %xmm3     # 0x6b060
jle 0x63d4a
ucomisd %xmm0, %xmm3
jbe 0x63d64
movsd 0x7332(%rip), %xmm2     # 0x6b070
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm3
ja 0x63d3e
jmp 0x63d88
ucomisd %xmm0, %xmm3
jbe 0x63dbd
movsd 0x7318(%rip), %xmm2     # 0x6b070
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm3
ja 0x63d58
jmp 0x63de1
ucomisd 0x72dc(%rip), %xmm0     # 0x6b048
jb 0x63d88
movsd 0x72f2(%rip), %xmm2     # 0x6b068
movsd 0x72ca(%rip), %xmm3     # 0x6b048
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jae 0x63d7e
movl %edi, 0xd0(%rdx)
movl %esi, 0xd4(%rdx)
movsd %xmm1, 0xd8(%rdx)
movsd %xmm0, 0xe0(%rdx)
movl $0x0, 0xe8(%rdx)
movsd 0x72a2(%rip), %xmm0     # 0x6b058
movl $0xf0, %esi
jmp 0x63dfa
ucomisd 0x7283(%rip), %xmm0     # 0x6b048
jb 0x63de1
movsd 0x7299(%rip), %xmm2     # 0x6b068
movsd 0x7271(%rip), %xmm3     # 0x6b048
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jae 0x63dd7
movl %edi, 0xd0(%rdx)
movl %esi, 0xd4(%rdx)
movsd %xmm1, 0xd8(%rdx)
movl $0xe0, %esi
movsd %xmm0, (%rdx,%rsi)
movslq 0x14(%rbx), %rdx
imulq $0x178, %rdx, %rdx      # imm = 0x178
movzbl 0x194(%rcx), %esi
movl 0x198(%rcx), %ecx
shlq $0x20, %rcx
orq %rsi, %rcx
movq %rcx, -0x80(%rdx,%rax)
movl $0x0, -0x78(%rdx,%rax)
movq %r15, -0x70(%rdx,%rax)
movslq 0x14(%rbx), %rcx
movq (%rbx), %rdx
movq 0x8(%rbx), %rax
imulq $0x178, %rcx, %rcx      # imm = 0x178
movl 0x120(%rdx), %esi
movl %esi, 0x48(%rcx,%rax)
movl 0x1a8(%rdx), %edx
movl 0xa0(%rcx,%rax), %esi
testl %esi, %esi
je 0x63e67
cmpl $0x2, %edx
jne 0x63e76
cmpl $0x1, %esi
jne 0x63e76
addq %rcx, %rax
addq $-0xd0, %rax
movl %edx, 0x170(%rax)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x4a75c
cmpl $0x0, 0x3240(%rax)
js 0x63cb4
movq (%rbx), %rax
movl 0xc(%rax), %r14d
callq 0x4a75c
movl 0x3238(%rax), %r12d
callq 0x4a75c
imull 0x3240(%rax), %r12d
cmpl %r12d, %r14d
jge 0x63cb4
movsd 0x7192(%rip), %xmm0     # 0x6b058
movsd %xmm0, -0x28(%rbp)
jmp 0x63cb4