// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_nmea_msg()
void decode_nmea_msg()
{
char c;
int i;
static int row = 0;

   venus_nmea = 0;
   start_msg_decode(1);

   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;
   }

   if(debug_file && (rcvr_type == ESIP_RCVR)) {
      fprintf(debug_file, "Rcvd eSIP:%s\n", nmea_msg);
   }
   if(debug_file && (rcvr_type == FURUNO_RCVR)) {
      fprintf(debug_file, "Rcvd furuno:%s\n", nmea_msg);
   }


   msg_col = 0;     // index of next char to get from nmea buffer
   get_msg_field(); // get the NMEA message type 

   if     (!strcmp(msg_field, "GPGSV")) parse_gpgsv(GPS);
   else if(!strcmp(msg_field, "BDGSV")) parse_gpgsv(BEIDOU);
   else if(!strcmp(msg_field, "GBGSV")) parse_gpgsv(BEIDOU);
   else if(!strcmp(msg_field, "GLGSV")) parse_gpgsv(GLONASS);
   else if(!strcmp(msg_field, "GAGSV")) parse_gpgsv(GALILEO);
   else if(!strcmp(msg_field, "GNGSV")) parse_gpgsv(MIXED);

   else if(!strcmp(msg_field, "GPGSA")) parse_gpgsa(GPS);
   else if(!strcmp(msg_field, "BDGSA")) parse_gpgsa(BEIDOU);
   else if(!strcmp(msg_field, "GBGSA")) parse_gpgsa(BEIDOU);
   else if(!strcmp(msg_field, "GLGSA")) parse_gpgsa(GLONASS);
   else if(!strcmp(msg_field, "GAGSA")) parse_gpgsa(GALILEO);
   else if(!strcmp(msg_field, "GNGSA")) parse_gpgsa(MIXED);

   else if(!strcmp(msg_field, "GPGGA")) parse_gpgga(GPS);
   else if(!strcmp(msg_field, "BDGGA")) parse_gpgga(BEIDOU);
   else if(!strcmp(msg_field, "GBGGA")) parse_gpgga(BEIDOU);
   else if(!strcmp(msg_field, "GLGGA")) parse_gpgga(GLONASS);
   else if(!strcmp(msg_field, "GAGGA")) parse_gpgga(GALILEO);
   else if(!strcmp(msg_field, "GNGGA")) parse_gpgga(MIXED);

   else if(!strcmp(msg_field, "GPRMC")) parse_gprmc(GPS);
   else if(!strcmp(msg_field, "BDRCM")) parse_gprmc(BEIDOU);
   else if(!strcmp(msg_field, "GBRMC")) parse_gprmc(BEIDOU);
   else if(!strcmp(msg_field, "GLRMC")) parse_gprmc(GLONASS);
   else if(!strcmp(msg_field, "GARMC")) parse_gprmc(GALILEO);
   else if(!strcmp(msg_field, "GNRMC")) parse_gprmc(MIXED);

   else if(!strcmp(msg_field, "GPZDA")) parse_gpzda(GPS);
   else if(!strcmp(msg_field, "BDZDA")) parse_gpzda(BEIDOU);
   else if(!strcmp(msg_field, "GBZDA")) parse_gpzda(BEIDOU);
   else if(!strcmp(msg_field, "GLZDA")) parse_gpzda(GLONASS);
   else if(!strcmp(msg_field, "GAZDA")) parse_gpzda(GALILEO);
   else if(!strcmp(msg_field, "GNZDA")) parse_gpzda(MIXED);

   else if(!strcmp(msg_field, "GPGNS")) parse_gpgns(GPS);
   else if(!strcmp(msg_field, "BDGNS")) parse_gpgns(BEIDOU);
   else if(!strcmp(msg_field, "GBGNS")) parse_gpgns(BEIDOU);
   else if(!strcmp(msg_field, "GLGNS")) parse_gpgns(GLONASS);
   else if(!strcmp(msg_field, "GAGNS")) parse_gpgns(GALILEO);
   else if(!strcmp(msg_field, "GNGNS")) parse_gpgns(MIXED);

// else if(!strcmp(msg_field, "GPGLL")) parse_gpgll(GPS);
// else if(!strcmp(msg_field, "BDGLL")) parse_gpgll(BEIDOU);
// else if(!strcmp(msg_field, "GBGLL")) parse_gpgll(BEIDOU);
// else if(!strcmp(msg_field, "GLGLL")) parse_gpgll(GLONASS);
// else if(!strcmp(msg_field, "GAGLL")) parse_gpgll(GALILEO);
// else if(!strcmp(msg_field, "GNGLL")) parse_gpgll(MIXED);

