// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %r15
leaq 0x1f545c(%rip), %rsi    # 0x3a7738
movl $0x30, %edi
movl $0x59, %edx
callq 0x104226
movq %rax, %rbx
leal (%r13,%r12,2), %eax
leal 0x10(%r13,%r12,2), %ecx
testl %r14d, %r14d
cmovel %eax, %ecx
leal 0x80(%rcx), %r14d
testl %ebp, %ebp
cmovel %ecx, %r14d
movb %r12b, 0x18(%rbx)
movl $0x100, %edi            # imm = 0x100
leaq 0x1f541d(%rip), %rsi    # 0x3a7738
movl $0x6b, %edx
callq 0x104226
movq %rax, (%rbx)
movq %rax, %rdi
movl %r14d, %esi
movq 0x48(%rsp), %r14
movq %r15, %rdx
movq 0x40(%rsp), %rcx
movq %r14, %r8
callq 0x1a2288
testl %eax, %eax
je 0x1b2354
movq $0x0, 0x8(%rbx)
jmp 0x1b23ea
movl 0x4(%rsp), %ebp
movq (%rbx), %rax
movq (%rax), %rdi
callq 0xe7b9c
movq %rax, 0x8(%rbx)
movq (%rbx), %rax
movl 0x48(%rax), %eax
testb %r12b, %r12b
je 0x1b2383
testl %eax, %eax
je 0x1b2417
leaq 0x1f544d(%rip), %rsi    # 0x3a77ce
jmp 0x1b23e0
cmpl $0x1, %eax
jne 0x1b23d9
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, 0x20(%rbx)
movl $0x0, 0x28(%rbx)
movq %r15, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x19ff2b
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x1b242a
movq 0x10(%rbx), %rdi
callq 0x1a0058
movq %rax, 0x20(%rbx)
movq 0x10(%rbx), %rdi
callq 0x1a0073
cmpl %ebp, %eax
movl %ebp, %ecx
cmovbl %eax, %ecx
testl %ebp, %ebp
cmovsl %eax, %ecx
movl %ecx, 0x28(%rbx)
jmp 0x1b2405
leaq 0x1f542b(%rip), %rsi    # 0x3a780b
movq %r14, %rdi
xorl %eax, %eax
callq 0xfcb67
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, 0x20(%rbx)
movl $0x0, 0x28(%rbx)
movq %rbx, %rdi
callq 0x1b224c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, 0x20(%rbx)
movl $0x0, 0x28(%rbx)
jmp 0x1b2405
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1b23fb
callq 0x652dc