// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_alrm()
void parse_zy_alrm()
{
int val;
int survey;

   // alarms
   log_packet_id("alarms");

   if(get_msg_field()) {
      val = atohex(msg_field);
      survey = (minor_alarms & (~MINOR_SURVEY));
      minor_alarms = 0x0000;
      critical_alarms = 0x0000;

      if(val & 0x0100) minor_alarms |= MINOR_OSC_AGE;
      if(val & 0x0200) critical_alarms |= CRIT_OCXO;
      if(val & 0x0010) critical_alarms |= CRIT_FPGA;
      if(val & 0x0020) minor_alarms |= MINOR_EEPROM;
      if(val & 0x0040) critical_alarms |= CRIT_GPS;
      if(val & 0x0080) minor_alarms |= MINOR_OSC_AGE;
      if(val & 0x0001) minor_alarms |= MINOR_NO_TRACK;
      if(val & 0x0002) minor_alarms |= (MINOR_ANT_NO_PWR);
      if(val & 0x0004) minor_alarms |= MINOR_OSC_CTRL;   // !!!!! TFOM
      if(val & 0x0008) critical_alarms |= CRIT_RAM;
      minor_alarms |= survey;
      have_antenna = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xa25f1(%rip), %rdi     # 0x188170
callq 0x7add0
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe5d35
leaq 0x2b5087(%rip), %rdi    # 0x39ac20
callq 0x98d0
movl %eax, -0x4(%rbp)
leaq 0x286810(%rip), %rax    # 0x36c3b8
movl (%rax), %eax
andl $-0x21, %eax
movl %eax, -0x8(%rbp)
leaq 0x286801(%rip), %rax    # 0x36c3b8
movl $0x0, (%rax)
leaq 0x2867ec(%rip), %rax    # 0x36c3b0
movl $0x0, (%rax)
movl -0x4(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0xe5bec
leaq 0x2867da(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2867ce(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0xe5c0e
leaq 0x2867b0(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x2867a4(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xe5c2e
leaq 0x286790(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x286784(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xe5c51
leaq 0x286778(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
leaq 0x286769(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xe5c71
leaq 0x28674d(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x286741(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xe5c93
leaq 0x286733(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x286727(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xe5cb3
leaq 0x286713(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x286707(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xe5cd3
leaq 0x2866f3(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x6, %ecx
leaq 0x2866e7(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xe5cf3
leaq 0x2866d3(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x2866c7(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xe5d13
leaq 0x2866ab(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x28669f(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x8(%rbp), %ecx
leaq 0x28669b(%rip), %rax    # 0x36c3b8
orl (%rax), %ecx
leaq 0x286692(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2866dd(%rip), %rax    # 0x36c40c
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)