// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_cs_time()
void parse_cs_time()
{
double jd;

   if(get_msg_field()) {
      pri_hours = hours = cs_hours = atoi(msg_field);
   }
   if(get_msg_field()) {
      pri_minutes = minutes = cs_minutes = atoi(msg_field);
   }
   if(get_msg_field()) {
      pri_seconds = seconds = cs_seconds = atoi(msg_field);
   }
   pri_frac = 0.0;

   if(have_cs_mjd && cs_mjd) {
      jd = cs_mjd + JD_MJD;
      gregorian(0, jd);
      pri_year = year = g_year;
      pri_month = month = g_month;
      pri_day = day = g_day;
   }
   else {  // no MJD set, get it from system clock
      get_clock_time();   // get system clock time in UTC
      pri_year = year = clk_year;
      pri_month = month = clk_month;
      pri_day = day = clk_day;
   }

   have_cs_time = 1;

   if(timing_mode == TMODE_GPS) {     // convert utc time to gps time
      utc_to_gps();
   }
   else {
      adjust_rcvr_time(0.0);  // incorporarte possibly negative fractional second into time variables
   }

   if(seconds != last_misc_second) {
      update_gps_screen(1006);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0xb0bd0
cmpl $0x0, %eax
je 0xdc9fb
leaq 0x2be247(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x19d1d9(%rip), %rax    # 0x279bc0
movl %ecx, (%rax)
leaq 0x28fcc0(%rip), %rax    # 0x36c6b0
movl %ecx, (%rax)
leaq 0x28fcef(%rip), %rax    # 0x36c6e8
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xdca2e
leaq 0x2be214(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x19d1aa(%rip), %rax    # 0x279bc4
movl %ecx, (%rax)
leaq 0x28fc89(%rip), %rax    # 0x36c6ac
movl %ecx, (%rax)
leaq 0x28fcb8(%rip), %rax    # 0x36c6e4
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xdca61
leaq 0x2be1e1(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x19d17b(%rip), %rax    # 0x279bc8
movl %ecx, (%rax)
leaq 0x28fc52(%rip), %rax    # 0x36c6a8
movl %ecx, (%rax)
leaq 0x28fc81(%rip), %rax    # 0x36c6e0
movl %ecx, (%rax)
leaq 0x28fc90(%rip), %rax    # 0x36c6f8
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x19d16e(%rip), %rax    # 0x279be4
cmpl $0x0, (%rax)
je 0xdcb0e
leaq 0x19d052(%rip), %rax    # 0x279ad8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xdca97
jp 0xdca97
jmp 0xdcb0e
movsd 0x94b71(%rip), %xmm0    # 0x171610
leaq 0x19d032(%rip), %rax    # 0x279ad8
addsd (%rax), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x28fdc2(%rip), %rax    # 0x36c884
movl (%rax), %ecx
leaq 0x28fbf1(%rip), %rax    # 0x36c6bc
movl %ecx, (%rax)
leaq 0x28fc20(%rip), %rax    # 0x36c6f4
movl %ecx, (%rax)
leaq 0x28fd9f(%rip), %rax    # 0x36c87c
movl (%rax), %ecx
leaq 0x28fbd2(%rip), %rax    # 0x36c6b8
movl %ecx, (%rax)
leaq 0x28fc01(%rip), %rax    # 0x36c6f0
movl %ecx, (%rax)
leaq 0x28fd88(%rip), %rax    # 0x36c880
movl (%rax), %ecx
leaq 0x28fbb3(%rip), %rax    # 0x36c6b4
movl %ecx, (%rax)
leaq 0x28fbe2(%rip), %rax    # 0x36c6ec
movl %ecx, (%rax)
jmp 0xdcb64
callq 0xa750
leaq 0x28fd8e(%rip), %rax    # 0x36c8a8
movl (%rax), %ecx
leaq 0x28fb99(%rip), %rax    # 0x36c6bc
movl %ecx, (%rax)
leaq 0x28fbc8(%rip), %rax    # 0x36c6f4
movl %ecx, (%rax)
leaq 0x28fd6b(%rip), %rax    # 0x36c8a0
movl (%rax), %ecx
leaq 0x28fb7a(%rip), %rax    # 0x36c6b8
movl %ecx, (%rax)
leaq 0x28fba9(%rip), %rax    # 0x36c6f0
movl %ecx, (%rax)
leaq 0x28fd54(%rip), %rax    # 0x36c8a4
movl (%rax), %ecx
leaq 0x28fb5b(%rip), %rax    # 0x36c6b4
movl %ecx, (%rax)
leaq 0x28fb8a(%rip), %rax    # 0x36c6ec
movl %ecx, (%rax)
leaq 0x19d075(%rip), %rax    # 0x279be0
movl $0x1, (%rax)
leaq 0x28fb25(%rip), %rax    # 0x36c69d
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xdcb87
callq 0x7fc70
jmp 0xdcb8f
xorps %xmm0, %xmm0
callq 0x7fbf0
leaq 0x28fb12(%rip), %rax    # 0x36c6a8
movl (%rax), %eax
cmpl 0xec7c2(%rip), %eax     # 0x1c9360
je 0xdcbaa
movl $0x3ee, %edi            # imm = 0x3EE
callq 0x9d790
addq $0x10, %rsp
popq %rbp
retq