// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/esa-mmsearch.c
// Function: gt_querysubstringmatch
static void gt_querysubstringmatch(bool selfmatch,
                                   const GtEncseq *dbencseq,
                                   const ESASuffixptr *suftabpart,
                                   GtReadmode readmode,
                                   GtUword numberofsuffixes,
                                   uint64_t queryunitnum,
                                   GtQueryrepresentation *queryrep,
                                   GtUword minmatchlength,
                                   GtProcessquerymatch processquerymatch,
                                   void *processquerymatchinfo,
                                   GtQuerymatch *querymatchspaceptr)
{
  GtMMsearchiterator *mmsi;
  GtUword totallength, localqueryoffset = 0;
  uint64_t localqueryunitnum = queryunitnum;
  GtQuerysubstring querysubstring;

  gt_assert(numberofsuffixes > 0);
  totallength = gt_encseq_total_length(dbencseq);
  querysubstring.queryrep = queryrep;
  for (querysubstring.currentoffset = 0;
       querysubstring.currentoffset <= queryrep->seqlen - minmatchlength;
       querysubstring.currentoffset++)
  {
    GtUword dbstart;

    mmsi = gt_mmsearchiterator_new(dbencseq,
                                   suftabpart,
                                   0, /* leftbound */
                                   numberofsuffixes - 1, /* rightbound */
                                   0, /* offset */
                                   readmode,
                                   &querysubstring,
                                   minmatchlength);
    while (gt_mmsearchiterator_next(&dbstart,mmsi))
    {
      if (gt_mmsearch_isleftmaximal(dbencseq,
                                    readmode,
                                    dbstart,
                                    &querysubstring))
      {
        GtUword dbseqnum, dbseqlen, db_seqstart, extend;
        const char *db_desc = NULL, *query_desc = NULL;

        extend = gt_mmsearch_extendright(dbencseq,
                                         mmsi->esr,
                                         readmode,
                                         totallength,
                                         dbstart + minmatchlength,
                                         &querysubstring,
                                         minmatchlength);

        if (gt_encseq_has_multiseq_support(dbencseq))
        {
          dbseqnum = gt_encseq_seqnum(dbencseq,dbstart);
          dbseqlen = gt_encseq_seqlength(dbencseq,dbseqnum);
          db_seqstart = gt_encseq_seqstartpos(dbencseq,dbseqnum);
        } else
        {
          dbseqnum = dbseqlen = db_seqstart = 0;
        }
        gt_querymatch_init(querymatchspaceptr,
                           minmatchlength + extend,
                           dbseqnum,
                           dbstart - db_seqstart,
                           db_seqstart,
                           dbseqlen,
                           0, /* score */
                           0, /* edist */
                           0, /* mismatches */
                           selfmatch,
                           localqueryunitnum,
                           minmatchlength + extend,
                           localqueryoffset,
                           0,
                           queryrep->seqlen,
                           db_desc,
                           query_desc);
        processquerymatch(processquerymatchinfo,querymatchspaceptr);
      }
    }
    gt_mmsearchiterator_delete(mmsi);
    mmsi = NULL;
    if (gt_mmsearch_accessquery(queryrep,querysubstring.currentoffset)
        == (GtUchar) GT_SEPARATOR)
    {
      localqueryunitnum++;
      localqueryoffset = 0;
    } else
    {
      localqueryoffset++;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf0, %rsp
movb %dil, %al
movq 0x140(%rsp), %rdi
movq 0x138(%rsp), %rdi
movq 0x130(%rsp), %rdi
movq 0x128(%rsp), %rdi
movq 0x120(%rsp), %rdi
andb $0x1, %al
movb %al, 0xef(%rsp)
movq %rsi, 0xe0(%rsp)
movq %rdx, 0xd8(%rsp)
movl %ecx, 0xd4(%rsp)
movq %r8, 0xc8(%rsp)
movq %r9, 0xc0(%rsp)
movq $0x0, 0xa8(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xc8(%rsp)
ja 0x239bb9
movq 0x402418(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2dc481(%rip), %rsi    # 0x516013
leaq 0x33dc59(%rip), %rdx    # 0x5777f2
leaq 0x33d814(%rip), %rcx    # 0x5773b4
leaq 0x33d4c3(%rip), %r8     # 0x57706a
movl $0x1fc, %r9d            # imm = 0x1FC
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x239bbb
movq 0xe0(%rsp), %rdi
callq 0xa9d00
movq %rax, 0xb0(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x90(%rsp)
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq 0x120(%rsp), %rcx
movq 0x20(%rcx), %rcx
subq 0x128(%rsp), %rcx
cmpq %rcx, %rax
ja 0x239f01
movq 0xe0(%rsp), %rdi
movq 0xd8(%rsp), %rsi
movq 0xc8(%rsp), %rcx
subq $0x1, %rcx
movl 0xd4(%rsp), %r9d
movq 0x128(%rsp), %rax
xorl %edx, %edx
movl %edx, %r8d
leaq 0x90(%rsp), %r10
movq %r8, %rdx
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x238240
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x238350
testb $0x1, %al
jne 0x239c81
jmp 0x239e78
movq 0xe0(%rsp), %rdi
movl 0xd4(%rsp), %esi
movq 0x88(%rsp), %rdx
leaq 0x90(%rsp), %rcx
callq 0x239850
testb $0x1, %al
jne 0x239cae
jmp 0x239e73
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq 0xe0(%rsp), %rdi
movq 0xb8(%rsp), %rax
movq 0x28(%rax), %rsi
movl 0xd4(%rsp), %edx
movq 0xb0(%rsp), %rcx
movq 0x88(%rsp), %r8
addq 0x128(%rsp), %r8
movq 0x128(%rsp), %rax
leaq 0x90(%rsp), %r9
movq %rax, (%rsp)
callq 0x2398f0
movq %rax, 0x68(%rsp)
movq 0xe0(%rsp), %rdi
callq 0xb2480
testb $0x1, %al
jne 0x239d24
jmp 0x239d77
movq 0xe0(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0xb03a0
movq %rax, 0x80(%rsp)
movq 0xe0(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0xb09f0
movq %rax, 0x78(%rsp)
movq 0xe0(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0xb0530
movq %rax, 0x70(%rsp)
jmp 0x239d95
movq $0x0, 0x70(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x140(%rsp), %rdi
movq 0x128(%rsp), %rsi
addq 0x68(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x88(%rsp), %rcx
subq 0x70(%rsp), %rcx
movq 0x70(%rsp), %r8
movq 0x78(%rsp), %r9
movb 0xef(%rsp), %bpl
movq 0xa0(%rsp), %r15
movq 0x128(%rsp), %r14
addq 0x68(%rsp), %r14
movq 0xa8(%rsp), %rbx
movq 0x120(%rsp), %rax
movq 0x20(%rax), %r11
movq 0x60(%rsp), %r10
movq 0x58(%rsp), %rax
xorl %r12d, %r12d
andb $0x1, %bpl
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movzbl %bpl, %ebp
movl %ebp, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq %r11, 0x40(%rsp)
movq %r10, 0x48(%rsp)
movq %rax, 0x50(%rsp)
callq 0x267890
movq 0x130(%rsp), %rax
movq 0x138(%rsp), %rdi
movq 0x140(%rsp), %rsi
callq *%rax
jmp 0x239c63
movq 0xb8(%rsp), %rdi
callq 0x2384d0
movq $0x0, 0xb8(%rsp)
movq 0x120(%rsp), %rdi
movq 0x98(%rsp), %rsi
callq 0x239f20
movzbl %al, %eax
cmpl $0xff, %eax
jne 0x239ed2
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa0(%rsp)
movq $0x0, 0xa8(%rsp)
jmp 0x239ee6
movq 0xa8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa8(%rsp)
jmp 0x239ee8
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x239bec
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)