// File: /workspace/github_cpp_makefile_star2_O1/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 0x8f985
cmpl $0xd, %edi
je 0x8f985
cmpl $0xa, %edi
jne 0x8f948
pushq %rbp
movq %rsp, %rbp
movl 0x2dd2f1(%rip), %ecx    # 0x36cbd0
incl %ecx
movl %ecx, 0x2dd2e9(%rip)    # 0x36cbd0
leaq 0x1aeaa2(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8f911
movl 0x2dd2d0(%rip), %edx    # 0x36cbcc
leaq 0x9451a(%rip), %rsi     # 0x123e1d
leaq 0x2dd236(%rip), %r8     # 0x36cb40
xorl %eax, %eax
callq 0x9560
leaq 0x2dd228(%rip), %rdi    # 0x36cb40
callq 0x9899
movl $0xfffffd44, %eax       # imm = 0xFFFFFD44
addl 0x2dd2a4(%rip), %eax    # 0x36cbcc
cmpl $0xd, %eax
ja 0x8f9b3
leaq 0x8fcd4(%rip), %rcx     # 0x11f60c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2bc, %edi            # imm = 0x2BC
jmp 0x8f9ae
movslq 0x2dd275(%rip), %rax    # 0x36cbc4
cmpq $0x7e, %rax
jg 0x8f985
leaq 0x1(%rax), %rcx
movl %ecx, 0x2dd265(%rip)    # 0x36cbc4
leaq 0x2dd1da(%rip), %rcx    # 0x36cb40
movb %dil, (%rax,%rcx)
movb $0x0, 0x1(%rax,%rcx)
cmpb $0x72, 0x2dd1ca(%rip)   # 0x36cb40
jne 0x8f985
cmpb $0x3e, 0x2dd1c2(%rip)   # 0x36cb41
je 0x8f8d5
retq
movl $0x2c5, %edi            # imm = 0x2C5
jmp 0x8f9ae
movl $0x2bd, %edi            # imm = 0x2BD
jmp 0x8f9ae
movl $0x2c9, %edi            # imm = 0x2C9
jmp 0x8f9ae
callq 0x8f44b
jmp 0x8f9b3
movl $0x2c1, %edi            # imm = 0x2C1
jmp 0x8f9ae
movl $0x2c3, %edi            # imm = 0x2C3
callq 0x8e0bc
leaq 0x2dd186(%rip), %rdi    # 0x36cb40
leaq 0x9429e(%rip), %rsi     # 0x123c5f
callq 0x9090
testq %rax, %rax
je 0x8f9de
xorl %eax, %eax
movl %eax, 0x2dd1f9(%rip)    # 0x36cbcc
movl %eax, 0x2dd1f7(%rip)    # 0x36cbd0
callq 0x70023
movl $0x0, 0x2dd1dc(%rip)    # 0x36cbc4
movb $0x0, 0x2dd151(%rip)    # 0x36cb40
popq %rbp
jmp 0x8df44