// File: /workspace/github_cpp_makefile_star2_O1/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 0xae6f7(%rip), %rdi     # 0x121be0
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x73504
leaq 0x1cba6f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x7351a
leaq 0x1cba59(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x73532
leaq 0x1cba41(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x73548
leaq 0x1cba2b(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x1a5381(%rip), %rcx    # 0x2188d0
movq (%rcx), %rcx
cmpq $0x1, %rcx
sete %sil
leaq 0x1a7a73(%rip), %rdx    # 0x21afd4
movl (%rdx), %edx
cmpl $0x41, %edx
sete %dil
andb %sil, %dil
leaq 0x1a5384(%rip), %rsi    # 0x2188f8
movl (%rsi), %esi
cmpl $0x47, %esi
sete %r8b
testb %r8b, %dil
je 0x73590
leaq 0x1cb96b(%rip), %rax    # 0x23eef4
movl (%rax), %eax
jmp 0x73616
testb %dil, %dil
je 0x7359f
cmpl $0x47, %esi
je 0x73582
cmpl $0x33, %esi
je 0x73582
cmpq $0x1, %rcx
jne 0x735b7
leal -0x33(%rdx), %esi
cmpl $0x1d, %esi
ja 0x735b7
movl $0x20004009, %edi       # imm = 0x20004009
btl %esi, %edi
jb 0x735cf
cmpl $0x41, %edx
sete %sil
cmpl $0x50, %edx
sete %dl
cmpq $0x1, %rcx
jne 0x73616
orb %dl, %sil
je 0x73616
leaq 0x1cb91e(%rip), %rcx    # 0x23eef4
xorl (%rcx), %eax
movl $0x1, %ecx
andl %ecx, %ebx
leaq 0x299ebe(%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 0x299ebc(%rip), %rdx    # 0x30d4bd
movb %dil, (%rdx)
leaq 0x299dc1(%rip), %rdx    # 0x30d3cc
movl %ecx, (%rdx)
leaq 0x299dbc(%rip), %rdx    # 0x30d3d0
movl %ecx, (%rdx)
testb $0x8, %al
leaq 0xae5df(%rip), %rax     # 0x121bfe
leaq 0xae5d4(%rip), %rcx     # 0x121bfa
cmoveq %rax, %rcx
leaq 0x1cb8c7(%rip), %rax    # 0x23eef8
movq %rcx, (%rax)
leaq 0x1cb8b5(%rip), %rax    # 0x23eef0
sete (%rax)
xorl %edi, %edi
callq 0x58f50
leaq 0x1cb924(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
jne 0x7365e
leaq 0x299dec(%rip), %rax    # 0x30d444
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq