// File: /workspace/github_c_makefile_star2_O1/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, %r14d
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %rdx
movl %edi, 0xa0(%rsp)
movq 0x2a8(%rsp), %r8
movq 0x2a0(%rsp), %r15
leaq 0x148(%rsp), %rdi
movl $0x83, %esi
movq %r15, %rcx
callq 0x1aab20
xorl %r13d, %r13d
testl %eax, %eax
setne %cl
movq %r12, 0x98(%rsp)
je 0xbf24b
movq $0x0, 0x90(%rsp)
movl $0x0, 0x8c(%rsp)
movq %r12, %r15
jmp 0xbf35d
movl %ecx, 0x88(%rsp)
testq %r12, %r12
je 0xbf2a9
movq %r12, %rdi
callq 0x121e78
testq %rax, %rax
je 0xbf2a9
testq %rbx, %rbx
je 0xbf337
movq %rbx, %rdi
callq 0x120d4c
testq %rax, %rax
movq 0x98(%rsp), %r15
jne 0xbf80c
movq $0x0, 0x90(%rsp)
movl $0x0, 0x8c(%rsp)
movl 0x88(%rsp), %ecx
jmp 0xbf35d
testq %rbx, %rbx
je 0xbf325
movq %rbx, %rdi
callq 0x120d4c
testq %rax, %rax
je 0xbf325
callq 0xf36ef
movq %rax, %r12
movq %rax, %rdi
callq 0xf6a0a
movq %r12, %rdi
movq %r15, %rsi
callq 0xf6add
movq %rbx, %rdi
callq 0x120d23
movq %r12, %rdi
movq %rax, %rsi
movq 0x2a8(%rsp), %rdx
callq 0xf374b
movq %rax, %rbx
movq %r12, %rdi
callq 0xf424d
movq %rbx, 0x90(%rsp)
testq %rbx, %rbx
movl 0x88(%rsp), %eax
movb %al, %r13b
movl $0x1, %ecx
cmovnel %r13d, %ecx
movb $0x1, %al
movl %eax, 0x8c(%rsp)
jmp 0xbf355
movq 0x148(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0xbf343
movq $0x0, 0x90(%rsp)
movl $0x0, 0x8c(%rsp)
movl 0x88(%rsp), %ecx
movq 0x98(%rsp), %r15
testb %cl, %cl
je 0xbf366
xorl %r12d, %r12d
jmp 0xbf3ce
movq 0x148(%rsp), %rdi
movl %ecx, %ebx
callq 0xec1d8
movq 0x148(%rsp), %rdi
movq 0x1a0(%rsp), %rdx
movl 0x190(%rsp), %ecx
leaq 0x1(%rax), %r8
movq 0x2a8(%rsp), %rsi
movq %rsi, 0x18(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebp, 0x8(%rsp)
movq 0x90(%rsp), %rsi
movq %rsi, (%rsp)
movq %rax, %rsi
movq %r15, %r9
callq 0x1acfb1
movq %rax, %r12
testq %rax, %rax
movzbl %bl, %eax
movl $0x1, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x88(%rsp)
testb %cl, %cl
jne 0xbf7c4
movq 0x280(%rsp), %rbx
callq 0x1c3820
movq %rax, 0xb0(%rsp)
testq %r15, %r15
je 0xbf409
movq %r15, %rdi
callq 0x121e78
testq %rax, %rax
je 0xbf409
xorl %r14d, %r14d
jmp 0xbf41d
movq 0x90(%rsp), %rax
cmpq %rax, 0x148(%rsp)
sete %r14b
testq %rbx, %rbx
movq 0xb0(%rsp), %r13
je 0xbf435
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1c3942
movq %r13, %rdi
movl %ebp, %esi
callq 0x1c39c8
movzbl 0xa0(%rsp), %eax
movl %eax, 0xac(%rsp)
movzbl %r14b, %eax
movl %eax, 0xcc(%rsp)
movq %r13, %rbx
movq %r12, 0xd0(%rsp)
jmp 0xbf796
movq %r12, %rdi
callq 0x1ad140
movq %rax, %rbp
movq 0x148(%rsp), %rdi
callq 0xf0b51
testb %al, %al
je 0xbf4d2
movq 0x148(%rsp), %rdi
movq %rbp, %rsi
callq 0xefc48
movq %rax, %rbx
movq 0x148(%rsp), %rdi
movq %rax, %rsi
callq 0xeffd3
movq %rax, 0xb8(%rsp)
movq 0x148(%rsp), %rdi
movq %rbx, 0xa0(%rsp)
movq %rbx, %rsi
callq 0xefce0
movq %rax, 0xc0(%rsp)
jmp 0xbf4f6
movq $0x0, 0xa0(%rsp)
movq $0x0, 0xc0(%rsp)
movq $0x0, 0xb8(%rsp)
movq %r12, %rdi
callq 0x1ad163
movq %rax, %r13
movq %r12, %rdi
callq 0x1ad189
movq %rax, %r14
movq %r12, %rdi
callq 0x1ad176
movq %rax, %rbx
testq %r15, %r15
je 0xbf57b
movq %r15, %rdi
callq 0x121e78
testq %rax, %rax
je 0xbf57b
xorl %r15d, %r15d
movq %r15, 0xe0(%rsp)
movq %r12, %rdi
callq 0x1ad199
movq %rax, 0xd8(%rsp)
movq %r12, %rdi
callq 0x1ad1ae
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 0xbf5ca
movq 0x90(%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 0xefce0
movq %rax, %r15
movq %r12, %rdi
callq 0x1ad153
movq 0x288(%rsp), %r12
testq %r12, %r12
je 0xbf67b
movq 0xc0(%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 0x1c3a3d
movq 0x148(%rsp), %rsi
movq 0x290(%rsp), %rdi
movq %rbx, %rdx
leaq 0xd8(%rsp), %rcx
movl 0xcc(%rsp), %r8d
callq *%r12
jmp 0xbf786
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 0xc0(%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 0x1c4c6f
testb %al, %al
je 0xbf786
movq 0x29159e(%rip), %xmm0   # 0x350d10
movdqa %xmm0, %xmm1
movq 0x298(%rsp), %rdi
movq %rbx, %rsi
callq 0x1c3b64
movq 0x98(%rsp), %r15
movq 0xd0(%rsp), %r12
movq %r12, %rdi
movq 0x2a8(%rsp), %rsi
callq 0x1ad1c6
testl %eax, %eax
je 0xbf469
cmpl $-0x1, %eax
jne 0xbf7bc
movb $0x1, %al
movl %eax, 0x88(%rsp)
movq %rbx, %rdi
callq 0x1c3b35
movq %r12, %rdi
callq 0x1ad10c
leaq 0x148(%rsp), %rdi
callq 0x1a9e1c
cmpb $0x0, 0x8c(%rsp)
je 0xbf7f0
movq 0x90(%rsp), %rdi
callq 0xee90c
movzbl 0x88(%rsp), %eax
negl %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1e659
nopl (%rax)