// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_azel()
void parse_scpi_azel()
{
int n;
int prn, aaa,eee,sss;
char *s;

   // process the SYST:STAT? az/el info line
   log_packet_id("scpi azel");

   if(no_uccm_ref) {
      gps_status = GPS_NO_SATS;
      have_gps_status = 1;
      minor_alarms |= MINOR_NO_TRACK;
      have_tracking = 1;
   }
   else if(rcvr_type == UCCM_RCVR) {
      have_gps_status = 0;
      minor_alarms &= (~MINOR_NO_TRACK);
      have_tracking = 1;

      if(strstr(scpi_status_line, "MODE")) {
         s = strstr(scpi_status_line, "SURVEY");
         if(s) {
            rcvr_mode = RCVR_MODE_SURVEY;
            minor_alarms |= (MINOR_SURVEY);
            if(scpi_type == SAMSUNG_TYPE) {
               survey_progress = atoi(s+7);
               have_progress = 6;
            }
            else {
               survey_progress = atoi(s+9);
               have_progress = 7;
            }
         }
         else if(strstr(scpi_status_line, "HOLD")) {
            rcvr_mode = RCVR_MODE_HOLD;
            minor_alarms &= (~MINOR_SURVEY);
         }
         else if(strstr(scpi_status_line, "FIXED")) {  // samsung
            rcvr_mode = RCVR_MODE_HOLD;
            minor_alarms &= (~MINOR_SURVEY);
         }
         else {
            rcvr_mode = RCVR_MODE_UNKNOWN;
         }
      }
   }

   while(1) {  // convert '*' (attempting to track) to ' '
      s = strchr(scpi_status_line, '*');
      if(s == 0) break;
      *s = ' ';
   }
   scpi_status_line[17] = 0; // break line between TRACKED and NOT-TRACKED areas

   prn = aaa = eee = sss = (-1);
   n = sscanf(scpi_status_line, "%d %d %d %d", &prn, &eee,&aaa,&sss);
   if((n == 4) && (prn >= 1) && (prn <= MAX_PRN) && (sss >= 0)) {  // 32
      if((aaa >= 0) && (eee >= 0)) {
         set_sat_azel(prn, (float) aaa, (float) eee);
         have_sat_azel = 10;
      }

      sat[prn].sig_level = ((float) sss);
      if(adjust_scpi_ss) {  // scale sig strength level to 0..50
         if(sss > 0) {
            sat[prn].sig_level = (float) (20.0 * log10((double) sss) + 6.00);
         }
         level_type = "SIG";
      }
      else level_type = "C/N";

      sat[prn].level_msg = 15;
      have_snr |= rinex_gnss(prn);
      ++scpi_tracked;
if(rcvr_type == UCCM_RCVR) sat[prn].tracking = 1; // uuuuuu
      record_sig_levels(prn);
   }

   // get not-tracked info
   sss = 0; 
   prn = aaa = eee = (-1);
   n = sscanf(&scpi_status_line[17+1], "%d %d %d", &prn, &eee,&aaa);
   if((n == 3) && (prn >= 1) && (prn <= MAX_PRN) && (aaa >= 0) && (eee >= 0)) { // 32
      set_sat_azel(prn, (float) aaa, (float) eee);
      have_sat_azel = 11;

      sat[prn].sig_level = ((float) 0.001);  // sig levek >0 and <1 allows untracked sat to show in sat map
      sat[prn].level_msg = 16;
      sat[prn].tracking = (-1); // uuuuuu
      have_snr |= rinex_gnss(prn);
      ++scpi_not_tracked;
      record_sig_levels(prn);
   }

   if(0) {  // second column of untracked sats
      sss = 0;
      prn = aaa = eee = (-1);
      n = sscanf(&scpi_status_line[30+1], "%d %d %d", &prn, &eee,&aaa);
      if((n == 3) && (prn >= 1) && (prn <= MAX_PRN) && (aaa >= 0) && (eee >= 0)) { // 32
         set_sat_azel(prn, (float) aaa, (float) eee);
         have_sat_azel = 11;

         sat[prn].sig_level = ((float) 0.001);  // sig levek >0 and <1 allows untracked sat to show in sat map
         sat[prn].level_msg = 16;
         sat[prn].tracking = (-1); // uuuuuu
         have_snr |= rinex_gnss(prn);
         ++scpi_not_tracked;
         record_sig_levels(prn);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x859a1(%rip), %rdi     # 0x12551f
callq 0x58dc2
cmpl $0x0, 0x2d045e(%rip)    # 0x36ffe8
je 0x9fbbf
leaq 0x26d909(%rip), %rax    # 0x30d49c
movl $0x8, (%rax)
leaq 0x26d710(%rip), %rax    # 0x30d2b0
leaq 0x26d631(%rip), %rcx    # 0x30d1d8
orb $0x8, (%rcx)
movl $0x1, %ecx
movl %ecx, (%rax)
leaq 0x26d6d8(%rip), %rax    # 0x30d290
movl %ecx, (%rax)
jmp 0x9fcdc
leaq 0x178d0a(%rip), %rax    # 0x2188d0
cmpq $0x8, (%rax)
jne 0x9fcdc
leaq 0x26d6d9(%rip), %rax    # 0x30d2b0
movl $0x0, (%rax)
leaq 0x26d5f4(%rip), %rbx    # 0x30d1d8
movl (%rbx), %r14d
movl %r14d, %r15d
andl $-0x9, %r15d
movl %r15d, (%rbx)
leaq 0x26d698(%rip), %rax    # 0x30d290
movl $0x1, (%rax)
leaq 0x2ccf3b(%rip), %rdi    # 0x36cb40
leaq 0x881cb(%rip), %rsi     # 0x127dd7
callq 0x9090
testq %rax, %rax
je 0x9fcdc
leaq 0x2ccf1f(%rip), %rdi    # 0x36cb40
leaq 0x85901(%rip), %rsi     # 0x125529
callq 0x9090
testq %rax, %rax
je 0x9fc73
leaq 0x26d497(%rip), %rcx    # 0x30d0d0
movb $0xb, (%rcx)
orl $0x20, %r15d
movl %r15d, (%rbx)
leaq 0x17b396(%rip), %rcx    # 0x21afe0
cmpl $0x53, (%rcx)
jne 0x9fcba
addq $0x7, %rax
movq %rax, %rdi
callq 0x95e0
leaq 0x26e22a(%rip), %rcx    # 0x30de8c
movl %eax, (%rcx)
leaq 0x26e225(%rip), %rax    # 0x30de90
movl $0x6, (%rax)
jmp 0x9fcdc
leaq 0x2ccec6(%rip), %rdi    # 0x36cb40
leaq 0x96372(%rip), %rsi     # 0x135ff3
callq 0x9090
testq %rax, %rax
jne 0x9fca7
leaq 0x2cceae(%rip), %rdi    # 0x36cb40
leaq 0x85897(%rip), %rsi     # 0x125530
callq 0x9090
testq %rax, %rax
je 0x9ff51
leaq 0x26d422(%rip), %rax    # 0x30d0d0
movb $0x7, (%rax)
andl $-0x29, %r14d
movl %r14d, (%rbx)
jmp 0x9fcdc
addq $0x9, %rax
movq %rax, %rdi
callq 0x95e0
leaq 0x26e1bf(%rip), %rcx    # 0x30de8c
movl %eax, (%rcx)
leaq 0x26e1ba(%rip), %rax    # 0x30de90
movl $0x7, (%rax)
leaq 0x2cce5d(%rip), %rdi    # 0x36cb40
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
je 0x9fd0e
leaq 0x2cce47(%rip), %rbx    # 0x36cb40
movb $0x20, (%rax)
movq %rbx, %rdi
movl $0x2a, %esi
callq 0x9100
testq %rax, %rax
jne 0x9fcf9
movb $0x0, 0x2cce3c(%rip)    # 0x36cb51
leaq 0x2cce24(%rip), %rdi    # 0x36cb40
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
leaq -0x28(%rbp), %rbx
movl %r12d, (%rbx)
leaq -0x2c(%rbp), %rcx
movl %r12d, (%rcx)
leaq -0x30(%rbp), %r8
movl %r12d, (%r8)
leaq -0x24(%rbp), %r14
movl %r12d, (%r14)
leaq 0x69dcf(%rip), %rsi     # 0x109b14
movq %r14, %rdx
movq %rbx, %r9
xorl %eax, %eax
callq 0x9360
cmpl $0x4, %eax
sete %cl
movl (%r14), %edi
leal -0x1(%rdi), %eax
cmpl $0x3e7, %eax            # imm = 0x3E7
setb %dl
movl (%rbx), %eax
testl %eax, %eax
setns %sil
andb %cl, %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x9fe70
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %edx
movl %ecx, %esi
orl %edx, %esi
js 0x9fdaa
cvtsi2ss %ecx, %xmm0
cvtsi2ss %edx, %xmm1
callq 0x5ace1
leaq 0x26d4f6(%rip), %rax    # 0x30d294
movl $0xa, (%rax)
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %edi
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movslq %edi, %rcx
imulq $0x348, %rcx, %rdx      # imm = 0x348
leaq 0x19f1ee(%rip), %rbx    # 0x23efb0
movss %xmm0, 0x20(%rbx,%rdx)
leaq 0x17b24d(%rip), %rdx    # 0x21b01c
cmpl $0x0, (%rdx)
je 0x9fe14
leaq 0x87236(%rip), %r14     # 0x127011
testl %eax, %eax
jle 0x9fe1b
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x9160
mulsd 0x6bd4d(%rip), %xmm0    # 0x10bb40
addsd 0x7e9a5(%rip), %xmm0    # 0x11e7a0
cvtsd2ss %xmm0, %xmm0
movl -0x24(%rbp), %edi
movslq %edi, %rcx
imulq $0x348, %rcx, %rax      # imm = 0x348
movss %xmm0, 0x20(%rbx,%rax)
jmp 0x9fe1b
leaq 0x8571b(%rip), %r14     # 0x125536
leaq 0x19f0d6(%rip), %rax    # 0x23eef8
movq %r14, (%rax)
imulq $0x348, %rcx, %rax      # imm = 0x348
movl $0xf, 0x1c(%rbx,%rax)
callq 0xdc1dd
leaq 0x26d50c(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
incl 0x2d2088(%rip)          # 0x371ed0
leaq 0x178a81(%rip), %rax    # 0x2188d0
cmpq $0x8, (%rax)
movslq -0x24(%rbp), %rdi
jne 0x9fe6b
imulq $0x348, %rdi, %rax      # imm = 0x348
movl $0x1, 0x218(%rbx,%rax)
callq 0x5cdab
movl $0x0, -0x28(%rbp)
leaq -0x2c(%rbp), %rbx
movl %r12d, (%rbx)
leaq -0x30(%rbp), %r14
movl %r12d, (%r14)
leaq -0x24(%rbp), %r15
movl %r12d, (%r15)
leaq 0x2cccbf(%rip), %rdi    # 0x36cb52
leaq 0x69c7d(%rip), %rsi     # 0x109b17
movq %r15, %rdx
movq %rbx, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x9360
cmpl $0x3, %eax
sete %cl
movl (%r15), %edi
leal -0x1(%rdi), %eax
cmpl $0x3e7, %eax            # imm = 0x3E7
setb %dl
movl (%r14), %eax
testl %eax, %eax
setns %sil
andb %cl, %sil
andb %dl, %sil
movl (%rbx), %ecx
testl %ecx, %ecx
setns %dl
andb %sil, %dl
cmpb $0x1, %dl
jne 0x9ff44
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
callq 0x5ace1
leaq 0x26d39e(%rip), %rax    # 0x30d294
movl $0xb, (%rax)
movslq -0x24(%rbp), %rdi
imulq $0x348, %rdi, %rax      # imm = 0x348
leaq 0x19f0a2(%rip), %rcx    # 0x23efb0
movabsq $0x3a83126f00000010, %rdx # imm = 0x3A83126F00000010
movq %rdx, 0x1c(%rcx,%rax)
movl $0xffffffff, 0x218(%rcx,%rax) # imm = 0xFFFFFFFF
callq 0xdc1dd
leaq 0x26d418(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
incl 0x2d1f98(%rip)          # 0x371ed4
movl -0x24(%rbp), %edi
callq 0x5cdab
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26d178(%rip), %rax    # 0x30d0d0
movb $0x63, (%rax)
jmp 0x9fcdc