// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_x72_response(char)
void get_x72_response(char c)
{
   // get the data returned by the HEALTH, etc messages
   if(c == 0x0D) return;
   if(c == 0x00) return;

   if(c == 0x0A) {  // end-of-line,  process it
      response_end:
      ++x72_line;
if(debug_file) fprintf(debug_file, "get_x72_response %d, line:%2d: %s\n", x72_response,x72_line, scpi_status_line);

      strupr(scpi_status_line);
      if(x72_response == X72_HEALTH_MSG) {
         parse_x72_val(x72_response);
      }
      else if(x72_response == X72_GET_CREG_MSG) {
         parse_x72_val(x72_response);
      }
      else if(x72_response == X72_GET_PPS_MSG) {
         parse_x72_val(x72_response);
      }
      else if(x72_response == X72_SET_DDS_MSG) {
         parse_x72_val(x72_response);
      }
      else if(x72_response == X72_SET_SRVC_MSG) {
         parse_x72_val(x72_response);
      }
      else if(x72_response == X72_SET_FC_MSG) {
         parse_x72_val(x72_response);
      }
      else if(x72_response == X72_INFO_MSG) {
         parse_x72_info();
      }

      if(strstr(scpi_status_line, "R>")) {  // command line prompt
         x72_response = 0;
         x72_line = 0;
         poll_next_x72();
      }

      scpi_col = 0;
      scpi_status_line[0] = 0;
      update_x72_screen();
   }
   else {  // accumulate the status line
      if(scpi_col < ((int)sizeof(scpi_status_line)-2)) {
         scpi_status_line[scpi_col++] = c;
         scpi_status_line[scpi_col] = 0;
         if((scpi_status_line[0] == 'r') && (scpi_status_line[1] == '>')) {  // command line prompt -> end of message data
            goto response_end;
         }
      }
   }
}

// Assembly:
testl %edi, %edi
je 0x8f9e0
cmpl $0xd, %edi
je 0x8f9e0
cmpl $0xa, %edi
jne 0x8f9a3
pushq %rbp
movq %rsp, %rbp
movl 0x2dd296(%rip), %ecx    # 0x36cbd0
incl %ecx
movl %ecx, 0x2dd28e(%rip)    # 0x36cbd0
leaq 0x1aea47(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8f96c
movl 0x2dd275(%rip), %edx    # 0x36cbcc
leaq 0x9459f(%rip), %rsi     # 0x123efd
leaq 0x2dd1db(%rip), %r8     # 0x36cb40
xorl %eax, %eax
callq 0x9560
leaq 0x2dd1cd(%rip), %rdi    # 0x36cb40
callq 0x9899
movl $0xfffffd44, %eax       # imm = 0xFFFFFD44
addl 0x2dd249(%rip), %eax    # 0x36cbcc
cmpl $0xd, %eax
ja 0x8fa0e
leaq 0x8fd51(%rip), %rcx     # 0x11f6e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2bc, %edi            # imm = 0x2BC
jmp 0x8fa09
movslq 0x2dd21a(%rip), %rax    # 0x36cbc4
cmpq $0x7e, %rax
jg 0x8f9e0
leaq 0x1(%rax), %rcx
movl %ecx, 0x2dd20a(%rip)    # 0x36cbc4
leaq 0x2dd17f(%rip), %rcx    # 0x36cb40
movb %dil, (%rax,%rcx)
movb $0x0, 0x1(%rax,%rcx)
cmpb $0x72, 0x2dd16f(%rip)   # 0x36cb40
jne 0x8f9e0
cmpb $0x3e, 0x2dd167(%rip)   # 0x36cb41
je 0x8f930
retq
movl $0x2c5, %edi            # imm = 0x2C5
jmp 0x8fa09
movl $0x2bd, %edi            # imm = 0x2BD
jmp 0x8fa09
movl $0x2c9, %edi            # imm = 0x2C9
jmp 0x8fa09
callq 0x8f4a8
jmp 0x8fa0e
movl $0x2c1, %edi            # imm = 0x2C1
jmp 0x8fa09
movl $0x2c3, %edi            # imm = 0x2C3
callq 0x8e0e2
leaq 0x2dd12b(%rip), %rdi    # 0x36cb40
leaq 0x94323(%rip), %rsi     # 0x123d3f
callq 0x9090
testq %rax, %rax
je 0x8fa39
xorl %eax, %eax
movl %eax, 0x2dd19e(%rip)    # 0x36cbcc
movl %eax, 0x2dd19c(%rip)    # 0x36cbd0
callq 0x70000
movl $0x0, 0x2dd181(%rip)    # 0x36cbc4
movb $0x0, 0x2dd0f6(%rip)    # 0x36cb40
popq %rbp
jmp 0x8df68