// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r10
movq %rcx, %r11
movq %rdx, %rbp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x78(%rsp), %r15
movl 0x70(%rsp), %r12d
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rdi)
movq (%rcx), %r9
movq %r9, (%rsi)
testq %r15, %r15
je 0xd3a1f
movq %rcx, %r13
movq %rdx, %rbp
movq %r15, %rdi
callq 0xd3922
cmpl $0x4, %r12d
jne 0xd3ba2
cmpl $0x7, %eax
ja 0xd3c7f
movl %eax, %ecx
leaq 0x34230(%rip), %rdx     # 0x107c28
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x34399(%rip), %rsi     # 0x107da1
movq 0x80(%rsp), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xd3c37
movl $0x1, %eax
cmpl $0x4, %r12d
jne 0xd3c70
movq 0x50(%rsp), %rax
subq $0x8, %rsp
movl $0x3, 0x14(%rsp)
movq %rdx, %r12
movl $0x3, %edi
movq %rbp, %rsi
movq %r11, %rdx
movq %r8, %rcx
movq %r8, 0x18(%rsp)
movq %rax, %r8
pushq %r10
pushq $0x0
pushq $0x4
movq %r10, %r13
movq %r11, %r15
callq 0xc4aa1
movq %r15, %rdx
movq 0x30(%rsp), %rcx
movq %r13, %r10
addq $0x20, %rsp
movq %rax, %rsi
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%r14)
movq 0x60(%rsp), %rax
movq (%rax), %r9
movq %r9, (%rbx)
testq %r12, %r12
je 0xd3aa6
movl $0x2, %eax
cmpb $0x0, (%r12)
jne 0xd3c70
subq $0x8, %rsp
movl $0x4, %edi
movq %rsi, %r12
movq %rbp, %rsi
movq 0x58(%rsp), %r8
pushq %r10
pushq $0x0
pushq $0x4
callq 0xc4aa1
movq 0x80(%rsp), %rdx
addq $0x20, %rsp
cmpq %r12, %rax
jae 0xd3af2
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%r14)
movq (%rdx), %rcx
movq %rcx, (%rbx)
movl $0x4, 0xc(%rsp)
movq %rax, %r12
movq 0x8(%rdx), %r9
subq $0x8, %rsp
movl $0x5, %edi
movq %rbp, %rsi
movq %r15, %rdx
movq 0x18(%rsp), %rcx
movq 0x58(%rsp), %r8
pushq %r13
pushq $0x0
pushq $0x4
callq 0xc4aa1
movq 0x80(%rsp), %rdx
addq $0x20, %rsp
cmpq %r12, %rax
jae 0xd3b49
movq 0x58(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%r14)
movq 0x8(%rdx), %rcx
movq %rcx, (%rbx)
movl $0x5, 0xc(%rsp)
movq %rax, %r12
movq 0x10(%rdx), %r9
subq $0x8, %rsp
movl $0x6, %edi
movq %rbp, %rsi
movq %r15, %rdx
movq 0x18(%rsp), %rcx
movq 0x58(%rsp), %r8
pushq %r13
pushq $0x0
pushq $0x4
callq 0xc4aa1
movq 0x80(%rsp), %rdx
addq $0x20, %rsp
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpq %r12, %rcx
jae 0xd3c70
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%r14)
movq 0x10(%rdx), %rax
jmp 0xd3c68
cmpl $0x2, %eax
jb 0xd3c70
leaq 0x342ce(%rip), %rsi     # 0x107e80
leaq 0x3391e(%rip), %rcx     # 0x1074d7
leaq 0x2a4ee(%rip), %r8      # 0xfe0ae
movq 0x80(%rsp), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x34f1f
jmp 0xd3c37
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%r14)
movq (%r13), %rax
movq %rax, (%rbx)
movl $0x4, %eax
jmp 0xd3c70
testq %rbp, %rbp
je 0xd3c00
movl $0x2, %eax
cmpb $0x0, (%rbp)
jne 0xd3c70
leaq 0x34104(%rip), %rsi     # 0x107d0b
movq 0x80(%rsp), %rdi
movq %r15, %rdx
movq %r15, %rcx
jmp 0xd3c30
leaq 0x34212(%rip), %rsi     # 0x107e30
leaq 0x3524b(%rip), %rcx     # 0x108e70
movq 0x80(%rsp), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x34f1f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xd3c70
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%r14)
movq 0x8(%r13), %rax
movq %rax, (%rbx)
movl $0x5, %eax
jmp 0xd3c70
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%r14)
movq 0x10(%r13), %rax
movq %rax, (%rbx)
movl $0x6, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2fe6a