// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_brandy_msg()
void decode_brandy_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) fprintf(debug_file, "decode brandy: %s\n", nmea_msg);
//if(raw_file) fprintf(raw_file, "decode brandy: %s\n", nmea_msg);

   msg_col = 0;     // index of next char to get from nmea buffer
   if(isdigit(nmea_msg[0])) {
      parse_brandy_t();
      last_was_gsv = 0;
   }
   else if(nmea_msg[0] == '?') {  // error code
      last_was_gsv = 0;
   }
   else {
      get_msg_field(); // get the NMEA message type 
      if     (!strcmp(msg_field, "GPGSV")) {
         parse_gpgsv(GPS);
      }
      else if(!strcmp(msg_field, "GPGSA")) parse_gpgsa(GPS);
      else if(!strcmp(msg_field, "GPGGA")) parse_gpgga(GPS);
      else if(!strcmp(msg_field, "GPRMC")) parse_gprmc(GPS);
      else if(!strcmp(msg_field, "PRCCG")) parse_prccg();
      else if(!strcmp(msg_field, "PFEC"))  parse_pfec();
      else last_was_gsv = 0;
   }

   poll_next_brandy();

   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, 0x2d89c5(%rip)    # 0x356ae4
pushq $0x1
popq %rdi
callq 0x73dcb
leaq 0x2a7702(%rip), %rbx    # 0x325830
movb $0x0, (%rbx)
xorl %r14d, %r14d
leaq 0x2a4117(%rip), %r15    # 0x322252
movzwl (%r15), %eax
cmpq %rax, %r14
jae 0x7e15f
callq 0x51c47
movb %al, (%r14,%rbx)
movb $0x0, 0x1(%r14,%rbx)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0x7e13b
leaq 0x2a7ade(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
movsbl (%rbx), %eax
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
ja 0x7e17b
callq 0x7d2f5
jmp 0x7e17f
cmpb $0x3f, %al
jne 0x7e1cd
andl $0x0, 0x2ddc9e(%rip)    # 0x35be24
callq 0x7de4c
leaq 0x1aa22e(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x18f460(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x7e1b5
callq 0xae83
leaq 0x1aade4(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x75767
leaq 0x2a7867(%rip), %rdi    # 0x325a40
leaq 0x8ef97(%rip), %rsi     # 0x10d177
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7e284
leaq 0x2a7849(%rip), %rdi    # 0x325a40
leaq 0x8ef9d(%rip), %rsi     # 0x10d19b
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7e291
leaq 0x2a782b(%rip), %rdi    # 0x325a40
leaq 0x8efa3(%rip), %rsi     # 0x10d1bf
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7e29e
leaq 0x2a7811(%rip), %rdi    # 0x325a40
leaq 0x8efad(%rip), %rsi     # 0x10d1e3
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7e2ab
leaq 0x2a77f7(%rip), %rdi    # 0x325a40
leaq 0x8f4bc(%rip), %rsi     # 0x10d70c
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x7e2b8
leaq 0x2a77dd(%rip), %rdi    # 0x325a40
leaq 0x9677d(%rip), %rsi     # 0x1149e7
pushq $0x5
popq %rdx
callq 0x9380
testl %eax, %eax
jne 0x7e17f
callq 0x77d53
jmp 0x7e186
pushq $0x1
popq %rdi
callq 0x75b58
jmp 0x7e186
pushq $0x1
popq %rdi
callq 0x75967
jmp 0x7e186
pushq $0x1
popq %rdi
callq 0x76766
jmp 0x7e186
pushq $0x1
popq %rdi
callq 0x7665f
jmp 0x7e186
callq 0x7dde1
jmp 0x7e186