// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r14
pushq %rbx
leaq 0x9b71f(%rip), %rdi     # 0x1232c3
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87bbf
leaq 0x1b73b4(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
leaq 0x28560a(%rip), %rbx    # 0x30d1d0
movl $0x0, (%rbx)
leaq 0x285605(%rip), %r14    # 0x30d1d8
andb $-0x5, 0x1(%r14)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87bee
leaq 0x1b7385(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
jne 0x87bf5
orb $0x2, (%rbx)
testb $0x2, %al
jne 0x87bfc
orb $0x1, (%rbx)
testb $0x4, %al
jne 0x87c05
orb $0x4, 0x1(%r14)
testb $0x20, %al
jne 0x87c0c
orb $0x8, (%rbx)
testb $0x10, %al
jne 0x87c13
orb $0x10, (%rbx)
testb $0x20, %al
jne 0x87c1a
orb $0x8, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c30
leaq 0x1b7343(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c46
leaq 0x1b732d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c5c
leaq 0x1b7317(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c72
leaq 0x1b7301(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
je 0x87c79
orb $0x1, (%rbx)
testb $0x2, %al
je 0x87c80
orb $0x1, (%rbx)
testb $0x1c, %al
je 0x87c87
orb $0x1, (%rbx)
testb %al, %al
jns 0x87c8e
orb $0x1, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87ca4
leaq 0x1b72cf(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
je 0x87cad
orb $0x4, 0x1(%r14)
testb $0x2, %al
je 0x87cb4
orb $0x2, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87cca
leaq 0x1b72a9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87ce0
leaq 0x1b7293(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87cf6
leaq 0x1b727d(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
je 0x87cfd
orb $0x8, (%rbx)
testb $0x6, %al
je 0x87d04
orb $0x10, (%rbx)
testb $0x8, %al
je 0x87d0b
orb $0x2, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87d21
leaq 0x1b7252(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x3f, %al
je 0x87d28
orb $0x8, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87d3e
leaq 0x1b7235(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %al, %al
je 0x87d45
orb $0x8, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87d5b
leaq 0x1b7218(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %al, %al
je 0x87d62
orb $0x8, (%rbx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87d78
leaq 0x1b71fb(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %al, %al
je 0x87d7f
orb $0x8, (%rbx)
movl $0x16, %ebx
leaq 0x1b71e5(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87d9b
orb $0x8, (%r14)
decl %ebx
jne 0x87d8b
popq %rbx
popq %r14
popq %rbp
retq