// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_sro_msg()
void decode_sro_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);


   sro_msg_id = polled_msg_id;
   if     (strstr(nmea_msg,  "TNTSRO")) parse_sro_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,  "?")) {
      sro_msg_id = 0;
   }

   else if(sro_msg_id == SRO_M_MSG)      parse_sro_m();
   else if(sro_msg_id == SRO_ID_MSG)     parse_sro_id();
   else if(sro_msg_id == SRO_SN_MSG)     parse_sro_sn();
   else if(sro_msg_id == SRO_ST_MSG)     parse_sro_st();
   else if(sro_msg_id == SRO_TR_MSG)     parse_sro_tr();
   else if(sro_msg_id == SRO_SY_MSG)     parse_sro_sy();
   else if(sro_msg_id == SRO_DE_MSG)     parse_sro_de();
   else if(sro_msg_id == SRO_PW_MSG)     parse_sro_pw();
   else if(sro_msg_id == SRO_FC_MSG)     parse_sro_fc();
   else if(sro_msg_id == SRO_FS_MSG)     parse_sro_fs();
   else if(sro_msg_id == SRO_TW_MSG)     parse_sro_tw();
   else if(sro_msg_id == SRO_AW_MSG)     parse_sro_aw();
   else if(sro_msg_id == SRO_TC_MSG)     parse_sro_tc();
   else if(sro_msg_id == SRO_VS_MSG)     parse_sro_vs();
   else if(sro_msg_id == SRO_VT_MSG)     parse_sro_vt();
   else if(sro_msg_id == SRO_GF_MSG)     parse_sro_gf();
   else if(sro_msg_id == SRO_RA_MSG)     parse_sro_ra();

   else if(sro_msg_id == SRO_L05_MSG)    parse_sro_l05();
   else if(sro_msg_id == SRO_L06_MSG)    parse_sro_l06();
   else if(sro_msg_id == SRO_R05_MSG)    parse_sro_r05();
   else if(sro_msg_id == SRO_R06_MSG)    parse_sro_r06();
   else if(sro_msg_id == SRO_R14_MSG)    parse_sro_r14();
   else if(sro_msg_id == SRO_R15_MSG)    parse_sro_r15();
   else if(sro_msg_id == SRO_R48_MSG)    parse_sro_r48();
   else if(sro_msg_id == SRO_R49_MSG)    parse_sro_r49();
   else if(sro_msg_id == SRO_R4F_MSG)    parse_sro_r4F();

   else if(sro_msg_id == SRO_TD_MSG)     parse_sro_td();
   else if(sro_msg_id == SRO_DT_MSG)     parse_sro_dt();
   else if(sro_msg_id == SRO_RAQUIK_MSG) parse_sro_raquik();

   else if(sro_msg_id == SCPI_USER_MSG)     parse_scpi_user();
   else if(sro_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_sro();

   sro_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 0x7f2b8
leaq 0x2af91b(%rip), %r15    # 0x33b830
movb $0x0, (%r15)
leaq 0x2ac332(%rip), %rbx    # 0x338252
leaq 0x1b3049(%rip), %r12    # 0x23ef70
movzwl (%rbx), %eax
cmpq %rax, %r14
jae 0x8bf56
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x8bf40
orb $0x8, (%r12)
movb %al, (%r14,%r15)
movb $0x0, 0x1(%r14,%r15)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0x8bf27
leaq 0x2afce7(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
leaq 0x2ac2ea(%rip), %rax    # 0x338254
xorl %ecx, %ecx
movw %cx, (%rax)
movw %cx, (%rbx)
leaq 0x2ac2dd(%rip), %rax    # 0x338256
movw %cx, (%rax)
leaq 0x2af8ad(%rip), %rdi    # 0x33b830
callq 0x9899
leaq 0x1b2401(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8bfb2
movl 0x2e0c63(%rip), %edx    # 0x36cc00
leaq 0x97a62(%rip), %rsi     # 0x123a06
leaq 0x2af885(%rip), %rcx    # 0x33b830
xorl %eax, %eax
callq 0x9560
movl 0x2e0c48(%rip), %ebx    # 0x36cc00
movl %ebx, 0x2e0c56(%rip)    # 0x36cc14
leaq 0x2af86b(%rip), %rdi    # 0x33b830
leaq 0x97a4e(%rip), %rsi     # 0x123a1a
callq 0x9090
testq %rax, %rax
je 0x8bfdd
callq 0x8b25d
jmp 0x8c02d
leaq 0x2af84c(%rip), %rdi    # 0x33b830
leaq 0x94781(%rip), %rsi     # 0x12076c
callq 0x9090
testq %rax, %rax
jne 0x8c023
leaq 0x2af834(%rip), %rdi    # 0x33b830
leaq 0x97a1e(%rip), %rsi     # 0x123a21
callq 0x9090
testq %rax, %rax
jne 0x8c023
leaq 0x2af81c(%rip), %rdi    # 0x33b830
movl $0x3f, %esi
callq 0x9100
testq %rax, %rax
je 0x8c081
movl $0x0, 0x2e0be7(%rip)    # 0x36cc14
callq 0x8247a
callq 0x6f80b
leaq 0x1b2382(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
movl $0x0, 0x2e0bc8(%rip)    # 0x36cc14
setne %al
leaq 0x1975aa(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8c06b
callq 0xafe8
leaq 0x1b2f2e(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leal -0x320(%rbx), %eax
cmpl $0x26, %eax
ja 0x8c0a3
leaq 0x932c5(%rip), %rcx     # 0x11f358
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x8b073
jmp 0x8c02d
cmpl $-0x25, %ebx
je 0x8c0ad
cmpl $0x25, %ebx
jne 0x8c02d
callq 0x8c1c5
jmp 0x8c02d
callq 0x8b762
jmp 0x8c02d
callq 0x8b99b
jmp 0x8c02d
callq 0x8b4e0
jmp 0x8c02d
callq 0x8b6f9
jmp 0x8c02d
callq 0x8b5d1
jmp 0x8c02d
callq 0x8b2a8
jmp 0x8c02d
callq 0x8b440
jmp 0x8c02d
callq 0x8b3f0
jmp 0x8c02d
callq 0x8b607
jmp 0x8c02d
callq 0x8b516
jmp 0x8c02d
callq 0x8b34e
jmp 0x8c02d
callq 0x8b2f3
jmp 0x8c02d
callq 0x8b959
jmp 0x8c02d
callq 0x8b657
jmp 0x8c02d
callq 0x8b384
jmp 0x8c02d
callq 0x8b3ba
jmp 0x8c02d
callq 0x8b798
jmp 0x8c02d
callq 0x8b8d6
jmp 0x8c02d
callq 0x8b4aa
jmp 0x8c02d
callq 0x8b923
jmp 0x8c02d
callq 0x8b54c
jmp 0x8c02d
callq 0x8b68d
jmp 0x8c02d
callq 0x8b97a
jmp 0x8c02d
callq 0x8b837
jmp 0x8c02d
callq 0x8b6c3
jmp 0x8c02d
callq 0x8b801
jmp 0x8c02d
callq 0x8b8a0
jmp 0x8c02d