// File: /workspace/github_cpp_makefile_star2_O2/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 0x9185b(%rip), %rdi     # 0x10d2eb
callq 0x520bf
callq 0x51c47
leaq 0x27b72f(%rip), %rbx    # 0x2f71d0
andl $0x0, (%rbx)
leaq 0x27b72d(%rip), %r14    # 0x2f71d8
andb $-0x5, 0x1(%r14)
callq 0x51c47
testb $0x1, %al
jne 0x7babc
orb $0x2, (%rbx)
testb $0x2, %al
jne 0x7bac3
orb $0x1, (%rbx)
testb $0x4, %al
jne 0x7bacc
orb $0x4, 0x1(%r14)
testb $0x20, %al
jne 0x7bad3
orb $0x8, (%rbx)
testb $0x10, %al
jne 0x7bada
orb $0x10, (%rbx)
testb $0x20, %al
jne 0x7bae1
orb $0x8, (%rbx)
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
testb $0x1, %al
je 0x7bafc
orb $0x1, (%rbx)
testb $0x2, %al
je 0x7bb03
orb $0x1, (%rbx)
testb $0x1c, %al
je 0x7bb0a
orb $0x1, (%rbx)
testb %al, %al
jns 0x7bb11
orb $0x1, (%rbx)
callq 0x51c47
testb $0x1, %al
je 0x7bb1f
orb $0x4, 0x1(%r14)
testb $0x2, %al
je 0x7bb26
orb $0x2, (%rbx)
callq 0x51c47
callq 0x51c47
callq 0x51c47
testb $0x1, %al
je 0x7bb3c
orb $0x8, (%rbx)
testb $0x6, %al
je 0x7bb43
orb $0x10, (%rbx)
testb $0x8, %al
je 0x7bb4a
orb $0x2, (%rbx)
callq 0x51c47
testb $0x3f, %al
je 0x7bb56
orb $0x8, (%rbx)
callq 0x51c47
testb %al, %al
je 0x7bb62
orb $0x8, (%rbx)
callq 0x51c47
testb %al, %al
je 0x7bb6e
orb $0x8, (%rbx)
callq 0x51c47
testb %al, %al
je 0x7bb7a
orb $0x8, (%rbx)
pushq $0x16
popq %rbx
subl $0x1, %ebx
jb 0x7bb89
callq 0x51c47
jmp 0x7bb7d
popq %rbx
popq %r14
popq %rbp
retq