// else if(!strcmp(msg_field, "GPVTG")) parse_gpvtg(GPS);
// else if(!strcmp(msg_field, "BDVTG")) parse_gpvtg(BEIDOU);
// else if(!strcmp(msg_field, "GBVTG")) parse_gpvtg(BEIDOU);
// else if(!strcmp(msg_field, "GLVTG")) parse_gpvtg(GLONASS);
// else if(!strcmp(msg_field, "GAVTG")) parse_gpvtg(GALILEO);
// else if(!strcmp(msg_field, "GNVTG")) parse_gpvtg(MIXED);

   else if(!strcmp(msg_field, "PASHR"))  parse_pashr();       // Ashtech Z12 messages

   else if(!strcmp(msg_field, "PERDCRW"))  parse_crw();       // Furuno esip messages
   else if(!strcmp(msg_field, "PERDCRX"))  parse_crx();
   else if(!strcmp(msg_field, "PERDCRY"))  parse_cry();
   else if(!strcmp(msg_field, "PERDCRZ"))  parse_crz();
   else if(!strcmp(msg_field, "PERDCRM"))  parse_crm();
   else if(!strcmp(msg_field, "PERDCRN"))  parse_crn();
   else if(!strcmp(msg_field, "PERDACK"))  parse_perdack();
   else if(!strcmp(msg_field, "PERDAPI"))  parse_perdapi();
   else if(!strcmp(msg_field, "PERDSYS"))  parse_perdsys();

   else if(!strcmp(msg_field, "PFEC"))  parse_pfec();         // Furuno messages

   else if(!strcmp(msg_field, "PGRMT")) parse_pgrmt(MIXED);   // Garmin GPS sensor status
   else if(!strcmp(msg_field, "PGRMF")) parse_pgrmf(MIXED);   // Garmin GPS system data
   else if(!strcmp(msg_field, "PSTI"))  parse_psti(MIXED);
   else if(!strcmp(msg_field, "PJLTS")) parse_pjlts(MIXED);

   else {
      last_was_gsv = 0;
      parse_gp_unkn();
   }


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

   saw_rcvr_msg = 1;
   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
