// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_true_status()
void parse_true_status()
{
u32 ho;
int val;

   log_packet_id("status");

   if(get_msg_field()) {  // 10MHz
      val = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {  // 1PPS
      val = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {  // antenna          
      val = atoi(msg_field);
      if(val) minor_alarms |= (MINOR_ANT_NO_PWR);
      else    minor_alarms &= (~MINOR_ANT_NO_PWR);
      have_antenna = 56;
   }
   else return;

   if(get_msg_field()) {  // holdover duration
      ho = (u32) atoi(msg_field);
      if(ho) holdover = ho;
   }
   else return;

   if(get_msg_field()) {  // num sats
      val = atoi(msg_field);
   }
   else return;

   if(get_msg_field()) {  // state
      val = atoi(msg_field);
      if     (val == 0) discipline_mode = DIS_MODE_NORMAL;
      else if(val == 1) discipline_mode = DIS_MODE_ACQUIRE;     // acquiring
      else if(val == 2) discipline_mode = DIS_MODE_POWERUP;
      else if(val == 3) discipline_mode = DIS_MODE_AUTO_HOLD;
      else if(val == 4) discipline_mode = DIS_MODE_MANUAL_HOLD;
      else if(val == 5) discipline_mode = DIS_MODE_SOFT_HOLD;
      else if(val == 6) discipline_mode = DIS_MODE_NO_GPS;      // no gps
      else if(val == 7) discipline_mode = DIS_MODE_LEARNING;    // training OCXO
      else if(1 || ((val >= 8) && (val <= 17))) {
         true_wait = val;
         discipline_mode = DIS_MODE_WAIT;
      }
      else discipline_mode = DIS_MODE_UNKNOWN;

      true_debug = atoi(msg_field);
      have_true_debug = 1;
      have_ffom = 1;
   }
   else return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xa0cd6(%rip), %rdi     # 0x188e45
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe818f
leaq 0x2b2a9b(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
jmp 0xe8194
jmp 0xe836e
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe81af
leaq 0x2b2a7b(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
jmp 0xe81b4
jmp 0xe836e
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe820e
leaq 0x2b2a5b(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0xe81ea
leaq 0x2841de(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x6, %ecx
leaq 0x2841d2(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xe81ff
leaq 0x2841c7(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x7, %ecx
leaq 0x2841bb(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x284206(%rip), %rax    # 0x36c40c
movl $0x38, (%rax)
jmp 0xe8213
jmp 0xe836e
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe8240
leaq 0x2b29fc(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0xe823e
movl -0x4(%rbp), %ecx
leaq 0x2843fc(%rip), %rax    # 0x36c638
movl %ecx, (%rax)
jmp 0xe8245
jmp 0xe836e
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe8260
leaq 0x2b29ca(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
jmp 0xe8265
jmp 0xe836e
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe836c
leaq 0x2b29a6(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0xe8297
leaq 0x2843e8(%rip), %rax    # 0x36c677
movb $0x0, (%rax)
jmp 0xe8339
cmpl $0x1, -0x8(%rbp)
jne 0xe82ac
leaq 0x2843d3(%rip), %rax    # 0x36c677
movb $0x17, (%rax)
jmp 0xe8337
cmpl $0x2, -0x8(%rbp)
jne 0xe82be
leaq 0x2843be(%rip), %rax    # 0x36c677
movb $0x1, (%rax)
jmp 0xe8335
cmpl $0x3, -0x8(%rbp)
jne 0xe82d0
leaq 0x2843ac(%rip), %rax    # 0x36c677
movb $0x2, (%rax)
jmp 0xe8333
cmpl $0x4, -0x8(%rbp)
jne 0xe82e2
leaq 0x28439a(%rip), %rax    # 0x36c677
movb $0x3, (%rax)
jmp 0xe8331
cmpl $0x5, -0x8(%rbp)
jne 0xe82f4
leaq 0x284388(%rip), %rax    # 0x36c677
movb $0x16, (%rax)
jmp 0xe832f
cmpl $0x6, -0x8(%rbp)
jne 0xe8306
leaq 0x284376(%rip), %rax    # 0x36c677
movb $0x15, (%rax)
jmp 0xe832d
cmpl $0x7, -0x8(%rbp)
jne 0xe8318
leaq 0x284364(%rip), %rax    # 0x36c677
movb $0x14, (%rax)
jmp 0xe832b
movl -0x8(%rbp), %eax
movl %eax, 0x2e6ea3(%rip)    # 0x3cf1c4
leaq 0x28434f(%rip), %rax    # 0x36c677
movb $0x18, (%rax)
jmp 0xe832d
jmp 0xe832f
jmp 0xe8331
jmp 0xe8333
jmp 0xe8335
jmp 0xe8337
jmp 0xe8339
leaq 0x2b28e0(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x2b4232(%rip), %rax    # 0x39c580
movl %ecx, (%rax)
leaq 0x2b422d(%rip), %rax    # 0x39c584
movl $0x1, (%rax)
leaq 0x283ad8(%rip), %rax    # 0x36be3c
movl $0x1, (%rax)
jmp 0xe836e
jmp 0xe836e
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)