// File: /workspace/github_cpp_makefile_star2_O3/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 0x83d8c
movl $0xa, %edi
callq 0x83d8c
testl %eax, %eax
je 0xa3d20
leaq 0x297d40(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x67bcb(%rip), %xmm0    # 0x10b8d8
mulsd 0x67bfb(%rip), %xmm0    # 0x10b910
leaq 0x2692b4(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
movl $0xb, %edi
callq 0x83d8c
testl %eax, %eax
je 0xa3d55
leaq 0x297d0b(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x67b96(%rip), %xmm0    # 0x10b8d8
mulsd 0x67bc6(%rip), %xmm0    # 0x10b910
leaq 0x269287(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
movl $0x9, %edi
callq 0x83d8c
testl %eax, %eax
je 0xa3d8a
leaq 0x297cd6(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x652e9(%rip), %xmm0    # 0x109060
divsd 0x67b29(%rip), %xmm0    # 0x10b8a8
leaq 0x26925a(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
movl $0x4, %edi
callq 0x83d8c
testl %eax, %eax
je 0xa3dc4
leaq 0x297ca1(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x652fc(%rip), %xmm0    # 0x1090a8
leaq 0x26926d(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
leaq 0x26957a(%rip), %rax    # 0x30d338
movl $0x37, (%rax)
movl $0x5, %edi
callq 0x83d8c
movl $0x4, %edi
callq 0x83d8c
testl %eax, %eax
je 0xa3e08
leaq 0x297c5d(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x652b8(%rip), %xmm0    # 0x1090a8
leaq 0x269231(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x269532(%rip), %rax    # 0x30d334
movl $0x37, (%rax)
movl $0x2, %edi
callq 0x83d8c
testl %eax, %eax
je 0xa3f2b
movl $0x218, %eax            # imm = 0x218
leaq 0x19b18a(%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 0xa3e28
leaq 0x297bf9(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
jle 0xa3f2b
movl %eax, %ebx
incl %ebx
leaq 0x297be1(%rip), %r14    # 0x33ba40
movl $0x2, %edi
callq 0x83d8c
movq %r14, %rdi
callq 0x95e0
movl %eax, %r15d
movl $0x2, %edi
callq 0x83d8c
movl %eax, %r12d
leal -0x1(%r15), %eax
cmpl $0x3e6, %eax            # imm = 0x3E6
ja 0xa3f20
movl %r15d, %eax
imulq $0x348, %rax, %r14      # imm = 0x348
leaq 0x19b10f(%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 0x7abac(%rip), %xmm1    # 0x11ea70
callq 0x5ace1
movl $0x42200000, 0x20(%r13,%r14) # imm = 0x42200000
movl %r15d, 0x218(%r13,%r14)
movb %r12b, 0x1f1(%r13,%r14)
leaq 0x297b57(%rip), %r14    # 0x33ba40
leaq 0x2693a4(%rip), %rax    # 0x30d294
movl $0x21, (%rax)
leaq 0x7a0fe(%rip), %rax     # 0x11dffb
leaq 0x19aff4(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
movl %r15d, %edi
callq 0xdc1dd
leaq 0x269436(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl %r15d, %edi
callq 0x5cdab
decl %ebx
cmpl $0x1, %ebx
ja 0xa3e5f
movl $0xa, %edi
callq 0x83d8c
movl $0x1, %edi
callq 0x83d8c
testl %eax, %eax
je 0xa3f71
leaq 0x297af6(%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 0x269161(%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 0x83d8c