// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xef8c2(%rip), %rax     # 0x170c70
testl %edi, (%rax)
je 0x81580
movl $0x0, 0x2f0a64(%rip)    # 0x371e24
callq 0x811da
callq 0x811da
testl %eax, %eax
sete %al
leaq 0x1974fa(%rip), %rcx    # 0x2188d0
movq (%rcx), %rbx
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rbx
sete %cl
orb %al, %cl
jne 0x81489
leaq 0x2ba64d(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x28bcd1(%rip), %rcx    # 0x30d0d0
movb (%rcx), %dl
cmpl $0x3, %eax
je 0x81443
cmpl $0x2, %eax
je 0x8143f
cmpl $0x1, %eax
jne 0x81447
movb $0x2, (%rcx)
cmpq $0x20000000, %rbx       # imm = 0x20000000
jne 0x8144b
leaq 0x2bbe81(%rip), %rax    # 0x33d2a4
cmpl $0x0, (%rax)
je 0x8144b
leaq 0x2bbe71(%rip), %rax    # 0x33d2a0
movl (%rax), %esi
movb $0x7, %al
cmpl $0x2, %esi
je 0x81449
cmpl $0x4, %esi
je 0x81449
jmp 0x8144b
movb $0x3, %al
jmp 0x81449
movb $0x4, %al
jmp 0x81449
movb $0x63, %al
movb %al, (%rcx)
leaq 0x28be3e(%rip), %rax    # 0x30d290
movl $0x1, (%rax)
leaq 0x28bd79(%rip), %rax    # 0x30d1d8
movl (%rax), %esi
movl %esi, %edi
andl $-0x9, %edi
movl %edi, (%rax)
cmpb $0x2, (%rcx)
jne 0x8147f
cmpq $0x40000, %rbx          # imm = 0x40000
jne 0x8147a
movb %dl, (%rcx)
jmp 0x8147f
orl $0x8, %esi
movl %esi, (%rax)
leaq 0x28bf87(%rip), %rax    # 0x30d40d
movb $0x2, (%rax)
movl $0xc, %r14d
leaq 0x2ba5aa(%rip), %rbx    # 0x33ba40
leaq 0x1bdb13(%rip), %r15    # 0x23efb0
leaq 0x28bea8(%rip), %r12    # 0x30d34c
callq 0x811da
testl %eax, %eax
je 0x814e5
movq %rbx, %rdi
callq 0x95e0
leal -0x1(%rax), %ecx
cmpl $0x3e6, %ecx            # imm = 0x3E6
ja 0x814e5
movl %eax, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
movl %eax, 0x218(%r15,%rcx)
movl $0x2, 0x1c(%r15,%rcx)
movl %eax, %edi
callq 0xdbb74
orl %eax, (%r12)
decl %r14d
jne 0x814a4
callq 0x811da
testl %eax, %eax
je 0x8151c
leaq 0x2ba546(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a1fda(%rip), %rax    # 0x2234e8
movsd %xmm0, (%rax)
leaq 0x1a1fcb(%rip), %rax    # 0x2234e4
orb $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8154e
leaq 0x2ba514(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a1fb0(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
leaq 0x1a1f99(%rip), %rax    # 0x2234e4
orb $0x2, (%rax)
callq 0x811da
testl %eax, %eax
je 0x81580
leaq 0x2ba4e2(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a1f86(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
leaq 0x1a1f67(%rip), %rax    # 0x2234e4
orb $0x4, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq