// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x8ab60(%rip), %rdi     # 0x10e042
callq 0x520bf
leaq 0x181afa(%rip), %rax    # 0x204fe8
cmpl $0x4f, (%rax)
jne 0x8364f
leaq 0x2a2332(%rip), %rdi    # 0x325830
leaq 0x8ab49(%rip), %rsi     # 0x10e04e
callq 0x9090
testq %rax, %rax
je 0x83549
movq %rax, %rbx
addq $0x10, %rbx
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x830bb
movq %rbx, %rdi
callq 0x9470
divsd 0x6faf7(%rip), %xmm0    # 0xf3028
leaq 0x274890(%rip), %rax    # 0x2f7dc8
movsd %xmm0, (%rax)
leaq 0x273d71(%rip), %rax    # 0x2f72b4
movl $0x1, (%rax)
leaq 0x2a22e0(%rip), %rdi    # 0x325830
leaq 0x8ab08(%rip), %rsi     # 0x10e05f
callq 0x9090
testq %rax, %rax
je 0x83598
movq %rax, %rbx
addq $0xb, %rbx
pushq $0x9
popq %rsi
movq %rbx, %rdi
callq 0x830bb
movq %rbx, %rdi
callq 0x9470
divsd 0x6faa5(%rip), %xmm0    # 0xf3028
leaq 0x27484e(%rip), %rax    # 0x2f7dd8
movsd %xmm0, (%rax)
leaq 0x273d23(%rip), %rax    # 0x2f72b8
orb $0x1, (%rax)
leaq 0x2a2291(%rip), %rdi    # 0x325830
leaq 0x8aac5(%rip), %rsi     # 0x10e06b
callq 0x9090
testq %rax, %rax
je 0x83624
movq %rax, %rbx
leaq 0x4(%rax), %r14
pushq $0x5
popq %r15
movq %r14, %rdi
movl %r15d, %esi
callq 0x830bb
movq %r14, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x273b13(%rip), %rax    # 0x2f70f0
movsd %xmm0, (%rax)
leaq 0x274814(%rip), %rax    # 0x2f7dfc
orb $0x1, (%rax)
leaq 0x273cfe(%rip), %r14    # 0x2f72f0
orb $0x1, (%r14)
addq $0xa, %rbx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x830bb
movq %rbx, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x273adc(%rip), %rax    # 0x2f70f8
movsd %xmm0, (%rax)
orb $0x2, (%r14)
leaq 0x2a2205(%rip), %rdi    # 0x325830
leaq 0x8aa3e(%rip), %rsi     # 0x10e070
callq 0x9090
testq %rax, %rax
je 0x836f1
leaq 0x273e50(%rip), %rax    # 0x2f7497
movb $0x1, (%rax)
jmp 0x8375e
callq 0x75767
testl %eax, %eax
je 0x8368b
leaq 0x2a23e1(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x273a7d(%rip), %rax    # 0x2f70f0
movsd %xmm0, (%rax)
leaq 0x27477e(%rip), %rax    # 0x2f7dfc
orb $0x1, (%rax)
leaq 0x273c68(%rip), %rax    # 0x2f72f0
orb $0x1, (%rax)
callq 0x75767
testl %eax, %eax
je 0x836bd
leaq 0x2a23a5(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x273a49(%rip), %rax    # 0x2f70f8
movsd %xmm0, (%rax)
leaq 0x273c36(%rip), %rax    # 0x2f72f0
orb $0x2, (%rax)
callq 0x75767
testl %eax, %eax
je 0x83724
leaq 0x2a2373(%rip), %rax    # 0x325a40
movzbl (%rax), %eax
cmpl $0x48, %eax
je 0x83715
cmpl $0x41, %eax
jne 0x83719
leaq 0x273af7(%rip), %rax    # 0x2f71d8
xorl %ecx, %ecx
testb $0x20, (%rax)
sete %cl
leal (%rcx,%rcx,2), %eax
orl $0x4, %eax
jmp 0x8371b
leaq 0x2a2138(%rip), %rdi    # 0x325830
leaq 0x8a977(%rip), %rsi     # 0x10e076
callq 0x9090
testq %rax, %rax
je 0x83769
leaq 0x273d87(%rip), %rax    # 0x2f7497
movb $0xa, (%rax)
jmp 0x8375e
movb $0x8, %al
jmp 0x8371b
movb $0x63, %al
leaq 0x2739ae(%rip), %rcx    # 0x2f70d0
movb %al, (%rcx)
callq 0x75767
callq 0x75767
testl %eax, %eax
je 0x8375e
leaq 0x2a2307(%rip), %rdi    # 0x325a40
callq 0x9470
divsd 0x6f8e2(%rip), %xmm0    # 0xf3028
leaq 0x27467b(%rip), %rax    # 0x2f7dc8
movsd %xmm0, (%rax)
leaq 0x273b5c(%rip), %rax    # 0x2f72b4
movl $0x16, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a20c0(%rip), %rdi    # 0x325830
leaq 0x8a908(%rip), %rsi     # 0x10e07f
callq 0x9090
testq %rax, %rax
je 0x8378d
leaq 0x273d0f(%rip), %rax    # 0x2f7497
movb $0x5, (%rax)
jmp 0x8375e
leaq 0x2a209c(%rip), %rdi    # 0x325830
leaq 0x8a8f2(%rip), %rsi     # 0x10e08d
callq 0x9090
testq %rax, %rax
je 0x837b1
leaq 0x273ceb(%rip), %rax    # 0x2f7497
movb $0x0, (%rax)
jmp 0x8375e
leaq 0x2a2078(%rip), %rdi    # 0x325830
leaq 0x8a8d7(%rip), %rsi     # 0x10e096
callq 0x9090
testq %rax, %rax
je 0x83817
leaq 0x2a2060(%rip), %rdi    # 0x325830
leaq 0x8a8c9(%rip), %rsi     # 0x10e0a0
callq 0x9090
testq %rax, %rax
je 0x837f0
leaq 0x273caf(%rip), %rax    # 0x2f7497
movb $0x3, (%rax)
jmp 0x8375e
leaq 0x2a2039(%rip), %rdi    # 0x325830
leaq 0x8a8b0(%rip), %rsi     # 0x10e0ae
callq 0x9090
testq %rax, %rax
je 0x83817
leaq 0x273c88(%rip), %rax    # 0x2f7497
movb $0x2, (%rax)
jmp 0x8375e
leaq 0x273c79(%rip), %rax    # 0x2f7497
movb $-0x1, (%rax)
jmp 0x8375e