// File: /workspace/github_cpp_makefile_star2_O1/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 0x7db4a(%rip), %rdi     # 0x125ec7
callq 0x58e77
movl $0x560, %eax            # imm = 0x560
leaq 0x196c22(%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 0xa8390
leaq 0x196b5a(%rip), %rax    # 0x23ef0c
movl $0x0, (%rax)
leaq 0x28fe95(%rip), %rax    # 0x338254
movzwl (%rax), %eax
leaq 0x28fe89(%rip), %rcx    # 0x338252
cmpw (%rcx), %ax
jae 0xa84f2
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0xa83ea
leaq 0x196b89(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8403
leaq 0x196b70(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8419
leaq 0x196b5a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8432
leaq 0x196b41(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
movl %eax, %r12d
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8450
leaq 0x196b23(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %r15b, %ecx
leal 0x40(%rcx), %r15d
cmpb $0x2, %bl
cmovnel %ecx, %r15d
testl %r15d, %r15d
je 0xa83b8
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 0x5ad98
movl %r15d, %edi
callq 0xdbb74
leaq 0x264e7f(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl %r15d, %edi
callq 0x5ced3
leaq 0x196a2e(%rip), %rax    # 0x23ef0c
incl (%rax)
leaq 0x264e31(%rip), %rax    # 0x30d318
movl $0xde, (%rax)
jmp 0xa83b8
leaq 0x75a77(%rip), %rax     # 0x11df70
leaq 0x1969f8(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
leaq 0x196a02(%rip), %rax    # 0x23ef0c
movl (%rax), %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5e411