// File: /workspace/github_cpp_makefile_star2_O2/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 0x82cd3
cmpl $0xd, %edi
je 0x82cd3
cmpl $0xa, %edi
jne 0x82c96
pushq %rbp
movq %rsp, %rbp
movl 0x2d3fa3(%rip), %ecx    # 0x356bd0
incl %ecx
movl %ecx, 0x2d3f9b(%rip)    # 0x356bd0
leaq 0x1a5754(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x82c5f
movl 0x2d3f82(%rip), %edx    # 0x356bcc
leaq 0x8b1f4(%rip), %rsi     # 0x10de45
leaq 0x2d3ee8(%rip), %r8     # 0x356b40
xorl %eax, %eax
callq 0x9560
leaq 0x2d3eda(%rip), %rdi    # 0x356b40
callq 0x988f
movl $0xfffffd44, %eax       # imm = 0xFFFFFD44
addl 0x2d3f56(%rip), %eax    # 0x356bcc
cmpl $0xd, %eax
ja 0x82d01
leaq 0x869a2(%rip), %rcx     # 0x109628
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2bc, %edi            # imm = 0x2BC
jmp 0x82cfc
movslq 0x2d3f27(%rip), %rax    # 0x356bc4
cmpq $0x7e, %rax
jg 0x82cd3
leaq 0x1(%rax), %rcx
movl %ecx, 0x2d3f17(%rip)    # 0x356bc4
leaq 0x2d3e8c(%rip), %rcx    # 0x356b40
movb %dil, (%rax,%rcx)
movb $0x0, 0x1(%rax,%rcx)
cmpb $0x72, 0x2d3e7c(%rip)   # 0x356b40
jne 0x82cd3
cmpb $0x3e, 0x2d3e74(%rip)   # 0x356b41
je 0x82c23
retq
movl $0x2c5, %edi            # imm = 0x2C5
jmp 0x82cfc
movl $0x2bd, %edi            # imm = 0x2BD
jmp 0x82cfc
movl $0x2c9, %edi            # imm = 0x2C9
jmp 0x82cfc
callq 0x827b8
jmp 0x82d01
movl $0x2c1, %edi            # imm = 0x2C1
jmp 0x82cfc
movl $0x2c3, %edi            # imm = 0x2C3
callq 0x81484
leaq 0x2d3e38(%rip), %rdi    # 0x356b40
leaq 0x8af78(%rip), %rsi     # 0x10dc87
callq 0x9090
testq %rax, %rax
je 0x82d2c
andl $0x0, 0x2d3eac(%rip)    # 0x356bcc
andl $0x0, 0x2d3ea9(%rip)    # 0x356bd0
callq 0x6698e
andl $0x0, 0x2d3e91(%rip)    # 0x356bc4
movb $0x0, 0x2d3e06(%rip)    # 0x356b40
popq %rbp
jmp 0x8130d