// File: /workspace/github_cpp_makefile_star2_O3/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 0x9427b(%rip), %rdi     # 0x1240cd
callq 0x58dc2
leaq 0x27d37a(%rip), %r14    # 0x30d1d8
andl $0xffffefd1, (%r14)     # imm = 0xFFFFEFD1
leaq 0x27d638(%rip), %rax    # 0x30d4a4
andb $-0x5, (%rax)
leaq 0x27d3b6(%rip), %rax    # 0x30d22c
leaq 0x27d353(%rip), %rcx    # 0x30d1d0
andb $-0x19, (%rcx)
movl $0xde, (%rax)
leaq 0x27d41b(%rip), %rax    # 0x30d2a8
cmpl $0x0, (%rax)
jne 0x8fe9f
leaq 0x1889ab(%rip), %rcx    # 0x218844
movl $0xde, (%rcx)
movl $0xde, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x8ff40
movl $0xd, %r12d
leaq 0x2abb81(%rip), %rbx    # 0x33ba40
leaq 0x8f856(%rip), %r13     # 0x11f71c
leaq 0x27d5ca(%rip), %r15    # 0x30d497
decl %r12d
je 0x8ff40
movsbl (%rbx), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x8ff37
movq %rbx, %rdi
callq 0x95e0
decl %eax
cmpl $0x8, %eax
ja 0x8ff37
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0xa, (%r15)
jmp 0x8ff37
movb $0x4, (%r15)
jmp 0x8ff37
movb $0x5, (%r15)
jmp 0x8ff37
leaq 0x27d2c1(%rip), %rax    # 0x30d1d0
orb $0x10, (%rax)
jmp 0x8ff37
orb $0x6, (%r14)
jmp 0x8ff37
movb $0x2, (%r15)
jmp 0x8ff37
orb $0x10, 0x1(%r14)
jmp 0x8ff37
leaq 0x27d2a2(%rip), %rax    # 0x30d1d0
orb $0x8, (%rax)
jmp 0x8ff37
orb $0x20, (%r14)
callq 0x810b1
testl %eax, %eax
jne 0x8fecd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq