// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_scpi_status(unsigned char)
void get_scpi_status(u08 c)
{
   if(c == 0x0D) return;

   if(c == 0x0A) {  // end-of-line, process it
      strupr(scpi_status_line);
      if(strstr(scpi_status_line, "SELF TEST")) {
         parse_scpi_status_test();
         scpi_status = 0;
poll_next_scpi(); //;;;;;;;;
      }
      else if(strstr(scpi_status_line, "PRN") && strstr(scpi_status_line, "EL")) {  // tracking info follows
         if(strstr(scpi_status_line, "SS")) adjust_scpi_ss = 1;
         else                               adjust_scpi_ss = 0;
         scpi_status = 2;
         if(rcvr_type == UCCM_RCVR) {
            reset_sat_tracking();
         }
      }
      else if(strstr(scpi_status_line, "ELEV") && strstr(scpi_status_line, "MASK")) {  // end of tracking info
         scpi_status = 4; // skip lines until we see the "SELF TEST" or "------------" end-of-status line
      }
      if(scpi_status == 2) {
         parse_scpi_azel();
      }

      scpi_col = 0;
      scpi_status_line[0] = 0;
   }
   else {
      if(scpi_col < ((int)sizeof(scpi_status_line)-2)) {
         scpi_status_line[scpi_col++] = c;
         scpi_status_line[scpi_col] = 0;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dil, %al
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0xd, %eax
jne 0xd973c
jmp 0xd98ab
movzbl -0x1(%rbp), %eax
cmpl $0xa, %eax
jne 0xd986d
leaq 0x2f25c0(%rip), %rdi    # 0x3cbd10
callq 0x9890
leaq 0x2f25b4(%rip), %rdi    # 0x3cbd10
leaq 0xaf141(%rip), %rsi     # 0x1888a4
callq 0x9090
cmpq $0x0, %rax
je 0xd9787
callq 0xd9500
movl $0x0, 0x2f5a37(%rip)    # 0x3cf1b4
callq 0x97d50
jmp 0xd984c
leaq 0x2f2582(%rip), %rdi    # 0x3cbd10
leaq 0xbc542(%rip), %rsi     # 0x195cd7
callq 0x9090
cmpq $0x0, %rax
je 0xd980c
leaq 0x2f2569(%rip), %rdi    # 0x3cbd10
leaq 0x967a7(%rip), %rsi     # 0x16ff55
callq 0x9090
cmpq $0x0, %rax
je 0xd980c
leaq 0x2f2550(%rip), %rdi    # 0x3cbd10
leaq 0xbc7db(%rip), %rsi     # 0x195fa2
callq 0x9090
cmpq $0x0, %rax
je 0xd97e1
leaq 0x1a0a23(%rip), %rax    # 0x27a1fc
movl $0x1, (%rax)
jmp 0xd97ee
leaq 0x1a0a14(%rip), %rax    # 0x27a1fc
movl $0x0, (%rax)
movl $0x2, 0x2f59bc(%rip)    # 0x3cf1b4
leaq 0x19e2b1(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0xd980a
callq 0x81c10
jmp 0xd984a
leaq 0x2f24fd(%rip), %rdi    # 0x3cbd10
leaq 0xaf094(%rip), %rsi     # 0x1888ae
callq 0x9090
cmpq $0x0, %rax
je 0xd9848
leaq 0x2f24e4(%rip), %rdi    # 0x3cbd10
leaq 0xac963(%rip), %rsi     # 0x186196
callq 0x9090
cmpq $0x0, %rax
je 0xd9848
movl $0x4, 0x2f596c(%rip)    # 0x3cf1b4
jmp 0xd984a
jmp 0xd984c
cmpl $0x2, 0x2f5961(%rip)    # 0x3cf1b4
jne 0xd985a
callq 0xd9010
movl $0x0, 0x2f2530(%rip)    # 0x3cbd94
movb $0x0, 0x2f24a5(%rip)    # 0x3cbd10
jmp 0xd98ab
cmpl $0x7f, 0x2f2520(%rip)   # 0x3cbd94
jge 0xd98a9
movb -0x1(%rbp), %dl
movl 0x2f2515(%rip), %eax    # 0x3cbd94
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x2f250a(%rip)    # 0x3cbd94
movslq %eax, %rcx
leaq 0x2f247c(%rip), %rax    # 0x3cbd10
movb %dl, (%rax,%rcx)
movslq 0x2f24f6(%rip), %rcx    # 0x3cbd94
leaq 0x2f246b(%rip), %rax    # 0x3cbd10
movb $0x0, (%rax,%rcx)
jmp 0xd98ab
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)