// File: 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
subq $0x10, %rsp
leaq 0xc234b(%rip), %rdi     # 0x1873ba
callq 0x7add0
leaq 0x2a733d(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x7, %ecx
leaq 0x2a7331(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2a7328(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x2a731c(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2a7313(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x21, %ecx
leaq 0x2a7307(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2a72fe(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
leaq 0x2a72ef(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2a75b2(%rip), %rax    # 0x36c684
movl (%rax), %ecx
andl $-0x5, %ecx
leaq 0x2a75a6(%rip), %rax    # 0x36c684
movl %ecx, (%rax)
leaq 0x2a7325(%rip), %rax    # 0x36c40c
movl $0xde, (%rax)
leaq 0x2a72bc(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x2a72b0(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
leaq 0x2a72a7(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
andl $-0x11, %ecx
leaq 0x2a729b(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
leaq 0x2a736a(%rip), %rax    # 0x36c488
cmpl $0x0, (%rax)
jne 0xc5130
leaq 0x1b28fa(%rip), %rax    # 0x277a24
movl $0xde, (%rax)
leaq 0x2a7351(%rip), %rax    # 0x36c488
movl $0xde, (%rax)
movl $0x0, -0x8(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc52a2
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0xc, %eax
jle 0xc5165
jmp 0xc52a2
leaq 0x2d5ab4(%rip), %rax    # 0x39ac20
movsbl (%rax), %edi
callq 0x9330
cmpl $0x0, %eax
je 0xc529d
leaq 0x2d5a9c(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x4(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0xc51a1
leaq 0x2a74de(%rip), %rax    # 0x36c677
movb $0xa, (%rax)
jmp 0xc529b
cmpl $0x2, -0x4(%rbp)
jne 0xc51b6
leaq 0x2a74c9(%rip), %rax    # 0x36c677
movb $0x2, (%rax)
jmp 0xc5299
cmpl $0x3, -0x4(%rbp)
jne 0xc51cb
leaq 0x2a74b4(%rip), %rax    # 0x36c677
movb $0x5, (%rax)
jmp 0xc5297
cmpl $0x4, -0x4(%rbp)
jne 0xc51eb
leaq 0x2a71d8(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x2a71cc(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0xc5295
cmpl $0x5, -0x4(%rbp)
jne 0xc5200
leaq 0x2a747f(%rip), %rax    # 0x36c677
movb $0x4, (%rax)
jmp 0xc5293
cmpl $0x6, -0x4(%rbp)
jne 0xc5220
leaq 0x2a71ab(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x1000, %ecx           # imm = 0x1000
leaq 0x2a719c(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xc5291
cmpl $0x7, -0x4(%rbp)
jne 0xc523d
leaq 0x2a7183(%rip), %rax    # 0x36c3b0
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2a7177(%rip), %rax    # 0x36c3b0
movl %ecx, (%rax)
jmp 0xc528f
cmpl $0x8, -0x4(%rbp)
jne 0xc525a
leaq 0x2a716e(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x6, %ecx
leaq 0x2a7162(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xc528d
cmpl $0x9, -0x4(%rbp)
jne 0xc5277
leaq 0x2a7151(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x20, %ecx
leaq 0x2a7145(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xc528b
cmpl $0xa, -0x4(%rbp)
jne 0xc527f
jmp 0xc5289
cmpl $0xb, -0x4(%rbp)
jne 0xc5287
jmp 0xc5287
jmp 0xc5289
jmp 0xc528b
jmp 0xc528d
jmp 0xc528f
jmp 0xc5291
jmp 0xc5293
jmp 0xc5295
jmp 0xc5297
jmp 0xc5299
jmp 0xc529b
jmp 0xc529d
jmp 0xc5144
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)