// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x7f47d
leaq 0x2aedfe(%rip), %r15    # 0x33b830
movb $0x0, (%r15)
leaq 0x2ab815(%rip), %rbx    # 0x338252
leaq 0x1b252c(%rip), %r12    # 0x23ef70
movzwl (%rbx), %eax
cmpq %rax, %r14
jae 0x8ca73
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8ca5d
orb $0x8, (%r12)
movb %al, (%r14,%r15)
movb $0x0, 0x1(%r14,%r15)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0x8ca44
leaq 0x2af1ca(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
leaq 0x2ab7cd(%rip), %rax    # 0x338254
xorl %ecx, %ecx
movw %cx, (%rax)
movw %cx, (%rbx)
leaq 0x2ab7c0(%rip), %rax    # 0x338256
movw %cx, (%rax)
leaq 0x2aed90(%rip), %rdi    # 0x33b830
callq 0x9899
leaq 0x1b18e4(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8cacf
movl 0x2e0146(%rip), %edx    # 0x36cc00
leaq 0x96e65(%rip), %rsi     # 0x123926
leaq 0x2aed68(%rip), %rcx    # 0x33b830
xorl %eax, %eax
callq 0x9560
movl 0x2e012b(%rip), %ebx    # 0x36cc00
movl %ebx, 0x2e0129(%rip)    # 0x36cc04
leaq 0x2aed4e(%rip), %rdi    # 0x33b830
leaq 0x96e58(%rip), %rsi     # 0x123941
callq 0x9090
testq %rax, %rax
je 0x8cafa
callq 0x8c789
jmp 0x8cb3e
leaq 0x2aed2f(%rip), %rdi    # 0x33b830
leaq 0x93b84(%rip), %rsi     # 0x12068c
callq 0x9090
testq %rax, %rax
je 0x8cb1e
movl $0x0, 0x2e00f8(%rip)    # 0x36cc14
jmp 0x8cb3e
leaq 0x2aed0b(%rip), %rdi    # 0x33b830
movl $0x3f, %esi
callq 0x9100
testq %rax, %rax
je 0x8cb92
movl $0x0, 0x2e00c6(%rip)    # 0x36cc04
callq 0x82578
callq 0x6ed53
leaq 0x1b1871(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
movl $0x0, 0x2e00a7(%rip)    # 0x36cc04
setne %al
leaq 0x196a99(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8cb7c
callq 0xaff7
leaq 0x1b241d(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leal -0x384(%rbx), %eax
cmpl $0x6, %eax
ja 0x8cbb4
leaq 0x92790(%rip), %rcx     # 0x11f334
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x8c632
jmp 0x8cb3e
cmpl $-0x25, %ebx
je 0x8cbbe
cmpl $0x25, %ebx
jne 0x8cb3e
callq 0x8c1c3
jmp 0x8cb3e
callq 0x8c873
jmp 0x8cb3e
callq 0x8c910
jmp 0x8cb3e
callq 0x8c83a
jmp 0x8cb3e
callq 0x8c931
jmp 0x8cb3e