// File: /workspace/github_cpp_makefile_star2_O1/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 0x638bb(%rip), %rdi     # 0x10ddd7
callq 0x58e77
leaq 0x2637f8(%rip), %rax    # 0x30dd20
movb $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0xaa544
leaq 0x291505(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %ebx
jmp 0xaa546
xorl %ebx, %ebx
callq 0x811da
testl %eax, %eax
je 0xaa563
leaq 0x2914ea(%rip), %rdi    # 0x33ba40
callq 0x95e0
decl %eax
cvtsi2sd %eax, %xmm0
jmp 0xaa56b
movsd 0x5eb8d(%rip), %xmm0    # 0x1090f8
movsd %xmm0, -0x28(%rbp)
callq 0x811da
xorl %r14d, %r14d
movl $0x0, %r15d
testl %eax, %eax
je 0xaa591
leaq 0x2914b7(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r15d
callq 0x811da
testl %eax, %eax
je 0xaa5a9
leaq 0x29149f(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r14d
callq 0x811da
testl %eax, %eax
je 0xaa5c3
leaq 0x291487(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r12d
jmp 0xaa5c6
xorl %r12d, %r12d
callq 0x811da
testl %eax, %eax
je 0xaa616
leaq 0x29146a(%rip), %rdi    # 0x33ba40
callq 0x95e0
cmpl $0x4, %eax
je 0xaa5e9
cmpl $0x1, %eax
jne 0xaa6c6
leaq 0x262eb4(%rip), %rax    # 0x30d4a4
movl (%rax), %eax
andl $-0x2, %eax
xorl %ecx, %ecx
leaq 0x262ea6(%rip), %rdx    # 0x30d4a4
movl %eax, (%rdx)
leaq 0x262eb6(%rip), %rax    # 0x30d4bd
movb %cl, (%rax)
leaq 0x262dbc(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0xaa641
leaq 0x29141a(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x26261e(%rip), %rcx    # 0x30cc50
movl %eax, (%rcx)
leaq 0x262619(%rip), %rax    # 0x30cc54
movl $0x4, (%rax)
callq 0x811da
testl %eax, %eax
je 0xaa67e
leaq 0x2913ef(%rip), %rdi    # 0x33ba40
callq 0x95e0
leal (,%rax,8), %ecx
movabsq $0x14ff0402000a, %rdx   # imm = 0x14FF0402000A
shrq %cl, %rdx
cmpl $0x6, %eax
movl $0xff, %eax
cmovbl %edx, %eax
leaq 0x262e1b(%rip), %rcx    # 0x30d497
movb %al, (%rcx)
movl %ebx, %edi
movl $0x1, %esi
movl $0x1, %edx
callq 0xd4110
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
xorpd %xmm0, %xmm0
movl %r15d, %edi
movl %r14d, %esi
movl %r12d, %edx
callq 0xd41e0
addsd -0x28(%rbp), %xmm0
callq 0x5c837
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7327e
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0xaa616
leaq 0x262dcb(%rip), %rax    # 0x30d4a4
movl (%rax), %eax
orl $0x1, %eax
movb $0x3, %cl
jmp 0xaa5f7