// File: /workspace/github_cpp_makefile_star2_O3/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 0x810b1
testl %eax, %eax
je 0x841c0
leaq 0x2b78a7(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, 0x2edc84(%rip)    # 0x371e28
leaq 0x1971cd(%rip), %rcx    # 0x21b378
movl (%rcx), %ecx
testl %ecx, %ecx
je 0x84369
cltd
idivl %ecx
testl %edx, %edx
jne 0x84369
callq 0x810b1
testl %eax, %eax
je 0x8422b
leaq 0x2b7870(%rip), %rdi    # 0x33ba40
callq 0x95e0
cmpl $0x1, %eax
jne 0x8422b
cvtsi2sdl 0x2edc46(%rip), %xmm0 # 0x371e28
leaq 0x28938f(%rip), %rax    # 0x30d578
movsd %xmm0, (%rax)
leaq 0x289544(%rip), %rax    # 0x30d738
movzwl (%rax), %eax
cvtsi2sd %eax, %xmm1
mulsd 0x87705(%rip), %xmm1    # 0x10b908
addsd 0x8768d(%rip), %xmm1    # 0x10b898
movsd %xmm1, -0x18(%rbp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd492e
addsd -0x18(%rbp), %xmm0
leaq 0x289349(%rip), %rax    # 0x30d570
movsd %xmm0, (%rax)
callq 0x810b1
callq 0x810b1
callq 0x810b1
xorl %ebx, %ebx
testl %eax, %eax
je 0x8425a
leaq 0x2b77f9(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
js 0x8425a
xorl %ebx, %ebx
cmpl $0x3e8, %eax            # imm = 0x3E8
cmovbl %eax, %ebx
callq 0x810b1
callq 0x810b1
callq 0x810b1
movl %ebx, %r14d
testl %eax, %eax
je 0x842a5
leaq 0x2b77c9(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x9a46c(%rip), %xmm0    # 0x11e6f0
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1bad1e(%rip), %rcx    # 0x23efb0
movsd %xmm0, 0x8(%rcx,%rax)
leaq 0x289119(%rip), %rax    # 0x30d3b8
movl $0x57, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x842fa
leaq 0x2b778b(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x9a436(%rip), %xmm0    # 0x11e6f8
mulsd 0x9a436(%rip), %xmm0    # 0x11e700
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1bacd8(%rip), %rcx    # 0x23efb0
movsd %xmm0, 0x30(%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x842ea
jnp 0x842fa
movl %ebx, %edi
callq 0xdc1dd
leaq 0x289048(%rip), %rcx    # 0x30d340
orl %eax, (%rcx)
callq 0x810b1
testl %eax, %eax
je 0x84347
leaq 0x2b7736(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x9a3d9(%rip), %xmm0    # 0x11e6f0
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1bac8b(%rip), %rcx    # 0x23efb0
movsd %xmm0, 0x38(%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x84337
jnp 0x84347
movl %ebx, %edi
callq 0xdc1dd
leaq 0x289003(%rip), %rcx    # 0x30d348
orl %eax, (%rcx)
imulq $0x348, %r14, %rax      # imm = 0x348
leaq 0x1bac5b(%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