// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpssd()
void parse_gpssd()
{
double hold_alt;
int almanac;
int prn;
int count;
int flag;
u32 val;

   while(get_msg_field()) {
      if(msg_field[0] == 'A') {  // almanac flag
         almanac = atoi(&msg_field[1]);
      }
      else if(msg_field[0] == 'D') {  // PDOP threshold value
         pdop_mask = (float) atof(&msg_field[1]);
         have_pdop_mask |= 0x01;
      }
      else if(msg_field[0] == 'G') {  // datum
         datum = atoi(&msg_field[1]);
         have_datum = 1;
      }
      else if(msg_field[0] == 'H') {  // 2D position hold altitude
         hold_alt = atof(&msg_field[1]);
      }
      else if(msg_field[0] == 'M') {  // elevation mask angle
         el_mask = (float) atof(&msg_field[1]);
         have_el_mask = 1;
      }
      else if(msg_field[0] == 'S') {  // signal mask value
         amu_mask = (float) atof(&msg_field[1]);
         have_amu = 1;
      }
      else if(msg_field[0] == 't') {  // cable delay in nanoseconds
         cable_delay = atof(&msg_field[1]);
         cable_delay /= 1.0E9;
         have_cable_delay = 1;
      }
      else if(msg_field[0] == 'U') {  // excluded sats
         val = atohex(&msg_field[1]);
         count = 0;

         for(prn=1; prn<=32; prn++) {
            if(val & (1 << (prn-1))) ++count;
         }

         single_sat_prn = 0;
         have_single_prn = 1;
         if(count == 31) {  // all but 1 sat excluded
            for(prn=1; prn <= 32; prn++) {
               flag = (val & (1 << (prn-1)));
               if(flag == 0) {
                  single_sat_prn = prn; 
                  have_single_prn = 1;
                  break;
               }
            }
         }

         val = (~val);
         sats_enabled = val;
         update_disable_list(sats_enabled);
      }
      else if(msg_field[0] == 'W') {  // smoothing index
         smoothing_code = atoi(&msg_field[1]);
      }
      else if(msg_field[0] == 'X') {  // dynamic index
         dynamics_code = atoi(&msg_field[1]);
      }
      else if(msg_field[0] == 'Z') {  // fix mode
         furuno_fix_mode = atoi(&msg_field[1]);
         have_furuno_fix_mode = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0xb0bd0
cmpl $0x0, %eax
je 0xb3ef5
leaq 0x2e7083(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x41, %eax
jne 0xb3bbd
leaq 0x2e7074(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x95c0
movl %eax, -0xc(%rbp)
jmp 0xb3ef0
leaq 0x2e705c(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x44, %eax
jne 0xb3c05
leaq 0x2e704d(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x9480
cvtsd2ss %xmm0, %xmm0
leaq 0x2b86b5(%rip), %rax    # 0x36c29c
movss %xmm0, (%rax)
leaq 0x2b86ba(%rip), %rax    # 0x36c2ac
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2b86ae(%rip), %rax    # 0x36c2ac
movl %ecx, (%rax)
jmp 0xb3eee
leaq 0x2e7014(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x47, %eax
jne 0xb3c41
leaq 0x2e7005(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x95c0
movl %eax, %ecx
leaq 0x2b93a3(%rip), %rax    # 0x36cfd0
movl %ecx, (%rax)
leaq 0x2b939e(%rip), %rax    # 0x36cfd4
movl $0x1, (%rax)
jmp 0xb3eec
leaq 0x2e6fd8(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x48, %eax
jne 0xb3c6a
leaq 0x2e6fc9(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x9480
movsd %xmm0, -0x8(%rbp)
jmp 0xb3eea
leaq 0x2e6faf(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x4d, %eax
jne 0xb3caa
leaq 0x2e6fa0(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x9480
cvtsd2ss %xmm0, %xmm0
leaq 0x2b8600(%rip), %rax    # 0x36c294
movss %xmm0, (%rax)
leaq 0x2b893d(%rip), %rax    # 0x36c5dc
movl $0x1, (%rax)
jmp 0xb3ee8
leaq 0x2e6f6f(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x53, %eax
jne 0xb3cea
leaq 0x2e6f60(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x9480
cvtsd2ss %xmm0, %xmm0
leaq 0x2b85c4(%rip), %rax    # 0x36c298
movss %xmm0, (%rax)
leaq 0x2b88f9(%rip), %rax    # 0x36c5d8
movl $0x1, (%rax)
jmp 0xb3ee6
leaq 0x2e6f2f(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0xb3d48
leaq 0x2e6f20(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x9480
leaq 0x2b9298(%rip), %rax    # 0x36cfa8
movsd %xmm0, (%rax)
leaq 0x2b928d(%rip), %rax    # 0x36cfa8
movsd (%rax), %xmm0
movsd 0xbb301(%rip), %xmm1    # 0x16f028
divsd %xmm1, %xmm0
leaq 0x2b9276(%rip), %rax    # 0x36cfa8
movsd %xmm0, (%rax)
leaq 0x2b8757(%rip), %rax    # 0x36c494
movl $0x1, (%rax)
jmp 0xb3ee4
leaq 0x2e6ed1(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x55, %eax
jne 0xb3e4d
leaq 0x2e6ebe(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x98d0
movl %eax, -0x1c(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x1, -0x10(%rbp)
cmpl $0x20, -0x10(%rbp)
jg 0xb3db1
movl -0x1c(%rbp), %eax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xb3da4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xb3da6
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xb3d7c
leaq 0x2b8504(%rip), %rax    # 0x36c2bc
movl $0x0, (%rax)
leaq 0x2b84fb(%rip), %rax    # 0x36c2c0
movl $0x1, (%rax)
cmpl $0x1f, -0x14(%rbp)
jne 0xb3e25
movl $0x1, -0x10(%rbp)
cmpl $0x20, -0x10(%rbp)
jg 0xb3e23
movl -0x1c(%rbp), %eax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0xb3e16
movl -0x10(%rbp), %ecx
leaq 0x2b84b7(%rip), %rax    # 0x36c2bc
movl %ecx, (%rax)
leaq 0x2b84b2(%rip), %rax    # 0x36c2c0
movl $0x1, (%rax)
jmp 0xb3e23
jmp 0xb3e18
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xb3dd8
jmp 0xb3e25
movl -0x1c(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
leaq 0x2b848c(%rip), %rax    # 0x36c2c4
movl %ecx, (%rax)
leaq 0x2b8483(%rip), %rax    # 0x36c2c4
movl (%rax), %edi
callq 0x81cb0
jmp 0xb3ee2
leaq 0x2e6dcc(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x57, %eax
jne 0xb3e79
leaq 0x2e6dbd(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x95c0
movl %eax, %ecx
leaq 0x2b8433(%rip), %rax    # 0x36c2a8
movl %ecx, (%rax)
jmp 0xb3ee0
leaq 0x2e6da0(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x58, %eax
jne 0xb3ea5
leaq 0x2e6d91(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x95c0
movb %al, %cl
leaq 0x2b8404(%rip), %rax    # 0x36c2a5
movb %cl, (%rax)
jmp 0xb3ede
leaq 0x2e6d74(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x5a, %eax
jne 0xb3edc
leaq 0x2e6d65(%rip), %rdi    # 0x39ac20
addq $0x1, %rdi
callq 0x95c0
movl %eax, %ecx
leaq 0x2e85b3(%rip), %rax    # 0x39c480
movl %ecx, (%rax)
leaq 0x2e85ae(%rip), %rax    # 0x39c484
movl $0x1, (%rax)
jmp 0xb3ede
jmp 0xb3ee0
jmp 0xb3ee2
jmp 0xb3ee4
jmp 0xb3ee6
jmp 0xb3ee8
jmp 0xb3eea
jmp 0xb3eec
jmp 0xb3eee
jmp 0xb3ef0
jmp 0xb3b88
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)