// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/Simulator.h
// Function: Simulator::Player::UpdateStamina()
void UpdateStamina() {
      if (mStamina <= ServerParam::instance().effortDecThr() *
                          ServerParam::instance().staminaMax()) {
        if (mEffort >
            PlayerParam::instance().HeteroPlayer(mPlayerType).effortMin()) {
          mEffort -= ServerParam::instance().effortDec();
        }

        if (mEffort <
            PlayerParam::instance().HeteroPlayer(mPlayerType).effortMin()) {
          mEffort =
              PlayerParam::instance().HeteroPlayer(mPlayerType).effortMin();
        }
      }

      if (mStamina >= ServerParam::instance().effortIncThr() *
                          ServerParam::instance().staminaMax()) {
        if (mEffort <
            PlayerParam::instance().HeteroPlayer(mPlayerType).effortMax()) {
          mEffort += ServerParam::instance().effortInc();
          if (mEffort >
              PlayerParam::instance().HeteroPlayer(mPlayerType).effortMax()) {
            mEffort =
                PlayerParam::instance().HeteroPlayer(mPlayerType).effortMax();
          }
        }
      }

      double stamina_inc =
          Min(PlayerParam::instance().HeteroPlayer(mPlayerType).staminaIncMax(),
              ServerParam::instance().staminaMax() - mStamina);
      mStamina += stamina_inc;

      if (mStamina > ServerParam::instance().staminaMax()) {
        mStamina = ServerParam::instance().staminaMax();
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cvtsi2sdl 0x28(%rdi), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x4a75c
movsd 0x3080(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x4a75c
movsd -0x38(%rbp), %xmm0
mulsd 0x3048(%rax), %xmm0
ucomisd -0x30(%rbp), %xmm0
jb 0x4c743
movsd 0x30(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd -0x30(%rbp), %xmm0
ucomisd 0x3060(%rax,%rcx), %xmm0
jbe 0x4c6ed
callq 0x4a75c
movsd 0x30(%rbx), %xmm0
subsd 0x3090(%rax), %xmm0
movsd %xmm0, 0x30(%rbx)
movsd 0x30(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd 0x3060(%rax,%rcx), %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0x4c743
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd 0x3060(%rax,%rcx), %xmm0
movsd %xmm0, 0x30(%rbx)
xorps %xmm0, %xmm0
cvtsi2sdl 0x28(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x4a75c
movsd 0x3098(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x4a75c
movsd -0x38(%rbp), %xmm1
mulsd 0x3048(%rax), %xmm1
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x4c81c
movsd 0x30(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd 0x3058(%rax,%rcx), %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0x4c81c
callq 0x4a75c
movsd 0x30a0(%rax), %xmm0
addsd 0x30(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd %xmm0, 0x30(%rbx)
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd -0x30(%rbp), %xmm0
ucomisd 0x3058(%rax,%rcx), %xmm0
jbe 0x4c81c
callq 0x450ba
movq 0x5c38(%rax), %rax
movslq 0x38(%rbx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd 0x3058(%rax,%rcx), %xmm0
movsd %xmm0, 0x30(%rbx)
callq 0x450ba
movq 0x5c38(%rax), %r14
movslq 0x38(%rbx), %rax
imulq $0x3700, %rax, %r15     # imm = 0x3700
callq 0x4a75c
xorps %xmm0, %xmm0
cvtsi2sdl 0x28(%rbx), %xmm0
movsd 0x3048(%rax), %xmm1
subsd %xmm0, %xmm1
minsd 0x3018(%r14,%r15), %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x28(%rbx)
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
callq 0x4a75c
movapd -0x30(%rbp), %xmm0
ucomisd 0x3048(%rax), %xmm0
jbe 0x4c891
callq 0x4a75c
cvttsd2si 0x3048(%rax), %eax
movl %eax, 0x28(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq