// File: /workspace/github_c_makefile_star2_O2/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, %rbp
movq %rcx, %r15
movq %rdx, 0x70(%rsp)
movl %edi, %ebx
movq %rsi, 0x60(%rsp)
movq (%rsi), %rdi
callq 0x7055e
movq %rax, 0x90(%rsp)
testl %ebx, %ebx
jne 0x14ff55
movq 0x20(%r15), %rax
cmpq %rbp, %rax
jb 0x14ff55
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rbp, 0x78(%rsp)
movq %rax, %rcx
subq %rbp, %rcx
cmpq %rcx, %r13
ja 0x14ff43
movq (%r15), %rcx
leaq (%rcx,%r13), %r9
addq %rcx, %rax
movq %rax, (%rsp)
movq 0x60(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq 0x90(%rsp), %rcx
leaq 0x68(%rsp), %r8
callq 0x14f98b
movq 0x68(%rsp), %rsi
cmpq $-0x1, %rsi
je 0x14ff19
movq %rax, %rbx
cmpq %rbp, %rax
jb 0x14ff19
testq %rsi, %rsi
sete %al
testq %r13, %r13
sete %cl
orb %al, %cl
jne 0x14fe6c
movq (%r15), %r14
movq 0x60(%rsp), %rax
movl 0x48(%rax), %edx
movq (%rax), %rdi
decq %rsi
callq 0x705e4
cmpb $-0x3, %al
ja 0x14fe6c
cmpb -0x1(%r14,%r13), %al
je 0x14ff19
movq 0x60(%rsp), %r14
movq (%r14), %rdi
movq 0x68(%rsp), %rsi
callq 0x74c9d
movq %rax, %rbp
movq (%r14), %rdi
movq %rax, %rsi
callq 0x75173
movq %rax, 0x88(%rsp)
movq (%r14), %rdi
movq %rbp, %rsi
callq 0x74d9c
movq 0x68(%rsp), %rcx
subq %rax, %rcx
movq 0x20(%r15), %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %r12, 0x30(%rsp)
movq %rbx, 0x28(%rsp)
movq 0x70(%rsp), %rdx
movq %rdx, 0x20(%rsp)
movups %xmm0, (%rsp)
andq $0x0, 0x38(%rsp)
andl $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
movq 0xd8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movq 0x78(%rsp), %rbp
movq %rax, %r8
movq 0x88(%rsp), %r9
callq 0x16a116
movq 0xd0(%rsp), %rdi
movq %r14, %rsi
callq *0x80(%rsp)
movq (%r15), %rax
incq %r12
xorl %ecx, %ecx
cmpb $-0x1, (%rax,%r13)
movl $0x0, %eax
cmoveq %rax, %r12
sete %cl
addq %rcx, 0x70(%rsp)
incq %r13
movq 0x20(%r15), %rax
jmp 0x14fde4
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e800c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1950ad(%rip), %rsi    # 0x2e5013
leaq 0x1f4d24(%rip), %rdx    # 0x344c91
leaq 0x1f4d4e(%rip), %rcx    # 0x344cc2
leaq 0x1f4ca7(%rip), %r8     # 0x344c22
movl $0x1b4, %r9d            # imm = 0x1B4
xorl %eax, %eax
callq 0x17a50
callq 0x17390