// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_crm()
void parse_crm()
{
int i;
int prn;
static int tow = 0;
double val;

   prn = 0;
   if(get_msg_field()) {  // tow
      tow = atoi(msg_field);
      if(raw_msg_rate) {  // receiver always outputs RAW data at 1 Hz
         if((tow % raw_msg_rate) != 0) return;  // drop unwanted messages
      }
      else return;

      if(0) {
         pri_tow = i;
         this_tow = i;
         survey_tow = i;

         if(have_tow == 0) need_redraw = 3087;
         have_tow = 87;
      }
   }

   if(get_msg_field()) {  // sentence number
      i = atoi(msg_field);
      if(i == 1) {
         obs_tow = tow;
         jd_obs = GPS_EPOCH + ((double) gps_week * 7.0) + jtime(0,0,0,tow);
      }
   }

   if(get_msg_field()) {  // max sentences
      i = atoi(msg_field);
   }

   if(get_msg_field()) {  // gps system
      i = atoi(msg_field);
   }

   if(get_msg_field()) {  // prn
      prn = atoi(msg_field);
      if(prn < 0) prn = 0;
      else if(prn > MAX_PRN) prn = 0;
   }

   if(get_msg_field()) {  // reserved
      i = atoi(msg_field);
   }

   if(get_msg_field()) {  // snr - we get this from NMEA messages
      i = atoi(msg_field);
   }

   if(get_msg_field()) {  // accumulated doppler range
      val = atof(msg_field);
      val /= (64.0);  // meters
      sat[prn].accum_range = val;
      have_accum_range = 87;
   }

   // Note: the GT87 can output "stuck" doppler and pseudorange values
   //       for sats that are supposed to be actively tracked.  We filter
   //       stuck values out when writinf RINEX file.
   if(get_msg_field()) {  // doppler freq
      val = atof(msg_field);  // meters/sec, scaled
      val /= (-4096.0);  // meters/sec
      val *= 1575.42E6 / (LIGHTSPEED*1000.0);   // !!!!!! need GLONASS freq
      sat[prn].doppler = val;
      if(val) {
         have_doppler |= rinex_gnss(prn);
      }
   }

   if(get_msg_field()) {  // pseudorange
      val = atof(msg_field);  // meters, scaled
      val /= (64.0);  // meters
      sat[prn].range = val;
      if(val) {
         have_range |= rinex_gnss(prn);
      }
   }

   sat[prn].ca_lli = 0;
   sat[prn].l1_lli = 0;
   sat[prn].l2_lli = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
callq 0x75767
testl %eax, %eax
je 0x785d2
leaq 0x2ad495(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, 0x2e3872(%rip)    # 0x35be28
leaq 0x18cdbb(%rip), %rcx    # 0x205378
movl (%rcx), %ecx
testl %ecx, %ecx
je 0x7877c
cltd
idivl %ecx
testl %edx, %edx
jne 0x7877c
callq 0x75767
testl %eax, %eax
je 0x7863d
leaq 0x2ad45e(%rip), %rdi    # 0x325a40
callq 0x95e0
cmpl $0x1, %eax
jne 0x7863d
cvtsi2sdl 0x2e3834(%rip), %xmm0 # 0x35be28
leaq 0x27ef7d(%rip), %rax    # 0x2f7578
movsd %xmm0, (%rax)
leaq 0x27f132(%rip), %rax    # 0x2f7738
movzwl (%rax), %eax
cvtsi2sd %eax, %xmm1
mulsd 0x7d36b(%rip), %xmm1    # 0xf5980
addsd 0x7d2f3(%rip), %xmm1    # 0xf5910
movsd %xmm1, -0x18(%rbp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xc2faf
addsd -0x18(%rbp), %xmm0
leaq 0x27ef37(%rip), %rax    # 0x2f7570
movsd %xmm0, (%rax)
callq 0x75767
callq 0x75767
callq 0x75767
xorl %ebx, %ebx
testl %eax, %eax
je 0x7866c
leaq 0x2ad3e7(%rip), %rdi    # 0x325a40
callq 0x95e0
testl %eax, %eax
js 0x7866c
xorl %ebx, %ebx
cmpl $0x3e8, %eax            # imm = 0x3E8
cmovbl %eax, %ebx
callq 0x75767
callq 0x75767
callq 0x75767
movl %ebx, %r14d
testl %eax, %eax
je 0x786b7
leaq 0x2ad3b7(%rip), %rdi    # 0x325a40
callq 0x9470
mulsd 0x8ffd2(%rip), %xmm0    # 0x108668
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1b090c(%rip), %rcx    # 0x228fb0
movsd %xmm0, 0x8(%rcx,%rax)
leaq 0x27ed07(%rip), %rax    # 0x2f73b8
movl $0x57, (%rax)
callq 0x75767
testl %eax, %eax
je 0x7870c
leaq 0x2ad379(%rip), %rdi    # 0x325a40
callq 0x9470
mulsd 0x8ff9c(%rip), %xmm0    # 0x108670
mulsd 0x8ff9c(%rip), %xmm0    # 0x108678
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1b08c6(%rip), %rcx    # 0x228fb0
movsd %xmm0, 0x30(%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x786fc
jnp 0x7870c
movl %ebx, %edi
callq 0xca4da
leaq 0x27ec36(%rip), %rcx    # 0x2f7340
orl %eax, (%rcx)
callq 0x75767
testl %eax, %eax
je 0x78759
leaq 0x2ad324(%rip), %rdi    # 0x325a40
callq 0x9470
mulsd 0x8ff3f(%rip), %xmm0    # 0x108668
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1b0879(%rip), %rcx    # 0x228fb0
movsd %xmm0, 0x38(%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x78749
jnp 0x78759
movl %ebx, %edi
callq 0xca4da
leaq 0x27ebf1(%rip), %rcx    # 0x2f7348
orl %eax, (%rcx)
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1b0849(%rip), %rcx    # 0x228fb0
andl $0x0, 0x68(%rcx,%rax)
andl $0x0, 0xa8(%rcx,%rax)
andl $0x0, 0xe8(%rcx,%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq