// File: /workspace/github_c_makefile_star2_O1/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 %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, %r13
movq (%rcx), %rax
movq %rax, (%rsi)
testq %r15, %r15
je 0xd2bf4
movq %rdx, %rbp
movq %r15, %rdi
callq 0xd2afa
cmpl $0x4, %r12d
jne 0xd2d83
cmpl $0x7, %eax
ja 0xd2e60
movl %eax, %ecx
leaq 0x35233(%rip), %rdx     # 0x107e00
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x3539c(%rip), %rsi     # 0x107f79
movq 0x80(%rsp), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3559f
jmp 0xd2e18
movl $0x1, %eax
cmpl $0x4, %r12d
jne 0xd2e51
movq %r9, %r10
movq 0x50(%rsp), %rax
movq %rdx, %r15
movq (%r13), %r9
subq $0x8, %rsp
movl $0x3, 0x14(%rsp)
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, %r12
callq 0xc3a59
movq 0x80(%rsp), %rsi
movq %r12, %rdx
movq 0x30(%rsp), %rcx
movq %r13, %r10
addq $0x20, %rsp
movq %rax, %rdi
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%r14)
movq (%rsi), %rax
movq %rax, (%rbx)
testq %r15, %r15
je 0xd2c84
movl $0x2, %eax
cmpb $0x0, (%r15)
jne 0xd2e51
movq (%rsi), %r9
subq $0x8, %rsp
movq %rdi, %r15
movl $0x4, %edi
movq %rbp, %rsi
movq 0x58(%rsp), %r8
pushq %r10
pushq $0x0
pushq $0x4
callq 0xc3a59
movq 0x80(%rsp), %rdx
addq $0x20, %rsp
cmpq %r15, %rax
jae 0xd2cd3
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%r14)
movq (%rdx), %rcx
movq %rcx, (%rbx)
movl $0x4, 0xc(%rsp)
movq %rax, %r15
movq 0x8(%rdx), %r9
subq $0x8, %rsp
movl $0x5, %edi
movq %rbp, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
movq 0x58(%rsp), %r8
pushq %r13
pushq $0x0
pushq $0x4
callq 0xc3a59
movq 0x80(%rsp), %rdx
addq $0x20, %rsp
cmpq %r15, %rax
jae 0xd2d2a
movq 0x58(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%r14)
movq 0x8(%rdx), %rcx
movq %rcx, (%rbx)
movl $0x5, 0xc(%rsp)
movq %rax, %r15
movq 0x10(%rdx), %r9
subq $0x8, %rsp
movl $0x6, %edi
movq %rbp, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
movq 0x58(%rsp), %r8
pushq %r13
pushq $0x0
pushq $0x4
callq 0xc3a59
movq 0x80(%rsp), %rdx
addq $0x20, %rsp
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpq %r15, %rcx
jae 0xd2e51
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%r14)
movq 0x10(%rdx), %rax
jmp 0xd2e49
cmpl $0x2, %eax
jb 0xd2e51
leaq 0x352c5(%rip), %rsi     # 0x108058
leaq 0x34917(%rip), %rcx     # 0x1076b1
leaq 0x2b36d(%rip), %r8      # 0xfe10e
movq 0x80(%rsp), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3559f
jmp 0xd2e18
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%r14)
movq (%r13), %rax
movq %rax, (%rbx)
movl $0x4, %eax
jmp 0xd2e51
testq %rbp, %rbp
je 0xd2de1
movl $0x2, %eax
cmpb $0x0, (%rbp)
jne 0xd2e51
leaq 0x350fb(%rip), %rsi     # 0x107ee3
movq 0x80(%rsp), %rdi
movq %r15, %rdx
movq %r15, %rcx
jmp 0xd2e11
leaq 0x35209(%rip), %rsi     # 0x108008
leaq 0x36242(%rip), %rcx     # 0x109048
movq 0x80(%rsp), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xd2e51
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%r14)
movq 0x8(%r13), %rax
movq %rax, (%rbx)
movl $0x5, %eax
jmp 0xd2e51
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 0x30467
nopl (%rax)