// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x78(%rsp), %r12
movl 0x70(%rsp), %r13d
movq 0x60(%rsp), %rdx
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rdi)
movq (%rdx), %r9
movq %r9, (%rsi)
testq %r12, %r12
je 0xb9633
movq 0x80(%rsp), %r15
movq %r12, %rdi
callq 0xb94db
movl %eax, %ebp
cmpl $0x4, %r13d
jne 0xb96a3
cmpl $0x7, %ebp
ja 0xb9862
movl %ebp, %eax
leaq 0x378c8(%rip), %rcx     # 0xf0ed4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq 0x60(%rsp), %rcx
jmpq *%rax
leaq 0x37a2c(%rip), %rsi     # 0xf104d
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xc007
jmp 0xb9820
cmpl $0x4, %r13d
jne 0xb96d3
movq 0x50(%rsp), %rax
subq $0x8, %rsp
pushq $0x3
popq %rbp
movl %ebp, %edi
movq %r15, %rsi
movq %rcx, 0x10(%rsp)
movq %rcx, %rdx
movq %r8, 0x18(%rsp)
movq %r8, %rcx
movq %rax, %r8
movq %r10, %r12
pushq %r10
pushq $0x0
pushq $0x4
callq 0xa7cc2
addq $0x20, %rsp
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%r14)
movq 0x60(%rsp), %r13
movq (%r13), %r9
movq %r9, (%rbx)
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0xb96da
cmpb $0x0, (%rax)
je 0xb96da
pushq $0x2
jmp 0xb9850
cmpl $0x2, %ebp
jb 0xb9851
leaq 0x37a79(%rip), %rsi     # 0xf112c
leaq 0x370cc(%rip), %rcx     # 0xf0786
leaq 0x2dced(%rip), %r8      # 0xe73ae
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xc007
jmp 0xb9820
pushq $0x1
jmp 0xb9850
subq $0x8, %rsp
pushq $0x4
popq %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq %rcx, %r13
movq 0x18(%rsp), %rcx
movq 0x58(%rsp), %r8
pushq %r12
pushq $0x0
pushq $0x4
callq 0xa7cc2
movq 0x80(%rsp), %rdx
addq $0x20, %rsp
cmpq %r13, %rax
jae 0xb9729
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%r14)
movq (%rdx), %rcx
movq %rcx, (%rbx)
pushq $0x4
popq %rbp
movq %rax, %r13
movq 0x8(%rdx), %r9
subq $0x8, %rsp
pushq $0x5
popq %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x58(%rsp), %r8
pushq %r12
pushq $0x0
pushq $0x4
callq 0xa7cc2
movq %r13, %rcx
movq 0x80(%rsp), %r13
addq $0x20, %rsp
cmpq %rcx, %rax
jae 0xb977e
movq 0x58(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, (%r14)
movq 0x8(%r13), %rcx
movq %rcx, (%rbx)
pushq $0x5
popq %rbp
movq %rax, %rcx
movq 0x10(%r13), %r9
subq $0x8, %rsp
pushq $0x6
popq %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq %rcx, %r15
movq 0x18(%rsp), %rcx
movq 0x58(%rsp), %r8
pushq %r12
pushq $0x0
pushq $0x4
callq 0xa7cc2
addq $0x20, %rsp
cmpq %r15, %rax
jae 0xb9851
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%r14)
movq 0x10(%r13), %rax
jmp 0xb984b
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, (%r14)
movq (%rcx), %rax
movq %rax, (%rbx)
pushq $0x4
jmp 0xb9850
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0xb97f3
cmpb $0x0, (%rax)
jne 0xb969c
leaq 0x377bd(%rip), %rsi     # 0xf0fb7
movq %r15, %rdi
movq %r12, %rdx
movq %r12, %rcx
jmp 0xb9819
leaq 0x378d0(%rip), %rsi     # 0xf10dc
leaq 0x38909(%rip), %rcx     # 0xf211c
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xc007
pushq $-0x1
jmp 0xb9850
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%r14)
movq 0x8(%rcx), %rax
movq %rax, (%rbx)
pushq $0x5
jmp 0xb9850
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, (%r14)
movq 0x10(%rcx), %rax
movq %rax, (%rbx)
pushq $0x6
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7474f(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x107f3(%rip), %rsi     # 0xca066
leaq 0x37822(%rip), %rdx     # 0xf109c
leaq 0x3783b(%rip), %rcx     # 0xf10bc
leaq 0x376b0(%rip), %r8      # 0xf0f38
movl $0xc9, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
nop