// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_io_options()
void get_io_options()
{
u08 posn;
u08 vel;
u08 timing;
u08 aux;

   log_packet_id("Packet 0x55 (I/O options)");

   posn = tsip_byte();
   vel = tsip_byte();
   timing = tsip_byte();
   aux = tsip_byte();
//sprintf(debug_text, "posn:%02X  vel:%02X  timing:%02X  aux:%02X", posn,vel,timing,aux);

   if(ACU_GG || ACU_360) {  // aux not supported on these devices
      aux = amu_flag;
   }
   else if(SV6_FAMILY || ACUTIME | PALISADE) {
      aux ^= amu_flag;  // set polarity to match what a tbolt does

      if(timing & 0x01) {  // UTC time
         time_flags |= (TFLAGS_UTC);
         timing_mode = TMODE_UTC;
         have_timing_mode = 1;
      }
      else {  // GPS time
         time_flags &= (~TFLAGS_UTC);
         timing_mode = TMODE_GPS;
         have_timing_mode = 1;
      }
//sprintf(debug_text2, "tflags:%04X  tmode:%02X", time_flags, timing_mode);
      have_rcvr_tmode = 1;
   }

   if(aux & 0x08) {  // dbc mode
      level_type = "dBc";
      amu_mode = 0;
   }
   else { // amu mode
      level_type = "AMU";
      amu_mode = 1;
   }
   check_tsip_end(1);
   if(tsip_error) return;

   have_io_options = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0xae97d(%rip), %rdi     # 0x121cc0
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7335e
leaq 0x1cbc15(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x73374
leaq 0x1cbbff(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x7338c
leaq 0x1cbbe7(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x733a2
leaq 0x1cbbd1(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x1a5527(%rip), %rcx    # 0x2188d0
movq (%rcx), %rdx
cmpq $0x1, %rdx
sete %sil
leaq 0x1a7c19(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
cmpl $0x41, %ecx
sete %dil
andb %sil, %dil
leaq 0x1a552a(%rip), %rsi    # 0x2188f8
movl (%rsi), %esi
cmpl $0x47, %esi
sete %r8b
testb %r8b, %dil
je 0x733e7
leaq 0x1cbb11(%rip), %rax    # 0x23eef4
movl (%rax), %eax
jmp 0x73457
testb %dil, %dil
je 0x733f8
cmpl $0x47, %esi
je 0x733dc
cmpl $0x33, %esi
je 0x733dc
jmp 0x73410
cmpq $0x1, %rdx
jne 0x73457
addl $-0x33, %ecx
cmpl $0x1d, %ecx
ja 0x73457
movl $0x20004009, %edx       # imm = 0x20004009
btl %ecx, %edx
jae 0x73457
leaq 0x1cbadd(%rip), %rcx    # 0x23eef4
xorl (%rcx), %eax
movl $0x1, %ecx
andl %ecx, %ebx
leaq 0x29a07d(%rip), %rdx    # 0x30d4a4
movl (%rdx), %esi
andl $-0x2, %esi
orl %ebx, %esi
xorl %edi, %edi
testl %ebx, %ebx
setne %dil
leal (%rdi,%rdi,2), %edi
movl %esi, (%rdx)
leaq 0x29a07b(%rip), %rdx    # 0x30d4bd
movb %dil, (%rdx)
leaq 0x299f80(%rip), %rdx    # 0x30d3cc
movl %ecx, (%rdx)
leaq 0x299f7b(%rip), %rdx    # 0x30d3d0
movl %ecx, (%rdx)
testb $0x8, %al
leaq 0xae87e(%rip), %rax     # 0x121cde
leaq 0xae873(%rip), %rcx     # 0x121cda
cmoveq %rax, %rcx
leaq 0x1cba86(%rip), %rax    # 0x23eef8
movq %rcx, (%rax)
leaq 0x1cba74(%rip), %rax    # 0x23eef0
sete (%rax)
xorl %edi, %edi
callq 0x58e9b
leaq 0x1cbae3(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x7349f
leaq 0x299fab(%rip), %rax    # 0x30d444
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq