// File: 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
subq $0x30, %rsp
leaq 0x8b6e9(%rip), %rdi     # 0x1727c8
callq 0x7add0
leaq 0x285e15(%rip), %rax    # 0x36cf00
movb $0x1, (%rax)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe7138
leaq 0x2b3af0(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe7151
leaq 0x2b3ad7(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x4(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe716a
leaq 0x2b3abe(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0xc(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe7183
leaq 0x2b3aa5(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x10(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe719c
leaq 0x2b3a8c(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x14(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe722f
leaq 0x2b3a6f(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x18(%rbp)
cmpl $0x1, -0x18(%rbp)
je 0xe71c5
cmpl $0x4, -0x18(%rbp)
jne 0xe71f3
leaq 0x2854b8(%rip), %rax    # 0x36c684
movl (%rax), %ecx
andl $-0x2, %ecx
leaq 0x2854ac(%rip), %rax    # 0x36c684
movl %ecx, (%rax)
leaq 0x2854bc(%rip), %rax    # 0x36c69d
movb $0x0, (%rax)
leaq 0x2853c1(%rip), %rax    # 0x36c5ac
movl $0x1, (%rax)
jmp 0xe722d
cmpl $0x2, -0x18(%rbp)
je 0xe71ff
cmpl $0x3, -0x18(%rbp)
jne 0xe722b
leaq 0x28547e(%rip), %rax    # 0x36c684
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x285472(%rip), %rax    # 0x36c684
movl %ecx, (%rax)
leaq 0x285482(%rip), %rax    # 0x36c69d
movb $0x3, (%rax)
leaq 0x285387(%rip), %rax    # 0x36c5ac
movl $0x1, (%rax)
jmp 0xe722d
jmp 0xe722f
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe725d
leaq 0x2b39e0(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x284be2(%rip), %rax    # 0x36be30
movl %ecx, (%rax)
leaq 0x284bdd(%rip), %rax    # 0x36be34
movl $0x4, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe72e4
leaq 0x2b39b2(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0xe7288
leaq 0x2853f4(%rip), %rax    # 0x36c677
movb $0xa, (%rax)
jmp 0xe72e2
cmpl $0x1, -0x1c(%rbp)
jne 0xe729a
leaq 0x2853e2(%rip), %rax    # 0x36c677
movb $0x0, (%rax)
jmp 0xe72e0
cmpl $0x2, -0x1c(%rbp)
jne 0xe72ac
leaq 0x2853d0(%rip), %rax    # 0x36c677
movb $0x2, (%rax)
jmp 0xe72de
cmpl $0x3, -0x1c(%rbp)
jne 0xe72be
leaq 0x2853be(%rip), %rax    # 0x36c677
movb $0x4, (%rax)
jmp 0xe72dc
cmpl $0x5, -0x1c(%rbp)
jne 0xe72d0
leaq 0x2853ac(%rip), %rax    # 0x36c677
movb $0x14, (%rax)
jmp 0xe72da
leaq 0x2853a0(%rip), %rax    # 0x36c677
movb $-0x1, (%rax)
jmp 0xe72dc
jmp 0xe72de
jmp 0xe72e0
jmp 0xe72e2
jmp 0xe72e4
movl -0x8(%rbp), %edi
movl $0x1, %edx
movl %edx, %esi
callq 0x122140
movl -0x4(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
xorps %xmm0, %xmm0
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x7fb00
movl $0x2253, %edi           # imm = 0x2253
callq 0x9d790
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)