// File: 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
subq $0x10, %rsp
xorl %edi, %edi
callq 0xae4a0
leaq 0x2db7ea(%rip), %rax    # 0x39aa10
movb $0x0, (%rax)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0x2d81f8(%rip), %rcx    # 0x397432
movzwl (%rcx), %ecx
cmpl %ecx, %eax
jge 0xbf286
callq 0x7a510
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %dl
movslq -0x8(%rbp), %rcx
leaq 0x2db7b9(%rip), %rax    # 0x39aa10
movb %dl, (%rax,%rcx)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x2db7a6(%rip), %rax    # 0x39aa10
movb $0x0, (%rax,%rcx)
cmpl $0x1f5, -0x8(%rbp)      # imm = 0x1F5
jl 0xbf279
jmp 0xbf286
jmp 0xbf27b
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xbf230
leaq 0x2dbb97(%rip), %rax    # 0x39ae24
movl $0x0, (%rax)
leaq 0x2d819a(%rip), %rax    # 0x397434
movw $0x0, (%rax)
leaq 0x2d818c(%rip), %rax    # 0x397432
movw $0x0, (%rax)
leaq 0x2d8184(%rip), %rax    # 0x397436
movw $0x0, (%rax)
leaq 0x2db752(%rip), %rdi    # 0x39aa10
callq 0x9890
leaq 0x1de2a6(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xbf2f5
leaq 0x1de299(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movl 0x30caf0(%rip), %edx    # 0x3cbdd0
leaq 0xc7a06(%rip), %rsi     # 0x186ced
leaq 0x2db722(%rip), %rcx    # 0x39aa10
movb $0x0, %al
callq 0x9550
movl 0x30cad5(%rip), %eax    # 0x3cbdd0
movl %eax, 0x30cae3(%rip)    # 0x3cbde4
leaq 0x2db708(%rip), %rdi    # 0x39aa10
leaq 0xc79f2(%rip), %rsi     # 0x186d01
callq 0x9090
cmpq $0x0, %rax
je 0xbf324
callq 0xbe1e0
jmp 0xbf66d
leaq 0x2db6e5(%rip), %rdi    # 0x39aa10
leaq 0xc46ba(%rip), %rsi     # 0x1839ec
callq 0x9090
cmpq $0x0, %rax
je 0xbf34c
movl $0x0, 0x30ca9d(%rip)    # 0x3cbde4
jmp 0xbf66b
leaq 0x2db6bd(%rip), %rdi    # 0x39aa10
leaq 0xc79ae(%rip), %rsi     # 0x186d08
callq 0x9090
cmpq $0x0, %rax
je 0xbf374
movl $0x0, 0x30ca75(%rip)    # 0x3cbde4
jmp 0xbf669
leaq 0x2db695(%rip), %rdi    # 0x39aa10
leaq 0xc7a2a(%rip), %rsi     # 0x186dac
callq 0x9090
cmpq $0x0, %rax
je 0xbf39c
movl $0x0, 0x30ca4d(%rip)    # 0x3cbde4
jmp 0xbf667
cmpl $0x320, 0x30ca3e(%rip)  # imm = 0x320
jne 0xbf3b2
callq 0xbdf80
jmp 0xbf665
cmpl $0x321, 0x30ca28(%rip)  # imm = 0x321
jne 0xbf3c8
callq 0xbe1e0
jmp 0xbf663
cmpl $0x322, 0x30ca12(%rip)  # imm = 0x322
jne 0xbf3de
callq 0xbe240
jmp 0xbf661
cmpl $0x324, 0x30c9fc(%rip)  # imm = 0x324
jne 0xbf3f4
callq 0xbe2a0
jmp 0xbf65f
cmpl $0x325, 0x30c9e6(%rip)  # imm = 0x325
jne 0xbf40a
callq 0xbe330
jmp 0xbf65d
cmpl $0x326, 0x30c9d0(%rip)  # imm = 0x326
jne 0xbf420
callq 0xbe370
jmp 0xbf65b
cmpl $0x327, 0x30c9ba(%rip)  # imm = 0x327
jne 0xbf436
callq 0xbe3b0
jmp 0xbf659
cmpl $0x328, 0x30c9a4(%rip)  # imm = 0x328
jne 0xbf44c
callq 0xbe3f0
jmp 0xbf657
cmpl $0x329, 0x30c98e(%rip)  # imm = 0x329
jne 0xbf462
callq 0xbe450
jmp 0xbf655
cmpl $0x32a, 0x30c978(%rip)  # imm = 0x32A
jne 0xbf478
callq 0xbe4e0
jmp 0xbf653
cmpl $0x32b, 0x30c962(%rip)  # imm = 0x32B
jne 0xbf48e
callq 0xbe520
jmp 0xbf651
cmpl $0x32c, 0x30c94c(%rip)  # imm = 0x32C
jne 0xbf4a4
callq 0xbe560
jmp 0xbf64f
cmpl $0x32d, 0x30c936(%rip)  # imm = 0x32D
jne 0xbf4ba
callq 0xbe5a0
jmp 0xbf64d
cmpl $0x32f, 0x30c920(%rip)  # imm = 0x32F
jne 0xbf4d0
callq 0xbe690
jmp 0xbf64b
cmpl $0x330, 0x30c90a(%rip)  # imm = 0x330
jne 0xbf4e6
callq 0xbe650
jmp 0xbf649
cmpl $0x332, 0x30c8f4(%rip)  # imm = 0x332
jne 0xbf4fc
callq 0xbe730
jmp 0xbf647
cmpl $0x331, 0x30c8de(%rip)  # imm = 0x331
jne 0xbf512
callq 0xbe6f0
jmp 0xbf645
cmpl $0x33e, 0x30c8c8(%rip)  # imm = 0x33E
jne 0xbf528
callq 0xbe770
jmp 0xbf643
cmpl $0x33f, 0x30c8b2(%rip)  # imm = 0x33F
jne 0xbf53e
callq 0xbe7b0
jmp 0xbf641
cmpl $0x340, 0x30c89c(%rip)  # imm = 0x340
jne 0xbf554
callq 0xbe850
jmp 0xbf63f
cmpl $0x341, 0x30c886(%rip)  # imm = 0x341
jne 0xbf56a
callq 0xbe890
jmp 0xbf63d
cmpl $0x342, 0x30c870(%rip)  # imm = 0x342
jne 0xbf580
callq 0xbe930
jmp 0xbf63b
cmpl $0x343, 0x30c85a(%rip)  # imm = 0x343
jne 0xbf596
callq 0xbe970
jmp 0xbf639
cmpl $0x344, 0x30c844(%rip)  # imm = 0x344
jne 0xbf5ac
callq 0xbea10
jmp 0xbf637
cmpl $0x345, 0x30c82e(%rip)  # imm = 0x345
jne 0xbf5bf
callq 0xbea50
jmp 0xbf635
cmpl $0x346, 0x30c81b(%rip)  # imm = 0x346
jne 0xbf5d2
callq 0xbeac0
jmp 0xbf633
cmpl $0x334, 0x30c808(%rip)  # imm = 0x334
jne 0xbf5e5
callq 0xbeb00
jmp 0xbf631
cmpl $0x333, 0x30c7f5(%rip)  # imm = 0x333
jne 0xbf5f8
callq 0xbeb30
jmp 0xbf62f
cmpl $0x337, 0x30c7e2(%rip)  # imm = 0x337
jne 0xbf60b
callq 0xbeb60
jmp 0xbf62d
cmpl $0x25, 0x30c7d2(%rip)   # 0x3cbde4
jne 0xbf61b
callq 0xbf6d0
jmp 0xbf62b
cmpl $-0x25, 0x30c7c2(%rip)  # 0x3cbde4
jne 0xbf629
callq 0xbf6d0
jmp 0xbf62b
jmp 0xbf62d
jmp 0xbf62f
jmp 0xbf631
jmp 0xbf633
jmp 0xbf635
jmp 0xbf637
jmp 0xbf639
jmp 0xbf63b
jmp 0xbf63d
jmp 0xbf63f
jmp 0xbf641
jmp 0xbf643
jmp 0xbf645
jmp 0xbf647
jmp 0xbf649
jmp 0xbf64b
jmp 0xbf64d
jmp 0xbf64f
jmp 0xbf651
jmp 0xbf653
jmp 0xbf655
jmp 0xbf657
jmp 0xbf659
jmp 0xbf65b
jmp 0xbf65d
jmp 0xbf65f
jmp 0xbf661
jmp 0xbf663
jmp 0xbf665
jmp 0xbf667
jmp 0xbf669
jmp 0xbf66b
jmp 0xbf66d
callq 0xb2630
movl %eax, -0x8(%rbp)
callq 0x983c0
movl $0x0, 0x30c760(%rip)    # 0x3cbde4
leaq 0x1ddf15(%rip), %rax    # 0x29d5a0
cmpq $0x0, (%rax)
je 0xbf6af
leaq 0x1c3148(%rip), %rax    # 0x2827e0
cmpq $0x0, (%rax)
je 0xbf6af
leaq 0x1c313b(%rip), %rax    # 0x2827e0
movq (%rax), %rax
movl %eax, %edi
callq 0xb8b0
leaq 0x1deaca(%rip), %rax    # 0x29e180
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)