// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prs_st()
void parse_prs_st()
{
int i;

   // status
   log_packet_id("status");

   for(i=0; i<6; i++) {
      if(get_msg_field()) {
         prs_st[i] = atoi(msg_field);
         have_prs_st |= (1 << i);

         if(prs_st[0] & 0x0F) critical_alarms |= CRIT_PWR;
         else                 critical_alarms &= (~CRIT_PWR);

         if(prs_st[3] & 0x0C) critical_alarms |= CRIT_OCXO;
         else                 critical_alarms &= (~CRIT_OCXO);

         if(prs_st[5] & 0x06) critical_alarms |= CRIT_FPGA;  // bad interrupt or watchdog
         else                 critical_alarms &= (~CRIT_FPGA);
//       have_critical_alarms = 1;

         if(prs_st[5] & 0x18) minor_alarms |= MINOR_EEPROM;
         else                 minor_alarms &= (~MINOR_EEPROM);
         have_eeprom = 1;
      }
      else ++bad_prs_val;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xc88a6(%rip), %rdi     # 0x188e45
callq 0x7add0
movl $0x0, -0x4(%rbp)
cmpl $0x6, -0x4(%rbp)
jge 0xc0728
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc0709
leaq 0x2da656(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %edx
movslq -0x4(%rbp), %rcx
leaq 0x1b96f4(%rip), %rax    # 0x279cd0
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
leaq 0x1b9676(%rip), %rax    # 0x279c68
orl (%rax), %ecx
leaq 0x1b966d(%rip), %rax    # 0x279c68
movl %ecx, (%rax)
leaq 0x1b96cc(%rip), %rax    # 0x279cd0
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0xc0625
leaq 0x2abd9b(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x2abd8f(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0xc063a
leaq 0x2abd84(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x5, %ecx
leaq 0x2abd78(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
leaq 0x1b968f(%rip), %rax    # 0x279cd0
movl 0xc(%rax), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0xc0663
leaq 0x2abd5d(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x2abd51(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0xc0678
leaq 0x2abd46(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x11, %ecx
leaq 0x2abd3a(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
leaq 0x1b9651(%rip), %rax    # 0x279cd0
movl 0x14(%rax), %eax
andl $0x6, %eax
cmpl $0x0, %eax
je 0xc06a1
leaq 0x2abd1f(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2abd13(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0xc06b6
leaq 0x2abd08(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x2abcfc(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
leaq 0x1b9613(%rip), %rax    # 0x279cd0
movl 0x14(%rax), %eax
andl $0x18, %eax
cmpl $0x0, %eax
je 0xc06e2
leaq 0x2abce9(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
leaq 0x2abcda(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xc06fa
leaq 0x2abccf(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
leaq 0x2abcc0(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2abd8b(%rip), %rax    # 0x36c48c
movl $0x1, (%rax)
jmp 0xc0718
movl 0x30b6f5(%rip), %eax    # 0x3cbe04
addl $0x1, %eax
movl %eax, 0x30b6ec(%rip)    # 0x3cbe04
jmp 0xc071a
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc05ab
addq $0x10, %rsp
popq %rbp
retq
nop