andl $0x0, 0x2dd82a(%rip)    # 0x356ae4
pushq $0x1
popq %rdi
callq 0x73dcb
leaq 0x2ac567(%rip), %rbx    # 0x325830
movb $0x0, (%rbx)
xorl %r14d, %r14d
leaq 0x2a8f7c(%rip), %r15    # 0x322252
movzwl (%r15), %eax
cmpq %rax, %r14
jae 0x792fa
callq 0x51c47
movb %al, (%r14,%rbx)
movb $0x0, 0x1(%r14,%rbx)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0x792d6
leaq 0x1af08f(%rip), %rbx    # 0x228390
movq (%rbx), %rdi
testq %rdi, %rdi
setne %cl
leaq 0x1895bf(%rip), %r14    # 0x2028d0
movq (%r14), %rax
movl $0x80000000, %edx       # imm = 0x80000000
cmpq %rdx, %rax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x79341
leaq 0x93e2c(%rip), %rsi     # 0x10d159
leaq 0x2ac4fc(%rip), %rdx    # 0x325830
xorl %eax, %eax
callq 0x9560
movq (%rbx), %rdi
movq (%r14), %rax
testq %rdi, %rdi
je 0x79363
cmpq $0x20000000, %rax       # imm = 0x20000000
jne 0x79363
leaq 0x93e12(%rip), %rsi     # 0x10d167
leaq 0x2ac4d4(%rip), %rdx    # 0x325830
xorl %eax, %eax
callq 0x9560
leaq 0x2ac8da(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
leaq 0x2ac6c7(%rip), %rdi    # 0x325a40
leaq 0x93df7(%rip), %rsi     # 0x10d177
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79884
leaq 0x2ac6a9(%rip), %rdi    # 0x325a40
leaq 0x93ddf(%rip), %rsi     # 0x10d17d
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79880
leaq 0x2ac68b(%rip), %rdi    # 0x325a40
leaq 0x93dc7(%rip), %rsi     # 0x10d183
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79880
leaq 0x2ac66d(%rip), %rdi    # 0x325a40
leaq 0x93daf(%rip), %rsi     # 0x10d189
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798ce
leaq 0x2ac64f(%rip), %rdi    # 0x325a40
leaq 0x93d97(%rip), %rsi     # 0x10d18f
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798d2
leaq 0x2ac631(%rip), %rdi    # 0x325a40
leaq 0x93d7f(%rip), %rsi     # 0x10d195
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798d6
leaq 0x2ac613(%rip), %rdi    # 0x325a40
leaq 0x93d67(%rip), %rsi     # 0x10d19b
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798e1
leaq 0x2ac5f5(%rip), %rdi    # 0x325a40
leaq 0x93d4f(%rip), %rsi     # 0x10d1a1
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798dd
leaq 0x2ac5d7(%rip), %rdi    # 0x325a40
leaq 0x93d37(%rip), %rsi     # 0x10d1a7
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798dd
leaq 0x2ac5b9(%rip), %rdi    # 0x325a40
leaq 0x93d1f(%rip), %rsi     # 0x10d1ad
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798eb
leaq 0x2ac59b(%rip), %rdi    # 0x325a40
leaq 0x93d07(%rip), %rsi     # 0x10d1b3
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798ef
leaq 0x2ac57d(%rip), %rdi    # 0x325a40
leaq 0x93cef(%rip), %rsi     # 0x10d1b9
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798f3
leaq 0x2ac55f(%rip), %rdi    # 0x325a40
leaq 0x93cd7(%rip), %rsi     # 0x10d1bf
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798fe
leaq 0x2ac541(%rip), %rdi    # 0x325a40
leaq 0x93cbf(%rip), %rsi     # 0x10d1c5
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798fa
leaq 0x2ac523(%rip), %rdi    # 0x325a40
leaq 0x93ca7(%rip), %rsi     # 0x10d1cb
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x798fa
leaq 0x2ac505(%rip), %rdi    # 0x325a40
leaq 0x93c8f(%rip), %rsi     # 0x10d1d1
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79908
leaq 0x2ac4e7(%rip), %rdi    # 0x325a40
leaq 0x93c77(%rip), %rsi     # 0x10d1d7
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7990c
leaq 0x2ac4c9(%rip), %rdi    # 0x325a40
leaq 0x93c5f(%rip), %rsi     # 0x10d1dd
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79910
leaq 0x2ac4ab(%rip), %rdi    # 0x325a40
leaq 0x93c47(%rip), %rsi     # 0x10d1e3
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7991b
leaq 0x2ac48d(%rip), %rdi    # 0x325a40
leaq 0x93c2f(%rip), %rsi     # 0x10d1e9
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79917
leaq 0x2ac46f(%rip), %rdi    # 0x325a40
leaq 0x93c17(%rip), %rsi     # 0x10d1ef
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79917
leaq 0x2ac451(%rip), %rdi    # 0x325a40
leaq 0x93bff(%rip), %rsi     # 0x10d1f5
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79928
leaq 0x2ac433(%rip), %rdi    # 0x325a40
leaq 0x93be7(%rip), %rsi     # 0x10d1fb
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7992c
leaq 0x2ac415(%rip), %rdi    # 0x325a40
leaq 0x93bcf(%rip), %rsi     # 0x10d201
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79930
leaq 0x2ac3f7(%rip), %rdi    # 0x325a40
leaq 0x94f0b(%rip), %rsi     # 0x10e55b
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7993b
leaq 0x2ac3d9(%rip), %rdi    # 0x325a40
leaq 0x93b99(%rip), %rsi     # 0x10d207
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79937
leaq 0x2ac3bb(%rip), %rdi    # 0x325a40
leaq 0x93b81(%rip), %rsi     # 0x10d20d
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79937
leaq 0x2ac39d(%rip), %rdi    # 0x325a40
leaq 0x93b69(%rip), %rsi     # 0x10d213
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79948
leaq 0x2ac37f(%rip), %rdi    # 0x325a40
leaq 0x93b51(%rip), %rsi     # 0x10d219
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7994c
leaq 0x2ac361(%rip), %rdi    # 0x325a40
leaq 0x93b39(%rip), %rsi     # 0x10d21f
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79950
leaq 0x2ac343(%rip), %rdi    # 0x325a40
leaq 0x93b21(%rip), %rsi     # 0x10d225
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7995b
leaq 0x2ac325(%rip), %rdi    # 0x325a40
leaq 0x93b09(%rip), %rsi     # 0x10d22b
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79957
leaq 0x2ac307(%rip), %rdi    # 0x325a40
leaq 0x93af1(%rip), %rsi     # 0x10d231
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79957
leaq 0x2ac2e9(%rip), %rdi    # 0x325a40
leaq 0x93ad9(%rip), %rsi     # 0x10d237
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79968
leaq 0x2ac2cb(%rip), %rdi    # 0x325a40
leaq 0x93ac1(%rip), %rsi     # 0x10d23d
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7996c
leaq 0x2ac2ad(%rip), %rdi    # 0x325a40
leaq 0x93aa9(%rip), %rsi     # 0x10d243
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79970
leaq 0x2ac28f(%rip), %rbx    # 0x325a40
leaq 0x93a91(%rip), %rsi     # 0x10d249
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x9380
testl %eax, %eax
je 0x79977
movq (%rbx), %rax
movabsq $0x49504144524550, %rcx # imm = 0x49504144524550
cmpq %rcx, %rax
je 0x79981
movabsq $0x4b434144524550, %rcx # imm = 0x4B434144524550
cmpq %rcx, %rax
je 0x7998b
movabsq $0x4d524344524550, %rcx # imm = 0x4D524344524550
cmpq %rcx, %rax
je 0x79995
movabsq $0x4e524344524550, %rcx # imm = 0x4E524344524550
cmpq %rcx, %rax
je 0x7999f
movabsq $0x53595344524550, %rcx # imm = 0x53595344524550
cmpq %rcx, %rax
je 0x799a9
movabsq $0x5a524344524550, %rcx # imm = 0x5A524344524550
cmpq %rcx, %rax
je 0x799b3
movabsq $0x58524344524550, %rcx # imm = 0x58524344524550
cmpq %rcx, %rax
je 0x799bd
movabsq $0x59524344524550, %rcx # imm = 0x59524344524550
cmpq %rcx, %rax
je 0x799c7
movabsq $0x57524344524550, %rcx # imm = 0x57524344524550
cmpq %rcx, %rax
jne 0x799d1
callq 0x77fa5
jmp 0x7988c
pushq $0x8
jmp 0x79886
pushq $0x1
popq %rdi
callq 0x75b58
leaq 0x1aeb2d(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x193d5f(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x798b6
callq 0xae83
leaq 0x1af6e3(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
jmp 0x79886
pushq $0x4
jmp 0x79886
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x79887
pushq $0x8
jmp 0x798e3
pushq $0x1
popq %rdi
callq 0x75967
jmp 0x7988c
pushq $0x2
jmp 0x798e3
pushq $0x4
jmp 0x798e3
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x798e4
pushq $0x8
jmp 0x79900
pushq $0x1
popq %rdi
callq 0x76766
jmp 0x7988c
pushq $0x2
jmp 0x79900
pushq $0x4
jmp 0x79900
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x79901
pushq $0x8
jmp 0x7991d
pushq $0x1
popq %rdi
callq 0x7665f
jmp 0x7988c
pushq $0x2
jmp 0x7991d
pushq $0x4
jmp 0x7991d
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x7991e
pushq $0x8
jmp 0x7993d
pushq $0x1
popq %rdi
callq 0x7687c
jmp 0x7988c
pushq $0x2
jmp 0x7993d
pushq $0x4
jmp 0x7993d
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x7993e
pushq $0x8
jmp 0x7995d
pushq $0x1
popq %rdi
callq 0x761f3
jmp 0x7988c
pushq $0x2
jmp 0x7995d
pushq $0x4
jmp 0x7995d
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x7995e
callq 0x7a58b
jmp 0x7988c
callq 0x7883d
jmp 0x7988c
callq 0x78200
jmp 0x7988c
callq 0x78590
jmp 0x7988c
callq 0x78785
jmp 0x7988c
callq 0x78b2f
jmp 0x7988c
callq 0x78509
jmp 0x7988c
callq 0x78214
jmp 0x7988c
callq 0x783ac
jmp 0x7988c
leaq 0x2ac068(%rip), %rdi    # 0x325a40
leaq 0x9b008(%rip), %rsi     # 0x1149e7
pushq $0x5
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79a67
leaq 0x2ac04e(%rip), %rdi    # 0x325a40
leaq 0x93856(%rip), %rsi     # 0x10d24f
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7988c
leaq 0x2ac030(%rip), %rdi    # 0x325a40
leaq 0x9383e(%rip), %rsi     # 0x10d255
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7988c
leaq 0x2ac012(%rip), %rdi    # 0x325a40
leaq 0x93826(%rip), %rsi     # 0x10d25b
pushq $0x5
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79a71
leaq 0x2abff8(%rip), %rdi    # 0x325a40
leaq 0x93811(%rip), %rsi     # 0x10d260
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x79a80
andl $0x0, 0x2e23c2(%rip)    # 0x35be24
jmp 0x7988c
callq 0x77d53
jmp 0x7988c
movl $0xc00f, %edi           # imm = 0xC00F
callq 0x7717c
jmp 0x7988c
callq 0x76e41
jmp 0x7988c