// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_alarm()
void parse_star_alarm()
{
int i;
int count;

   // device alarms and status
   log_packet_id("Star alarm");
// sprintf(debug_text2, "alarms:%s", nmea_msg);

   minor_alarms &= (~MINOR_ANT_NO_PWR);
   minor_alarms &= (~MINOR_NO_TRACK);
   minor_alarms &= (~MINOR_SURVEY);
   minor_alarms &= (~MINOR_PPS_SKIPPED);
   time_flags &= (~TFLAGS_INVALID);
   have_antenna = 222;

   critical_alarms &= (~CRIT_GPS);
   critical_alarms &= (~CRIT_OCXO);
   if(have_critical_alarms == 0) need_redraw = 222;
   have_critical_alarms = 222;

   count = 0;
   while(get_msg_field()) {
      if(++count > 12) break;

      if(isdigit(msg_field[0])) {
         i = atoi(msg_field);
         if(i == 1) {       // warmup
            discipline_mode = DIS_MODE_WARMUP;
         }
         else if(i == 2) {  // holdover
            discipline_mode = DIS_MODE_AUTO_HOLD;
         }
         else if(i == 3) {  // tracked fast
            discipline_mode = DIS_MODE_FAST_RECOVERY;
         }
         else if(i == 4) {  // ocxo fail
            critical_alarms |= CRIT_OCXO;
         }
         else if(i == 5) {  // squelched
            discipline_mode = DIS_MODE_RECOVERY;
         }
         else if(i == 6) {  // gps timing error
            minor_alarms |= MINOR_PPS_SKIPPED;
//          time_flags |= TFLAGS_INVALID;
         }
         else if(i == 7) {  // gps fail
            critical_alarms |= CRIT_GPS;
         }
         else if(i == 8) {  // antenna fault
            minor_alarms |= MINOR_ANT_NO_PWR;
         }
         else if(i == 9) {  // not surveyed
            minor_alarms |= MINOR_SURVEY;
         }
         else if(i == 10) { // temperature fault
         }
         else if(i == 11) { // missing aux PPS input
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x9420f(%rip), %rdi     # 0x123fed
callq 0x58e77
leaq 0x27d3ee(%rip), %r14    # 0x30d1d8
andl $0xffffefd1, (%r14)     # imm = 0xFFFFEFD1
leaq 0x27d6ac(%rip), %rax    # 0x30d4a4
andb $-0x5, (%rax)
leaq 0x27d42a(%rip), %rax    # 0x30d22c
leaq 0x27d3c7(%rip), %rcx    # 0x30d1d0
andb $-0x19, (%rcx)
movl $0xde, (%rax)
leaq 0x27d48f(%rip), %rax    # 0x30d2a8
cmpl $0x0, (%rax)
jne 0x8fe2b
leaq 0x188a1f(%rip), %rcx    # 0x218844
movl $0xde, (%rcx)
movl $0xde, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8fecc
movl $0xd, %r12d
leaq 0x2abbf5(%rip), %rbx    # 0x33ba40
leaq 0x8f7f2(%rip), %r13     # 0x11f644
leaq 0x27d63e(%rip), %r15    # 0x30d497
decl %r12d
je 0x8fecc
movsbl (%rbx), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x8fec3
movq %rbx, %rdi
callq 0x95e0
decl %eax
cmpl $0x8, %eax
ja 0x8fec3
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0xa, (%r15)
jmp 0x8fec3
movb $0x4, (%r15)
jmp 0x8fec3
movb $0x5, (%r15)
jmp 0x8fec3
leaq 0x27d335(%rip), %rax    # 0x30d1d0
orb $0x10, (%rax)
jmp 0x8fec3
orb $0x6, (%r14)
jmp 0x8fec3
movb $0x2, (%r15)
jmp 0x8fec3
orb $0x10, 0x1(%r14)
jmp 0x8fec3
leaq 0x27d316(%rip), %rax    # 0x30d1d0
orb $0x8, (%rax)
jmp 0x8fec3
orb $0x20, (%r14)
callq 0x811da
testl %eax, %eax
jne 0x8fe59
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq