// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/idxlocali.c
// Function: gt_runidxlocali
int gt_runidxlocali(const IdxlocaliOptions *idxlocalioptions,GtError *err)
{
  Genericindex *genericindex = NULL;
  bool haserr = false;
  GtLogger *logger;
  const GtEncseq *encseq = NULL;

  logger = gt_logger_new(idxlocalioptions->verbose,
                         GT_LOGGER_DEFLT_PREFIX, stdout);

  if (idxlocalioptions->doonline)
  {
    GtEncseqLoader *el;
    el = gt_encseq_loader_new();
    gt_encseq_loader_require_multiseq_support(el);
    gt_encseq_loader_drop_description_support(el);
    gt_encseq_loader_set_logger(el, logger);
    encseq = gt_encseq_loader_load(el, gt_str_get(idxlocalioptions->indexname),
                                   err);
    gt_encseq_loader_delete(el);
    if (encseq == NULL)
    {
      haserr = true;
    }
  } else
  {
    genericindex = genericindex_new(gt_str_get(idxlocalioptions->indexname),
                                    idxlocalioptions->withesa,
                                    idxlocalioptions->withesa ||
                                    idxlocalioptions->docompare,
                                    false,
                                    true,
                                    0,
                                    logger,
                                    err);
    if (genericindex == NULL)
    {
      haserr = true;
    } else
    {
      encseq = genericindex_getencseq(genericindex);
    }
  }
  if (!haserr)
  {
    GtSeqIterator *seqit;
    const GtUchar *query;
    GtUword querylen;
    char *desc = NULL;
    int retval;
    Limdfsresources *limdfsresources = NULL;
    const AbstractDfstransformer *dfst;
    SWdpresource *swdpresource = NULL;
    Showmatchinfo showmatchinfo;
    ProcessIdxMatch processmatch;
    GtAlphabet *a;
    void *processmatchinfoonline, *processmatchinfooffline;
    Storematchinfo storeonline, storeoffline;

    a = gt_encseq_alphabet(encseq);
    if (idxlocalioptions->docompare)
    {
      processmatch = storematch;
      gt_initstorematch(&storeonline,encseq);
      gt_initstorematch(&storeoffline,encseq);
      processmatchinfoonline = &storeonline;
      processmatchinfooffline = &storeoffline;
    } else
    {
      processmatch = idxlocali_showmatch;
      showmatchinfo.encseq = encseq;
      showmatchinfo.characters = gt_alphabet_characters(a);
      showmatchinfo.wildcardshow = gt_alphabet_wildcard_show(a);
      showmatchinfo.showalignment = idxlocalioptions->showalignment;
      processmatchinfoonline = processmatchinfooffline = &showmatchinfo;
    }
    if (idxlocalioptions->doonline || idxlocalioptions->docompare)
    {
      swdpresource = gt_newSWdpresource(idxlocalioptions->matchscore,
                                     idxlocalioptions->mismatchscore,
                                     idxlocalioptions->gapextend,
                                     idxlocalioptions->threshold,
                                     idxlocalioptions->showalignment,
                                     processmatch,
                                     processmatchinfoonline);
    }
    dfst = gt_locali_AbstractDfstransformer();
    if (!idxlocalioptions->doonline || idxlocalioptions->docompare)
    {
      gt_assert(genericindex != NULL);
      limdfsresources = gt_newLimdfsresources(genericindex,
                                           true,
                                           0,
                                           0,    /* maxpathlength */
                                           true, /* keepexpandedonstack */
                                           processmatch,
                                           processmatchinfooffline,
                                           NULL, /* processresult */
                                           NULL, /* processresult info */
                                           dfst);
    }
    seqit = gt_seq_iterator_sequence_buffer_new(idxlocalioptions->queryfiles,
                                               err);
    if (!seqit)
      haserr = true;
    if (!haserr)
    {
      gt_seq_iterator_set_symbolmap(seqit, gt_alphabet_symbolmap(a));
      for (showmatchinfo.queryunit = 0; /* Nothing */;
           showmatchinfo.queryunit++)
      {
        retval = gt_seq_iterator_next(seqit,
                                     &query,
                                     &querylen,
                                     &desc,
                                     err);
        if (retval < 0)
        {
          haserr = true;
          break;
        }
        if (retval == 0)
        {
          break;
        }
        printf("process sequence " Formatuint64_t " of length "GT_WU"\n",
                PRINTuint64_tcast(showmatchinfo.queryunit),querylen);
        if (idxlocalioptions->doonline || idxlocalioptions->docompare)
        {
          gt_multiapplysmithwaterman(swdpresource,encseq,query,querylen);
        }
        if (!idxlocalioptions->doonline || idxlocalioptions->docompare)
        {
          gt_indexbasedlocali(limdfsresources,
                           idxlocalioptions->matchscore,
                           idxlocalioptions->mismatchscore,
                           idxlocalioptions->gapstart,
                           idxlocalioptions->gapextend,
                           idxlocalioptions->threshold,
                           query,
                           querylen,
                           dfst);
        }
        if (idxlocalioptions->docompare)
        {
          gt_checkandresetstorematch(showmatchinfo.queryunit,
                                  &storeonline,&storeoffline);
        }
      }
      if (limdfsresources != NULL)
      {
        gt_freeLimdfsresources(&limdfsresources,dfst);
      }
      if (swdpresource != NULL)
      {
        gt_freeSWdpresource(swdpresource);
        swdpresource = NULL;
      }
      gt_seq_iterator_delete(seqit);
    }
    if (idxlocalioptions->docompare)
    {
      gt_freestorematch(&storeonline);
      gt_freestorematch(&storeoffline);
    }
  }
  if (genericindex == NULL)
  {
    gt_encseq_delete((GtEncseq *) encseq);
    encseq = NULL;
  } else
  {
    genericindex_delete(genericindex);
  }
  gt_logger_delete(logger);
  logger = NULL;
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r15
movq %rdi, %r14
movzbl 0x21(%rdi), %edi
movq 0x30510b(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x192afd(%rip), %rsi    # 0x3468d4
callq 0x103e40
movq %rax, %r13
cmpb $0x0, 0x23(%r14)
je 0x1b3e41
callq 0xef0cd
movq %rax, %rbx
movq %rax, %rdi
callq 0xf2497
movq %rbx, %rdi
callq 0xf22df
movq %rbx, %rdi
movq %r13, %rsi
callq 0xf249c
movq 0x8(%r14), %rdi
callq 0x11b0a1
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0xef129
movq %rax, %r12
movq %rbx, %rdi
callq 0xefbe3
xorl %edi, %edi
testq %r12, %r12
je 0x1b3f56
movq $0x0, 0x38(%rsp)
jmp 0x1b3e99
movq 0x8(%r14), %rdi
callq 0x11b0a1
movb 0x20(%r14), %cl
movb $0x1, %bpl
movb $0x1, %dl
testb %cl, %cl
jne 0x1b3e5b
movb 0x24(%r14), %dl
movq %r15, 0x8(%rsp)
movq %r13, (%rsp)
movzbl %cl, %esi
movzbl %dl, %edx
movq %rax, %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x1b22b6
testq %rax, %rax
je 0x1b3f5e
movq %rax, %rbx
movq %rax, %rdi
callq 0x1b2295
movq %rax, %r12
movq %rbx, 0x38(%rsp)
movq %r13, 0x48(%rsp)
xorl %eax, %eax
movq %rax, 0x60(%rsp)
movq %rax, 0x58(%rsp)
movq %r12, %rdi
callq 0xebcd9
cmpb $0x1, 0x24(%r14)
movq %r12, 0x50(%rsp)
movq %rax, 0x28(%rsp)
jne 0x1b3eec
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1b3c64
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1b3c64
leaq 0x2c9(%rip), %r12       # 0x1b41b3
jmp 0x1b3f22
movq %rax, %r13
leaq 0x88(%rsp), %rbx
movq %r12, 0x18(%rbx)
movq %rax, %rdi
callq 0xd11de
movq %rax, (%rbx)
movq %r13, %rdi
callq 0xd11f1
movb %al, 0x10(%rbx)
movb 0x22(%r14), %al
movb %al, 0x11(%rbx)
leaq 0x2dc(%rip), %r12       # 0x1b41fb
movq %rbx, %r13
cmpb $0x0, 0x23(%r14)
jne 0x1b3f30
cmpb $0x1, 0x24(%r14)
jne 0x1b3f65
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rdi
movq 0x38(%r14), %rsi
movq 0x48(%r14), %rdx
movzbl 0x22(%r14), %r8d
movq %rbx, (%rsp)
movq %r12, %r9
callq 0x1b53c9
movq %rax, %rbp
jmp 0x1b3f67
movb $0x1, %bpl
jmp 0x1b4189
xorl %edi, %edi
jmp 0x1b4189
xorl %ebp, %ebp
callq 0x1b442f
movq %rax, %rbx
cmpb $0x1, 0x23(%r14)
jne 0x1b3f7d
cmpb $0x1, 0x24(%r14)
jne 0x1b3fbd
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1b41ae
movq %rbx, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq %r13, (%rsp)
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movq %r12, %r9
callq 0x1b243b
movq %rax, %r13
movq %rax, 0x58(%rsp)
jmp 0x1b3fc0
xorl %r13d, %r13d
movq (%r14), %rdi
movq %r15, %rsi
callq 0x114f10
movq %rax, %r12
testq %rax, %rax
sete %al
je 0x1b40f9
movb %al, 0x27(%rsp)
movq 0x28(%rsp), %rdi
callq 0xd11ab
movq %r12, %rdi
movq %rax, %rsi
callq 0x1142c4
movq $0x0, 0x90(%rsp)
leaq 0x40(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r12, %rdi
movq %r15, %r8
callq 0x11433d
movb $0x1, 0x28(%rsp)
testl %eax, %eax
js 0x1b410a
testl %eax, %eax
je 0x1b4102
movq 0x90(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x1f3ec6(%rip), %rdi    # 0x3a7f08
xorl %eax, %eax
callq 0x17070
movb 0x23(%r14), %al
testb %al, %al
jne 0x1b4058
cmpb $0x1, 0x24(%r14)
jne 0x1b4073
movq 0x40(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq %rbp, %rdi
movq 0x50(%rsp), %rsi
callq 0x1b4a84
movb 0x23(%r14), %al
testb $0x1, %al
je 0x1b407f
movb 0x24(%r14), %al
cmpb $0x1, %al
jne 0x1b40b7
movq 0x28(%r14), %r9
movq 0x30(%r14), %rsi
movq 0x38(%r14), %rdx
movq 0x40(%r14), %rcx
movq 0x48(%r14), %r8
movq 0x40(%rsp), %rax
movq 0x30(%rsp), %rdi
movq %rbx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq %rax, (%rsp)
movq %r13, %rdi
callq 0x1b2c80
movb 0x24(%r14), %al
testb $0x1, %al
je 0x1b40d2
movq 0x90(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x1b3cc4
incq 0x90(%rsp)
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r15, %r8
callq 0x11433d
jmp 0x1b401e
movl %eax, %ebp
movq 0x48(%rsp), %r13
jmp 0x1b413b
movb 0x27(%rsp), %al
movb %al, 0x28(%rsp)
testq %r13, %r13
je 0x1b411c
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x1b2633
testq %rbp, %rbp
movq 0x48(%rsp), %r13
je 0x1b412e
movq %rbp, %rdi
callq 0x1b5456
movq %r12, %rdi
callq 0x11437f
movb 0x28(%rsp), %bpl
cmpb $0x1, 0x24(%r14)
movq 0x50(%rsp), %r14
jne 0x1b4175
movq 0x80(%rsp), %rdi
leaq 0x1f3d03(%rip), %rbx    # 0x3a7e59
movq %rbx, %rsi
movl $0x96, %edx
callq 0x1045eb
movq 0x70(%rsp), %rdi
movq %rbx, %rsi
movl $0x96, %edx
callq 0x1045eb
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1b4186
callq 0x1b224c
jmp 0x1b418e
movq %r14, %rdi
callq 0xea375
movq %r13, %rdi
callq 0x1040e0
movzbl %bpl, %eax
negl %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6592d