// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ss_test()
void parse_ss_test()
{
int flag6;
int flag10;
int flag11;
int flag12;
int flag13;
int flag14;
int flag15;
int flag16;
int flag17;
int flag18;
int i;

   log_packet_id("Self test results");

   tsip_byte();            // initiated vs power-up test

   critical_alarms = 0;
   minor_alarms &= (~MINOR_EEPROM);

   flag6 = tsip_byte();    // hardware
   if((flag6 & 0x01) == 0) critical_alarms |= CRIT_RAM;
   if((flag6 & 0x02) == 0) critical_alarms |= CRIT_ROM;
   if((flag6 & 0x04) == 0) minor_alarms |= MINOR_EEPROM;
   if((flag6 & 0x20) == 0) critical_alarms |= CRIT_FPGA;     // uart
   if((flag6 & 0x10) == 0) critical_alarms |= CRIT_RTC;
   if((flag6 & 0x20) == 0) critical_alarms |= CRIT_FPGA;

   tsip_byte();            // rsvd
   tsip_byte();            // rsvd
   tsip_byte();            // rsvd

   flag10 = tsip_byte();   // checksums
   if((flag10 & 0x01)) critical_alarms |= CRIT_ROM;  // boot cksum
   if((flag10 & 0x02)) critical_alarms |= CRIT_ROM;  // operation cksum
   if((flag10 & 0x1C)) critical_alarms |= CRIT_ROM;  // flash error code
   if((flag10 & 0x80)) critical_alarms |= CRIT_ROM;  // flash size

   flag11 = tsip_byte();   // 
   if(flag11 & 0x01) minor_alarms |= MINOR_EEPROM;
   if(flag11 & 0x02) critical_alarms |= CRIT_RAM;

   flag12 = tsip_byte();   // com1
   flag13 = tsip_byte();   // com2

   flag14 = tsip_byte();   // 
   if(flag14 & 0x01) critical_alarms |= CRIT_FPGA;
   if(flag14 & 0x06) critical_alarms |= CRIT_RTC;
   if(flag14 & 0x08) critical_alarms |= CRIT_RAM;

   flag15 = tsip_byte();   // RF
   if(flag15 & 0x3F) critical_alarms |= CRIT_GPS;

   flag16 = tsip_byte();   // correlator1
   if(flag16 & 0xFF) critical_alarms |= CRIT_GPS;
   flag17 = tsip_byte();   // correlator2
   if(flag17 & 0xFF) critical_alarms |= CRIT_GPS;
   flag18 = tsip_byte();   // correlator3
   if(flag18 & 0xFF) critical_alarms |= CRIT_GPS;

   for(i=19; i<=40; i++) { // rsvd
      tsip_byte();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xcc9eb(%rip), %rdi     # 0x18668a
callq 0x7add0
callq 0x7a510
leaq 0x2b2700(%rip), %rax    # 0x36c3b0
movl $0x0, (%rax)
leaq 0x2b26fb(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
leaq 0x2b26ec(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xb9cf9
leaq 0x2b26c5(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2b26b9(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0xb9d19
leaq 0x2b26a5(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2b2699(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0xb9d3c
leaq 0x2b268d(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
leaq 0x2b267e(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0xb9d5c
leaq 0x2b2662(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2b2656(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0xb9d7c
leaq 0x2b2642(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x2b2636(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0xb9d9c
leaq 0x2b2622(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2b2616(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb9dd6
leaq 0x2b25e8(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2b25dc(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x8(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xb9df6
leaq 0x2b25c8(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2b25bc(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x8(%rbp), %eax
andl $0x1c, %eax
cmpl $0x0, %eax
je 0xb9e16
leaq 0x2b25a8(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2b259c(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x8(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xb9e38
leaq 0x2b2586(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2b257a(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb9e66
leaq 0x2b2563(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x400, %ecx            # imm = 0x400
leaq 0x2b2554(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xb9e86
leaq 0x2b2538(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2b252c(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x10(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb9ec7
leaq 0x2b24f7(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2b24eb(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x18(%rbp), %eax
andl $0x6, %eax
cmpl $0x0, %eax
je 0xb9ee7
leaq 0x2b24d7(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x2b24cb(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl -0x18(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xb9f07
leaq 0x2b24b7(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2b24ab(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x3f, %eax
cmpl $0x0, %eax
je 0xb9f32
leaq 0x2b248c(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2b2480(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
andl $0xff, %eax
cmpl $0x0, %eax
je 0xb9f5f
leaq 0x2b245f(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2b2453(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
andl $0xff, %eax
cmpl $0x0, %eax
je 0xb9f8c
leaq 0x2b2432(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2b2426(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
andl $0xff, %eax
cmpl $0x0, %eax
je 0xb9fb9
leaq 0x2b2405(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2b23f9(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
movl $0x13, -0x2c(%rbp)
cmpl $0x28, -0x2c(%rbp)
jg 0xb9fd6
callq 0x7a510
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xb9fc0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)