// File: /workspace/github_cpp_makefile_star2_O2/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 0x8aef8(%rip), %rdi     # 0x10e015
callq 0x520bf
leaq 0x2740af(%rip), %r14    # 0x2f71d8
andl $0xffffefd1, (%r14)     # imm = 0xFFFFEFD1
leaq 0x27436d(%rip), %rax    # 0x2f74a4
andb $-0x5, (%rax)
leaq 0x2740eb(%rip), %rax    # 0x2f722c
leaq 0x274088(%rip), %rcx    # 0x2f71d0
andb $-0x19, (%rcx)
movl $0xde, (%rax)
leaq 0x274150(%rip), %rax    # 0x2f72a8
cmpl $0x0, (%rax)
jne 0x8316a
leaq 0x17f6e0(%rip), %rcx    # 0x202844
movl $0xde, (%rcx)
movl $0xde, (%rax)
pushq $0xc
popq %r12
leaq 0x2a28c5(%rip), %rbx    # 0x325a40
leaq 0x864de(%rip), %r13     # 0x109660
leaq 0x27430e(%rip), %r15    # 0x2f7497
callq 0x75767
testl %eax, %eax
je 0x831ff
subl $0x1, %r12d
jb 0x831ff
movsbl (%rbx), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x83189
movq %rbx, %rdi
callq 0x95e0
decl %eax
cmpl $0x8, %eax
ja 0x83189
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0xa, (%r15)
jmp 0x83189
movb $0x4, (%r15)
jmp 0x83189
movb $0x5, (%r15)
jmp 0x83189
leaq 0x273ffb(%rip), %rax    # 0x2f71d0
orb $0x10, (%rax)
jmp 0x83189
orb $0x6, (%r14)
jmp 0x83189
movb $0x2, (%r15)
jmp 0x83189
orb $0x10, 0x1(%r14)
jmp 0x83189
leaq 0x273fdc(%rip), %rax    # 0x2f71d0
orb $0x8, (%rax)
jmp 0x83189
orb $0x20, (%r14)
jmp 0x83189
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq