// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_taip_nav()
void parse_taip_nav()
{
int num_sv;
int prn;
int mode;
u08 iode;
float az;

   get_fixed_field(8);  // GPS time
   if(get_fixed_field(10)) {
      lat = atof(msg_field) / 1.0E7 * (PI/180.0);
   }
   if(get_fixed_field(11)) {
      lon = atof(msg_field) / 1.0E7 * (PI/180.0);
   }
   if(get_fixed_field(9)) {
      alt = (atof(msg_field) / 1.0E2) / FEET_PER_METER;
   }

   if(get_fixed_field(4)) {
      speed = (atof(msg_field) / 10.0);  // mph
      have_speed = 55;
   }
   if(get_fixed_field(5)) {
   }
   if(get_fixed_field(4)) {
      heading = (atof(msg_field) / 10.0);  // mph
      have_heading = 55;
   }

   if(get_fixed_field(2)) {  // sat prn's and iode
      reset_sat_tracking();
      num_sv = atoi(msg_field);
      while(num_sv-- > 0) {
         get_fixed_field(2);
         prn = atoi(msg_field);
         iode = (u08) get_fixed_field(2);        // iode

         if((prn >= 1) && (prn <= MAX_PRN)) {   // we fake a lot of this
            sat[prn].level_msg = 1;
            az = (float) (prn*10);
            set_sat_azel(prn, az, (float) 30.0);
            sat[prn].sig_level = (float) 40.0;
            sat[prn].tracking = prn;
            sat[prn].iode = iode;
            have_sat_azel = 33;
            level_type = "SNR";
            have_snr |= rinex_gnss(prn);

            record_sig_levels(prn);
         }
      }
   }

   get_fixed_field(10);  // reserved

   if(get_fixed_field(1)) {  // nav source
      mode = atoi(msg_field);
      if     (mode == 0) rcvr_mode = RCVR_MODE_2D;
      else if(mode == 1) rcvr_mode = RCVR_MODE_3D;
      else if(mode == 2) rcvr_mode = RCVR_MODE_DGPS;
      else if(mode == 3) rcvr_mode = RCVR_MODE_DGPS;
      else               rcvr_mode = RCVR_MODE_UNKNOWN;
   }

   if(get_fixed_field(1)) {  // age
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x8, %edi
callq 0x83e83
movl $0xa, %edi
callq 0x83e83
testl %eax, %eax
je 0xa3b09
leaq 0x297f57(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x67dd2(%rip), %xmm0    # 0x10b8c8
mulsd 0x67e0a(%rip), %xmm0    # 0x10b908
leaq 0x2694cb(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
movl $0xb, %edi
callq 0x83e83
testl %eax, %eax
je 0xa3b3e
leaq 0x297f22(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x67d9d(%rip), %xmm0    # 0x10b8c8
mulsd 0x67dd5(%rip), %xmm0    # 0x10b908
leaq 0x26949e(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
movl $0x9, %edi
callq 0x83e83
testl %eax, %eax
je 0xa3b73
leaq 0x297eed(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x65500(%rip), %xmm0    # 0x109060
divsd 0x67d30(%rip), %xmm0    # 0x10b898
leaq 0x269471(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
movl $0x4, %edi
callq 0x83e83
testl %eax, %eax
je 0xa3bad
leaq 0x297eb8(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x65513(%rip), %xmm0    # 0x1090a8
leaq 0x269484(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
leaq 0x269791(%rip), %rax    # 0x30d338
movl $0x37, (%rax)
movl $0x5, %edi
callq 0x83e83
movl $0x4, %edi
callq 0x83e83
testl %eax, %eax
je 0xa3bf1
leaq 0x297e74(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x654cf(%rip), %xmm0    # 0x1090a8
leaq 0x269448(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x269749(%rip), %rax    # 0x30d334
movl $0x37, (%rax)
movl $0x2, %edi
callq 0x83e83
testl %eax, %eax
je 0xa3d14
movl $0x218, %eax            # imm = 0x218
leaq 0x19b3a1(%rip), %rdx    # 0x23efb0
xorl %ecx, %ecx
movl %ecx, (%rdx,%rax)
movl %ecx, -0x1fc(%rdx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd358, %rax          # imm = 0xCD358
jne 0xa3c11
leaq 0x297e10(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
jle 0xa3d14
movl %eax, %ebx
incl %ebx
leaq 0x297df8(%rip), %r14    # 0x33ba40
movl $0x2, %edi
callq 0x83e83
movq %r14, %rdi
callq 0x95e0
movl %eax, %r15d
movl $0x2, %edi
callq 0x83e83
movl %eax, %r12d
leal -0x1(%r15), %eax
cmpl $0x3e6, %eax            # imm = 0x3E6
ja 0xa3d09
movl %r15d, %eax
imulq $0x348, %rax, %r14      # imm = 0x348
leaq 0x19b326(%rip), %r13    # 0x23efb0
movl $0x1, 0x1c(%r13,%r14)
movl %r15d, %eax
addl %eax, %eax
leal (%rax,%rax,4), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movl %r15d, %edi
movss 0x7ad13(%rip), %xmm1    # 0x11e9c0
callq 0x5ad98
movl $0x42200000, 0x20(%r13,%r14) # imm = 0x42200000
movl %r15d, 0x218(%r13,%r14)
movb %r12b, 0x1f1(%r13,%r14)
leaq 0x297d6e(%rip), %r14    # 0x33ba40
leaq 0x2695bb(%rip), %rax    # 0x30d294
movl $0x21, (%rax)
leaq 0x7a28a(%rip), %rax     # 0x11df70
leaq 0x19b20b(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
movl %r15d, %edi
callq 0xdbb74
leaq 0x26964d(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl %r15d, %edi
callq 0x5ced3
decl %ebx
cmpl $0x1, %ebx
jg 0xa3c48
movl $0xa, %edi
callq 0x83e83
movl $0x1, %edi
callq 0x83e83
testl %eax, %eax
je 0xa3d5a
leaq 0x297d0d(%rip), %rdi    # 0x33ba40
callq 0x95e0
leal (,%rax,8), %ecx
movl $0x5050403, %edx        # imm = 0x5050403
shrl %cl, %edx
cmpl $0x4, %eax
movl $0x63, %eax
cmovbl %edx, %eax
leaq 0x269378(%rip), %rcx    # 0x30d0d0
movb %al, (%rcx)
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x83e83