// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_sats()
void parse_nvs_sats()
{
u08 sat_sys;
int prn;
u08 slot;
u08 el;
s16 az;
u08 snr;

   // 0x52 packet
   log_packet_id("nvs_sats");

   for(prn=1; prn<=MAX_PRN; prn++) {  // reset tracking info
      sat[prn].level_msg = 0;
      sat[prn].tracking = 0;
   }

   sat_count = 0;
   while(tsip_rptr < (tsip_wptr-0)) {
      sat_sys = tsip_byte();
      prn = (int) tsip_byte();
      slot = tsip_byte();
      el = tsip_byte();
      az = (s16) tsip_word();
      snr = tsip_byte();

      if(sat_sys == 2) prn += NVS_GLONASS_PRN;

      if((prn >= 1) && (prn <= MAX_PRN)) {
         sat[prn].level_msg = 77;
         if(snr) sat[prn].tracking = 1;
         else    sat[prn].tracking = (-1);
         sat[prn].sig_level = (float) snr;
         set_sat_azel(prn, (float) az, (float) el);
         have_snr |= rinex_gnss(prn);
         record_sig_levels(prn);
         ++sat_count;
         have_count = 222;
      }
   }

   level_type = "SNR";
   config_sat_count(sat_count); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xa4fcb(%rip), %rdi     # 0x1892fa
callq 0x7add0
movl $0x1, -0x8(%rbp)
cmpl $0x3e7, -0x8(%rbp)      # imm = 0x3E7
jg 0xe438a
movslq -0x8(%rbp), %rcx
leaq 0x1b9e41(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x0, 0x1c(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x1b9e25(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x0, 0x218(%rax)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xe433b
leaq 0x1b9d5b(%rip), %rax    # 0x29e0ec
movl $0x0, (%rax)
leaq 0x2b3096(%rip), %rax    # 0x397434
movzwl (%rax), %eax
leaq 0x2b308a(%rip), %rcx    # 0x397432
movzwl (%rcx), %ecx
subl $0x0, %ecx
cmpl %ecx, %eax
jge 0xe44f8
callq 0x7a510
movb %al, -0x1(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x8(%rbp)
callq 0x7a510
movb %al, -0x9(%rbp)
callq 0x7a510
movb %al, -0xa(%rbp)
callq 0x7a560
movw %ax, -0xc(%rbp)
callq 0x7a510
movb %al, -0xd(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0x2, %eax
jne 0xe43fc
movl -0x8(%rbp), %eax
addl $0x40, %eax
movl %eax, -0x8(%rbp)
cmpl $0x1, -0x8(%rbp)
jl 0xe44f3
cmpl $0x3e7, -0x8(%rbp)      # imm = 0x3E7
jg 0xe44f3
movslq -0x8(%rbp), %rcx
leaq 0x1b9d72(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x4d, 0x1c(%rax)
cmpb $0x0, -0xd(%rbp)
je 0xe4456
movslq -0x8(%rbp), %rcx
leaq 0x1b9d50(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1, 0x218(%rax)
jmp 0xe4475
movslq -0x8(%rbp), %rcx
leaq 0x1b9d2f(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
movzbl -0xd(%rbp), %eax
cvtsi2ss %eax, %xmm0
movslq -0x8(%rbp), %rax
imulq $0x348, %rax, %rcx      # imm = 0x348
leaq 0x1b9d01(%rip), %rax    # 0x29e190
movss %xmm0, 0x20(%rax,%rcx)
movl -0x8(%rbp), %edi
movswl -0xc(%rbp), %eax
cvtsi2ss %eax, %xmm0
movzbl -0xa(%rbp), %eax
cvtsi2ss %eax, %xmm1
callq 0x7d450
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x28806e(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x288065(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
movl -0x8(%rbp), %edi
callq 0x80340
leaq 0x1b9c14(%rip), %rax    # 0x29e0ec
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x1b9c08(%rip), %rax    # 0x29e0ec
movl %ecx, (%rax)
leaq 0x28800b(%rip), %rax    # 0x36c4f8
movl $0xde, (%rax)
jmp 0xe4397
leaq 0x1b9bd9(%rip), %rax    # 0x29e0d8
leaq 0x9e510(%rip), %rcx     # 0x182a16
movq %rcx, (%rax)
leaq 0x1b9bdc(%rip), %rax    # 0x29e0ec
movl (%rax), %edi
callq 0x82080
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)