// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_conf()
void parse_star_conf()   
{
char *s;

   // device configuration info
   log_packet_id("Star config");

   if(star_type == OSA_TYPE) {
      s = strstr(nmea_msg, "PPS_CABLE_DELAY:");
      if(s) {
         s = s+16;
         zpad(s,6);
         cable_delay = atof(s) / 1.0E9;
         have_cable_delay = 1;
      }

      s = strstr(nmea_msg, "PPS_OFFSET:");
      if(s) {
         s = s+11;
         zpad(s,9);
         pps1_delay = atof(s) / 1.0E9;
         have_pps_delay |= 0x01;
      }

      s = strstr(nmea_msg, "TAU:");
      if(s) {
         s = s+4;
         zpad(s,5);
         time_constant = (float) atof(s);  // user time const
         have_osc_params |= PARAM_TC;
         have_tc |= 0x01;

         s = s + 5 + 1;
         zpad(s,5);
         real_time_constant = (float) atof(s);
         have_tc |= 0x02;
      }

      if     (strstr(nmea_msg, "/INIT"))             discipline_mode = DIS_MODE_POWERUP;
      else if(strstr(nmea_msg, "/WARM-UP"))          discipline_mode = DIS_MODE_WARMUP;
      else if(strstr(nmea_msg, "/TRACKED-FAST"))     discipline_mode = DIS_MODE_FAST_RECOVERY;
      else if(strstr(nmea_msg, "/TRACKED"))          discipline_mode = DIS_MODE_NORMAL;
      else if(strstr(nmea_msg, "/HOLDOVER")) {
         if(strstr(nmea_msg, "MODE:HOLDOVER"))       discipline_mode = DIS_MODE_MANUAL_HOLD;
         else if(strstr(nmea_msg, "MODE:AUTOMATIC")) discipline_mode = DIS_MODE_AUTO_HOLD;
         else                                        discipline_mode = DIS_MODE_UNKNOWN;
      }
      else                                           discipline_mode = DIS_MODE_UNKNOWN;
   }
   else {
      if(get_msg_field()) {  // user time constant
         time_constant = (float) atof(msg_field);
         have_osc_params |= PARAM_TC;
         have_tc |= 0x01;
      }

      if(get_msg_field()) {  // real pll time constant
         real_time_constant = (float) atof(msg_field);
         have_tc |= 0x02;
      }

      if(get_msg_field()) {  // user mode (A)utomatic or (H)oldover
         if(msg_field[0] == 'H') rcvr_mode = RCVR_MODE_PROP;       // user holdover
         else if(msg_field[0] == 'A') {
            if(minor_alarms & MINOR_SURVEY) rcvr_mode = RCVR_MODE_3D;
            else rcvr_mode = RCVR_MODE_HOLD;  // position hold
         }
         else rcvr_mode = RCVR_MODE_UNKNOWN;
      }

      if(get_msg_field()) {  // time zone - !!!! we don't do this
      }

      if(get_msg_field()) {  // cable delay
         cable_delay = atof(msg_field) / 1.0E9;
         have_cable_delay = 22;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x93ecd(%rip), %rdi     # 0x1240fa
callq 0x58dc2
leaq 0x18adaf(%rip), %rax    # 0x21afe8
cmpl $0x4f, (%rax)
jne 0x9039e
leaq 0x2ab5e7(%rip), %rdi    # 0x33b830
leaq 0x93eb6(%rip), %rsi     # 0x124106
callq 0x9090
testq %rax, %rax
je 0x90296
movq %rax, %rbx
addq $0x10, %rbx
movq %rbx, %rdi
movl $0x6, %esi
callq 0x8fdd2
movq %rbx, %rdi
callq 0x9470
divsd 0x78daa(%rip), %xmm0    # 0x109028
leaq 0x27db43(%rip), %rax    # 0x30ddc8
movsd %xmm0, (%rax)
leaq 0x27d024(%rip), %rax    # 0x30d2b4
movl $0x1, (%rax)
leaq 0x2ab593(%rip), %rdi    # 0x33b830
leaq 0x93e73(%rip), %rsi     # 0x124117
callq 0x9090
testq %rax, %rax
je 0x902e7
movq %rax, %rbx
addq $0xb, %rbx
movq %rbx, %rdi
movl $0x9, %esi
callq 0x8fdd2
movq %rbx, %rdi
callq 0x9470
divsd 0x78d56(%rip), %xmm0    # 0x109028
leaq 0x27daff(%rip), %rax    # 0x30ddd8
movsd %xmm0, (%rax)
leaq 0x27cfd4(%rip), %rax    # 0x30d2b8
orb $0x1, (%rax)
leaq 0x2ab542(%rip), %rdi    # 0x33b830
leaq 0x93e2e(%rip), %rsi     # 0x124123
callq 0x9090
testq %rax, %rax
je 0x90373
movq %rax, %rbx
leaq 0x4(%rax), %r14
movq %r14, %rdi
movl $0x5, %esi
callq 0x8fdd2
movq %r14, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x27cdc6(%rip), %rax    # 0x30d0f0
movsd %xmm0, (%rax)
leaq 0x27dac7(%rip), %rax    # 0x30ddfc
orb $0x1, (%rax)
leaq 0x27cfb1(%rip), %r14    # 0x30d2f0
orb $0x1, (%r14)
addq $0xa, %rbx
movq %rbx, %rdi
movl $0x5, %esi
callq 0x8fdd2
movq %rbx, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x27cd8d(%rip), %rax    # 0x30d0f8
movsd %xmm0, (%rax)
orb $0x2, (%r14)
leaq 0x2ab4b6(%rip), %rdi    # 0x33b830
leaq 0x93da7(%rip), %rsi     # 0x124128
callq 0x9090
testq %rax, %rax
je 0x90440
leaq 0x27d101(%rip), %rax    # 0x30d497
movb $0x1, (%rax)
jmp 0x904ad
callq 0x810b1
testl %eax, %eax
je 0x903da
leaq 0x2ab692(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x27cd2e(%rip), %rax    # 0x30d0f0
movsd %xmm0, (%rax)
leaq 0x27da2f(%rip), %rax    # 0x30ddfc
orb $0x1, (%rax)
leaq 0x27cf19(%rip), %rax    # 0x30d2f0
orb $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x9040c
leaq 0x2ab656(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x27ccfa(%rip), %rax    # 0x30d0f8
movsd %xmm0, (%rax)
leaq 0x27cee7(%rip), %rax    # 0x30d2f0
orb $0x2, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x90473
leaq 0x2ab624(%rip), %rax    # 0x33ba40
movzbl (%rax), %eax
cmpl $0x48, %eax
je 0x90464
cmpl $0x41, %eax
jne 0x90468
leaq 0x27cda8(%rip), %rax    # 0x30d1d8
xorl %ecx, %ecx
testb $0x20, (%rax)
sete %cl
leal (%rcx,%rcx,2), %eax
addl $0x4, %eax
jmp 0x9046a
leaq 0x2ab3e9(%rip), %rdi    # 0x33b830
leaq 0x93ce0(%rip), %rsi     # 0x12412e
callq 0x9090
testq %rax, %rax
je 0x904b2
leaq 0x27d038(%rip), %rax    # 0x30d497
movb $0xa, (%rax)
jmp 0x904ad
movb $0x8, %al
jmp 0x9046a
movb $0x63, %al
leaq 0x27cc5f(%rip), %rcx    # 0x30d0d0
movb %al, (%rcx)
callq 0x810b1
callq 0x810b1
testl %eax, %eax
je 0x904ad
leaq 0x2ab5b8(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x78b93(%rip), %xmm0    # 0x109028
leaq 0x27d92c(%rip), %rax    # 0x30ddc8
movsd %xmm0, (%rax)
leaq 0x27ce0d(%rip), %rax    # 0x30d2b4
movl $0x16, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2ab377(%rip), %rdi    # 0x33b830
leaq 0x93c77(%rip), %rsi     # 0x124137
callq 0x9090
testq %rax, %rax
je 0x904d6
leaq 0x27cfc6(%rip), %rax    # 0x30d497
movb $0x5, (%rax)
jmp 0x904ad
leaq 0x2ab353(%rip), %rdi    # 0x33b830
leaq 0x93c61(%rip), %rsi     # 0x124145
callq 0x9090
testq %rax, %rax
je 0x904fa
leaq 0x27cfa2(%rip), %rax    # 0x30d497
movb $0x0, (%rax)
jmp 0x904ad
leaq 0x2ab32f(%rip), %rdi    # 0x33b830
leaq 0x93c46(%rip), %rsi     # 0x12414e
callq 0x9090
testq %rax, %rax
je 0x90560
leaq 0x2ab317(%rip), %rdi    # 0x33b830
leaq 0x93c38(%rip), %rsi     # 0x124158
callq 0x9090
testq %rax, %rax
je 0x90539
leaq 0x27cf66(%rip), %rax    # 0x30d497
movb $0x3, (%rax)
jmp 0x904ad
leaq 0x2ab2f0(%rip), %rdi    # 0x33b830
leaq 0x93c1f(%rip), %rsi     # 0x124166
callq 0x9090
testq %rax, %rax
je 0x90560
leaq 0x27cf3f(%rip), %rax    # 0x30d497
movb $0x2, (%rax)
jmp 0x904ad
leaq 0x27cf30(%rip), %rax    # 0x30d497
movb $-0x1, (%rax)
jmp 0x904ad