// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_lpfrs_msg()
void decode_lpfrs_msg()
{
char c;
int i;

   start_msg_decode(0);

   nmea_msg[0] = 0;
   for(i=0; i<tsip_wptr; i++) {  // copy message from tsip buffer to nmea buffer
      c = tsip_byte();
      nmea_msg[i] = c;
      nmea_msg[i+1] = 0;
      if(i >= ((int)sizeof(nmea_msg)-12)) break;
   }
   msg_col = 0;     // index of next char to get from nmea buffer

   tsip_wptr = tsip_rptr = 0;
   tsip_sync = 0;

   // get the response from the reciver and pass it to (HOPEFULLY) the routine
   // that expects it...

   strupr(nmea_msg);

if(debug_file) fprintf(debug_file, "Decode msg %d:[%s]\n", polled_msg_id, nmea_msg);
//sprintf(debug_text, "Decode msg %d:[%s]", polled_msg_id, nmea_msg);


   lpfrs_msg_id = polled_msg_id;
   if     (strstr(nmea_msg,  "TNT")) parse_lpfrs_id();
   else if(strstr(nmea_msg,  "RESET")) sro_msg_id = 0;
   else if(strstr(nmea_msg,  "TNT")) sro_msg_id = 0;
   else if(strstr(nmea_msg,  "?")) {
      lpfrs_msg_id = 0;
   }

   else if(lpfrs_msg_id == LPFRS_M_MSG)       parse_lpfrs_m();
   else if(lpfrs_msg_id == LPFRS_ID_MSG)      parse_lpfrs_id();
   else if(lpfrs_msg_id == LPFRS_C_READ_MSG)  parse_lpfrs_c_read();
   else if(lpfrs_msg_id == LPFRS_F_READ_MSG)  parse_lpfrs_f_read();
   else if(lpfrs_msg_id == LPFRS_C_WRITE_MSG) parse_lpfrs_c_write();
   else if(lpfrs_msg_id == LPFRS_F_WRITE_MSG) parse_lpfrs_f_write();

   else if(lpfrs_msg_id == SCPI_USER_MSG)     parse_scpi_user();
   else if(lpfrs_msg_id == (0-SCPI_USER_MSG)) parse_scpi_user();

   i = get_norcvr_message();   // returns true if seconds just ticked
///   if(SLOW_PRS_POLL && (seconds & 0x01));  // enable this to trigger high priority message polls every seoncd
                                              // ... but this slows polling loop cycle to around 1 minute
///   else if(i && (prs_poll_tick == 0)) prs_poll_tick = 1;  // trigger high priority message polls
   poll_next_lpfrs();

   lpfrs_msg_id = 0;

   if(sim_file && sim_delay) {  // throttle sim file messages
      Sleep(sim_delay);
   }

   saw_rcvr_msg = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x73dcb
leaq 0x2a59ce(%rip), %r15    # 0x325830
movb $0x0, (%r15)
leaq 0x2a23e5(%rip), %r14    # 0x322252
movzwl (%r14), %eax
cmpq %rax, %rbx
jae 0x7fe91
callq 0x51c47
movb %al, (%rbx,%r15)
movb $0x0, 0x1(%rbx,%r15)
incq %rbx
cmpq $0x1f6, %rbx            # imm = 0x1F6
jne 0x7fe6d
leaq 0x2a5dac(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
leaq 0x2a23b2(%rip), %rax    # 0x322254
andw $0x0, (%rax)
andw $0x0, (%r14)
leaq 0x2a23a4(%rip), %rax    # 0x322256
andw $0x0, (%rax)
leaq 0x2a5973(%rip), %rdi    # 0x325830
callq 0x988f
leaq 0x1a84c7(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x7feec
movl 0x2d6d29(%rip), %edx    # 0x356c00
leaq 0x8da70(%rip), %rsi     # 0x10d94e
leaq 0x2a594b(%rip), %rcx    # 0x325830
xorl %eax, %eax
callq 0x9560
movl 0x2d6d0e(%rip), %ebx    # 0x356c00
movl %ebx, 0x2d6d0c(%rip)    # 0x356c04
leaq 0x2a5931(%rip), %rdi    # 0x325830
leaq 0x8da63(%rip), %rsi     # 0x10d969
callq 0x9090
testq %rax, %rax
je 0x7ff17
callq 0x7fbbb
jmp 0x7ff53
leaq 0x2a5912(%rip), %rdi    # 0x325830
leaq 0x8a78f(%rip), %rsi     # 0x10a6b4
callq 0x9090
testq %rax, %rax
je 0x7ff38
andl $0x0, 0x2d6cde(%rip)    # 0x356c14
jmp 0x7ff53
leaq 0x2a58f1(%rip), %rdi    # 0x325830
pushq $0x3f
popq %rsi
callq 0x9100
testq %rax, %rax
je 0x7ffa6
andl $0x0, 0x2d6cb1(%rip)    # 0x356c04
callq 0x76a3e
callq 0x657d5
andl $0x0, 0x2d6ca0(%rip)    # 0x356c04
leaq 0x1a8455(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x18d687(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x7ff8e
callq 0xae83
leaq 0x1a900b(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leal -0x384(%rbx), %eax
cmpl $0x6, %eax
ja 0x7ffc8
leaq 0x89380(%rip), %rcx     # 0x109338
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x7fa73
jmp 0x7ff53
cmpl $-0x25, %ebx
je 0x7ffd2
cmpl $0x25, %ebx
jne 0x7ff53
callq 0x7f628
jmp 0x7ff53
callq 0x7fca5
jmp 0x7ff53
callq 0x7fd42
jmp 0x7ff53
callq 0x7fc6c
jmp 0x7ff53
callq 0x7fd63
jmp 0x7ff53