// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.cpp
// Function: Parser::ParseTime(char*, char**, bool)
void Parser::ParseTime(char *msg, char **end_ptr, bool is_new_cycle) {
  while (!isspace(*msg))
    msg++;
  *end_ptr = msg;
  int time = parser::get_int(end_ptr);

  RealTime real_time = GetRealTimeParser();

  /* if (mpObserver->IsPlanned()) { // -- 决策完了，才收到信息
          std::cerr << "# " << mpObserver->SelfUnum() << " @ " <<
  mpObserver->CurrentTime() << " got a deprecated message" << std::endl;
  }*/

  if (is_new_cycle == true) {
    /** player: sense msg & hear msg */
    /** coach:  sight msg & hear msg */
    if (time > mpObserver->CurrentTime().T()) // new cycle
    {
      mpObserver->SetCurrentTime(Time(time, 0));
      mpObserver->SetLastCycleBeginRealTime(real_time);
    } else {
      if (real_time - mpObserver->GetLastCycleBeginRealTime() >
          ServerParam::instance().simStep() *
              0.7) // stoppage time, add some buffer
      {
        mpObserver->SetCurrentTime(
            Time(time, mpObserver->CurrentTime().S() + 1));
        mpObserver->SetLastCycleBeginRealTime(real_time);
      } else {
        // the current time has been set by another msg just now
      }
    }
  } else {
    /** player: sight msg */
    if (time != mpObserver->CurrentTime().T()) // new cycle -- miss a sense
    {
      mpObserver->SetCurrentTime(Time(time, 0));
      mpObserver->SetLastCycleBeginRealTime(
          real_time - ServerParam::instance().synchOffset());

      PRINT_ERROR("Player " << mpObserver->SelfUnum() << " miss a sense at "
                            << mpObserver->CurrentTime());
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0xa0d0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x72273
jmp 0x72281
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x72259
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x77bf0
movl %eax, -0x20(%rbp)
callq 0x9e590
movq %rax, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x781c0
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x7242c
movq -0xa0(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, -0xa4(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq %rax, %rdi
callq 0x13040
movl %eax, %ecx
movl -0xa4(%rbp), %eax
cmpl %ecx, %eax
jle 0x7234d
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb0(%rbp)
movl -0x20(%rbp), %esi
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x13c70
movq -0xb0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x77ca0
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x781f0
jmp 0x72427
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6eeb0
movq %rax, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x9e930
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xb8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x6ee90
movsd -0xb8(%rbp), %xmm0
cvtsi2sd %eax, %xmm1
movsd 0x506e1(%rip), %xmm2    # 0xc2a80
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x72423
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movl -0x20(%rbp), %ecx
movl %ecx, -0xc4(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq %rax, %rdi
callq 0x13050
movl -0xc4(%rbp), %esi
movl %eax, %edx
addl $0x1, %edx
leaq -0x70(%rbp), %rdi
callq 0x13c70
movq -0xc0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x77ca0
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
callq 0x781f0
jmp 0x72425
jmp 0x72425
jmp 0x72427
jmp 0x725a5
movq -0xa0(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, -0xc8(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq %rax, %rdi
callq 0x13040
movl %eax, %ecx
movl -0xc8(%rbp), %eax
cmpl %ecx, %eax
je 0x725a3
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xd8(%rbp)
movl -0x20(%rbp), %esi
leaq -0x88(%rbp), %rdi
xorl %edx, %edx
callq 0x13c70
movq -0xd8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x77ca0
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xd0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x78220
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x9e880
movq -0xd0(%rbp), %rdi
movq %rax, -0x98(%rbp)
movq %rdx, -0x90(%rbp)
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x781f0
movq 0x8bb04(%rip), %rdi     # 0xfdff0
leaq 0x50f93(%rip), %rsi     # 0xc3486
callq 0xa5a0
movq %rax, %rdi
leaq 0x52d4f(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, %rdi
movl $0x247, %esi            # imm = 0x247
callq 0xaa40
movq %rax, %rdi
leaq 0x51041(%rip), %rsi     # 0xc355f
callq 0xa5a0
movq %rax, %rdi
leaq 0x50fbd(%rip), %rsi     # 0xc34ea
callq 0xa5a0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movq 0x10(%rax), %rdi
callq 0x11dd0
movq -0xe8(%rbp), %rdi
movl (%rax), %esi
callq 0xaa40
movq %rax, %rdi
leaq 0x50f8e(%rip), %rsi     # 0xc34f2
callq 0xa5a0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movq %rcx, -0xe0(%rbp)
movq 0x10(%rax), %rdi
callq 0x11a70
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
callq 0x11d40
movq %rax, %rdi
movq 0x8ba14(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x725a3
jmp 0x725a5
addq $0xf0, %rsp
popq %rbp
retq
nop