// File: 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
subq $0x10, %rsp
leaq 0xc1d68(%rip), %rdi     # 0x1873e7
callq 0x7add0
leaq 0x1b4b3d(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0xc595c
leaq 0x2d5375(%rip), %rdi    # 0x39aa10
leaq 0xc1d51(%rip), %rsi     # 0x1873f3
callq 0x9090
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc56f9
movq -0x8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x6, %esi
callq 0xc4fb0
movq -0x8(%rbp), %rdi
callq 0x9480
movsd 0xa994b(%rip), %xmm1    # 0x16f028
divsd %xmm1, %xmm0
leaq 0x2a78c0(%rip), %rax    # 0x36cfa8
movsd %xmm0, (%rax)
leaq 0x2a6da1(%rip), %rax    # 0x36c494
movl $0x1, (%rax)
leaq 0x2d5310(%rip), %rdi    # 0x39aa10
leaq 0xc1cfd(%rip), %rsi     # 0x187404
callq 0x9090
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc5766
movq -0x8(%rbp), %rax
addq $0xb, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x9, %esi
callq 0xc4fb0
movq -0x8(%rbp), %rdi
callq 0x9480
movsd 0xa98e6(%rip), %xmm1    # 0x16f028
divsd %xmm1, %xmm0
leaq 0x2a786b(%rip), %rax    # 0x36cfb8
movsd %xmm0, (%rax)
leaq 0x2a6d40(%rip), %rax    # 0x36c498
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a6d34(%rip), %rax    # 0x36c498
movl %ecx, (%rax)
leaq 0x2d52a3(%rip), %rdi    # 0x39aa10
leaq 0xc1c9c(%rip), %rsi     # 0x187410
callq 0x9090
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc5837
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0xc4fb0
movq -0x8(%rbp), %rdi
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2a6b16(%rip), %rax    # 0x36c2d0
movsd %xmm0, (%rax)
leaq 0x2a7817(%rip), %rax    # 0x36cfdc
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a780b(%rip), %rax    # 0x36cfdc
movl %ecx, (%rax)
leaq 0x2a6cf6(%rip), %rax    # 0x36c4d0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a6cea(%rip), %rax    # 0x36c4d0
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
addq $0x5, %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0xc4fb0
movq -0x8(%rbp), %rdi
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2a6aba(%rip), %rax    # 0x36c2d8
movsd %xmm0, (%rax)
leaq 0x2a6ca7(%rip), %rax    # 0x36c4d0
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2a6c9b(%rip), %rax    # 0x36c4d0
movl %ecx, (%rax)
leaq 0x2d51d2(%rip), %rdi    # 0x39aa10
leaq 0xc1bd0(%rip), %rsi     # 0x187415
callq 0x9090
cmpq $0x0, %rax
je 0xc585f
leaq 0x2a6e20(%rip), %rax    # 0x36c677
movb $0x1, (%rax)
jmp 0xc5957
leaq 0x2d51aa(%rip), %rdi    # 0x39aa10
leaq 0xc1bae(%rip), %rsi     # 0x18741b
callq 0x9090
cmpq $0x0, %rax
je 0xc5887
leaq 0x2a6df8(%rip), %rax    # 0x36c677
movb $0xa, (%rax)
jmp 0xc5955
leaq 0x2d5182(%rip), %rdi    # 0x39aa10
leaq 0xc1b8f(%rip), %rsi     # 0x187424
callq 0x9090
cmpq $0x0, %rax
je 0xc58af
leaq 0x2a6dd0(%rip), %rax    # 0x36c677
movb $0x5, (%rax)
jmp 0xc5953
leaq 0x2d515a(%rip), %rdi    # 0x39aa10
leaq 0xc1b75(%rip), %rsi     # 0x187432
callq 0x9090
cmpq $0x0, %rax
je 0xc58d4
leaq 0x2a6da8(%rip), %rax    # 0x36c677
movb $0x0, (%rax)
jmp 0xc5951
leaq 0x2d5135(%rip), %rdi    # 0x39aa10
leaq 0xc1b59(%rip), %rsi     # 0x18743b
callq 0x9090
cmpq $0x0, %rax
je 0xc5945
leaq 0x2d511c(%rip), %rdi    # 0x39aa10
leaq 0xc1b4a(%rip), %rsi     # 0x187445
callq 0x9090
cmpq $0x0, %rax
je 0xc5912
leaq 0x2a6d6a(%rip), %rax    # 0x36c677
movb $0x3, (%rax)
jmp 0xc5943
leaq 0x2d50f7(%rip), %rdi    # 0x39aa10
leaq 0xc1b33(%rip), %rsi     # 0x187453
callq 0x9090
cmpq $0x0, %rax
je 0xc5937
leaq 0x2a6d45(%rip), %rax    # 0x36c677
movb $0x2, (%rax)
jmp 0xc5941
leaq 0x2a6d39(%rip), %rax    # 0x36c677
movb $-0x1, (%rax)
jmp 0xc5943
jmp 0xc594f
leaq 0x2a6d2b(%rip), %rax    # 0x36c677
movb $-0x1, (%rax)
jmp 0xc5951
jmp 0xc5953
jmp 0xc5955
jmp 0xc5957
jmp 0xc5aa0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc59af
leaq 0x2d52b3(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2a694f(%rip), %rax    # 0x36c2d0
movsd %xmm0, (%rax)
leaq 0x2a7650(%rip), %rax    # 0x36cfdc
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a7644(%rip), %rax    # 0x36cfdc
movl %ecx, (%rax)
leaq 0x2a6b2f(%rip), %rax    # 0x36c4d0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a6b23(%rip), %rax    # 0x36c4d0
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc59ed
leaq 0x2d5260(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2a6904(%rip), %rax    # 0x36c2d8
movsd %xmm0, (%rax)
leaq 0x2a6af1(%rip), %rax    # 0x36c4d0
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2a6ae5(%rip), %rax    # 0x36c4d0
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc5a58
leaq 0x2d5222(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x48, %eax
jne 0xc5a12
leaq 0x2a68a3(%rip), %rax    # 0x36c2b0
movb $0x8, (%rax)
jmp 0xc5a56
leaq 0x2d5207(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
cmpl $0x41, %eax
jne 0xc5a4a
leaq 0x2a6990(%rip), %rax    # 0x36c3b8
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xc5a3e
leaq 0x2a6877(%rip), %rax    # 0x36c2b0
movb $0x4, (%rax)
jmp 0xc5a48
leaq 0x2a686b(%rip), %rax    # 0x36c2b0
movb $0x7, (%rax)
jmp 0xc5a54
leaq 0x2a685f(%rip), %rax    # 0x36c2b0
movb $0x63, (%rax)
jmp 0xc5a56
jmp 0xc5a58
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc5a64
jmp 0xc5a64
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc5a9e
leaq 0x2d51ab(%rip), %rdi    # 0x39ac20
callq 0x9480
movsd 0xa95a6(%rip), %xmm1    # 0x16f028
divsd %xmm1, %xmm0
leaq 0x2a751b(%rip), %rax    # 0x36cfa8
movsd %xmm0, (%rax)
leaq 0x2a69fc(%rip), %rax    # 0x36c494
movl $0x16, (%rax)
jmp 0xc5aa0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)