// File: /workspace/github_cpp_makefile_star2_O3/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 0x636ce(%rip), %rdi     # 0x10de6b
callq 0x58dc2
leaq 0x263577(%rip), %rax    # 0x30dd20
movb $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaa7c5
leaq 0x291284(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %ebx
jmp 0xaa7c7
xorl %ebx, %ebx
callq 0x810b1
testl %eax, %eax
je 0xaa7e4
leaq 0x291269(%rip), %rdi    # 0x33ba40
callq 0x95e0
decl %eax
cvtsi2sd %eax, %xmm0
jmp 0xaa7ec
movsd 0x5e90c(%rip), %xmm0    # 0x1090f8
movsd %xmm0, -0x28(%rbp)
callq 0x810b1
xorl %r14d, %r14d
movl $0x0, %r15d
testl %eax, %eax
je 0xaa812
leaq 0x291236(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r15d
callq 0x810b1
testl %eax, %eax
je 0xaa82a
leaq 0x29121e(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r14d
callq 0x810b1
testl %eax, %eax
je 0xaa844
leaq 0x291206(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r12d
jmp 0xaa847
xorl %r12d, %r12d
callq 0x810b1
testl %eax, %eax
je 0xaa897
leaq 0x2911e9(%rip), %rdi    # 0x33ba40
callq 0x95e0
cmpl $0x4, %eax
je 0xaa86a
cmpl $0x1, %eax
jne 0xaa947
leaq 0x262c33(%rip), %rax    # 0x30d4a4
movl (%rax), %eax
andl $-0x2, %eax
xorl %ecx, %ecx
leaq 0x262c25(%rip), %rdx    # 0x30d4a4
movl %eax, (%rdx)
leaq 0x262c35(%rip), %rax    # 0x30d4bd
movb %cl, (%rax)
leaq 0x262b3b(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaa8c2
leaq 0x291199(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x26239d(%rip), %rcx    # 0x30cc50
movl %eax, (%rcx)
leaq 0x262398(%rip), %rax    # 0x30cc54
movl $0x4, (%rax)
callq 0x810b1
testl %eax, %eax
je 0xaa8ff
leaq 0x29116e(%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 0x262b9a(%rip), %rcx    # 0x30d497
movb %al, (%rcx)
movl %ebx, %edi
movl $0x1, %esi
movl $0x1, %edx
callq 0xd485e
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
xorpd %xmm0, %xmm0
movl %r15d, %edi
movl %r14d, %esi
movl %r12d, %edx
callq 0xd492e
addsd -0x28(%rbp), %xmm0
callq 0x5c71d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x730e8
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0xaa897
leaq 0x262b4a(%rip), %rax    # 0x30d4a4
movl (%rax), %eax
orl $0x1, %eax
movb $0x3, %cl
jmp 0xaa878