// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/encseq_access_type.c
// Function: gt_encseq_access_type_determine
int gt_encseq_access_type_determine(GtUword *specialranges,
                                    GtUword *wildcardranges,
                                    GtUword totallength,
                                    GtUword numofsequences,
                                    GtUword numofdbfiles,
                                    GtUword lengthofalphadef,
                                    GtUword lengthofdbfilenames,
                                    const GtUword *specialrangestab,
                                    const GtUword *wildcardrangestab,
                                    const Definedunsignedlong *equallength,
                                    unsigned int numofchars,
                                    const char *str_sat,
                                    GtError *err)
{
  GtEncseqAccessType sat = GT_ACCESS_TYPE_UNDEFINED;
  bool haserr = false;

  *specialranges = specialrangestab[0];
  *wildcardranges = wildcardrangestab[0];
  if (str_sat == NULL)
  {
    if (numofchars == GT_DNAALPHASIZE)
    {
      sat = determinesmallestrep(specialranges,wildcardranges,
                                 equallength,totallength,numofsequences,
                                 numofdbfiles,lengthofdbfilenames,
                                 specialrangestab,wildcardrangestab,numofchars,
                                 lengthofalphadef);
    } else
    {
      sat = GT_ACCESS_TYPE_BYTECOMPRESS;
    }
  } else
  {
    sat = gt_encseq_access_type_get(str_sat);
    if (numofchars == GT_DNAALPHASIZE)
    {
      switch (sat)
      {
        case GT_ACCESS_TYPE_UCHARTABLES:
          *specialranges = specialrangestab[0];
          *wildcardranges = wildcardrangestab[0];
          break;
        case GT_ACCESS_TYPE_USHORTTABLES:
          *specialranges = specialrangestab[1];
          *wildcardranges = wildcardrangestab[1];
           break;
        case GT_ACCESS_TYPE_UINT32TABLES:
          *specialranges = specialrangestab[2];
          *wildcardranges = wildcardrangestab[2];
          break;
        case GT_ACCESS_TYPE_DIRECTACCESS:
        case GT_ACCESS_TYPE_BITACCESS:
          break;
        case GT_ACCESS_TYPE_EQUALLENGTH:
          if (equallength == NULL || !equallength->defined) {
            gt_error_set(err,"illegal argument \"%s\" to option -sat: "
                             "%s is only possible for DNA sequences, if "
                             "all sequences are of equal length and no "
                             "sequence contains a wildcard",str_sat,str_sat);
            haserr = true;
          }
          break;
        case GT_ACCESS_TYPE_BYTECOMPRESS:
          gt_error_set(err,"illegal argument \"%s\" to option -sat: "
                           "cannot use bytecompress on DNA sequences",
                           str_sat);
          haserr = true;
          break;
        default:
          gt_assert(sat == GT_ACCESS_TYPE_UNDEFINED);
          gt_error_set(err,"illegal argument \"%s\" to option -sat: "
                           "must be one of the following keywords: %s",
                           str_sat,gt_encseq_access_type_list());
          haserr = true;
          break;
      }
    } else
    {
      if (sat != GT_ACCESS_TYPE_BYTECOMPRESS &&
          sat != GT_ACCESS_TYPE_DIRECTACCESS)
      {
        gt_error_set(err,"illegal argument \"%s\" to option -sat: "
                        "as the sequence is not DNA, you can choose %s or %s",
                        str_sat,
                        gt_encseq_access_type_str(GT_ACCESS_TYPE_BYTECOMPRESS),
                        gt_encseq_access_type_str(GT_ACCESS_TYPE_DIRECTACCESS));
        haserr = true;
      }
    }
  }
  return haserr ? -1 : (int) sat;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq 0xe0(%rsp), %rax
movq 0xd8(%rsp), %rax
movl 0xd0(%rsp), %eax
movq 0xc8(%rsp), %rax
movq 0xc0(%rsp), %rax
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rax
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movq %r9, 0x68(%rsp)
movl $0x7, 0x64(%rsp)
movb $0x0, 0x63(%rsp)
movq 0xb8(%rsp), %rax
movq (%rax), %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq 0xc0(%rsp), %rax
movq (%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, 0xd8(%rsp)
jne 0x13ead9
cmpl $0x4, 0xd0(%rsp)
jne 0x13eacc
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0xc8(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x70(%rsp), %r9
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %rbx
movq 0xc0(%rsp), %r11
movl 0xd0(%rsp), %r10d
movq 0x68(%rsp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x13ed40
movl %eax, 0x64(%rsp)
jmp 0x13ead4
movl $0x1, 0x64(%rsp)
jmp 0x13ed17
movq 0xd8(%rsp), %rdi
callq 0x13e840
movl %eax, 0x64(%rsp)
cmpl $0x4, 0xd0(%rsp)
jne 0x13ecb0
movl 0x64(%rsp), %eax
movq %rax, 0x58(%rsp)
subq $0x6, %rax
ja 0x13ec2c
movq 0x58(%rsp), %rax
leaq 0x4c0bd(%rip), %rcx     # 0x18abd4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xb8(%rsp), %rax
movq (%rax), %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq 0xc0(%rsp), %rax
movq (%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
jmp 0x13ecae
movq 0xb8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
jmp 0x13ecae
movq 0xb8(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq 0xc0(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x88(%rsp), %rax
movq %rcx, (%rax)
jmp 0x13ecae
jmp 0x13ecae
cmpq $0x0, 0xc8(%rsp)
je 0x13ebd4
movq 0xc8(%rsp), %rax
testb $0x1, (%rax)
jne 0x13ebff
movq 0xe0(%rsp), %rdi
movq 0xd8(%rsp), %rdx
movq 0xd8(%rsp), %rcx
leaq 0x4c0c0(%rip), %rsi     # 0x18acb3
movb $0x0, %al
callq 0xc0d0
movb $0x1, 0x63(%rsp)
jmp 0x13ecae
movq 0xe0(%rsp), %rdi
movq 0xd8(%rsp), %rdx
leaq 0x4c12e(%rip), %rsi     # 0x18ad49
movb $0x0, %al
callq 0xc0d0
movb $0x1, 0x63(%rsp)
jmp 0x13ecae
jmp 0x13ec2e
cmpl $0x7, 0x64(%rsp)
je 0x13ec6d
movq 0x7539c(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1f420(%rip), %rsi     # 0x15e066
leaq 0x4c14b(%rip), %rdx     # 0x18ad98
leaq 0x4c164(%rip), %rcx     # 0x18adb8
leaq 0x4bfd9(%rip), %r8      # 0x18ac34
movl $0xc9, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x13ec6f
movq 0xe0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x50(%rsp)
callq 0x13e7d0
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rdx
movq %rax, %rcx
leaq 0x4c136(%rip), %rsi     # 0x18add8
movb $0x0, %al
callq 0xc0d0
movb $0x1, 0x63(%rsp)
jmp 0x13ed15
cmpl $0x1, 0x64(%rsp)
je 0x13ed13
cmpl $0x0, 0x64(%rsp)
je 0x13ed13
movq 0xe0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x38(%rsp)
movl $0x1, %edi
callq 0x13e7e0
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x13e7e0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq %rax, %r8
leaq 0x4c121(%rip), %rsi     # 0x18ae28
movb $0x0, %al
callq 0xc0d0
movb $0x1, 0x63(%rsp)
jmp 0x13ed15
jmp 0x13ed17
testb $0x1, 0x63(%rsp)
je 0x13ed29
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x2c(%rsp)
jmp 0x13ed31
movl 0x64(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq