// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_time()
void parse_zy_time()
{
int doy;
int yy;
int hh,mm,ss;
int tmode, op_mode;
double jd;

   // time, date, tfom, discipline mode
   log_packet_id("time");

   pps_enabled = 1;
   yy = doy = hh = mm = ss = 0;
   tmode = op_mode = 0;

   if(get_msg_field()) yy = atoi(msg_field);
   if(get_msg_field()) doy = atoi(msg_field);

   if(get_msg_field()) hh = atoi(msg_field);
   if(get_msg_field()) mm = atoi(msg_field);
   if(get_msg_field()) ss= atoi(msg_field);

   if(get_msg_field()) {
      tmode = atoi(msg_field);
      if((tmode == 1) || (tmode == 4)) { 
         time_flags &= (~TFLAGS_UTC);
         timing_mode = TMODE_GPS;
         have_timing_mode = 1;
      }
      else if((tmode == 2) || (tmode == 3)) {  // utc time
         time_flags |= (TFLAGS_UTC);
         timing_mode = TMODE_UTC;
         have_timing_mode = 1;
      }
   }

   if(get_msg_field()) {
      tfom = atoi(msg_field);
      have_tfom = 4;
   }

   if(get_msg_field()) {
      op_mode = atoi(msg_field);
      if     (op_mode == 0) discipline_mode = DIS_MODE_WARMUP;
      else if(op_mode == 1) discipline_mode = DIS_MODE_NORMAL;
      else if(op_mode == 2) discipline_mode = DIS_MODE_AUTO_HOLD;
      else if(op_mode == 3) discipline_mode = DIS_MODE_RECOVERY;
      else if(op_mode == 5) discipline_mode = DIS_MODE_LEARNING;
      else                  discipline_mode = DIS_MODE_UNKNOWN;
   }

   jd = jdate(yy, 1, 1) + (double) (doy-1) + jtime(hh,mm,ss,0.0);
   set_gregorian_time(jd);

   update_gps_screen(8787);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x5d460(%rip), %rdi     # 0xf7eeb
callq 0x520bf
leaq 0x25d289(%rip), %rax    # 0x2f7d20
movb $0x1, (%rax)
callq 0x75767
testl %eax, %eax
je 0x9aab3
leaq 0x28af96(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %ebx
jmp 0x9aab5
xorl %ebx, %ebx
callq 0x75767
testl %eax, %eax
je 0x9aad2
leaq 0x28af7b(%rip), %rdi    # 0x325a40
callq 0x95e0
decl %eax
cvtsi2sd %eax, %xmm0
jmp 0x9aada
movsd 0x5861e(%rip), %xmm0    # 0xf30f8
movsd %xmm0, -0x28(%rbp)
callq 0x75767
xorl %r14d, %r14d
movl $0x0, %r15d
testl %eax, %eax
je 0x9ab00
leaq 0x28af48(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %r15d
callq 0x75767
testl %eax, %eax
je 0x9ab18
leaq 0x28af30(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %r14d
callq 0x75767
testl %eax, %eax
je 0x9ab32
leaq 0x28af18(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %r12d
jmp 0x9ab35
xorl %r12d, %r12d
callq 0x75767
testl %eax, %eax
je 0x9ab85
leaq 0x28aefb(%rip), %rdi    # 0x325a40
callq 0x95e0
cmpl $0x4, %eax
je 0x9ab58
cmpl $0x1, %eax
jne 0x9ac30
leaq 0x25c945(%rip), %rax    # 0x2f74a4
movl (%rax), %eax
andl $-0x2, %eax
xorl %ecx, %ecx
leaq 0x25c937(%rip), %rdx    # 0x2f74a4
movl %eax, (%rdx)
leaq 0x25c947(%rip), %rax    # 0x2f74bd
movb %cl, (%rax)
leaq 0x25c84d(%rip), %rax    # 0x2f73cc
movl $0x1, (%rax)
callq 0x75767
testl %eax, %eax
je 0x9abb0
leaq 0x28aeab(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x25c0af(%rip), %rcx    # 0x2f6c50
movl %eax, (%rcx)
leaq 0x25c0aa(%rip), %rax    # 0x2f6c54
movl $0x4, (%rax)
callq 0x75767
testl %eax, %eax
je 0x9abed
leaq 0x28ae80(%rip), %rdi    # 0x325a40
callq 0x95e0
leal (,%rax,8), %ecx
movabsq $0x14ff0402000a, %rdx   # imm = 0x14FF0402000A
shrq %cl, %rdx
cmpl $0x6, %eax
movl $0xff, %eax
cmovbl %edx, %eax
leaq 0x25c8ac(%rip), %rcx    # 0x2f7497
movb %al, (%rcx)
pushq $0x1
popq %rdx
movl %ebx, %edi
movl %edx, %esi
callq 0xc2f07
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
xorpd %xmm0, %xmm0
movl %r15d, %edi
movl %r14d, %esi
movl %r12d, %edx
callq 0xc2faf
addsd -0x28(%rbp), %xmm0
callq 0x55392
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x694f6
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x9ab85
leaq 0x25c861(%rip), %rax    # 0x2f74a4
movl (%rax), %eax
orl $0x1, %eax
movb $0x3, %cl
jmp 0x9ab66