// File: /workspace/github_cpp_makefile_star2_O3/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 0xef9ed(%rip), %rax     # 0x170c70
testl %edi, (%rax)
je 0x81459
movl $0x0, 0x2f0b8f(%rip)    # 0x371e24
callq 0x810b1
callq 0x810b1
testl %eax, %eax
sete %al
leaq 0x197625(%rip), %rcx    # 0x2188d0
movq (%rcx), %rbx
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rbx
sete %cl
orb %al, %cl
jne 0x81362
leaq 0x2ba778(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x28bdfc(%rip), %rcx    # 0x30d0d0
cmpl $0x3, %eax
je 0x81339
cmpl $0x2, %eax
je 0x81335
cmpl $0x1, %eax
jne 0x8133d
movb (%rcx), %al
movb $0x2, (%rcx)
cmpq $0x20000000, %rbx       # imm = 0x20000000
jne 0x81462
leaq 0x2bbfa8(%rip), %rdx    # 0x33d2a4
cmpl $0x0, (%rdx)
je 0x81462
leaq 0x2bbf94(%rip), %rax    # 0x33d2a0
movl (%rax), %edx
movb $0x7, %al
cmpl $0x2, %edx
je 0x8133f
cmpl $0x4, %edx
je 0x8133f
leaq 0x28bf6f(%rip), %rax    # 0x30d290
movl $0x1, (%rax)
leaq 0x28beaa(%rip), %rax    # 0x30d1d8
movl (%rax), %edx
jmp 0x8148f
movb $0x3, %al
jmp 0x8133f
movb $0x4, %al
jmp 0x8133f
movb $0x63, %al
movb %al, (%rcx)
leaq 0x28bf48(%rip), %rax    # 0x30d290
movl $0x1, (%rax)
leaq 0x28be83(%rip), %rax    # 0x30d1d8
andb $-0x9, (%rax)
leaq 0x28c0ae(%rip), %rax    # 0x30d40d
movb $0x2, (%rax)
movl $0xc, %r14d
leaq 0x2ba6d1(%rip), %rbx    # 0x33ba40
leaq 0x1bdc3a(%rip), %r15    # 0x23efb0
leaq 0x28bfcf(%rip), %r12    # 0x30d34c
callq 0x810b1
testl %eax, %eax
je 0x813be
movq %rbx, %rdi
callq 0x95e0
leal -0x1(%rax), %ecx
cmpl $0x3e6, %ecx            # imm = 0x3E6
ja 0x813be
movl %eax, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
movl %eax, 0x218(%r15,%rcx)
movl $0x2, 0x1c(%r15,%rcx)
movl %eax, %edi
callq 0xdc1dd
orl %eax, (%r12)
decl %r14d
jne 0x8137d
callq 0x810b1
testl %eax, %eax
je 0x813f5
leaq 0x2ba66d(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a2101(%rip), %rax    # 0x2234e8
movsd %xmm0, (%rax)
leaq 0x1a20f2(%rip), %rax    # 0x2234e4
orb $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x81427
leaq 0x2ba63b(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a20d7(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
leaq 0x1a20c0(%rip), %rax    # 0x2234e4
orb $0x2, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x81459
leaq 0x2ba609(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a20ad(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
leaq 0x1a208e(%rip), %rax    # 0x2234e4
orb $0x4, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28be27(%rip), %rdx    # 0x30d290
movl $0x1, (%rdx)
leaq 0x28bd62(%rip), %rsi    # 0x30d1d8
movl (%rsi), %edx
movl %edx, %edi
andl $-0x9, %edi
movl %edi, (%rsi)
cmpq $0x40000, %rbx          # imm = 0x40000
jne 0x8148f
movb %al, (%rcx)
jmp 0x81358
orl $0x8, %edx
leaq 0x28bd3f(%rip), %rax    # 0x30d1d8
movl %edx, (%rax)
jmp 0x81358