// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_gps_time()
void get_gps_time()
{
float gps_tow;
u16 xgps_week;
float gps_utc_offset;

   log_packet_id("Packet 0x41 - GPS time");

   gps_tow = sv6_tow = tsip_single();
   xgps_week = sv6_week = tsip_word();
   faked_tow = 0;
   gps_utc_offset = tsip_single();
   check_tsip_end(1);
   if(tsip_error) return;

   saw_sv6_time = 1;

//sv6_tow = (float) (int) (gps_tow + 0.50);

   if(SV6_FAMILY || (have_pri_time == 0)) {
      have_week = 33;
      gps_week = xgps_week;
      tow = (u32) gps_tow;  
      pri_tow = tow;
      this_tow = tow;
      survey_tow = tow;

      if(have_tow == 0) need_redraw = 3029;
      have_tow = 55;
   }

   if(SV6_FAMILY || (have_pri_time == 0)) {
      if(!user_set_utc_ofs && gps_utc_offset) utc_offset = (int) gps_utc_offset;
      check_utc_ofs(33);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xe8f77(%rip), %rdi     # 0x184d36
callq 0x7add0
callq 0x7a860
movss %xmm0, 0x32f21b(%rip)   # 0x3cafec
movss %xmm0, -0x4(%rbp)
callq 0x7a560
movw %ax, 0x32f206(%rip)     # 0x3cafe8
movw %ax, -0x6(%rbp)
leaq 0x2d0b3b(%rip), %rax    # 0x36c928
movl $0x0, (%rax)
callq 0x7a860
movss %xmm0, -0xc(%rbp)
movl $0x1, %edi
callq 0x7aee0
leaq 0x202342(%rip), %rax    # 0x29e150
cmpl $0x0, (%rax)
je 0x9be18
jmp 0x9bf7b
leaq 0x1dbcbd(%rip), %rax    # 0x277adc
movl $0x1, (%rax)
leaq 0x1dbc84(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9be62
leaq 0x1de37b(%rip), %rax    # 0x27a1b4
cmpl $0x36, (%rax)
je 0x9be72
leaq 0x1de36f(%rip), %rax    # 0x27a1b4
cmpl $0x33, (%rax)
je 0x9be72
leaq 0x1de363(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x9be72
leaq 0x1de357(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
je 0x9be72
leaq 0x20224f(%rip), %rax    # 0x29e0b8
cmpl $0x0, (%rax)
jne 0x9befd
leaq 0x2d0693(%rip), %rax    # 0x36c50c
movl $0x21, (%rax)
movw -0x6(%rbp), %cx
leaq 0x2d0a8e(%rip), %rax    # 0x36c918
movw %cx, (%rax)
cvttss2si -0x4(%rbp), %rax
movl %eax, %ecx
leaq 0x2d0a80(%rip), %rax    # 0x36c91c
movl %ecx, (%rax)
leaq 0x2d0a77(%rip), %rax    # 0x36c91c
movl (%rax), %ecx
leaq 0x2d0a76(%rip), %rax    # 0x36c924
movl %ecx, (%rax)
leaq 0x2d0a65(%rip), %rax    # 0x36c91c
movl (%rax), %ecx
leaq 0x2d0a60(%rip), %rax    # 0x36c920
movl %ecx, (%rax)
leaq 0x2d0a53(%rip), %rax    # 0x36c91c
movl (%rax), %eax
movl %eax, %ecx
leaq 0x2d0a5c(%rip), %rax    # 0x36c930
movq %rcx, (%rax)
leaq 0x2d062a(%rip), %rax    # 0x36c508
cmpl $0x0, (%rax)
jne 0x9bef0
leaq 0x1dbb3a(%rip), %rax    # 0x277a24
movl $0xbd5, (%rax)          # imm = 0xBD5
leaq 0x2d0611(%rip), %rax    # 0x36c508
movl $0x37, (%rax)
leaq 0x1dbbac(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9bf3a
leaq 0x1de2a3(%rip), %rax    # 0x27a1b4
cmpl $0x36, (%rax)
je 0x9bf46
leaq 0x1de297(%rip), %rax    # 0x27a1b4
cmpl $0x33, (%rax)
je 0x9bf46
leaq 0x1de28b(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x9bf46
leaq 0x1de27f(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
je 0x9bf46
leaq 0x202177(%rip), %rax    # 0x29e0b8
cmpl $0x0, (%rax)
jne 0x9bf7b
leaq 0x2d09c7(%rip), %rax    # 0x36c914
cmpl $0x0, (%rax)
jne 0x9bf71
movss -0xc(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x9bf63
jp 0x9bf63
jmp 0x9bf71
cvttss2si -0xc(%rbp), %ecx
leaq 0x2d0999(%rip), %rax    # 0x36c908
movl %ecx, (%rax)
movl $0x21, %edi
callq 0x7a270
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)