// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x18, %rsp
leaq 0x7e8ce(%rip), %rdi     # 0x10f467
callq 0x520bf
cmpl $0x0, 0x2c9443(%rip)    # 0x359fe8
je 0x90bd8
leaq 0x2668ee(%rip), %rax    # 0x2f749c
movl $0x8, (%rax)
leaq 0x2666f5(%rip), %rax    # 0x2f72b0
leaq 0x266616(%rip), %rcx    # 0x2f71d8
orb $0x8, (%rcx)
pushq $0x1
popq %rcx
movl %ecx, (%rax)
leaq 0x2666bf(%rip), %rax    # 0x2f7290
movl %ecx, (%rax)
jmp 0x90cf2
leaq 0x171cf1(%rip), %rax    # 0x2028d0
cmpq $0x8, (%rax)
jne 0x90cf2
leaq 0x2666c0(%rip), %rax    # 0x2f72b0
andl $0x0, (%rax)
leaq 0x2665de(%rip), %rbx    # 0x2f71d8
movl (%rbx), %r14d
movl %r14d, %r15d
andl $-0x9, %r15d
movl %r15d, (%rbx)
leaq 0x266682(%rip), %rax    # 0x2f7290
movl $0x1, (%rax)
leaq 0x2c5f25(%rip), %rdi    # 0x356b40
leaq 0x810fa(%rip), %rsi     # 0x111d1c
callq 0x9090
testq %rax, %rax
je 0x90cf2
leaq 0x2c5f09(%rip), %rdi    # 0x356b40
leaq 0x7e833(%rip), %rsi     # 0x10f471
callq 0x9090
testq %rax, %rax
je 0x90c89
leaq 0x266481(%rip), %rcx    # 0x2f70d0
movb $0xb, (%rcx)
orl $0x20, %r15d
movl %r15d, (%rbx)
leaq 0x174380(%rip), %rcx    # 0x204fe0
cmpl $0x53, (%rcx)
jne 0x90cd0
addq $0x7, %rax
movq %rax, %rdi
callq 0x95e0
leaq 0x267214(%rip), %rcx    # 0x2f7e8c
movl %eax, (%rcx)
leaq 0x26720f(%rip), %rax    # 0x2f7e90
movl $0x6, (%rax)
jmp 0x90cf2
leaq 0x2c5eb0(%rip), %rdi    # 0x356b40
leaq 0x8f268(%rip), %rsi     # 0x11feff
callq 0x9090
testq %rax, %rax
jne 0x90cbd
leaq 0x2c5e98(%rip), %rdi    # 0x356b40
leaq 0x7e7c9(%rip), %rsi     # 0x10f478
callq 0x9090
testq %rax, %rax
je 0x90f3f
leaq 0x26640c(%rip), %rax    # 0x2f70d0
movb $0x7, (%rax)
andl $-0x29, %r14d
movl %r14d, (%rbx)
jmp 0x90cf2
addq $0x9, %rax
movq %rax, %rdi
callq 0x95e0
leaq 0x2671a9(%rip), %rcx    # 0x2f7e8c
movl %eax, (%rcx)
leaq 0x2671a4(%rip), %rax    # 0x2f7e90
movl $0x7, (%rax)
leaq 0x2c5e47(%rip), %rbx    # 0x356b40
pushq $0x2a
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x9100
testq %rax, %rax
je 0x90d12
movb $0x20, (%rax)
jmp 0x90cfd
movb $0x0, 0x2c5e38(%rip)    # 0x356b51
leaq 0x2c5e20(%rip), %rdi    # 0x356b40
leaq -0x20(%rbp), %rbx
orl $-0x1, (%rbx)
leaq -0x24(%rbp), %rcx
orl $-0x1, (%rcx)
leaq -0x28(%rbp), %r8
orl $-0x1, (%r8)
leaq -0x1c(%rbp), %r14
orl $-0x1, (%r14)
leaq 0x62e1f(%rip), %rsi     # 0xf3b64
movq %r14, %rdx
movq %rbx, %r9
xorl %eax, %eax
callq 0x9350
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 0x90e6a
movl -0x28(%rbp), %ecx
movl -0x24(%rbp), %edx
movl %ecx, %esi
orl %edx, %esi
js 0x90daa
cvtsi2ss %ecx, %xmm0
cvtsi2ss %edx, %xmm1
callq 0x53b74
leaq 0x2664f6(%rip), %rax    # 0x2f7294
movl $0xa, (%rax)
movl -0x20(%rbp), %eax
movl -0x1c(%rbp), %edi
cvtsi2ss %eax, %xmm0
movslq %edi, %rcx
imulq $0x348, %rcx, %rdx      # imm = 0x348
leaq 0x1981f1(%rip), %rbx    # 0x228fb0
movss %xmm0, 0x20(%rbx,%rdx)
leaq 0x174250(%rip), %rdx    # 0x20501c
cmpl $0x0, (%rdx)
je 0x90e0e
leaq 0x8017e(%rip), %r14     # 0x110f56
testl %eax, %eax
jle 0x90e15
cvtsi2sd %eax, %xmm0
callq 0x9160
mulsd 0x64dcb(%rip), %xmm0    # 0xf5bb8
addsd 0x77923(%rip), %xmm0    # 0x108718
cvtsd2ss %xmm0, %xmm0
movl -0x1c(%rbp), %edi
movslq %edi, %rcx
imulq $0x348, %rcx, %rax      # imm = 0x348
movss %xmm0, 0x20(%rbx,%rax)
jmp 0x90e15
leaq 0x7e669(%rip), %r14     # 0x10f47e
leaq 0x1980dc(%rip), %rax    # 0x228ef8
movq %r14, (%rax)
imulq $0x348, %rcx, %rax      # imm = 0x348
movl $0xf, 0x1c(%rbx,%rax)
callq 0xca4da
leaq 0x266512(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
incl 0x2cb08e(%rip)          # 0x35bed0
leaq 0x171a87(%rip), %rax    # 0x2028d0
cmpq $0x8, (%rax)
movslq -0x1c(%rbp), %rdi
jne 0x90e65
imulq $0x348, %rdi, %rax      # imm = 0x348
movl $0x1, 0x218(%rbx,%rax)
callq 0x559ba
andl $0x0, -0x20(%rbp)
leaq -0x24(%rbp), %rbx
orl $-0x1, (%rbx)
leaq -0x28(%rbp), %r14
orl $-0x1, (%r14)
leaq -0x1c(%rbp), %r15
orl $-0x1, (%r15)
leaq 0x2c5cc6(%rip), %rdi    # 0x356b52
leaq 0x62cd4(%rip), %rsi     # 0xf3b67
movq %r15, %rdx
movq %rbx, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x9350
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 0x90f34
cvtsi2ss %eax, %xmm0
cvtsi2ss %ecx, %xmm1
callq 0x53b74
leaq 0x2663ab(%rip), %rax    # 0x2f7294
movl $0xb, (%rax)
movslq -0x1c(%rbp), %rdi
imulq $0x348, %rdi, %rax      # imm = 0x348
leaq 0x1980af(%rip), %rcx    # 0x228fb0
movabsq $0x3a83126f00000010, %rdx # imm = 0x3A83126F00000010
movq %rdx, 0x1c(%rcx,%rax)
orl $-0x1, 0x218(%rcx,%rax)
callq 0xca4da
leaq 0x266428(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
incl 0x2cafa8(%rip)          # 0x35bed4
movl -0x1c(%rbp), %edi
callq 0x559ba
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26618a(%rip), %rax    # 0x2f70d0
movb $0x63, (%rax)
jmp 0x90cf2