// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_nmea_time()
void get_nmea_time()
{
double ftime;
int time;

   // get a time field from a NMEA message

   if(rcvr_type == BRANDY_RCVR) {  // we use the brandywine time and date message
      get_msg_field();
   }
   else if(get_msg_field()) {  // time
      ftime = atof(msg_field);  // time field can be floating point
      time = (int) ftime;
      pri_hours = hours = (time / 10000);
      pri_minutes = minutes = ((time / 100) % 100);
      pri_seconds = seconds = ((time / 1) % 100);
      pri_frac = raw_frac = ftime - (double) time;
//vvvv   time_flags |= TFLAGS_UTC;  // UTC based time
      if(timing_mode == TMODE_GPS) {  // convert utc time to gps time
         utc_to_gps();
      }
      time_flags &= (~TFLAGS_INVALID);
   }
   else if(1) { // empty time field, use system clock and flag as invalid time
      get_clock_time();
      hours = pri_hours = clk_hours;
      minutes = pri_minutes = clk_minutes;
      seconds = pri_seconds = clk_seconds;
      pri_frac = raw_frac = clk_frac;
      time_flags |= (~TFLAGS_INVALID);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x1c6371(%rip), %rax    # 0x277ab0
cmpq $0x40000, (%rax)        # imm = 0x40000
jne 0xb1752
callq 0xb0bd0
jmp 0xb18c2
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb1834
leaq 0x2e94b9(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd %xmm0, -0x8(%rbp)
cvttsd2si -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
movl %eax, %ecx
leaq 0x2baf23(%rip), %rax    # 0x36c6b0
movl %ecx, (%rax)
leaq 0x2baf52(%rip), %rax    # 0x36c6e8
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl $0x64, %ecx
cltd
idivl %ecx
leaq 0x2baefa(%rip), %rax    # 0x36c6ac
movl %edx, (%rax)
leaq 0x2baf29(%rip), %rax    # 0x36c6e4
movl %edx, (%rax)
movl -0xc(%rbp), %eax
movl $0x1, %ecx
cltd
idivl %ecx
movl $0x64, %ecx
cltd
idivl %ecx
leaq 0x2baed1(%rip), %rax    # 0x36c6a8
movl %edx, (%rax)
leaq 0x2baf00(%rip), %rax    # 0x36c6e0
movl %edx, (%rax)
movsd -0x8(%rbp), %xmm0
cvtsi2sdl -0xc(%rbp), %xmm1
subsd %xmm1, %xmm0
leaq 0x2baec9(%rip), %rax    # 0x36c6c0
movsd %xmm0, (%rax)
leaq 0x2baef6(%rip), %rax    # 0x36c6f8
movsd %xmm0, (%rax)
leaq 0x2bae90(%rip), %rax    # 0x36c69d
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xb181a
callq 0x7fc70
leaq 0x2bae63(%rip), %rax    # 0x36c684
movl (%rax), %ecx
andl $-0x5, %ecx
leaq 0x2bae57(%rip), %rax    # 0x36c684
movl %ecx, (%rax)
jmp 0xb18c0
callq 0xa750
leaq 0x2bb06c(%rip), %rax    # 0x36c8ac
movl (%rax), %ecx
leaq 0x2bae9f(%rip), %rax    # 0x36c6e8
movl %ecx, (%rax)
leaq 0x2bae5e(%rip), %rax    # 0x36c6b0
movl %ecx, (%rax)
leaq 0x2bb055(%rip), %rax    # 0x36c8b0
movl (%rax), %ecx
leaq 0x2bae80(%rip), %rax    # 0x36c6e4
movl %ecx, (%rax)
leaq 0x2bae3f(%rip), %rax    # 0x36c6ac
movl %ecx, (%rax)
leaq 0x2bb03e(%rip), %rax    # 0x36c8b4
movl (%rax), %ecx
leaq 0x2bae61(%rip), %rax    # 0x36c6e0
movl %ecx, (%rax)
leaq 0x2bae20(%rip), %rax    # 0x36c6a8
movl %ecx, (%rax)
leaq 0x2bb027(%rip), %rax    # 0x36c8b8
movsd (%rax), %xmm0
leaq 0x2bae24(%rip), %rax    # 0x36c6c0
movsd %xmm0, (%rax)
leaq 0x2bae51(%rip), %rax    # 0x36c6f8
movsd %xmm0, (%rax)
leaq 0x2badd2(%rip), %rax    # 0x36c684
movl (%rax), %ecx
orl $-0x5, %ecx
leaq 0x2badc6(%rip), %rax    # 0x36c684
movl %ecx, (%rax)
jmp 0xb18c2
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)