// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_acron_message()
void get_acron_message()
{
u08 c;

   // This routine buffers up an incoming ACRON ZEIT message.  When the end of the
   // message is seen, the message is parsed and decoded with decode_acron_msg()

   if(SERIAL_DATA_AVAILABLE(RCVR_PORT) == 0) {
      check_com_timer(RCVR_PORT);
      return;
   }
   else {
      reset_com_timer(RCVR_PORT);
   }

   c = get_com_char();
   c &= 0x7F;           // remove parity bit

   if(com[RCVR_PORT].rcv_error) {      // parity/framing/overrun errors
      com[RCVR_PORT].rcv_error = 0;
//!!!!!qqqq    goto rst_msg;
   }

   if(tsip_sync == 0) {    // syncing to start of message
      tsip_sync = 1;
      get_sync_time();
      tsip_wptr = 0;
      tsip_rptr = 0;
      goto get_acron;
   }
   else if(tsip_sync == 1) { // '$' has been seen, now build the message
      get_acron:
      if(c == 0x0D) goto acron_end;  // message has no checksum

      if(tsip_wptr < MAX_TSIP) {   // add char to the message buffer
         tsip_buf[tsip_wptr++] = c;
      }
      else {
         tsip_error |= OVFL_ERROR;
         goto rst_msg;
      }
   }
   else if(tsip_sync == 3) {  // end of message
      acron_end:
      decode_acron_msg(); // process the message
      packet_end = 1;
      tsip_wptr = 0;      // prepare for next message
      tsip_sync = 0;
   }
   else {     // should never happen, prepare for next message
      rst_msg:
      tsip_wptr = 0;
      tsip_sync = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0xa, %edi
callq 0xcad0
cmpl $0x0, %eax
jne 0xe1ad6
movl $0xa, %edi
callq 0x2b610
jmp 0xe1c1a
movl $0xa, %edi
callq 0x2bd30
callq 0x79fc0
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
andl $0x7f, %eax
movb %al, -0x1(%rbp)
leaq 0x28b9c7(%rip), %rax    # 0x36d4c0
cmpb $0x0, 0x17a12(%rax)
je 0xe1b10
leaq 0x28b9b7(%rip), %rax    # 0x36d4c0
movb $0x0, 0x17a12(%rax)
leaq 0x2b591f(%rip), %rax    # 0x397436
movzwl (%rax), %eax
cmpl $0x0, %eax
jne 0xe1b4a
leaq 0x2b5910(%rip), %rax    # 0x397436
movw $0x1, (%rax)
callq 0x7a1d0
leaq 0x2b58fb(%rip), %rax    # 0x397432
movw $0x0, (%rax)
leaq 0x2b58f1(%rip), %rax    # 0x397434
movw $0x0, (%rax)
jmp 0xe1b5b
leaq 0x2b58e5(%rip), %rax    # 0x397436
movzwl (%rax), %eax
cmpl $0x1, %eax
jne 0xe1bc2
jmp 0xe1b5b
movzbl -0x1(%rbp), %eax
cmpl $0xd, %eax
jne 0xe1b66
jmp 0xe1bd3
leaq 0x2b58c5(%rip), %rax    # 0x397432
movzwl (%rax), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jge 0xe1ba6
movb -0x1(%rbp), %dl
leaq 0x2b58b1(%rip), %rax    # 0x397432
movw (%rax), %ax
movw %ax, %si
addw $0x1, %si
leaq 0x2b58a0(%rip), %rcx    # 0x397432
movw %si, (%rcx)
movzwl %ax, %eax
movl %eax, %ecx
leaq 0x2b488f(%rip), %rax    # 0x396430
movb %dl, (%rax,%rcx)
jmp 0xe1bc0
leaq 0x1bc5a3(%rip), %rax    # 0x29e150
movl (%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
leaq 0x1bc594(%rip), %rax    # 0x29e150
movl %ecx, (%rax)
jmp 0xe1bfe
jmp 0xe1c18
leaq 0x2b586d(%rip), %rax    # 0x397436
movzwl (%rax), %eax
cmpl $0x3, %eax
jne 0xe1bfc
jmp 0xe1bd3
callq 0xe1950
movl $0x1, 0x2e9292(%rip)    # 0x3cae74
leaq 0x2b5849(%rip), %rax    # 0x397432
movw $0x0, (%rax)
leaq 0x2b5841(%rip), %rax    # 0x397436
movw $0x0, (%rax)
jmp 0xe1c16
jmp 0xe1bfe
leaq 0x2b582d(%rip), %rax    # 0x397432
movw $0x0, (%rax)
leaq 0x2b5825(%rip), %rax    # 0x397436
movw $0x0, (%rax)
jmp 0xe1c18
jmp 0xe1c1a
addq $0x10, %rsp
popq %rbp
retq