// File: /workspace/github_cpp_makefile_star2_O3/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 0xafabe(%rip), %rdi     # 0x121aa6
callq 0x58dc2
callq 0x58a30
movss %xmm0, -0xc(%rbp)
movss %xmm0, 0x2f9e0d(%rip)   # 0x36be0c
callq 0x588d2
movl %eax, %ebx
movw %ax, 0x2f9dfb(%rip)     # 0x36be08
leaq 0x29b734(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x58a30
movss %xmm0, -0x10(%rbp)
xorl %edi, %edi
callq 0x58e9b
leaq 0x1ccf3e(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
je 0x7203e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x1a68b7(%rip), %rax    # 0x2188fc
movl $0x1, (%rax)
leaq 0x1a687e(%rip), %rax    # 0x2188d0
movq (%rax), %rax
leaq 0x1cce7c(%rip), %rcx    # 0x23eed8
movl (%rcx), %ecx
cmpq $0x1, %rax
jne 0x7208f
testl %ecx, %ecx
je 0x72093
leaq 0x1a8f65(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
leal -0x33(%rcx), %edx
cmpl $0x1e, %edx
jae 0x7210b
movl $0x20004009, %esi       # imm = 0x20004009
btl %edx, %esi
jae 0x7210b
xorl %ecx, %ecx
jmp 0x72095
testl %ecx, %ecx
jne 0x72037
movb $0x1, %cl
leaq 0x29b290(%rip), %rdx    # 0x30d32c
movl $0x21, (%rdx)
leaq 0x29b68f(%rip), %rdx    # 0x30d738
movw %bx, (%rdx)
cvttss2si -0xc(%rbp), %rdx
leaq 0x29b683(%rip), %rsi    # 0x30d73c
movl %edx, (%rsi)
leaq 0x29b682(%rip), %rsi    # 0x30d744
movl %edx, (%rsi)
leaq 0x29b675(%rip), %rsi    # 0x30d740
movl %edx, (%rsi)
movl %edx, %edx
leaq 0x29b67a(%rip), %rsi    # 0x30d750
movq %rdx, (%rsi)
leaq 0x29b248(%rip), %rdx    # 0x30d328
cmpl $0x0, (%rdx)
jne 0x720f2
leaq 0x1a6758(%rip), %rsi    # 0x218844
movl $0xbd5, (%rsi)          # imm = 0xBD5
movl $0x37, (%rdx)
cmpq $0x1, %rax
jne 0x72126
testb %cl, %cl
jne 0x7212e
leaq 0x1a8ecb(%rip), %rax    # 0x21afd4
movl (%rax), %ecx
addl $-0x33, %ecx
cmpl $0x1d, %ecx
ja 0x72037
movl $0x20004009, %eax       # imm = 0x20004009
btl %ecx, %eax
jb 0x7212e
jmp 0x72037
testb %cl, %cl
je 0x72037
xorps %xmm0, %xmm0
movss -0x10(%rbp), %xmm1
ucomiss %xmm0, %xmm1
jne 0x7213d
jnp 0x72156
leaq 0x29b5f0(%rip), %rax    # 0x30d734
cmpl $0x0, (%rax)
jne 0x72156
cvttss2si %xmm1, %eax
leaq 0x29b5d4(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x29b1bf(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x72037
leaq 0x29b3a7(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x29b5ab(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0x72037
leaq 0x1a66a5(%rip), %rcx    # 0x218844
movl $0x7f1, (%rcx)          # imm = 0x7F1
movl $0x21, (%rax)
jmp 0x72037