// File: /workspace/github_cpp_makefile_star2_O3/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 0x9b88b(%rip), %rdi     # 0x1233a3
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87b33
leaq 0x1b7440(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
leaq 0x285696(%rip), %rbx    # 0x30d1d0
movl $0x0, (%rbx)
leaq 0x285691(%rip), %r14    # 0x30d1d8
andb $-0x5, 0x1(%r14)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87b62
leaq 0x1b7411(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
jne 0x87b69
orb $0x2, (%rbx)
testb $0x2, %al
jne 0x87b70
orb $0x1, (%rbx)
testb $0x4, %al
jne 0x87b79
orb $0x4, 0x1(%r14)
testb $0x20, %al
jne 0x87b80
orb $0x8, (%rbx)
testb $0x10, %al
jne 0x87b87
orb $0x10, (%rbx)
testb $0x20, %al
jne 0x87b8e
orb $0x8, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87ba4
leaq 0x1b73cf(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87bba
leaq 0x1b73b9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87bd0
leaq 0x1b73a3(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87be6
leaq 0x1b738d(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
je 0x87bed
orb $0x1, (%rbx)
testb $0x2, %al
je 0x87bf4
orb $0x1, (%rbx)
testb $0x1c, %al
je 0x87bfb
orb $0x1, (%rbx)
testb %al, %al
jns 0x87c02
orb $0x1, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c18
leaq 0x1b735b(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
je 0x87c21
orb $0x4, 0x1(%r14)
testb $0x2, %al
je 0x87c28
orb $0x2, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c3e
leaq 0x1b7335(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c54
leaq 0x1b731f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c6a
leaq 0x1b7309(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x1, %al
je 0x87c71
orb $0x8, (%rbx)
testb $0x6, %al
je 0x87c78
orb $0x10, (%rbx)
testb $0x8, %al
je 0x87c7f
orb $0x2, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87c95
leaq 0x1b72de(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x3f, %al
je 0x87c9c
orb $0x8, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87cb2
leaq 0x1b72c1(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %al, %al
je 0x87cb9
orb $0x8, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87ccf
leaq 0x1b72a4(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %al, %al
je 0x87cd6
orb $0x8, (%rbx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87cec
leaq 0x1b7287(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %al, %al
je 0x87cf3
orb $0x8, (%rbx)
movl $0x16, %ebx
leaq 0x1b7271(%rip), %r14    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87d0f
orb $0x8, (%r14)
decl %ebx
jne 0x87cff
popq %rbx
popq %r14
popq %rbp
retq