// File: /workspace/github_cpp_makefile_star2_O3/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 0x43dce
movq (%rbx), %rax
movsd 0x150(%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x61a4b
addsd 0x7e2f(%rip), %xmm0     # 0x69878
jmp 0x61a59
ucomisd %xmm0, %xmm1
jbe 0x61a59
addsd 0x762f(%rip), %xmm0     # 0x69088
leaq (%r15,%r14), %rcx
addq $-0xd0, %rcx
movsd 0x75f4(%rip), %xmm2     # 0x69060
ucomisd %xmm0, %xmm2
jbe 0x61a86
movsd 0x75f6(%rip), %xmm1     # 0x69070
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm2
ja 0x61a7a
jmp 0x61aaa
ucomisd 0x75ba(%rip), %xmm0     # 0x69048
jb 0x61aaa
movsd 0x75d0(%rip), %xmm1     # 0x69068
movsd 0x75a8(%rip), %xmm2     # 0x69048
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x61aa0
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 0x43dce
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
cmpl $0x0, 0xc(%rsi)
movl 0x14(%rbx), %edx
jle 0x61c5c
leaq (%r12,%r14), %rdi
addq $-0xd0, %rdi
movslq %edx, %rdx
imulq $0x178, %rdx, %rdx      # imm = 0x178
movq 0x5c38(%rax), %rax
movslq 0x114(%rdi), %rdi
imulq $0x3700, %rdi, %rdi     # imm = 0x3700
movsd -0x28(%rbp), %xmm1
mulsd 0x3018(%rax,%rdi), %xmm1
movsd -0x48(%rcx,%rdx), %xmm0
minsd %xmm1, %xmm0
movsd 0x7bb8(%rip), %xmm1     # 0x69730
mulsd %xmm1, %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
divsd %xmm1, %xmm0
movsd 0x128(%rsi), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x28(%rbp)
callq 0x49360
movsd 0x3048(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x49360
movsd -0x30(%rbp), %xmm0
mulsd 0x3060(%rax), %xmm0
ucomisd -0x28(%rbp), %xmm0
movl 0x14(%rbx), %edx
movq 0x8(%rbx), %rcx
jbe 0x61c5c
movslq %edx, %rax
imulq $0x178, %rax, %rax      # imm = 0x178
movsd -0x40(%rcx,%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x49360
movsd -0x28(%rbp), %xmm0
subsd 0x3070(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x49360
movsd 0x3068(%rax), %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x61c21
callq 0x49360
movsd 0x3068(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq (%rbx), %rax
movl 0xc(%rax), %r14d
callq 0x49360
movq %rax, %rcx
movl %r14d, %eax
cltd
idivl 0x3238(%rcx)
testl %edx, %edx
je 0x61e10
movslq 0x14(%rbx), %rdx
movq 0x8(%rbx), %rcx
imulq $0x178, %rdx, %rax      # imm = 0x178
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x40(%rcx,%rax)
movsd 0x73fc(%rip), %xmm3     # 0x69060
decl %edx
movslq %edx, %rax
imulq $0x178, %rax, %rax      # imm = 0x178
leaq (%rcx,%rax), %rdx
addq $0xa8, %rdx
addq $0xa8, %rcx
movq (%rbx), %rax
movl 0x1a0(%rax), %esi
movl %esi, 0xc8(%rdx)
movl 0x1ac(%rax), %esi
movl %esi, 0x124(%rdx)
movl 0x178(%rax), %edi
movl 0x17c(%rax), %esi
movsd 0x188(%rax), %xmm0
movsd 0x180(%rax), %xmm1
testl %edi, %edi
jle 0x61cd7
ucomisd %xmm0, %xmm3
jbe 0x61cf1
movsd 0x73a5(%rip), %xmm2     # 0x69070
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm3
ja 0x61ccb
jmp 0x61d15
ucomisd %xmm0, %xmm3
jbe 0x61d4a
movsd 0x738b(%rip), %xmm2     # 0x69070
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm3
ja 0x61ce5
jmp 0x61d6e
ucomisd 0x734f(%rip), %xmm0     # 0x69048
jb 0x61d15
movsd 0x7365(%rip), %xmm2     # 0x69068
movsd 0x733d(%rip), %xmm3     # 0x69048
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jae 0x61d0b
movl %edi, 0xd0(%rdx)
movl %esi, 0xd4(%rdx)
movsd %xmm1, 0xd8(%rdx)
movsd %xmm0, 0xe0(%rdx)
movl $0x0, 0xe8(%rdx)
movsd 0x7315(%rip), %xmm0     # 0x69058
movl $0xf0, %esi
jmp 0x61d87
ucomisd 0x72f6(%rip), %xmm0     # 0x69048
jb 0x61d6e
movsd 0x730c(%rip), %xmm2     # 0x69068
movsd 0x72e4(%rip), %xmm3     # 0x69048
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jae 0x61d64
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(%rax), %esi
movl 0x198(%rax), %eax
shlq $0x20, %rax
orq %rsi, %rax
movq %rax, -0x80(%rdx,%rcx)
movl $0x0, -0x78(%rdx,%rcx)
movq %r15, -0x70(%rdx,%rcx)
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 0x61df4
cmpl $0x2, %edx
jne 0x61e03
cmpl $0x1, %esi
jne 0x61e03
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 0x49360
cmpl $0x0, 0x3240(%rax)
js 0x61c42
movq (%rbx), %rax
movl 0xc(%rax), %r14d
callq 0x49360
movl 0x3238(%rax), %r12d
callq 0x49360
imull 0x3240(%rax), %r12d
cmpl %r12d, %r14d
jge 0x61c42
movsd 0x7205(%rip), %xmm0     # 0x69058
movsd %xmm0, -0x28(%rbp)
jmp 0x61c42
nop