// File: 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
subq $0x20, %rsp
movl $0x8, %edi
callq 0xb4d60
movl $0xa, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde160
leaq 0x2bcae8(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd 0x9106b(%rip), %xmm1    # 0x16f1b0
divsd %xmm1, %xmm0
movsd 0x9353f(%rip), %xmm1    # 0x171690
mulsd %xmm1, %xmm0
leaq 0x28e054(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
movl $0xb, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde19e
leaq 0x2bcaaa(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd 0x9102d(%rip), %xmm1    # 0x16f1b0
divsd %xmm1, %xmm0
movsd 0x93501(%rip), %xmm1    # 0x171690
mulsd %xmm1, %xmm0
leaq 0x28e01e(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
movl $0x9, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde1dc
leaq 0x2bca6c(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd 0x90e8f(%rip), %xmm1    # 0x16f050
divsd %xmm1, %xmm0
movsd 0x93463(%rip), %xmm1    # 0x171630
divsd %xmm1, %xmm0
leaq 0x28dfe8(%rip), %rax    # 0x36c1c0
movsd %xmm0, (%rax)
movl $0x4, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde21b
leaq 0x2bca2e(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd 0x90ec1(%rip), %xmm1    # 0x16f0c0
divsd %xmm1, %xmm0
leaq 0x28dff6(%rip), %rax    # 0x36c200
movsd %xmm0, (%rax)
leaq 0x28e303(%rip), %rax    # 0x36c518
movl $0x37, (%rax)
movl $0x5, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde22c
jmp 0xde22c
movl $0x4, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde26b
leaq 0x2bc9de(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd 0x90e71(%rip), %xmm1    # 0x16f0c0
divsd %xmm1, %xmm0
leaq 0x28dfae(%rip), %rax    # 0x36c208
movsd %xmm0, (%rax)
leaq 0x28e2af(%rip), %rax    # 0x36c514
movl $0x37, (%rax)
movl $0x2, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde3c8
callq 0x81c10
leaq 0x2bc996(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x4(%rbp)
cmpl $0x0, %eax
jle 0xde3c6
movl $0x2, %edi
callq 0xb4d60
leaq 0x2bc969(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
movl $0x2, %edi
callq 0xb4d60
movb %al, -0xd(%rbp)
cmpl $0x1, -0x8(%rbp)
jl 0xde3c1
cmpl $0x3e7, -0x8(%rbp)      # imm = 0x3E7
jg 0xde3c1
movslq -0x8(%rbp), %rcx
leaq 0x1bfea2(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1, 0x1c(%rax)
imull $0xa, -0x8(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x14(%rbp)
movl -0x8(%rbp), %edi
movss -0x14(%rbp), %xmm0
movss 0xa509c(%rip), %xmm1    # 0x1833b8
callq 0x7d450
movslq -0x8(%rbp), %rcx
leaq 0x1bfe64(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0xa5076(%rip), %xmm0    # 0x1833b4
movss %xmm0, 0x20(%rax)
movl -0x8(%rbp), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x1bfe3f(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0x218(%rax)
movb -0xd(%rbp), %cl
movslq -0x8(%rbp), %rdx
leaq 0x1bfe21(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movb %cl, 0x1f1(%rax)
leaq 0x28e0ee(%rip), %rax    # 0x36c474
movl $0x21, (%rax)
leaq 0x1bfd45(%rip), %rax    # 0x29e0d8
leaq 0xa467c(%rip), %rcx     # 0x182a16
movq %rcx, (%rax)
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x28e17e(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x28e175(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
movl -0x8(%rbp), %edi
callq 0x80340
jmp 0xde292
jmp 0xde3c8
movl $0xa, %edi
callq 0xb4d60
movl $0x1, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde44a
leaq 0x2bc838(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0xde402
leaq 0x28deb3(%rip), %rax    # 0x36c2b0
movb $0x3, (%rax)
jmp 0xde448
cmpl $0x1, -0xc(%rbp)
jne 0xde414
leaq 0x28dea1(%rip), %rax    # 0x36c2b0
movb $0x4, (%rax)
jmp 0xde446
cmpl $0x2, -0xc(%rbp)
jne 0xde426
leaq 0x28de8f(%rip), %rax    # 0x36c2b0
movb $0x5, (%rax)
jmp 0xde444
cmpl $0x3, -0xc(%rbp)
jne 0xde438
leaq 0x28de7d(%rip), %rax    # 0x36c2b0
movb $0x5, (%rax)
jmp 0xde442
leaq 0x28de71(%rip), %rax    # 0x36c2b0
movb $0x63, (%rax)
jmp 0xde444
jmp 0xde446
jmp 0xde448
jmp 0xde44a
movl $0x1, %edi
callq 0xb4d60
cmpl $0x0, %eax
je 0xde45b
jmp 0xde45b
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)