// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Hr()
void parse_moto_Hr()
{
int i;
int prn;
u08 iode;
double pr;

   log_packet_id("inverse differential");
   if(moto_chans != 12) {
      moto_chans = 12;
      config_msg_ofs();
   }
   have_moto_Hr = 1;

   get_moto_time(0);                  

   gps_week = tsip_word();  // these are what we really want from this message         
   faked_tow = 0;
   if(have_week == 0) need_redraw = 2048;
   have_week = 8;
   pri_tow = tow = this_tow = tsip_dword();               
   if(have_tow == 0) need_redraw = 2049;
   have_tow = 8;
   survey_tow = tow;

   obs_tow = (double) tow;
   jd_obs = GPS_EPOCH + ((double) gps_week * 7.0) + jtime(0,0,0,tow);

   get_moto_lla();    // lat/lon/alt               
   speed = tsip_word();   // speed          
   heading = tsip_word(); // heading        
   get_moto_status();                
   tsip_word();       // dop            
   tsip_byte();       // dop type       

   tsip_byte();       // vis count      
   tsip_word();       // fix vector     

   have_speed = 3;
   have_heading = 3;
                                     
   for(i=0; i<12; i++) {
      prn = tsip_byte();    // prn
      iode = tsip_byte();   // iode
      pr = (double) (unsigned) tsip_dword();   // pseudorange in cm
      pr /= 100.0;    // meters
      tsip_dword();   // range rate

      if((prn >= 1) && (prn <= MAX_PRN)) { 
         sat[prn].iode = (u08) iode;
         if(have_moto_range == 0) {  // use the @@Bg/@@Eg message
            sat[prn].range = pr;
            if(pr) {
               have_range |= rinex_gnss(prn);
            }
         }
      }
   }
                                     
   get_moto_tag();    // id tag         
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xb3eac(%rip), %rdi     # 0x18815b
callq 0x7add0
leaq 0x1a5f49(%rip), %rax    # 0x27a204
cmpl $0xc, (%rax)
je 0xd42d2
leaq 0x1a5f3d(%rip), %rax    # 0x27a204
movl $0xc, (%rax)
callq 0x63c20
leaq 0x298123(%rip), %rax    # 0x36c3fc
movl $0x1, (%rax)
xorl %edi, %edi
callq 0xd1ba0
callq 0x7a560
movw %ax, %cx
leaq 0x298623(%rip), %rax    # 0x36c918
movw %cx, (%rax)
leaq 0x298629(%rip), %rax    # 0x36c928
movl $0x0, (%rax)
leaq 0x298200(%rip), %rax    # 0x36c50c
cmpl $0x0, (%rax)
jne 0xd431e
leaq 0x1a370c(%rip), %rax    # 0x277a24
movl $0x800, (%rax)          # imm = 0x800
leaq 0x2981e7(%rip), %rax    # 0x36c50c
movl $0x8, (%rax)
callq 0x7a680
movl %eax, %ecx
leaq 0x2985e7(%rip), %rax    # 0x36c920
movl %ecx, (%rax)
leaq 0x2985da(%rip), %rax    # 0x36c91c
movl %ecx, (%rax)
leaq 0x2985d9(%rip), %rax    # 0x36c924
movl %ecx, (%rax)
leaq 0x2981b4(%rip), %rax    # 0x36c508
cmpl $0x0, (%rax)
jne 0xd4366
leaq 0x1a36c4(%rip), %rax    # 0x277a24
movl $0x801, (%rax)          # imm = 0x801
leaq 0x29819b(%rip), %rax    # 0x36c508
movl $0x8, (%rax)
leaq 0x2985a2(%rip), %rax    # 0x36c91c
movl (%rax), %ecx
movl %ecx, %edx
leaq 0x2985ab(%rip), %rcx    # 0x36c930
movq %rdx, (%rcx)
movl (%rax), %ecx
cvtsi2sd %rcx, %xmm0
leaq 0x2983c2(%rip), %rcx    # 0x36c758
movsd %xmm0, (%rcx)
leaq 0x298577(%rip), %rcx    # 0x36c918
movzwl (%rcx), %ecx
cvtsi2sd %ecx, %xmm0
movsd 0x9d2d8(%rip), %xmm1    # 0x171688
mulsd %xmm1, %xmm0
movsd 0x9d25c(%rip), %xmm1    # 0x171618
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movl (%rax), %eax
cvtsi2sd %rax, %xmm0
xorl %edx, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
addsd %xmm1, %xmm0
leaq 0x298366(%rip), %rax    # 0x36c750
movsd %xmm0, (%rax)
callq 0xd1ac0
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
leaq 0x297dfa(%rip), %rax    # 0x36c200
movsd %xmm0, (%rax)
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
leaq 0x297deb(%rip), %rax    # 0x36c208
movsd %xmm0, (%rax)
callq 0xd1f90
callq 0x7a560
callq 0x7a510
callq 0x7a510
callq 0x7a560
leaq 0x2980d7(%rip), %rax    # 0x36c518
movl $0x3, (%rax)
leaq 0x2980c6(%rip), %rax    # 0x36c514
movl $0x3, (%rax)
movl $0x0, -0x4(%rbp)
cmpl $0xc, -0x4(%rbp)
jge 0xd4542
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x8(%rbp)
callq 0x7a510
movb %al, -0x9(%rbp)
callq 0x7a680
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x9abba(%rip), %xmm1    # 0x16f050
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
callq 0x7a680
cmpl $0x1, -0x8(%rbp)
jl 0xd4532
cmpl $0x3e7, -0x8(%rbp)      # imm = 0x3E7
jg 0xd4532
movb -0x9(%rbp), %cl
movslq -0x8(%rbp), %rdx
leaq 0x1c9ccb(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movb %cl, 0x1f1(%rax)
leaq 0x297f24(%rip), %rax    # 0x36c400
cmpl $0x0, (%rax)
jne 0xd4530
movsd -0x18(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1c9c9f(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x38(%rax)
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd4512
jp 0xd4512
jmp 0xd452e
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x298005(%rip), %rax    # 0x36c528
orl (%rax), %ecx
leaq 0x297ffc(%rip), %rax    # 0x36c528
movl %ecx, (%rax)
jmp 0xd4530
jmp 0xd4532
jmp 0xd4534
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xd445b
callq 0xd1fc0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)