// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/tools/gt_repfind.c
// Function: gt_callenumquerymatches
static int gt_callenumquerymatches(bool selfmatch,
                                   const char *indexname,
                                   const GtStrArray *query_files,
                                   const GtStr *query_indexname,
                                   GtReadmode query_readmode,
                                   unsigned int userdefinedleastlength,
                                   GtQuerymatchoutoptions *querymatchoutoptions,
                                   Gt_extend_querymatch_func eqmf,
                                   void *eqmf_data,
                                   const GtSeedExtendDisplayFlag
                                      *out_display_flag,
                                   GtLogger *logger,
                                   GtError *err)
{
  Suffixarray suffixarray;
  GtQuerysubstringmatchiterator *qsmi = NULL;
  bool haserr = false, query_encseq_own = false;
  GtEncseq *query_encseq = NULL;
  GtUword totallength = 0;

  if (gt_mapsuffixarray(&suffixarray,
                        SARR_ESQTAB | SARR_SUFTAB | SARR_SSPTAB,
                        indexname,
                        logger,
                        err) != 0)
  {
    haserr = true;
  }
  if (!haserr)
  {
    if (query_files == NULL || gt_str_array_size(query_files) == 0)
    {
      if (query_indexname == NULL || gt_str_length(query_indexname) == 0)
      {
        query_encseq = suffixarray.encseq;
      } else
      {
        GtEncseqLoader *el = gt_encseq_loader_new();

        gt_encseq_loader_require_ssp_tab(el);
        gt_encseq_loader_set_logger(el, logger);
        query_encseq = gt_encseq_loader_load(el, gt_str_get(query_indexname),
                                             err);
        gt_encseq_loader_delete(el);
        query_encseq_own = true;
        if (query_encseq == NULL)
        {
          haserr = true;
        }
      }
    } else
    {
      gt_assert(query_indexname == NULL || gt_str_length(query_indexname) == 0);
    }
  }
  if (!haserr)
  {
    totallength = gt_encseq_total_length(suffixarray.encseq);
    qsmi = gt_querysubstringmatchiterator_new(suffixarray.encseq,
                                              totallength,
                                              suffixarray.suftab,
                                              suffixarray.readmode,
                                              totallength + 1,
                                              query_files,
                                              query_encseq,
                                              query_readmode,
                                              userdefinedleastlength,
                                              err);
    if (qsmi == NULL)
    {
      haserr = true;
    }
  }
  if (!haserr)
  {
    int retval;
    GtSeqorEncseq query_seqorencseq;
    GtQuerymatch *exactseed = gt_querymatch_new();
    bool same_encseq;

    if (query_files == NULL || gt_str_array_size(query_files) == 0)
    {
      same_encseq = (suffixarray.encseq == query_encseq) ? true : false;
    } else
    {
      same_encseq = false;
    }
    if (querymatchoutoptions != NULL)
    {
      gt_querymatch_outoptions_set(exactseed,querymatchoutoptions);
    }
    gt_querymatch_query_readmode_set(exactseed,query_readmode);
    while (!haserr &&
           (retval = gt_querysubstringmatchiterator_next(qsmi, err)) == 0)
    {
      GtUword dbstart, dbseqnum, db_seqstart, dbseqlen,
              matchlength, query_seqlen, querystart, query_seqstart;
      uint64_t queryunitnum;

      dbstart = gt_querysubstringmatchiterator_dbstart(qsmi);
      if (gt_encseq_has_multiseq_support(suffixarray.encseq))
      {
        dbseqnum = gt_encseq_seqnum(suffixarray.encseq,dbstart);
        dbseqlen = gt_encseq_seqlength(suffixarray.encseq, dbseqnum);
        db_seqstart = gt_encseq_seqstartpos(suffixarray.encseq, dbseqnum);
      } else
      {
        dbseqnum = dbseqlen = db_seqstart = 0;
      }
      matchlength = gt_querysubstringmatchiterator_matchlength(qsmi);
      query_seqlen = gt_querysubstringmatchiterator_query_seqlen(qsmi);
      queryunitnum = gt_querysubstringmatchiterator_queryunitnum(qsmi);
      if (query_files == NULL || gt_str_array_size(query_files) == 0)
      {
        GT_SEQORENCSEQ_INIT_ENCSEQ(&query_seqorencseq,query_encseq);
        query_seqstart = gt_encseq_seqstartpos(query_encseq,queryunitnum);
      } else
      {
        GT_SEQORENCSEQ_INIT_SEQ(&query_seqorencseq,
                                gt_querysubstringmatchiterator_query(qsmi),
                                gt_querysubstringmatchiterator_desc(qsmi),
                                query_seqlen,
                                NULL,
                                0,
                                true);
        query_seqstart = 0;
      }
      querystart = gt_querysubstringmatchiterator_querystart(qsmi);
      if (eqmf != NULL)
      {
        gt_querymatch_init(exactseed,
                           matchlength,
                           dbseqnum,
                           dbstart - db_seqstart,
                           db_seqstart,
                           dbseqlen,
                           0, /* score */
                           0, /* edist */
                           0, /* mismatches */
                           selfmatch,
                           queryunitnum,
                           matchlength,
                           querystart,
                           query_seqstart,
                           query_seqlen,
                           NULL,
                           NULL);
        eqmf(eqmf_data,suffixarray.encseq,exactseed,&query_seqorencseq,
             same_encseq);
      } else
      {
        GtSeqorEncseq dbes;

        GT_SEQORENCSEQ_INIT_ENCSEQ(&dbes,suffixarray.encseq);
        if (gt_querymatch_complete(exactseed,
                                   out_display_flag,
                                   matchlength,
                                   dbseqnum,
                                   dbstart - db_seqstart,
                                   db_seqstart,
                                   dbseqlen,
                                   0, /* score */
                                   0, /* edist */
                                   0, /* mismatches */
                                   selfmatch,
                                   queryunitnum,
                                   matchlength,
                                   querystart,
                                   &dbes,
                                   &query_seqorencseq,
                                   query_seqstart,
                                   query_seqlen,
                                   dbstart - db_seqstart,
                                   querystart - query_seqstart,
                                   matchlength,
                                   false))
        {
          /* for exact matches we do not output evalues and bitscores */
          gt_querymatch_prettyprint(DBL_MAX,DBL_MAX,out_display_flag,exactseed);
        }
      }
    }
    if (retval == -1)
    {
      haserr = true;
    }
    gt_querymatch_delete(exactseed);
  }
  gt_querysubstringmatchiterator_delete(qsmi);
  gt_freesuffixarray(&suffixarray);
  if (query_encseq_own)
  {
    gt_encseq_delete(query_encseq);
  }
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %r9d, %r15d
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %rdx
movl %edi, %r14d
movq 0x2b8(%rsp), %r8
movq 0x2b0(%rsp), %rcx
leaq 0x158(%rsp), %rdi
movl $0x83, %esi
callq 0x14de4e
testl %eax, %eax
je 0x40bb7
movb $0x1, %bl
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x411ca
movl %eax, %r12d
movl %r15d, 0x98(%rsp)
movl %ebp, 0xa8(%rsp)
testq %r13, %r13
movq %r13, 0x90(%rsp)
je 0x40c2e
movq %r13, %rdi
callq 0xae61c
testq %rax, %rax
je 0x40c2e
testq %rbx, %rbx
movl %r14d, %ebp
je 0x40cf1
movq %rbx, %rdi
callq 0xad289
testq %rax, %rax
movq 0x2b8(%rsp), %r15
movl 0x98(%rsp), %r14d
jne 0x41218
xorl %r13d, %r13d
movl $0x0, 0x8c(%rsp)
xorl %r12d, %r12d
movq 0x90(%rsp), %rbx
jmp 0x40d1a
testq %rbx, %rbx
movl %r14d, %ebp
je 0x40cd9
movq %rbx, %rdi
callq 0xad289
testq %rax, %rax
je 0x40cd9
testl %r12d, %r12d
setne %r13b
callq 0x791cd
movq %rax, %r12
movq %rax, %rdi
callq 0x7d150
movq %r12, %rdi
movq 0x2b0(%rsp), %rsi
callq 0x7d487
movq %rbx, %rdi
callq 0xad1fa
movq %r12, %rdi
movq %rax, %rsi
movq 0x2b8(%rsp), %r15
movq %r15, %rdx
callq 0x7921d
movq %rax, %rbx
movq %r12, %rdi
callq 0x79f01
movq %rbx, 0xa0(%rsp)
testq %rbx, %rbx
sete %al
orb %r13b, %al
movq %rax, %r13
movb $0x1, %al
movl %eax, 0x8c(%rsp)
movl 0x98(%rsp), %r14d
je 0x41203
xorl %r12d, %r12d
movq 0x90(%rsp), %rbx
movq %r13, %rcx
jmp 0x40d7e
movq 0x158(%rsp), %r12
xorl %r13d, %r13d
movl $0x0, 0x8c(%rsp)
jmp 0x40d02
xorl %r13d, %r13d
movl $0x0, 0x8c(%rsp)
xorl %r12d, %r12d
movq 0x90(%rsp), %rbx
movq 0x2b8(%rsp), %r15
movl 0x98(%rsp), %r14d
movq 0x158(%rsp), %rdi
callq 0x7055e
movq 0x158(%rsp), %rdi
movq 0x1b0(%rsp), %rdx
movl 0x1a0(%rsp), %ecx
leaq 0x1(%rax), %r8
movq %r15, 0x18(%rsp)
movl %r14d, 0x10(%rsp)
movl 0xa8(%rsp), %esi
movl %esi, 0x8(%rsp)
movq %r12, 0xa0(%rsp)
movq %r12, (%rsp)
movq %rax, %rsi
movq %rbx, %r9
callq 0x150409
movq %rax, %r12
testq %rax, %rax
movzbl %r13b, %eax
pushq $0x1
popq %rcx
cmovnel %eax, %ecx
movq %rcx, 0xd8(%rsp)
testb %cl, %cl
je 0x40da6
movq 0xd8(%rsp), %rbx
movq 0xa0(%rsp), %r14
movl 0x8c(%rsp), %ebp
jmp 0x411ca
movq %rbx, %r14
movq 0x290(%rsp), %rbx
callq 0x169e40
movq %rax, 0xb8(%rsp)
testq %r14, %r14
je 0x40dd5
movq %r14, %rdi
callq 0xae61c
testq %rax, %rax
je 0x40dd5
xorl %r14d, %r14d
jmp 0x40de9
movq 0xa0(%rsp), %rax
cmpq %rax, 0x158(%rsp)
sete %r14b
testq %rbx, %rbx
movq 0xb8(%rsp), %r13
je 0x40e01
movq %r13, %rdi
movq %rbx, %rsi
callq 0x169fbc
movq %r13, %rdi
movl 0xa8(%rsp), %esi
callq 0x16a0a4
movzbl %bpl, %eax
movl %eax, 0xb4(%rsp)
movzbl %r14b, %eax
movl %eax, 0xd4(%rsp)
movq 0x90(%rsp), %rbx
movq %r12, 0xe0(%rsp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x1507e8
testl %eax, %eax
jne 0x4119f
movq %r12, %rdi
callq 0x1505fd
movq %rax, %rbp
movq 0x158(%rsp), %rdi
callq 0x76086
testb %al, %al
je 0x40eb2
movq 0x158(%rsp), %rdi
movq %rbp, %rsi
callq 0x74c9d
movq %rax, %r14
movq 0x158(%rsp), %rdi
movq %rax, %rsi
callq 0x75173
movq %rax, 0xc8(%rsp)
movq 0x158(%rsp), %rdi
movq %r14, 0x98(%rsp)
movq %r14, %rsi
callq 0x74d9c
movq %rax, 0xc0(%rsp)
jmp 0x40ed6
movq $0x0, 0x98(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xc8(%rsp)
movq %r12, %rdi
callq 0x150686
movq %rax, %r13
movq %r12, %rdi
callq 0x150712
movq %rax, %r14
movq %r12, %rdi
callq 0x1506cc
movq %rax, 0xa8(%rsp)
testq %rbx, %rbx
je 0x40f62
movq %rbx, %rdi
callq 0xae61c
testq %rax, %rax
je 0x40f62
andq $0x0, 0xf0(%rsp)
movq %r12, %rdi
callq 0x150755
movq %rax, 0xe8(%rsp)
movq %r12, %rdi
callq 0x15079d
movq %rax, 0xf8(%rsp)
movq %r14, %r15
movq %r14, 0x108(%rsp)
andq $0x0, 0x100(%rsp)
andq $0x0, 0x110(%rsp)
movw $0x100, 0x118(%rsp)     # imm = 0x100
xorl %ebx, %ebx
jmp 0x40fba
movq %r14, %r15
movq 0xa0(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
andq $0x0, 0xe8(%rsp)
andq $0x0, 0xf8(%rsp)
leaq 0x100(%rsp), %rax
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
andq $0x0, 0x110(%rsp)
movw $0x100, 0x118(%rsp)     # imm = 0x100
movq 0xa8(%rsp), %rsi
callq 0x74d9c
movq %rax, %rbx
movq %r12, %rdi
callq 0x150643
movq 0x298(%rsp), %r14
testq %r14, %r14
je 0x41070
movq 0xc0(%rsp), %r8
subq %r8, %rbp
pxor %xmm0, %xmm0
movdqu %xmm0, 0x48(%rsp)
movq %r15, 0x40(%rsp)
movq %rbx, 0x38(%rsp)
movq %rax, 0x30(%rsp)
movq %r13, 0x28(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0xb4(%rsp), %eax
movl %eax, 0x18(%rsp)
movdqu %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
movq 0xb8(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq 0x98(%rsp), %rdx
movq %rbp, %rcx
movq 0xc8(%rsp), %r9
callq 0x16a116
movq 0x158(%rsp), %rsi
movq 0x2a0(%rsp), %rdi
movq %rbx, %rdx
leaq 0xe8(%rsp), %rcx
movl 0xd4(%rsp), %r8d
callq *%r14
jmp 0x41182
movq 0x158(%rsp), %rcx
movq %rcx, 0x128(%rsp)
andq $0x0, 0x120(%rsp)
andq $0x0, 0x130(%rsp)
leaq 0x138(%rsp), %rcx
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rcx)
andq $0x0, 0x148(%rsp)
movw $0x100, 0x150(%rsp)     # imm = 0x100
movq 0xc0(%rsp), %r9
subq %r9, %rbp
movq %rax, %rcx
subq %rbx, %rcx
movq %r13, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %rbp, 0x60(%rsp)
movq %r15, 0x58(%rsp)
movq %rbx, 0x50(%rsp)
leaq 0xe8(%rsp), %rcx
movq %rcx, 0x48(%rsp)
leaq 0x120(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movq %r13, 0x30(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0xb4(%rsp), %eax
movl %eax, 0x20(%rsp)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rsp)
andl $0x0, 0x78(%rsp)
andq $0x0, 0x18(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, (%rsp)
movq 0xb8(%rsp), %rbx
movq %rbx, %rdi
movq 0x2a8(%rsp), %rsi
movq %r13, %rdx
movq 0x98(%rsp), %rcx
movq %rbp, %r8
callq 0x16b730
testb %al, %al
je 0x41182
movq 0x2a6ba2(%rip), %xmm0   # 0x2e7d10
movdqa %xmm0, %xmm1
movq 0x2a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x16a2d0
movq 0x90(%rsp), %rbx
movq 0x2b8(%rsp), %r15
movq 0xe0(%rsp), %r12
jmp 0x40e36
cmpl $-0x1, %eax
movq 0xd8(%rsp), %rbx
movq 0xa0(%rsp), %r14
movl 0x8c(%rsp), %ebp
jne 0x411bd
movb $0x1, %bl
movq 0xb8(%rsp), %rdi
callq 0x16a2a1
movq %r12, %rdi
callq 0x1505c9
leaq 0x158(%rsp), %rdi
callq 0x14d148
testb %bpl, %bpl
je 0x411ec
movq %r14, %rdi
callq 0x735fd
movzbl %bl, %eax
negl %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x90(%rsp), %rbx
movq 0xa0(%rsp), %r12
jmp 0x40d1a
movq 0x3f6d49(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x2a3dea(%rip), %rsi    # 0x2e5013
leaq 0x2b45cc(%rip), %rdx    # 0x2f57fc
leaq 0x2b4604(%rip), %rcx    # 0x2f583b
leaq 0x2b3d92(%rip), %r8     # 0x2f4fd0
movl $0x266, %r9d            # imm = 0x266
xorl %eax, %eax
callq 0x17a50
callq 0x17390