// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/idx-limdfs.c
// Function: genericindex_new
Genericindex *genericindex_new(const char *indexname,
                               bool withesa,
                               bool withencseq,
                               bool withdestab,
                               bool withssptab,
                               int userdefinedmaxdepth,
                               GtLogger *logger,
                               GtError *err)
{
  unsigned int demand = 0;
  bool haserr = false;
  Genericindex *genericindex;

  genericindex = gt_malloc(sizeof (*genericindex));
  if (withesa)
  {
    demand |= SARR_SUFTAB;
  }
  if (withencseq)
  {
    demand |= SARR_ESQTAB;
  }
  if (withdestab)
  {
    demand |= SARR_DESTAB;
  }
  if (withssptab)
  {
    demand |= SARR_SSPTAB;
  }
  genericindex->withesa = withesa;
  genericindex->suffixarray = gt_malloc(sizeof (*genericindex->suffixarray));
  if (gt_mapsuffixarray(genericindex->suffixarray,
                        demand,
                        indexname,
                        logger,
                        err) != 0)
  {
    haserr = true;
    genericindex->totallength = 0;
  } else
  {
    genericindex->totallength
      = gt_encseq_total_length(genericindex->suffixarray->encseq);
  }
  if (!haserr)
  {
    if (withesa && genericindex->suffixarray->readmode != GT_READMODE_FORWARD)
    {
      gt_error_set(err,"using option -esa you can only process index "
                       "in forward mode");
      haserr = true;
    } else
    {
      if (!withesa
            && genericindex->suffixarray->readmode != GT_READMODE_REVERSE)
      {
        gt_error_set(err,"with option -pck you can only process index "
                         "in reverse mode");
        haserr = true;
      }
    }
  }
  genericindex->packedindex = NULL;
  genericindex->mbtab = NULL;
  genericindex->maxdepth = 0;
  if (!haserr && !withesa)
  {
    genericindex->packedindex = gt_loadvoidBWTSeqForSA(indexname,true, err);
    if (genericindex->packedindex == NULL)
    {
      gt_assert(gt_error_is_set(err));
      haserr = true;
    }
  }
  if (!haserr && !withesa)
  {
    genericindex->mbtab = gt_bwtseq2mbtab(genericindex->packedindex);
    genericindex->maxdepth = gt_bwtseq2maxdepth(genericindex->packedindex);
    if (userdefinedmaxdepth >= 0 &&
        genericindex->maxdepth > (unsigned int) userdefinedmaxdepth)
    {
      genericindex->maxdepth = (unsigned int) userdefinedmaxdepth;
    }
  }
  if (haserr)
  {
    genericindex_delete(genericindex);
    return NULL;
  }
  return genericindex;
}

// Assembly:
subq $0x28, %rsp
movb %r8b, %al
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %r8
movq %rdi, 0x18(%rsp)
andb $0x1, %sil
movb %sil, 0x17(%rsp)
andb $0x1, %dl
movb %dl, 0x16(%rsp)
andb $0x1, %cl
movb %cl, 0x15(%rsp)
andb $0x1, %al
movb %al, 0x14(%rsp)
movl %r9d, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movb $0x0, 0xb(%rsp)
movl $0x30, %edi
leaq 0x3254b0(%rip), %rsi    # 0x579f91
movl $0x59, %edx
callq 0xe80f0
movq %rax, (%rsp)
testb $0x1, 0x17(%rsp)
je 0x254b01
movl 0xc(%rsp), %eax
orl $0x2, %eax
movl %eax, 0xc(%rsp)
testb $0x1, 0x16(%rsp)
je 0x254b13
movl 0xc(%rsp), %eax
orl $0x1, %eax
movl %eax, 0xc(%rsp)
testb $0x1, 0x15(%rsp)
je 0x254b25
movl 0xc(%rsp), %eax
orl $0x10, %eax
movl %eax, 0xc(%rsp)
testb $0x1, 0x14(%rsp)
je 0x254b39
movl 0xc(%rsp), %eax
orl $0x80, %eax
movl %eax, 0xc(%rsp)
movb 0x17(%rsp), %cl
movq (%rsp), %rax
andb $0x1, %cl
movb %cl, 0x18(%rax)
movl $0x100, %edi            # imm = 0x100
leaq 0x32543e(%rip), %rsi    # 0x579f91
movl $0x6b, %edx
callq 0xe80f0
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq (%rsp), %rax
movq (%rax), %rdi
movl 0xc(%rsp), %esi
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
callq 0x233e00
cmpl $0x0, %eax
je 0x254b9e
movb $0x1, 0xb(%rsp)
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
jmp 0x254bb8
movq (%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x8(%rax)
testb $0x1, 0xb(%rsp)
jne 0x254c1d
testb $0x1, 0x17(%rsp)
je 0x254bed
movq (%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x48(%rax)
je 0x254bed
movq 0x38(%rsp), %rdi
leaq 0x325448(%rip), %rsi    # 0x57a027
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0xb(%rsp)
jmp 0x254c1b
testb $0x1, 0x17(%rsp)
jne 0x254c19
movq (%rsp), %rax
movq (%rax), %rax
cmpl $0x1, 0x48(%rax)
je 0x254c19
movq 0x38(%rsp), %rdi
leaq 0x325457(%rip), %rsi    # 0x57a064
movb $0x0, %al
callq 0xd88c0
movb $0x1, 0xb(%rsp)
jmp 0x254c1b
jmp 0x254c1d
movq (%rsp), %rax
movq $0x0, 0x10(%rax)
movq (%rsp), %rax
movq $0x0, 0x20(%rax)
movq (%rsp), %rax
movl $0x0, 0x28(%rax)
testb $0x1, 0xb(%rsp)
jne 0x254ccd
testb $0x1, 0x17(%rsp)
jne 0x254ccd
movq 0x18(%rsp), %rdi
movq 0x38(%rsp), %rdx
movl $0x1, %esi
callq 0x22fa90
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq (%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x254ccb
jmp 0x254c7e
movq 0x38(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x254cc4
movq 0x3e730d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2c1376(%rip), %rsi    # 0x516013
leaq 0x2e52e3(%rip), %rdx    # 0x539f87
leaq 0x3253f5(%rip), %rcx    # 0x57a0a0
leaq 0x3252df(%rip), %r8     # 0x579f91
movl $0x93, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x254cc6
movb $0x1, 0xb(%rsp)
jmp 0x254ccd
testb $0x1, 0xb(%rsp)
jne 0x254d2a
testb $0x1, 0x17(%rsp)
jne 0x254d2a
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x22fd70
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x22fdf0
movl %eax, %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
cmpl $0x0, 0x10(%rsp)
jl 0x254d28
movq (%rsp), %rax
movl 0x28(%rax), %eax
cmpl 0x10(%rsp), %eax
jbe 0x254d28
movl 0x10(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
jmp 0x254d2a
testb $0x1, 0xb(%rsp)
je 0x254d45
movq (%rsp), %rdi
callq 0x254960
movq $0x0, 0x20(%rsp)
jmp 0x254d4e
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)