// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/esa-mmsearch.c
// Function: gt_queryuniquematch
void gt_queryuniquematch(bool selfmatch,
                         const Suffixarray *suffixarray,
                         uint64_t queryunitnum,
                         GtQueryrepresentation *queryrep,
                         GtUword minmatchlength,
                         GtProcessquerymatch processquerymatch,
                         void *processquerymatchinfo,
                         GtQuerymatch *querymatchspaceptr)
{
  GtUword offset, totallength = gt_encseq_total_length(suffixarray->encseq),
          localqueryoffset = 0;
  uint64_t localqueryunitnum = queryunitnum;

  gt_assert(!selfmatch && queryrep->seqlen >= minmatchlength);
  /*XXX gt_assert(!gt_querymatch_seq_desc_display(querymatchspaceptr));*/
  for (offset = 0; offset <= queryrep->seqlen - minmatchlength; offset++)
  {
    GtUword matchlen, dbstart;

    matchlen = gt_suffixarrayfindmums (suffixarray,
                                       0,
                                       0, /* leftbound */
                                       totallength, /* rightbound */
                                       &dbstart,
                                       queryrep->sequence + offset,
                                       queryrep->sequence + queryrep->seqlen);
    if (dbstart != ULONG_MAX &&
        matchlen >= minmatchlength &&
        gt_mum_isleftmaximal(suffixarray->encseq,
                             suffixarray->readmode,
                             dbstart,
                             offset,
                             queryrep->sequence))
    {
      GtUword dbseqnum = gt_encseq_seqnum(suffixarray->encseq,dbstart),
              dbseqlen = gt_encseq_seqlength(suffixarray->encseq,dbseqnum),
              db_seqstart = gt_encseq_seqstartpos(suffixarray->encseq,dbseqnum);

      gt_querymatch_init(querymatchspaceptr,
                         matchlen,
                         dbseqnum,
                         dbstart - db_seqstart,
                         db_seqstart,
                         dbseqlen,
                         0, /* score */
                         0, /* edist */
                         0, /* mismatches */
                         selfmatch,
                         localqueryunitnum,
                         matchlen,
                         localqueryoffset,
                         0,
                         queryrep->seqlen,
                         NULL,
                         NULL);
      processquerymatch(processquerymatchinfo,querymatchspaceptr);
    }
    if (queryrep->sequence[offset] == (GtUchar) GT_SEPARATOR)
    {
      localqueryunitnum++;
      localqueryoffset = 0;
    } else
    {
      localqueryoffset++;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, 0x80(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movl %edi, %ebx
movq %rsi, 0x70(%rsp)
movq (%rsi), %rdi
callq 0xec1d8
movq %rax, 0x90(%rsp)
testl %ebx, %ebx
jne 0x1acb73
movq %r14, %rdx
cmpq %r14, 0x20(%r15)
jb 0x1acb73
movq 0x20(%r15), %rax
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r15, 0x60(%rsp)
movq %rdx, 0x68(%rsp)
movq (%r15), %rcx
leaq (%rcx,%r13), %r9
addq %rcx, %rax
movq %rax, (%rsp)
movq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq 0x90(%rsp), %rcx
leaq 0x78(%rsp), %r8
callq 0x1ac67e
movq 0x68(%rsp), %rdx
movq 0x78(%rsp), %rsi
cmpq $-0x1, %rsi
je 0x1acb2a
movq %rax, %rbx
cmpq %rdx, %rax
jb 0x1acb2a
testq %rsi, %rsi
sete %al
testq %r13, %r13
sete %cl
orb %al, %cl
jne 0x1aca7a
movq 0x60(%rsp), %rax
movq (%rax), %rbp
movq 0x70(%rsp), %rax
movl 0x48(%rax), %edx
movq (%rax), %rdi
decq %rsi
callq 0xec1f8
movq 0x68(%rsp), %rdx
cmpb $-0x3, %al
ja 0x1aca7a
cmpb -0x1(%rbp,%r13), %al
je 0x1acb2a
movq 0x70(%rsp), %r15
movq (%r15), %rdi
movq 0x78(%rsp), %rsi
callq 0xefc48
movq %rax, %rbp
movq (%r15), %rdi
movq %rax, %rsi
callq 0xeffd3
movq %rax, 0x88(%rsp)
movq (%r15), %rdi
movq %rbp, %rsi
callq 0xefce0
movq 0x78(%rsp), %rcx
subq %rax, %rcx
movq 0x60(%rsp), %rdx
movq 0x20(%rdx), %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
xorl %edx, %edx
movq %rdx, 0x38(%rsp)
movq %r14, 0x30(%rsp)
movq %rbx, 0x28(%rsp)
movq %r12, 0x20(%rsp)
movq %rdx, 0x10(%rsp)
movups %xmm0, (%rsp)
movl $0x0, 0x18(%rsp)
movq 0xd8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movq %rax, %r8
movq 0x88(%rsp), %r9
callq 0x1c3a3d
movq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq *0x80(%rsp)
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %r15
movq (%r15), %rax
incq %r14
xorl %ecx, %ecx
cmpb $-0x1, (%rax,%r13)
sete %cl
movl $0x0, %eax
cmoveq %rax, %r14
addq %rcx, %r12
incq %r13
movq 0x20(%r15), %rax
movq %rax, %rcx
subq %rdx, %rcx
cmpq %rcx, %r13
jbe 0x1ac9f2
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x63764