// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_perdapi()
void parse_perdapi()
{
int i;
int gnss;
float val;
u32 mask;

   gnss = 0;
   get_msg_field();
   if(strstr(msg_field, "FIXMASK")) {  // snr and elevation mask
      get_msg_field(); // eat the "USER"


      if(get_msg_field()) {  // el mask
         val = (float) atof(msg_field);
         el_mask = val;
         have_el_mask = 87;
      }
      get_msg_field();

      if(get_msg_field()) {  // snr mask
         val = (float) atof(msg_field);
         amu_mask = val;
         have_amu = 87;
      }
      get_msg_field();

      for(i=1; i<256; i++) {
         sat[i].disabled = 0;
      }

      if(get_msg_field()) {  // excluded GPS sats
         mask = atohex(msg_field);
         esip_deleted_gps = mask;
         esip_disable(1, 32, mask);
      }
      if(get_msg_field()) {  // excluded Glonass
         mask = atohex(msg_field);
         esip_deleted_glonass = mask;
         esip_disable(65, 28, mask);
      }
      if(get_msg_field()) {  // excluded Galileo
         mask = atohex(msg_field);
         esip_deleted_galileo = mask;
//       esip_disable(211, 20, mask);  // !!!!!! what starting PRN to use?  Ublox uses 211..246
      }
      if(get_msg_field()) {  // excluded QZSS
         mask = atohex(msg_field);
         esip_deleted_qzss = mask;
         esip_disable(93, 7, mask);
      }
      if(get_msg_field()) {  // excluded SBAS
         mask = atohex(msg_field);
         esip_deleted_sbas = mask;
         esip_disable(33, 19, mask);
      }
      have_esip_fixmask = 87;
   }
   else if(strstr(msg_field, "FREQ")) {  // GCLK settings
      if(get_msg_field()) {    // GCLK enabled
         i = atoi(msg_field);
      }

      if(get_msg_field()) {  // GCLK freq
         pps2_freq = atof(msg_field);
         have_pps_freq |= 0x02;
      }

      if(get_msg_field()) {  // GCLK duty
         pps2_duty = atof(msg_field) / 100.0;
         have_pps_duty |= 0x02;
      }
//sprintf(debug_text, "GCLK enbl:%d  freq:%g  duty:%g", i, pps2_freq,pps2_duty);

      if(get_msg_field()) {  // offset in ns
         i = atoi(msg_field);
      }
   }
   else if(strstr(msg_field, "GNSS")) {  // GNSS systems in use
      get_msg_field(); // eat the talker id

      if(get_msg_field()) {  // gps
         i = atoi(msg_field);
         if(i) gnss |= GPS;
      }

      if(get_msg_field()) {  // glonass
         i = atoi(msg_field);
         if(i) gnss |= GLONASS;
      }

      if(get_msg_field()) {  // galileo
         i = atoi(msg_field);
         if(i) gnss |= GALILEO;
      }

      if(get_msg_field()) {  // QZSS
         i = atoi(msg_field);
         if(i) gnss |= QZSS;
      }

      if(get_msg_field()) {  // SBAS
         i = atoi(msg_field);
         if(i) gnss |= SBAS;
      }

      gnss_mask = gnss;
      have_gnss_mask = 87;
   }
   else if(strstr(msg_field, "RESTART")) {  // receiver restart command
   }
   else if(strstr(msg_field, "TIMEZONE")) {  // receiver timezone setting
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x811da
leaq 0x2b7517(%rip), %rdi    # 0x33ba40
leaq 0x9e8ed(%rip), %rsi     # 0x122e1d
callq 0x9090
testq %rax, %rax
je 0x846ff
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0x84574
leaq 0x2b74ed(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x288b51(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
leaq 0x288e8e(%rip), %rax    # 0x30d3fc
movl $0x57, (%rax)
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0x845aa
leaq 0x2b74b7(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x288b1f(%rip), %rax    # 0x30d0b8
movss %xmm0, (%rax)
leaq 0x288e54(%rip), %rax    # 0x30d3f8
movl $0x57, (%rax)
callq 0x811da
movl $0x349, %eax            # imm = 0x349
leaq 0x1ba9f5(%rip), %rcx    # 0x23efb0
movb $0x0, (%rcx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0x34801, %rax          # imm = 0x34801
jne 0x845bb
callq 0x811da
testl %eax, %eax
je 0x8460d
leaq 0x2b7463(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x28979f(%rip), %rcx    # 0x30dd88
movl %eax, (%rcx)
movl $0x349, %ecx            # imm = 0x349
addq 0xcb949(%rip), %rcx     # 0x14ff40
xorl %edx, %edx
btl %edx, %eax
setb (%rcx)
incl %edx
addq $0x348, %rcx            # imm = 0x348
cmpl $0x20, %edx
jne 0x845f9
callq 0x811da
testl %eax, %eax
je 0x8464d
leaq 0x2b7423(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x289763(%rip), %rcx    # 0x30dd8c
movl %eax, (%rcx)
movl $0xd549, %ecx           # imm = 0xD549
addq 0xcb909(%rip), %rcx     # 0x14ff40
xorl %edx, %edx
btl %edx, %eax
setb (%rcx)
incl %edx
addq $0x348, %rcx            # imm = 0x348
cmpl $0x1c, %edx
jne 0x84639
callq 0x811da
testl %eax, %eax
je 0x8466b
leaq 0x2b73e3(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x289727(%rip), %rcx    # 0x30dd90
movl %eax, (%rcx)
callq 0x811da
testl %eax, %eax
je 0x846ab
leaq 0x2b73c5(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x28970d(%rip), %rcx    # 0x30dd94
movl %eax, (%rcx)
movl $0x13129, %ecx          # imm = 0x13129
addq 0xcb8ab(%rip), %rcx     # 0x14ff40
xorl %edx, %edx
btl %edx, %eax
setb (%rcx)
incl %edx
addq $0x348, %rcx            # imm = 0x348
cmpl $0x7, %edx
jne 0x84697
callq 0x811da
testl %eax, %eax
je 0x846eb
leaq 0x2b7385(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x2896d1(%rip), %rcx    # 0x30dd98
movl %eax, (%rcx)
movl $0x6c49, %ecx           # imm = 0x6C49
addq 0xcb86b(%rip), %rcx     # 0x14ff40
xorl %edx, %edx
btl %edx, %eax
setb (%rcx)
incl %edx
addq $0x348, %rcx            # imm = 0x348
cmpl $0x13, %edx
jne 0x846d7
leaq 0x2896aa(%rip), %rax    # 0x30dd9c
movl $0x57, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2b733a(%rip), %rdi    # 0x33ba40
leaq 0x996d7(%rip), %rsi     # 0x11dde4
callq 0x9090
testq %rax, %rax
je 0x84783
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0x84746
leaq 0x2b7314(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x289608(%rip), %rax    # 0x30dd40
movsd %xmm0, (%rax)
leaq 0x28961d(%rip), %rax    # 0x30dd60
orb $0x2, (%rax)
callq 0x811da
testl %eax, %eax
je 0x84778
leaq 0x2b72ea(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x848fd(%rip), %xmm0    # 0x109060
leaq 0x2895de(%rip), %rax    # 0x30dd48
movsd %xmm0, (%rax)
leaq 0x2895ef(%rip), %rax    # 0x30dd64
orb $0x2, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x811da
leaq 0x2b72b6(%rip), %rdi    # 0x33ba40
leaq 0x9ff8d(%rip), %rsi     # 0x12471e
callq 0x9090
testq %rax, %rax
je 0x846f8
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0x847c2
leaq 0x2b728c(%rip), %rdi    # 0x33ba40
callq 0x95e0
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
jmp 0x847c4
xorl %ebx, %ebx
callq 0x811da
testl %eax, %eax
je 0x847e3
leaq 0x2b726c(%rip), %rdi    # 0x33ba40
callq 0x95e0
leal 0x2(%rbx), %ecx
testl %eax, %eax
cmovel %ebx, %ecx
movl %ecx, %ebx
callq 0x811da
testl %eax, %eax
je 0x84802
leaq 0x2b724d(%rip), %rdi    # 0x33ba40
callq 0x95e0
leal 0x4(%rbx), %ecx
testl %eax, %eax
cmovel %ebx, %ecx
movl %ecx, %ebx
callq 0x811da
testl %eax, %eax
je 0x84824
leaq 0x2b722e(%rip), %rdi    # 0x33ba40
callq 0x95e0
leal 0x4000(%rbx), %ecx
testl %eax, %eax
cmovel %ebx, %ecx
movl %ecx, %ebx
callq 0x811da
testl %eax, %eax
je 0x84846
leaq 0x2b720c(%rip), %rdi    # 0x33ba40
callq 0x95e0
leal 0x8000(%rbx), %ecx
testl %eax, %eax
cmovel %ebx, %ecx
movl %ecx, %ebx
leaq 0xec427(%rip), %rax     # 0x170c74
movl %ebx, (%rax)
leaq 0xec422(%rip), %rax     # 0x170c78
jmp 0x846f2