// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpgsa(int)
void parse_gpgsa(int system)
{
int mode_flag;
int fix_status;
int prn;
int i;

   if((system & system_mask) == 0) return;

   last_was_gsv = 0;
   if(get_msg_field()) mode_flag = msg_field[0];

   if(get_msg_field()) {
      if(0 && (rcvr_type == BRANDY_RCVR)) ;  // we get rvcr_mode from the Brandywine ",A" message
      else if(rcvr_type == ESIP_RCVR) ;  // we get rvcr_mode from the CRY message
      else {
         fix_status = atoi(msg_field);
         i = rcvr_mode;
         if(fix_status == 1) {
            rcvr_mode = RCVR_MODE_NO_SATS;  
            if((rcvr_type == FURUNO_RCVR) && have_furuno_fix_mode) {
               if((furuno_fix_mode == 2) || (furuno_fix_mode == 4)) {  // !!!! fix mode 4?
                  rcvr_mode = RCVR_MODE_HOLD;
               }
            }
         }
         else if(fix_status == 2) rcvr_mode = RCVR_MODE_2D;
         else if(fix_status == 3) rcvr_mode = RCVR_MODE_3D;
         else                     rcvr_mode = RCVR_MODE_UNKNOWN;
         have_tracking = 1;

         minor_alarms &= (~MINOR_NO_TRACK);
         if(rcvr_mode == RCVR_MODE_NO_SATS) { 
            if(rcvr_type == BRANDY_RCVR) rcvr_mode = i;  // Brandywine GPSDO sends fix_mode == 1 in position hold mode?
            else minor_alarms |= MINOR_NO_TRACK;
         }
         have_rcvr_mode = 2;
      }
   }

   for(i=1; i<=12; i++) {   // list of sats being tracked
      if(get_msg_field()) {
         prn = atoi(msg_field);
         if((prn >= 1) && (prn <= MAX_PRN)) { 
            sat[prn].tracking = prn;
            sat[prn].level_msg = 2;
            have_snr |= rinex_gnss(prn);
         }
      }
   }

// have_dops = 0;
   if(get_msg_field()) {
      pdop = (float) atof(msg_field);
      have_dops |= PDOP;
   }
   if(get_msg_field()) {
      hdop = (float) atof(msg_field);
      have_dops |= HDOP;
   }
   if(get_msg_field()) {
      vdop = (float) atof(msg_field);
      have_dops |= VDOP;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x11eefb(%rip), %rcx    # 0x1cfe50
andl (%rcx), %eax
cmpl $0x0, %eax
jne 0xb0f61
jmp 0xb1215
movl $0x0, 0x320089(%rip)    # 0x3d0ff4
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb0f82
leaq 0x2e9ca4(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
movl %eax, -0x8(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb10ba
movl $0x80000000, %ecx       # imm = 0x80000000
leaq 0x1c6b14(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0xb0fa6
jmp 0xb10b8
leaq 0x2e9c73(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0xc(%rbp)
leaq 0x2bb2f4(%rip), %rax    # 0x36c2b0
movzbl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0xb1014
leaq 0x2bb2e1(%rip), %rax    # 0x36c2b0
movb $0x2, (%rax)
leaq 0x1c6ad7(%rip), %rax    # 0x277ab0
cmpq $0x20000000, (%rax)     # imm = 0x20000000
jne 0xb1012
leaq 0x2eb49b(%rip), %rax    # 0x39c484
cmpl $0x0, (%rax)
je 0xb1012
leaq 0x2eb48b(%rip), %rax    # 0x39c480
cmpl $0x2, (%rax)
je 0xb1006
leaq 0x2eb47f(%rip), %rax    # 0x39c480
cmpl $0x4, (%rax)
jne 0xb1010
leaq 0x2bb2a3(%rip), %rax    # 0x36c2b0
movb $0x7, (%rax)
jmp 0xb1012
jmp 0xb1046
cmpl $0x2, -0xc(%rbp)
jne 0xb1026
leaq 0x2bb28f(%rip), %rax    # 0x36c2b0
movb $0x3, (%rax)
jmp 0xb1044
cmpl $0x3, -0xc(%rbp)
jne 0xb1038
leaq 0x2bb27d(%rip), %rax    # 0x36c2b0
movb $0x4, (%rax)
jmp 0xb1042
leaq 0x2bb271(%rip), %rax    # 0x36c2b0
movb $0x63, (%rax)
jmp 0xb1044
jmp 0xb1046
leaq 0x2bb423(%rip), %rax    # 0x36c470
movl $0x1, (%rax)
leaq 0x2bb35e(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x2bb352(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2bb241(%rip), %rax    # 0x36c2b0
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0xb10ae
leaq 0x1c6a32(%rip), %rax    # 0x277ab0
cmpq $0x40000, (%rax)        # imm = 0x40000
jne 0xb1097
movl -0x14(%rbp), %eax
movb %al, %cl
leaq 0x2bb21d(%rip), %rax    # 0x36c2b0
movb %cl, (%rax)
jmp 0xb10ac
leaq 0x2bb31a(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2bb30e(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xb10ae
leaq 0x2bb538(%rip), %rax    # 0x36c5ed
movb $0x2, (%rax)
jmp 0xb10ba
movl $0x1, -0x14(%rbp)
cmpl $0xc, -0x14(%rbp)
jg 0xb115b
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb114b
leaq 0x2e9b44(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x10(%rbp)
cmpl $0x1, -0x10(%rbp)
jl 0xb1149
cmpl $0x3e7, -0x10(%rbp)     # imm = 0x3E7
jg 0xb1149
movl -0x10(%rbp), %ecx
movslq -0x10(%rbp), %rdx
leaq 0x1ed08f(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0x218(%rax)
movslq -0x10(%rbp), %rcx
leaq 0x1ed074(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x2, 0x1c(%rax)
movl -0x10(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bb3ee(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x2bb3e5(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
jmp 0xb114b
jmp 0xb114d
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xb10c1
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb1199
leaq 0x2e9ab4(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1d1548(%rip), %rax    # 0x2826c8
movsd %xmm0, (%rax)
leaq 0x1d1539(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x1d152d(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb11d7
leaq 0x2e9a76(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1d1512(%rip), %rax    # 0x2826d0
movsd %xmm0, (%rax)
leaq 0x1d14fb(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x1d14ef(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb1215
leaq 0x2e9a38(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1d14dc(%rip), %rax    # 0x2826d8
movsd %xmm0, (%rax)
leaq 0x1d14bd(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x1d14b1(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)