// File: /workspace/github_c_makefile_star2_O2/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, %r14d
movl %ecx, %ebp
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %r15
leaq 0x1e7d63(%rip), %rsi    # 0x347ab8
pushq $0x30
popq %rdi
pushq $0x59
popq %rdx
callq 0x93160
movq %rax, %rbx
leal (%r13,%r12,2), %eax
leal 0x10(%r13,%r12,2), %ecx
testl %ebp, %ebp
cmovel %eax, %ecx
leal 0x80(%rcx), %ebp
testl %r14d, %r14d
movq 0x48(%rsp), %r14
cmovel %ecx, %ebp
movb %r12b, 0x18(%rbx)
pushq $0x6b
popq %rdx
movl $0x100, %edi            # imm = 0x100
leaq 0x1e7d22(%rip), %rsi    # 0x347ab8
callq 0x93160
movq %rax, (%rbx)
movq %rax, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq 0x40(%rsp), %rcx
movq %r14, %r8
callq 0x14de4e
testl %eax, %eax
je 0x15fdbe
andq $0x0, 0x8(%rbx)
jmp 0x15fdff
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x7055e
movq %rax, 0x8(%rbx)
movq (%rbx), %rax
movl 0x48(%rax), %eax
testb %r12b, %r12b
je 0x15fde5
testl %eax, %eax
je 0x15fdea
leaq 0x1e7d6b(%rip), %rsi    # 0x347b4e
jmp 0x15fdf5
cmpl $0x1, %eax
jne 0x15fdee
xorl %eax, %eax
jmp 0x15fe01
leaq 0x1e7d96(%rip), %rsi    # 0x347b8b
movq %r14, %rdi
xorl %eax, %eax
callq 0x89dbb
movb $0x1, %al
andq $0x0, 0x10(%rbx)
andq $0x0, 0x20(%rbx)
andl $0x0, 0x28(%rbx)
movl %eax, %ecx
orb %r12b, %cl
je 0x15fe1c
testb %al, %al
jne 0x15fe69
jmp 0x15fe73
pushq $0x1
popq %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x14b51f
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x15fe5d
movq %rax, %rdi
callq 0x14b723
movq %rax, 0x20(%rbx)
movq 0x10(%rbx), %rdi
callq 0x14b771
movl 0x4(%rsp), %edx
cmpl %edx, %eax
movl %edx, %ecx
cmovbl %eax, %ecx
testl %edx, %edx
cmovsl %eax, %ecx
movl %ecx, 0x28(%rbx)
jmp 0x15fe73
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
je 0x15fe85
movq %rbx, %rdi
callq 0x15fc68
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d80dc(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x18517d(%rip), %rsi    # 0x2e5013
leaq 0x1a8bd8(%rip), %rdx    # 0x308a75
leaq 0x1e7d23(%rip), %rcx    # 0x347bc7
leaq 0x1e7c0d(%rip), %r8     # 0x347ab8
movl $0x93, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390