// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x811da
testl %eax, %eax
je 0x833a0
leaq 0x2b887f(%rip), %r14    # 0x33ba40
leaq 0x1(%r14), %rbx
leaq 0x9beac(%rip), %r12     # 0x11f078
movl $0x349, %r15d           # imm = 0x349
addq 0xccd67(%rip), %r15     # 0x14ff40
leaq 0x289f00(%rip), %r13    # 0x30d0e0
movzbl (%r14), %eax
cmpl $0x4c, %eax
jle 0x8321d
leal -0x4d(%rax), %ecx
cmpl $0xd, %ecx
ja 0x8324c
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x289ea7(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
leaq 0x28a1e4(%rip), %rax    # 0x30d3fc
jmp 0x8332b
cmpl $0x44, %eax
je 0x83340
cmpl $0x47, %eax
jne 0x83331
movq %rbx, %rdi
callq 0x95e0
leaq 0x28abb2(%rip), %rcx    # 0x30ddf0
movl %eax, (%rcx)
leaq 0x28abad(%rip), %rax    # 0x30ddf4
jmp 0x8332b
cmpl $0x74, %eax
jne 0x83331
movq %rbx, %rdi
callq 0x9470
divsd 0x85dc3(%rip), %xmm0    # 0x109028
leaq 0x28ab5c(%rip), %rax    # 0x30ddc8
movsd %xmm0, (%rax)
leaq 0x28a03d(%rip), %rax    # 0x30d2b4
jmp 0x8332b
movq %rbx, %rdi
callq 0x95e0
leaq 0x289e3a(%rip), %rcx    # 0x30d0c5
movb %al, (%rcx)
jmp 0x83331
movq %rbx, %rdi
callq 0x98c6
xorl %edx, %edx
xorl %ecx, %ecx
btl %edx, %eax
adcl $0x0, %ecx
incl %edx
cmpl $0x20, %edx
jne 0x8329e
leaq 0x289e2a(%rip), %rdx    # 0x30d0dc
movl $0x0, (%rdx)
movl $0x1, (%r13)
cmpl $0x1f, %ecx
jne 0x83376
xorl %ecx, %ecx
btl %ecx, %eax
jae 0x83363
incl %ecx
cmpl $0x20, %ecx
jne 0x832cb
jmp 0x83376
movq %rbx, %rdi
callq 0x95e0
leaq 0x289dd9(%rip), %rcx    # 0x30d0c8
movl %eax, (%rcx)
jmp 0x83331
movq %rbx, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x289db2(%rip), %rax    # 0x30d0b8
movss %xmm0, (%rax)
leaq 0x28a0e7(%rip), %rax    # 0x30d3f8
jmp 0x8332b
movq %rbx, %rdi
callq 0x95e0
leaq 0x2b9f7e(%rip), %rcx    # 0x33d2a0
movl %eax, (%rcx)
leaq 0x2b9f79(%rip), %rax    # 0x33d2a4
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
jne 0x831e0
jmp 0x833a0
movq %rbx, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x289d69(%rip), %rax    # 0x30d0bc
movss %xmm0, (%rax)
leaq 0x289d6e(%rip), %rax    # 0x30d0cc
orb $0x1, (%rax)
jmp 0x83331
incl %ecx
leaq 0x289d70(%rip), %rdx    # 0x30d0dc
movl %ecx, (%rdx)
movl $0x1, (%r13)
movl %eax, %ecx
notl %ecx
leaq 0x289d63(%rip), %rdx    # 0x30d0e4
movl %ecx, (%rdx)
movq %r15, %rcx
xorl %edx, %edx
btl %edx, %eax
setb (%rcx)
incq %rdx
addq $0x348, %rcx            # imm = 0x348
cmpq $0x20, %rdx
jne 0x83388
jmp 0x83331
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq