// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
movl $0x0, 0x2e7b1b(%rip)    # 0x36cae4
movl $0x1, %edi
callq 0x7f47d
leaq 0x2b6856(%rip), %rbx    # 0x33b830
movb $0x0, (%rbx)
xorl %r14d, %r14d
leaq 0x2b326b(%rip), %r15    # 0x338252
leaq 0x1b9f82(%rip), %r12    # 0x23ef70
movzwl (%r15), %eax
cmpq %rax, %r14
jae 0x8501e
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x85008
orb $0x8, (%r12)
movb %al, (%r14,%rbx)
movb $0x0, 0x1(%r14,%rbx)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0x84fee
leaq 0x1b936b(%rip), %r14    # 0x23e390
movq (%r14), %rdi
leaq 0x1938a1(%rip), %rbx    # 0x2188d0
testq %rdi, %rdi
je 0x85053
movl $0x80000000, %eax       # imm = 0x80000000
cmpq %rax, (%rbx)
jne 0x85053
leaq 0x9e0ec(%rip), %rsi     # 0x123131
leaq 0x2b67e4(%rip), %rdx    # 0x33b830
xorl %eax, %eax
callq 0x9560
movq (%r14), %rdi
testq %rdi, %rdi
je 0x85079
cmpq $0x20000000, (%rbx)     # imm = 0x20000000
jne 0x85079
leaq 0x9e0d4(%rip), %rsi     # 0x12313f
leaq 0x2b67be(%rip), %rdx    # 0x33b830
xorl %eax, %eax
callq 0x9560
leaq 0x2b6bc4(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
callq 0x811da
leaq 0x2b69ae(%rip), %rax    # 0x33ba40
movl $0x53475047, %ecx       # imm = 0x53475047
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x56, %edx
orl %ecx, %edx
je 0x85430
movl $0x53474442, %ecx       # imm = 0x53474442
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x56, %edx
orl %ecx, %edx
je 0x85429
movl $0x53474247, %ecx       # imm = 0x53474247
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x56, %edx
orl %ecx, %edx
je 0x85429
movl $0x53474c47, %ecx       # imm = 0x53474C47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x56, %edx
orl %ecx, %edx
je 0x8547a
movl $0x53474147, %ecx       # imm = 0x53474147
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x56, %edx
orl %ecx, %edx
je 0x85481
movl $0x53474e47, %ecx       # imm = 0x53474E47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x56, %edx
orl %ecx, %edx
je 0x85488
movl $0x53475047, %ecx       # imm = 0x53475047
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x85496
movl $0x53474442, %ecx       # imm = 0x53474442
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x8548f
movl $0x53474247, %ecx       # imm = 0x53474247
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x8548f
movl $0x53474c47, %ecx       # imm = 0x53474C47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854a2
movl $0x53474147, %ecx       # imm = 0x53474147
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854a9
movl $0x53474e47, %ecx       # imm = 0x53474E47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854b0
movl $0x47475047, %ecx       # imm = 0x47475047
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854be
movl $0x47474442, %ecx       # imm = 0x47474442
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854b7
movl $0x47474247, %ecx       # imm = 0x47474247
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854b7
movl $0x47474c47, %ecx       # imm = 0x47474C47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854cd
movl $0x47474147, %ecx       # imm = 0x47474147
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854d4
movl $0x47474e47, %ecx       # imm = 0x47474E47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x854db
movl $0x4d525047, %ecx       # imm = 0x4D525047
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x43, %edx
orl %ecx, %edx
je 0x854e9
movl $0x43524442, %ecx       # imm = 0x43524442
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x4d, %edx
orl %ecx, %edx
je 0x854e2
movl $0x4d524247, %ecx       # imm = 0x4D524247
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x43, %edx
orl %ecx, %edx
je 0x854e2
movl $0x4d524c47, %ecx       # imm = 0x4D524C47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x43, %edx
orl %ecx, %edx
je 0x854f8
movl $0x4d524147, %ecx       # imm = 0x4D524147
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x43, %edx
orl %ecx, %edx
je 0x854ff
movl $0x4d524e47, %ecx       # imm = 0x4D524E47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x43, %edx
orl %ecx, %edx
je 0x85506
movl $0x445a5047, %ecx       # imm = 0x445A5047
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x85514
movl $0x445a4442, %ecx       # imm = 0x445A4442
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x8550d
movl $0x445a4247, %ecx       # imm = 0x445A4247
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x8550d
movl $0x445a4c47, %ecx       # imm = 0x445A4C47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x85523
movl $0x445a4147, %ecx       # imm = 0x445A4147
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x8552a
movl $0x445a4e47, %ecx       # imm = 0x445A4E47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x41, %edx
orl %ecx, %edx
je 0x85531
movl $0x4e475047, %ecx       # imm = 0x4E475047
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x53, %edx
orl %ecx, %edx
je 0x8553f
movl $0x4e474442, %ecx       # imm = 0x4E474442
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x53, %edx
orl %ecx, %edx
je 0x85538
movl $0x4e474247, %ecx       # imm = 0x4E474247
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x53, %edx
orl %ecx, %edx
je 0x85538
movl $0x4e474c47, %ecx       # imm = 0x4E474C47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x53, %edx
orl %ecx, %edx
je 0x8554e
movl $0x4e474147, %ecx       # imm = 0x4E474147
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x53, %edx
orl %ecx, %edx
je 0x85555
movl $0x4e474e47, %ecx       # imm = 0x4E474E47
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x53, %edx
orl %ecx, %edx
je 0x8555c
movl $0x48534150, %ecx       # imm = 0x48534150
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x52, %edx
orl %ecx, %edx
je 0x85563
movq (%rax), %rcx
movabsq $0x5359534452454f, %rdx # imm = 0x5359534452454F
cmpq %rdx, %rcx
jle 0x8556d
movabsq $0x5852434452454f, %rdx # imm = 0x5852434452454F
cmpq %rdx, %rcx
jle 0x855ac
movabsq $0x58524344524550, %rdx # imm = 0x58524344524550
cmpq %rdx, %rcx
je 0x855fc
movabsq $0x59524344524550, %rdx # imm = 0x59524344524550
cmpq %rdx, %rcx
je 0x85606
movabsq $0x5a524344524550, %rdx # imm = 0x5A524344524550
cmpq %rdx, %rcx
jne 0x8562e
callq 0x841f3
jmp 0x8543a
movl $0x8, %edi
jmp 0x85435
movl $0x1, %edi
callq 0x81589
leaq 0x1b8f7f(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x19e1b1(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x85464
callq 0xaff7
leaq 0x1b9b35(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %edi
jmp 0x85435
movl $0x4, %edi
jmp 0x85435
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x85435
movl $0x8, %edi
jmp 0x8549b
movl $0x1, %edi
callq 0x8139c
jmp 0x8543a
movl $0x2, %edi
jmp 0x8549b
movl $0x4, %edi
jmp 0x8549b
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x8549b
movl $0x8, %edi
jmp 0x854c3
movl $0x1, %edi
callq 0x82285
jmp 0x8543a
movl $0x2, %edi
jmp 0x854c3
movl $0x4, %edi
jmp 0x854c3
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x854c3
movl $0x8, %edi
jmp 0x854ee
movl $0x1, %edi
callq 0x8217b
jmp 0x8543a
movl $0x2, %edi
jmp 0x854ee
movl $0x4, %edi
jmp 0x854ee
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x854ee
movl $0x8, %edi
jmp 0x85519
movl $0x1, %edi
callq 0x823b3
jmp 0x8543a
movl $0x2, %edi
jmp 0x85519
movl $0x4, %edi
jmp 0x85519
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x85519
movl $0x8, %edi
jmp 0x85544
movl $0x1, %edi
callq 0x81cf2
jmp 0x8543a
movl $0x2, %edi
jmp 0x85544
movl $0x4, %edi
jmp 0x85544
movl $0xc00f, %edi           # imm = 0xC00F
jmp 0x85544
callq 0x8638b
jmp 0x8543a
movabsq $0x4d52434452454f, %rdx # imm = 0x4D52434452454F
cmpq %rdx, %rcx
jg 0x855d4
movabsq $0x49504144524550, %rdx # imm = 0x49504144524550
cmpq %rdx, %rcx
je 0x85610
movabsq $0x4b434144524550, %rdx # imm = 0x4B434144524550
cmpq %rdx, %rcx
jne 0x8562e
callq 0x83ee7
jmp 0x8543a
movabsq $0x53595344524550, %rdx # imm = 0x53595344524550
cmpq %rdx, %rcx
je 0x8561a
movabsq $0x57524344524550, %rdx # imm = 0x57524344524550
cmpq %rdx, %rcx
jne 0x8562e
callq 0x83c0e
jmp 0x8543a
movabsq $0x4d524344524550, %rdx # imm = 0x4D524344524550
cmpq %rdx, %rcx
je 0x85624
movabsq $0x4e524344524550, %rdx # imm = 0x4E524344524550
cmpq %rdx, %rcx
jne 0x8562e
callq 0x8446e
jmp 0x8543a
callq 0x83efb
jmp 0x8543a
callq 0x84096
jmp 0x8543a
callq 0x84517
jmp 0x8543a
callq 0x8485b
jmp 0x8543a
callq 0x8427a
jmp 0x8543a
movl $0x43454650, %ecx       # imm = 0x43454650
xorl (%rax), %ecx
movzbl 0x4(%rax), %edx
orl %ecx, %edx
je 0x85696
movl $0x4d524750, %ecx       # imm = 0x4D524750
movl (%rax), %edx
xorl %ecx, %edx
movzwl 0x4(%rax), %esi
xorl $0x54, %esi
orl %edx, %esi
je 0x8543a
xorl (%rax), %ecx
movzwl 0x4(%rax), %edx
xorl $0x46, %edx
orl %ecx, %edx
je 0x8543a
movl $0x49545350, %ecx       # imm = 0x49545350
xorl (%rax), %ecx
movzbl 0x4(%rax), %edx
orl %ecx, %edx
je 0x856a0
movl $0x544c4a50, %ecx       # imm = 0x544C4A50
xorl (%rax), %ecx
movzwl 0x4(%rax), %eax
xorl $0x53, %eax
orl %ecx, %eax
je 0x856af
movl $0x0, 0x2ec793(%rip)    # 0x371e24
jmp 0x8543a
callq 0x839bc
jmp 0x8543a
movl $0xc00f, %edi           # imm = 0xC00F
callq 0x82ce7
jmp 0x8543a
callq 0x829ac
jmp 0x8543a