// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpgsv(int)
void parse_gpgsv(int system)
{
int num_sents;
int sent_num;
int sat_count;
int prn;
int az, el;
int snr;
int i;

   if((system & system_mask) == 0) return;

   if(get_msg_field()) {
      num_sents = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {
      sent_num = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {
      sat_count = atoi(msg_field);
      have_count = 1;
   }

//   if(sent_num == 1) {  // reset sat tracking info 
   if(last_was_gsv == 0) {  // reset sat tracking info 
      reset_sat_tracking();
   }

   last_was_gsv = 1;

   for(i=0; i<4; i++) {
      if(get_msg_field()) prn = atoi(msg_field);
      else continue;

      if(get_msg_field()) el = atoi(msg_field);
      else continue;

      if(get_msg_field()) az = atoi(msg_field);
      else continue;

      if(get_msg_field()) snr = atoi(msg_field);
      else {
         snr = (0);
//       continue;
      }

      if((prn >= 1) && (prn <= MAX_PRN)) { 
         sat[prn].level_msg = 1;
         set_sat_azel(prn, (float) az, (float) el);
         sat[prn].sig_level = (float) snr;
         have_snr |= rinex_gnss(prn);
         if(snr > 0) sat[prn].tracking = prn;
         else        sat[prn].tracking = (-1);
         have_sat_azel = 2;

         record_sig_levels(prn);
      }
   }

   if(sent_num == num_sents) {
      level_type = "SNR";
      if((rcvr_type == BRANDY_RCVR) && (have_gpgsv == 0)) {
         new_queue(RESET_ALL_QUEUES, 1504);
      }
      have_gpgsv = system;
   }

   config_sat_count(sat_count);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xef7b8(%rip), %rax     # 0x170c70
testl %edi, (%rax)
je 0x81515
movl %edi, %ebx
callq 0x810b1
testl %eax, %eax
je 0x81515
leaq 0x2ba572(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r14d
callq 0x810b1
testl %eax, %eax
je 0x81515
leaq 0x2ba55a(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, -0x34(%rbp)
callq 0x810b1
testl %eax, %eax
je 0x81524
leaq 0x2ba542(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, -0x30(%rbp)
leaq 0x28be0b(%rip), %rax    # 0x30d318
movl $0x1, (%rax)
jmp 0x81524
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, -0x38(%rbp)
movl %ebx, -0x2c(%rbp)
cmpl $0x0, 0x2f08f2(%rip)    # 0x371e24
jne 0x8155a
movl $0x218, %eax            # imm = 0x218
leaq 0x1bda70(%rip), %rcx    # 0x23efb0
xorl %edx, %edx
movl %edx, (%rcx,%rax)
movl %edx, -0x1fc(%rcx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd358, %rax          # imm = 0xCD358
jne 0x81542
movl $0x1, 0x2f08c0(%rip)    # 0x371e24
movl $0x4, %r13d
leaq 0x2ba4cf(%rip), %rbx    # 0x33ba40
callq 0x810b1
testl %eax, %eax
je 0x81670
movq %rbx, %rdi
callq 0x95e0
movl %eax, %r15d
callq 0x810b1
testl %eax, %eax
je 0x81670
movq %rbx, %rdi
callq 0x95e0
movl %eax, %r12d
callq 0x810b1
testl %eax, %eax
je 0x81670
movq %rbx, %rdi
callq 0x95e0
movl %eax, -0x3c(%rbp)
callq 0x810b1
testl %eax, %eax
je 0x815cf
movq %rbx, %rdi
callq 0x95e0
movl %eax, %r14d
jmp 0x815d2
xorl %r14d, %r14d
leal -0x1(%r15), %eax
cmpl $0x3e6, %eax            # imm = 0x3E6
ja 0x81670
movl %r15d, %eax
imulq $0x348, %rax, %rbx      # imm = 0x348
xorps %xmm0, %xmm0
cvtsi2ssl -0x3c(%rbp), %xmm0
leaq 0x1bd9b6(%rip), %rax    # 0x23efb0
movl $0x1, 0x1c(%rax,%rbx)
xorps %xmm1, %xmm1
cvtsi2ss %r12d, %xmm1
movl %r15d, %edi
callq 0x5ace1
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
leaq 0x1bd98f(%rip), %rax    # 0x23efb0
movss %xmm0, 0x20(%rax,%rbx)
movl %r15d, %edi
callq 0xdc1dd
leaq 0x28bd16(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
testl %r14d, %r14d
movl %r15d, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovlel %ecx, %eax
leaq 0x1bd963(%rip), %rcx    # 0x23efb0
movl %eax, 0x218(%rcx,%rbx)
leaq 0x2ba3e5(%rip), %rbx    # 0x33ba40
leaq 0x28bc32(%rip), %rax    # 0x30d294
movl $0x2, (%rax)
movl %r15d, %edi
callq 0x5cdab
decl %r13d
jne 0x81571
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0x816c2
leaq 0x9c973(%rip), %rax     # 0x11dffb
leaq 0x1bd869(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
leaq 0x197237(%rip), %rax    # 0x2188d0
cmpq $0x40000, (%rax)        # imm = 0x40000
leaq 0x199a3d(%rip), %rbx    # 0x21b0e4
jne 0x816bd
cmpl $0x0, (%rbx)
jne 0x816bd
movl $0x7, %edi
movl $0x5e0, %esi            # imm = 0x5E0
callq 0x1118c
movl -0x2c(%rbp), %eax
movl %eax, (%rbx)
movl -0x30(%rbp), %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5e390