// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rbx
pushq %rax
leaq 0xaf8c1(%rip), %rdi     # 0x1219c6
callq 0x58e77
callq 0x58aae
movss %xmm0, -0x10(%rbp)
movss %xmm0, 0x2f9cf0(%rip)   # 0x36be0c
callq 0x588f0
movl %eax, %ebx
movw %ax, 0x2f9cde(%rip)     # 0x36be08
leaq 0x29b617(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x58aae
movss %xmm0, -0xc(%rbp)
xorl %edi, %edi
callq 0x58f50
leaq 0x1cce21(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
je 0x7215b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movss -0x10(%rbp), %xmm0
leaq 0x1a6795(%rip), %rax    # 0x2188fc
movl $0x1, (%rax)
leaq 0x1a675c(%rip), %rax    # 0x2188d0
movq (%rax), %rax
leaq 0x1ccd5a(%rip), %rcx    # 0x23eed8
movl (%rcx), %edx
cmpq $0x1, %rax
jne 0x721a7
testl %edx, %edx
je 0x721ab
leaq 0x1a8e43(%rip), %rdx    # 0x21afd4
movl (%rdx), %edx
addl $-0x33, %edx
cmpl $0x1d, %edx
ja 0x7220d
movl $0x20004009, %esi       # imm = 0x20004009
btl %edx, %esi
jb 0x721ab
jmp 0x7220d
testl %edx, %edx
jne 0x7220d
leaq 0x29b17a(%rip), %rdx    # 0x30d32c
movl $0x21, (%rdx)
leaq 0x29b579(%rip), %rdx    # 0x30d738
movw %bx, (%rdx)
cvttss2si %xmm0, %rdx
leaq 0x29b56e(%rip), %rsi    # 0x30d73c
movl %edx, (%rsi)
leaq 0x29b56d(%rip), %rsi    # 0x30d744
movl %edx, (%rsi)
leaq 0x29b560(%rip), %rsi    # 0x30d740
movl %edx, (%rsi)
movl %edx, %edx
leaq 0x29b565(%rip), %rsi    # 0x30d750
movq %rdx, (%rsi)
leaq 0x29b133(%rip), %rdx    # 0x30d328
cmpl $0x0, (%rdx)
jne 0x72207
leaq 0x1a6643(%rip), %rsi    # 0x218844
movl $0xbd5, (%rsi)          # imm = 0xBD5
movl $0x37, (%rdx)
movl (%rcx), %ecx
cmpq $0x1, %rax
jne 0x7223d
testl %ecx, %ecx
je 0x72245
leaq 0x1a8db4(%rip), %rax    # 0x21afd4
movl (%rax), %eax
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0x72154
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jb 0x72245
jmp 0x72154
testl %ecx, %ecx
jne 0x72154
xorps %xmm0, %xmm0
movss -0xc(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x72254
jnp 0x7226d
leaq 0x29b4d9(%rip), %rax    # 0x30d734
cmpl $0x0, (%rax)
jne 0x7226d
cvttss2si %xmm1, %eax
leaq 0x29b4bd(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x29b0a8(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x72154
leaq 0x29b290(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x29b494(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0x72154
leaq 0x1a658e(%rip), %rcx    # 0x218844
movl $0x7f1, (%rcx)          # imm = 0x7F1
movl $0x21, (%rax)
jmp 0x72154