// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_ebolt_health1()
void get_ebolt_health1()
{
u08 sv_fix;
u08 antenna_fault;

   log_packet_id("Packet 0x46 (Tbolt-E health)");

   sv_fix = tsip_byte();
   antenna_fault = tsip_byte();
   check_tsip_end(1);
   if(tsip_error) return;

   saw_version |= 0x04;
   saw_ebolt();
   tbolt_e |= 0x01;

   if(SV6_FAMILY) {
      have_critical_alarms = 33;
//    if(antenna_fault & 0x01) critical_alarms |= CRIT_RAM;      // alarm could be no backup battery
//    else                     critical_alarms &= (~CRIT_RAM);
      if(antenna_fault & 0x02) critical_alarms |= CRIT_FPGA;
      else                     critical_alarms &= (~CRIT_FPGA);
      if(antenna_fault & 0x0C) critical_alarms |= CRIT_GPS;
      else                     critical_alarms &= (~CRIT_GPS);
      if(antenna_fault & 0x20) critical_alarms |= CRIT_OCXO;
      else                     critical_alarms &= (~CRIT_OCXO);

      if(antenna_fault & 0x10) minor_alarms |= MINOR_ANT_NO_PWR;
      else                     minor_alarms &= (~MINOR_ANT_NO_PWR);
      have_antenna = 33;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xe8336(%rip), %rdi     # 0x184dd5
callq 0x7add0
callq 0x7a510
movb %al, -0x1(%rbp)
callq 0x7a510
movb %al, -0x2(%rbp)
movl $0x1, %edi
callq 0x7aee0
leaq 0x20168b(%rip), %rax    # 0x29e150
cmpl $0x0, (%rax)
je 0x9cacf
jmp 0x9cc3d
leaq 0x2cfb12(%rip), %rax    # 0x36c5e8
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x2cfb06(%rip), %rax    # 0x36c5e8
movl %ecx, (%rax)
callq 0x81d20
leaq 0x1daff0(%rip), %rax    # 0x277ae0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x1dafe4(%rip), %rax    # 0x277ae0
movl %ecx, (%rax)
leaq 0x1dafab(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9cc3d
leaq 0x1dd69e(%rip), %rax    # 0x27a1b4
cmpl $0x36, (%rax)
je 0x9cb43
leaq 0x1dd692(%rip), %rax    # 0x27a1b4
cmpl $0x33, (%rax)
je 0x9cb43
leaq 0x1dd686(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x9cb43
leaq 0x1dd67a(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x9cc3d
leaq 0x2cf93e(%rip), %rax    # 0x36c488
movl $0x21, (%rax)
movzbl -0x2(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x9cb73
leaq 0x2cf84d(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2cf841(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0x9cb88
leaq 0x2cf836(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x2cf82a(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movzbl -0x2(%rbp), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0x9cbab
leaq 0x2cf815(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2cf809(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0x9cbc0
leaq 0x2cf7fe(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x2cf7f2(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movzbl -0x2(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x9cbe3
leaq 0x2cf7dd(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x2cf7d1(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0x9cbf8
leaq 0x2cf7c6(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x11, %ecx
leaq 0x2cf7ba(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movzbl -0x2(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x9cc1b
leaq 0x2cf7ad(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x6, %ecx
leaq 0x2cf7a1(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0x9cc30
leaq 0x2cf796(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x7, %ecx
leaq 0x2cf78a(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2cf7d5(%rip), %rax    # 0x36c40c
movl $0x21, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)