// File: /workspace/github_c_makefile_star2_O3/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 $0x248, %rsp            # imm = 0x248
movl %r9d, %r12d
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rdx
movl %edi, %ebx
movq 0x2a8(%rsp), %r8
movq 0x2a0(%rsp), %rcx
leaq 0x148(%rsp), %rdi
movl $0x83, %esi
callq 0x1a2288
testl %eax, %eax
je 0xbd249
movb $0x1, %bl
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0xbd82f
movl %eax, %r13d
movl %r12d, 0x90(%rsp)
movl %ebp, 0xa0(%rsp)
testq %r14, %r14
movq %r14, 0x88(%rsp)
je 0xbd2be
movq %r14, %rdi
callq 0x11c131
testq %rax, %rax
je 0xbd2be
testq %r15, %r15
movl %ebx, %ebp
je 0xbd37c
movq %r15, %rdi
callq 0x11b0ca
testq %rax, %rax
movq 0x2a8(%rsp), %r14
movl 0x90(%rsp), %ebx
jne 0xbd87d
xorl %r13d, %r13d
movl $0x0, 0x84(%rsp)
xorl %r12d, %r12d
movq 0x88(%rsp), %r15
jmp 0xbd3a4
testq %r15, %r15
movl %ebx, %ebp
je 0xbd364
movq %r15, %rdi
callq 0x11b0ca
testq %rax, %rax
je 0xbd364
testl %r13d, %r13d
setne %bl
callq 0xef0cd
movq %rax, %r13
movq %rax, %rdi
callq 0xf23c9
movq %r13, %rdi
movq 0x2a0(%rsp), %rsi
callq 0xf249c
movq %r15, %rdi
callq 0x11b0a1
movq %r13, %rdi
movq %rax, %rsi
movq 0x2a8(%rsp), %r14
movq %r14, %rdx
callq 0xef129
movq %rax, %r15
movq %r13, %rdi
callq 0xefbe3
movq %r15, 0x98(%rsp)
testq %r15, %r15
sete %r13b
orb %bl, %r13b
movb $0x1, %al
movl %eax, 0x84(%rsp)
movl 0x90(%rsp), %ebx
je 0xbd868
xorl %r12d, %r12d
movq 0x88(%rsp), %r15
movq %r13, %rcx
jmp 0xbd409
movq 0x148(%rsp), %r12
xorl %r13d, %r13d
movl $0x0, 0x84(%rsp)
jmp 0xbd38d
xorl %r13d, %r13d
movl $0x0, 0x84(%rsp)
xorl %r12d, %r12d
movq 0x88(%rsp), %r15
movq 0x2a8(%rsp), %r14
movl 0x90(%rsp), %ebx
movq 0x148(%rsp), %rdi
callq 0xe7b9c
movq 0x148(%rsp), %rdi
movq 0x1a0(%rsp), %rdx
movl 0x190(%rsp), %ecx
leaq 0x1(%rax), %r8
movq %r14, 0x18(%rsp)
movl %ebx, 0x10(%rsp)
movl 0xa0(%rsp), %esi
movl %esi, 0x8(%rsp)
movq %r12, 0x98(%rsp)
movq %r12, (%rsp)
movq %rax, %rsi
movq %r15, %r9
callq 0x1a45a1
movq %rax, %r12
testq %rax, %rax
movzbl %r13b, %eax
movl $0x1, %ecx
cmovnel %eax, %ecx
movq %rcx, 0xc8(%rsp)
testb %cl, %cl
je 0xbd42a
movq 0xc8(%rsp), %rbx
movq 0x98(%rsp), %r14
jmp 0xbd828
movq 0x280(%rsp), %rbx
callq 0x1baabc
movq %rax, 0xb0(%rsp)
testq %r15, %r15
je 0xbd456
movq %r15, %rdi
callq 0x11c131
testq %rax, %rax
je 0xbd456
xorl %r15d, %r15d
jmp 0xbd46a
movq 0x98(%rsp), %rax
cmpq %rax, 0x148(%rsp)
sete %r15b
testq %rbx, %rbx
movq 0xb0(%rsp), %r13
je 0xbd482
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1babe3
movq %r13, %rdi
movl 0xa0(%rsp), %esi
callq 0x1bac69
movzbl %bpl, %eax
movl %eax, 0xac(%rsp)
movzbl %r15b, %eax
movl %eax, 0xc4(%rsp)
movq 0x88(%rsp), %r15
movq %r12, 0xd0(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x1a47b6
testl %eax, %eax
jne 0xbd804
movq %r12, %rdi
callq 0x1a4730
movq %rax, %rbp
movq 0x148(%rsp), %rdi
callq 0xec555
testb %al, %al
je 0xbd533
movq 0x148(%rsp), %rdi
movq %rbp, %rsi
callq 0xeb655
movq %rax, %rbx
movq 0x148(%rsp), %rdi
movq %rax, %rsi
callq 0xeb9d2
movq %rax, 0xb8(%rsp)
movq 0x148(%rsp), %rdi
movq %rbx, 0xa0(%rsp)
movq %rbx, %rsi
callq 0xeb6ee
movq %rax, 0x90(%rsp)
jmp 0xbd557
movq $0x0, 0xa0(%rsp)
movq $0x0, 0x90(%rsp)
movq $0x0, 0xb8(%rsp)
movq %r12, %rdi
callq 0x1a4753
movq %rax, %r13
movq %r12, %rdi
callq 0x1a4779
movq %rax, %r14
movq %r12, %rdi
callq 0x1a4766
movq %rax, %rbx
testq %r15, %r15
je 0xbd5dc
movq %r15, %rdi
callq 0x11c131
testq %rax, %rax
je 0xbd5dc
xorl %r15d, %r15d
movq %r15, 0xe0(%rsp)
movq %r12, %rdi
callq 0x1a4789
movq %rax, 0xd8(%rsp)
movq %r12, %rdi
callq 0x1a479e
movq %rax, 0xe8(%rsp)
movq %r14, 0xf8(%rsp)
movq %r15, 0xf0(%rsp)
movq %r15, 0x100(%rsp)
movw $0x100, 0x108(%rsp)     # imm = 0x100
xorl %r15d, %r15d
jmp 0xbd62b
movq 0x98(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
xorl %ecx, %ecx
movq %rcx, 0xd8(%rsp)
movq %rcx, 0xe8(%rsp)
leaq 0xf0(%rsp), %rax
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rax)
movq %rcx, 0x100(%rsp)
movw $0x100, 0x108(%rsp)     # imm = 0x100
movq %rbx, %rsi
callq 0xeb6ee
movq %rax, %r15
movq %r12, %rdi
callq 0x1a4743
movq 0x288(%rsp), %r12
testq %r12, %r12
je 0xbd6dc
movq 0x90(%rsp), %r8
subq %r8, %rbp
pxor %xmm0, %xmm0
movdqu %xmm0, 0x48(%rsp)
movq %r14, 0x40(%rsp)
movq %r15, 0x38(%rsp)
movq %rax, 0x30(%rsp)
movq %r13, 0x28(%rsp)
movq %rbx, 0x20(%rsp)
movl 0xac(%rsp), %eax
movl %eax, 0x18(%rsp)
movdqu %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0xb0(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq 0xa0(%rsp), %rdx
movq %rbp, %rcx
movq 0xb8(%rsp), %r9
callq 0x1bacde
movq 0x148(%rsp), %rsi
movq 0x290(%rsp), %rdi
movq %rbx, %rdx
leaq 0xd8(%rsp), %rcx
movl 0xc4(%rsp), %r8d
callq *%r12
jmp 0xbd7e7
movq 0x148(%rsp), %rcx
movq %rcx, 0x118(%rsp)
xorl %edx, %edx
movq %rdx, 0x110(%rsp)
movq %rdx, 0x120(%rsp)
leaq 0x128(%rsp), %rcx
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rcx)
movq %rdx, 0x138(%rsp)
movw $0x100, 0x140(%rsp)     # imm = 0x100
movq 0x90(%rsp), %r9
subq %r9, %rbp
movq %rax, %rcx
subq %r15, %rcx
movq %rcx, 0x68(%rsp)
movq %r14, 0x58(%rsp)
movq %r15, 0x50(%rsp)
movq %rax, 0x38(%rsp)
movq %rbx, 0x28(%rsp)
movq %r13, 0x70(%rsp)
movq %rbp, 0x60(%rsp)
leaq 0xd8(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %r13, 0x30(%rsp)
movl 0xac(%rsp), %eax
movl %eax, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, (%rsp)
movl $0x0, 0x78(%rsp)
movq %rbp, %r8
movq 0xb0(%rsp), %rbx
movq %rbx, %rdi
movq 0x298(%rsp), %rsi
movq %r13, %rdx
movq 0xa0(%rsp), %rcx
callq 0x1bbef3
testb %al, %al
je 0xbd7e7
movq 0x28a53d(%rip), %xmm0   # 0x347d10
movdqa %xmm0, %xmm1
movq 0x298(%rsp), %rdi
movq %rbx, %rsi
callq 0x1bae05
movq 0x88(%rsp), %r15
movq 0x2a8(%rsp), %r14
movq 0xd0(%rsp), %r12
jmp 0xbd4b7
cmpl $-0x1, %eax
movq 0xc8(%rsp), %rbx
movq 0x98(%rsp), %r14
jne 0xbd81b
movb $0x1, %bl
movq 0xb0(%rsp), %rdi
callq 0x1badd6
movl 0x84(%rsp), %ebp
movq %r12, %rdi
callq 0x1a46fc
leaq 0x148(%rsp), %rdi
callq 0x1a1540
testb %bpl, %bpl
je 0xbd851
movq %r14, %rdi
callq 0xea375
movzbl %bl, %eax
negl %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x88(%rsp), %r15
movq 0x98(%rsp), %r12
jmp 0xbd3a4
callq 0x1e308
nop