// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7d9f6(%rip), %rdi     # 0x125fa7
callq 0x58dc2
movl $0x560, %eax            # imm = 0x560
leaq 0x1969ee(%rip), %r13    # 0x23efb0
xorl %ecx, %ecx
movl %ecx, -0x1fc(%r13,%rax)
movl %ecx, (%r13,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd358, %rax          # imm = 0xCD358
jne 0xa85c4
leaq 0x196926(%rip), %rax    # 0x23ef0c
movl $0x0, (%rax)
leaq 0x28fc61(%rip), %rax    # 0x338254
movzwl (%rax), %eax
leaq 0x28fc55(%rip), %rcx    # 0x338252
xorl %edi, %edi
cmpw (%rcx), %ax
jae 0xa8746
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8620
leaq 0x196953(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8639
leaq 0x19693a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa864f
leaq 0x196924(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8668
leaq 0x19690b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588d2
movl %eax, %r12d
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8686
leaq 0x1968ed(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %r15b, %ecx
leal 0x40(%rcx), %r15d
cmpb $0x2, %bl
cmovnel %ecx, %r15d
testl %r15d, %r15d
je 0xa8723
movl %r15d, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
cmpb $0x1, %al
movl $0x0, %edx
sbbl %edx, %edx
movl $0x4d, 0x1c(%r13,%rcx)
orl $0x1, %edx
movl %edx, 0x218(%r13,%rcx)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x20(%r13,%rcx)
movswl %r12w, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movzbl %r14b, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movl %r15d, %edi
callq 0x5ace1
movl %r15d, %edi
callq 0xdc1dd
leaq 0x264c49(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl %r15d, %edi
callq 0x5cdab
leaq 0x1967f8(%rip), %rax    # 0x23ef0c
incl (%rax)
leaq 0x264bfb(%rip), %rax    # 0x30d318
movl $0xde, (%rax)
leaq 0x28fb2a(%rip), %rax    # 0x338254
movzwl (%rax), %eax
leaq 0x28fb1e(%rip), %rcx    # 0x338252
cmpw (%rcx), %ax
jb 0xa8608
leaq 0x1967c8(%rip), %rax    # 0x23ef0c
movl (%rax), %edi
leaq 0x758ae(%rip), %rax     # 0x11dffb
leaq 0x1967a4(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5e390