// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_raw_data()
void get_raw_data()
{
int prn;
double obs_time;
float dop;
float sig_level;
static int last_prn = (-1);

   log_packet_id("Packet 0x5A (Raw measurement data)");

   prn = tsip_byte();
   if(prn < 1) prn = 0;
   else if(prn > MAX_PRN) prn = 0;  // !!!! max_sat_check - put any bogus data in unused entry in array
   if(prn == last_prn) prn = 0;  // filter duplicate message  ACU_GG - rnx
   else last_prn = prn;

   sat[prn].sample_len = tsip_single();
   if(1 || (log_db == 0)) {
      sig_level = tsip_single();
      if(0 && SV6_FAMILY) {
         if(amu_mode == 0) {
            sat[prn].sig_level = amu_to_dbc(sat[prn].sig_level);
            sat[prn].level_msg = 0x5A;
            have_snr |= rinex_gnss(prn);
         }
      }
   }
   else tsip_single();

   sat[prn].last_cp = sat[prn].code_phase;
   sat[prn].code_phase = tsip_single();
   dop = tsip_single();
   sat[prn].doppler = dop;
   sat[prn].raw_time = tsip_double();    // gps time-of-week
   check_tsip_end(1);

if(0 && debug_file) fprintf(debug_file, "prn:%02d  time:%.7f\n", prn,sat[prn].raw_time);  //rnx3


   if(sat[prn].doppler != 0.0F) {
      if(have_doppler == 0) need_redraw = 2002;
      have_doppler |= rinex_gnss(prn);
   }

   if(raw_msg_rate && sat[prn].eph_valid && sat[prn].eph_flag) { // raw Hz !!!!
      obs_time = sat[prn].raw_time;
      if((((int) (obs_time + 0.005) % raw_msg_rate) == 0) || (res_t == RES_T)) {  // round up is for ACU_360  rnx
         obs_tow = (obs_time + rollover);
         jd_obs = GPS_EPOCH + ((double) gps_week * 7.0) + jtime(0,0,0,obs_time+rollover);
      }
   }

   if(0 && (sat[prn].code_phase != 0.0F)) {  //rnx
      if(have_phase == 0) need_redraw = 2003;
      have_phase |= rinex_gnss(prn);
   }
   if(raw_msg_rate) {
      calc_sat_posn(prn);  // calculate pesduorange from ephemeris data
   }

   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xe5819(%rip), %rdi     # 0x184fe8
callq 0x7add0
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
cmpl $0x1, -0x4(%rbp)
jge 0x9f7ee
movl $0x0, -0x4(%rbp)
jmp 0x9f800
cmpl $0x3e7, -0x4(%rbp)      # imm = 0x3E7
jle 0x9f7fe
movl $0x0, -0x4(%rbp)
jmp 0x9f800
movl -0x4(%rbp), %eax
cmpl 0x129d6f(%rip), %eax    # 0x1c9578
jne 0x9f814
movl $0x0, -0x4(%rbp)
jmp 0x9f81d
movl -0x4(%rbp), %eax
movl %eax, 0x129d5b(%rip)    # 0x1c9578
callq 0x7a860
movslq -0x4(%rbp), %rcx
leaq 0x1fe963(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
callq 0x7a860
movss %xmm0, -0x18(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x1fe93f(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd 0x28(%rax), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x1fe925(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x48(%rax)
callq 0x7a860
cvtss2sd %xmm0, %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x1fe902(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x28(%rax)
callq 0x7a860
movss %xmm0, -0x14(%rbp)
movss -0x14(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x1fe8d5(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x30(%rax)
callq 0x7a9d0
movslq -0x4(%rbp), %rcx
leaq 0x1fe8b6(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movl $0x1, %edi
callq 0x7aee0
movslq -0x4(%rbp), %rcx
leaq 0x1fe892(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd 0x30(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x9f91a
jp 0x9f91a
jmp 0x9f94f
leaq 0x2ccbff(%rip), %rax    # 0x36c520
cmpl $0x0, (%rax)
jne 0x9f933
leaq 0x1d80f7(%rip), %rax    # 0x277a24
movl $0x7d2, (%rax)          # imm = 0x7D2
movl -0x4(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2ccbdc(%rip), %rax    # 0x36c520
orl (%rax), %ecx
leaq 0x2ccbd3(%rip), %rax    # 0x36c520
movl %ecx, (%rax)
leaq 0x1dac02(%rip), %rax    # 0x27a558
cmpl $0x0, (%rax)
je 0x9fa6f
movslq -0x4(%rbp), %rcx
leaq 0x1fe826(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
cmpl $0x0, 0x244(%rax)
je 0x9fa6f
movslq -0x4(%rbp), %rcx
leaq 0x1fe804(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
cmpb $0x0, 0x202(%rax)
je 0x9fa6f
movslq -0x4(%rbp), %rcx
leaq 0x1fe7e2(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0xe326e(%rip), %xmm0    # 0x182c38
addsd -0x10(%rbp), %xmm0
cvttsd2si %xmm0, %eax
leaq 0x1dab7e(%rip), %rcx    # 0x27a558
cltd
idivl (%rcx)
cmpl $0x0, %edx
je 0x9f9f1
leaq 0x1d80fb(%rip), %rax    # 0x277ae4
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x9fa6d
movsd -0x10(%rbp), %xmm0
leaq 0x1dac43(%rip), %rax    # 0x27a640
movsd (%rax), %xmm1
addsd %xmm1, %xmm0
leaq 0x2ccd4c(%rip), %rax    # 0x36c758
movsd %xmm0, (%rax)
leaq 0x2ccf01(%rip), %rax    # 0x36c918
movzwl (%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0xd1c62(%rip), %xmm1    # 0x171688
mulsd %xmm1, %xmm0
movsd 0xd1be6(%rip), %xmm1    # 0x171618
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
leaq 0x1dabf9(%rip), %rax    # 0x27a640
addsd (%rax), %xmm0
xorl %edx, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
addsd %xmm1, %xmm0
leaq 0x2ccce7(%rip), %rax    # 0x36c750
movsd %xmm0, (%rax)
jmp 0x9fa6f
leaq 0x1daae2(%rip), %rax    # 0x27a558
cmpl $0x0, (%rax)
je 0x9fa83
movl -0x4(%rbp), %edi
callq 0x9e570
leaq 0x1fe6c6(%rip), %rax    # 0x29e150
cmpl $0x0, (%rax)
je 0x9fa91
jmp 0x9fa91
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)