// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq $0x0, 0x100(%rsp)
movb $0x0, 0xff(%rsp)
movq $0x0, 0xe8(%rsp)
movq 0x110(%rsp), %rax
movb 0x21(%rax), %al
movq 0x3e39ff(%rip), %rcx    # 0x63bf38
movq (%rcx), %rdx
leaq 0x2bf3a9(%rip), %rsi    # 0x5178ec
andb $0x1, %al
movzbl %al, %edi
callq 0xe7870
movq %rax, 0xf0(%rsp)
movq 0x110(%rsp), %rax
testb $0x1, 0x23(%rax)
je 0x258603
callq 0xb7a40
movq %rax, 0xe0(%rsp)
movq 0xe0(%rsp), %rdi
callq 0xbace0
movq 0xe0(%rsp), %rdi
callq 0xba570
movq 0xe0(%rsp), %rdi
movq 0xf0(%rsp), %rsi
callq 0xbacf0
movq 0xe0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x110(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x108(%rsp), %rdx
callq 0xb7aa0
movq %rax, 0xe8(%rsp)
movq 0xe0(%rsp), %rdi
callq 0xb7e50
cmpq $0x0, 0xe8(%rsp)
jne 0x2585fe
movb $0x1, 0xff(%rsp)
jmp 0x2586c3
movq 0x110(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, 0x28(%rsp)
movq 0x110(%rsp), %rax
movb 0x20(%rax), %al
movb %al, 0x36(%rsp)
movq 0x110(%rsp), %rcx
movb $0x1, %al
testb $0x1, 0x20(%rcx)
movb %al, 0x37(%rsp)
jne 0x25864b
movq 0x110(%rsp), %rax
movb 0x24(%rax), %al
movb %al, 0x37(%rsp)
movq 0x28(%rsp), %rdi
movb 0x36(%rsp), %cl
movb 0x37(%rsp), %al
movq 0xf0(%rsp), %rsi
movq 0x108(%rsp), %r8
movq %rsp, %rdx
movq %r8, 0x8(%rdx)
movq %rsi, (%rdx)
movzbl %cl, %esi
andl $0x1, %esi
movzbl %al, %edx
andl $0x1, %edx
movl $0x1, %r8d
xorl %r9d, %r9d
movl %r9d, %ecx
callq 0x254a90
movq %rax, 0x100(%rsp)
cmpq $0x0, 0x100(%rsp)
jne 0x2586ac
movb $0x1, 0xff(%rsp)
jmp 0x2586c1
movq 0x100(%rsp), %rdi
callq 0x2549d0
movq %rax, 0xe8(%rsp)
jmp 0x2586c3
testb $0x1, 0xff(%rsp)
jne 0x258b71
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa0(%rsp)
movq 0xe8(%rsp), %rdi
callq 0xb0f00
movq %rax, 0x70(%rsp)
movq 0x110(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x25875b
leaq 0x4c4(%rip), %rax       # 0x258be0
movq %rax, 0x78(%rsp)
movq 0xe8(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x258180
movq 0xe8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x258180
leaq 0x50(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x2587c8
leaq 0x53e(%rip), %rax       # 0x258ca0
movq %rax, 0x78(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x70(%rsp), %rdi
callq 0x7e970
movq %rax, 0x80(%rsp)
movq 0x70(%rsp), %rdi
callq 0x7e9d0
movb %al, 0x90(%rsp)
movq 0x110(%rsp), %rax
movb 0x22(%rax), %al
andb $0x1, %al
movb %al, 0x91(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x110(%rsp), %rax
testb $0x1, 0x23(%rax)
jne 0x2587e4
movq 0x110(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x258843
movq 0x110(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x110(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0x110(%rsp), %rax
movq 0x48(%rax), %rdx
movq 0x110(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x110(%rsp), %rax
movb 0x22(%rax), %r8b
movq 0x78(%rsp), %r9
movq 0x68(%rsp), %rax
andb $0x1, %r8b
movzbl %r8b, %r8d
movq %rax, (%rsp)
callq 0x25a950
movq %rax, 0xa0(%rsp)
callq 0x259310
movq %rax, 0xa8(%rsp)
movq 0x110(%rsp), %rax
testb $0x1, 0x23(%rax)
je 0x258870
movq 0x110(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x258907
jmp 0x258872
cmpq $0x0, 0x100(%rsp)
jne 0x2588b5
movq 0x3e371c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2bd785(%rip), %rsi    # 0x516013
leaq 0x321884(%rip), %rdx    # 0x57a119
leaq 0x321eea(%rip), %rcx    # 0x57a786
leaq 0x321e44(%rip), %r8     # 0x57a6e7
movl $0xf2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2588b7
movq 0x100(%rsp), %rdi
movq 0x78(%rsp), %r9
movq 0x60(%rsp), %r10
movq 0xa8(%rsp), %rax
movl $0x1, %r8d
xorl %ecx, %ecx
movl %r8d, %esi
movq %rcx, %rdx
movq %r10, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x254d60
movq %rax, 0xb0(%rsp)
movq 0x110(%rsp), %rax
movq (%rax), %rdi
movq 0x108(%rsp), %rsi
callq 0x113240
movq %rax, 0xd8(%rsp)
cmpq $0x0, 0xd8(%rsp)
jne 0x25893a
movb $0x1, 0xff(%rsp)
testb $0x1, 0xff(%rsp)
jne 0x258b4d
movq 0xd8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x70(%rsp), %rdi
callq 0x7e870
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x1118a0
movq $0x0, 0x88(%rsp)
movq 0xd8(%rsp), %rdi
movq 0x108(%rsp), %r8
leaq 0xd0(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
leaq 0xc0(%rsp), %rcx
callq 0x111ab0
movl %eax, 0xbc(%rsp)
cmpl $0x0, 0xbc(%rsp)
jge 0x2589c3
movb $0x1, 0xff(%rsp)
jmp 0x258afc
cmpl $0x0, 0xbc(%rsp)
jne 0x2589d2
jmp 0x258afc
movq 0x88(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x321dad(%rip), %rdi    # 0x57a796
movb $0x0, %al
callq 0x19070
movq 0x110(%rsp), %rax
testb $0x1, 0x23(%rax)
jne 0x258a0c
movq 0x110(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x258a31
movq 0xa0(%rsp), %rdi
movq 0xe8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq 0xc8(%rsp), %rcx
callq 0x25a3d0
movq 0x110(%rsp), %rax
testb $0x1, 0x23(%rax)
je 0x258a4d
movq 0x110(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x258abc
movq 0xb0(%rsp), %rdi
movq 0x110(%rsp), %rax
movq 0x30(%rax), %rsi
movq 0x110(%rsp), %rax
movq 0x38(%rax), %rdx
movq 0x110(%rsp), %rax
movq 0x40(%rax), %rcx
movq 0x110(%rsp), %rax
movq 0x48(%rax), %r8
movq 0x110(%rsp), %rax
movq 0x28(%rax), %r9
movq 0xd0(%rsp), %r11
movq 0xc8(%rsp), %r10
movq 0xa8(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x255cb0
movq 0x110(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x258ae1
movq 0x88(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x258230
jmp 0x258ae3
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x258978
cmpq $0x0, 0xb0(%rsp)
je 0x258b1c
movq 0xa8(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x2550d0
cmpq $0x0, 0xa0(%rsp)
je 0x258b40
movq 0xa0(%rsp), %rdi
callq 0x25aa60
movq $0x0, 0xa0(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x111c10
movq 0x110(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x258b6f
leaq 0x50(%rsp), %rdi
callq 0x2584d0
leaq 0x40(%rsp), %rdi
callq 0x2584d0
jmp 0x258b71
cmpq $0x0, 0x100(%rsp)
jne 0x258b97
movq 0xe8(%rsp), %rdi
callq 0xae070
movq $0x0, 0xe8(%rsp)
jmp 0x258ba4
movq 0x100(%rsp), %rdi
callq 0x254960
movq 0xf0(%rsp), %rdi
callq 0xe7ed0
movq $0x0, 0xf0(%rsp)
movb 0xff(%rsp), %dl
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax)