// File: /workspace/github_cpp_makefile_star2_O1/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 0x811da
testl %eax, %eax
je 0x842bc
leaq 0x2b77ab(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, 0x2edb88(%rip)    # 0x371e28
leaq 0x1970d1(%rip), %rcx    # 0x21b378
movl (%rcx), %ecx
testl %ecx, %ecx
je 0x84465
cltd
idivl %ecx
testl %edx, %edx
jne 0x84465
callq 0x811da
testl %eax, %eax
je 0x84327
leaq 0x2b7774(%rip), %rdi    # 0x33ba40
callq 0x95e0
cmpl $0x1, %eax
jne 0x84327
cvtsi2sdl 0x2edb4a(%rip), %xmm0 # 0x371e28
leaq 0x289293(%rip), %rax    # 0x30d578
movsd %xmm0, (%rax)
leaq 0x289448(%rip), %rax    # 0x30d738
movzwl (%rax), %eax
cvtsi2sd %eax, %xmm1
mulsd 0x87601(%rip), %xmm1    # 0x10b900
addsd 0x87581(%rip), %xmm1    # 0x10b888
movsd %xmm1, -0x18(%rbp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd41e0
addsd -0x18(%rbp), %xmm0
leaq 0x28924d(%rip), %rax    # 0x30d570
movsd %xmm0, (%rax)
callq 0x811da
callq 0x811da
callq 0x811da
xorl %ebx, %ebx
testl %eax, %eax
je 0x84356
leaq 0x2b76fd(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
js 0x84356
xorl %ebx, %ebx
cmpl $0x3e8, %eax            # imm = 0x3E8
cmovll %eax, %ebx
callq 0x811da
callq 0x811da
callq 0x811da
movl %ebx, %r14d
testl %eax, %eax
je 0x843a1
leaq 0x2b76cd(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x9a2d0(%rip), %xmm0    # 0x11e650
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1bac22(%rip), %rcx    # 0x23efb0
movsd %xmm0, 0x8(%rcx,%rax)
leaq 0x28901d(%rip), %rax    # 0x30d3b8
movl $0x57, (%rax)
callq 0x811da
testl %eax, %eax
je 0x843f6
leaq 0x2b768f(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x9a29a(%rip), %xmm0    # 0x11e658
mulsd 0x9a29a(%rip), %xmm0    # 0x11e660
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1babdc(%rip), %rcx    # 0x23efb0
movsd %xmm0, 0x30(%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x843e6
jnp 0x843f6
movl %ebx, %edi
callq 0xdbb74
leaq 0x288f4c(%rip), %rcx    # 0x30d340
orl %eax, (%rcx)
callq 0x811da
testl %eax, %eax
je 0x84443
leaq 0x2b763a(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x9a23d(%rip), %xmm0    # 0x11e650
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1bab8f(%rip), %rcx    # 0x23efb0
movsd %xmm0, 0x38(%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x84433
jnp 0x84443
movl %ebx, %edi
callq 0xdbb74
leaq 0x288f07(%rip), %rcx    # 0x30d348
orl %eax, (%rcx)
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1bab5f(%rip), %rcx    # 0x23efb0
xorl %edx, %edx
movl %edx, 0x68(%rcx,%rax)
movl %edx, 0xa8(%rcx,%rax)
movl %edx, 0xe8(%rcx,%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq