// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/greedyfwdmat.c
// Function: gt_findsubquerygmatchforward
int gt_findsubquerygmatchforward(const GtEncseq *encseq,
                              const void *genericindex,
                              GtUword totallength,
                              Greedygmatchforwardfunction gmatchforward,
                              const GtAlphabet *alphabet,
                              const GtStrArray *queryfilenames,
                              Definedunsignedlong minlength,
                              Definedunsignedlong maxlength,
                              bool showsequence,
                              bool showquerypos,
                              bool showsubjectpos,
                              GtError *err)
{
  Substringinfo substringinfo;
  Rangespecinfo rangespecinfo;
  bool haserr = false;
  GtSeqIterator *seqit;
  const GtUchar *query;
  GtUword querylen;
  char *desc = NULL;
  int retval;
  uint64_t unitnum;

  gt_error_check(err);
  substringinfo.genericindex = genericindex;
  substringinfo.totallength = totallength;
  rangespecinfo.minlength = minlength;
  rangespecinfo.maxlength = maxlength;
  rangespecinfo.showsequence = showsequence;
  rangespecinfo.showquerypos = showquerypos;
  rangespecinfo.showsubjectpos = showsubjectpos;
  substringinfo.preprocessgmatchlength = showunitnum;
  substringinfo.processgmatchlength = showifinlengthrange;
  substringinfo.postprocessgmatchlength = NULL;
  substringinfo.alphabet = alphabet;
  substringinfo.processinfo = &rangespecinfo;
  substringinfo.gmatchforward = gmatchforward;
  substringinfo.encseq = encseq;
  seqit = gt_seq_iterator_sequence_buffer_new(queryfilenames, err);
  if (!seqit)
    haserr = true;
  if (!haserr)
  {
    gt_seq_iterator_set_symbolmap(seqit, gt_alphabet_symbolmap(alphabet));
    for (unitnum = 0; /* Nothing */; unitnum++)
    {
      retval = gt_seq_iterator_next(seqit,
                                &query,
                                &querylen,
                                &desc,
                                err);
      if (retval < 0)
      {
        haserr = true;
        break;
      }
      if (retval == 0)
      {
        break;
      }
      gmatchposinsinglesequence(&substringinfo,
                                unitnum,
                                query,
                                querylen,
                                desc);
    }
    gt_seq_iterator_delete(seqit);
  }
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %rbx
movq %r8, 0x30(%rsp)
movq %rcx, 0x80(%rsp)
movq %rdx, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdi, %r13
movq 0x108(%rsp), %r14
movq $0x0, 0x18(%rsp)
testq %r14, %r14
je 0x1b1f4c
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1b2247
leaq 0xe0(%rsp), %rax
leaq 0xd0(%rsp), %rcx
movb (%rcx), %dl
movb %dl, 0xf(%rsp)
movq 0x8(%rcx), %rcx
movq %rcx, 0x60(%rsp)
movb (%rax), %cl
movb %cl, 0xe(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x114f10
testq %rax, %rax
sete %bl
je 0x1b21e8
movq %rax, %r15
movq 0x30(%rsp), %rdi
callq 0xd11ab
movq %r15, %rdi
movq %rax, %rsi
callq 0x1142c4
leaq 0x40(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r15, 0x28(%rsp)
movq %r15, %rdi
movq %r14, %r8
callq 0x11433d
testl %eax, %eax
js 0x1b21e1
xorl %ecx, %ecx
movb %bl, %cl
negl %ecx
movl %ecx, 0x24(%rsp)
cmpb $0x0, 0x100(%rsp)
leaq 0x48(%rsp), %rcx
movl $0x0, %edx
cmovneq %rcx, %rdx
testq %r13, %r13
cmovneq %rcx, %rdx
movq %rdx, 0x68(%rsp)
xorl %r14d, %r14d
testl %eax, %eax
je 0x1b21ef
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rbp
movq 0x18(%rsp), %rbx
leaq 0x1f56be(%rip), %rdi    # 0x3a76e0
movq %r14, 0x50(%rsp)
movq %r14, %rsi
xorl %eax, %eax
callq 0x17070
testq %rbx, %rbx
je 0x1b204c
cmpb $0x0, (%rbx)
je 0x1b204c
leaq 0x1eb040(%rip), %rdi    # 0x39d082
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17070
movl $0xa, %edi
callq 0x17a20
testq %rbp, %rbp
je 0x1b21b0
movq 0x10(%rsp), %rbx
leaq (%rbx,%rbp), %rax
movq %rax, 0x88(%rsp)
subq $0x8, %rsp
movq 0x78(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq 0x80(%rsp), %rcx
movq 0x70(%rsp), %r8
movq %rbx, %r9
pushq 0x90(%rsp)
callq *0x90(%rsp)
addq $0x10, %rsp
testq %rax, %rax
je 0x1b21a4
movq %rax, %r14
movq %rbp, 0x90(%rsp)
testq %r13, %r13
je 0x1b20e7
movq 0x48(%rsp), %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rbp
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xe7fcb
movzbl (%rbx,%r12), %r9d
cmpb %al, %r9b
jne 0x1b2211
incq %r12
cmpq %r12, %r14
jne 0x1b20c0
cmpq %r14, 0x60(%rsp)
seta %cl
cmpq %r14, 0x58(%rsp)
setb %al
testb %cl, 0xf(%rsp)
movq 0x90(%rsp), %rbp
jne 0x1b21a4
andb 0xe(%rsp), %al
jne 0x1b21a4
movq %rbx, %r15
subq 0x10(%rsp), %r15
movq 0x48(%rsp), %r12
cmpb $0x0, 0xf8(%rsp)
je 0x1b213b
leaq 0x1f5293(%rip), %rdi    # 0x3a73c4
movq %r15, %rsi
xorl %eax, %eax
callq 0x17070
leaq 0x209e7a(%rip), %rdi    # 0x3bbfbc
movq %r14, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0x100(%rsp)
je 0x1b2167
leaq 0x1fe326(%rip), %rdi    # 0x3b0483
movq %r12, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0xf0(%rsp)
je 0x1b219a
movl $0x20, %edi
callq 0x17a20
movq 0x306d56(%rip), %rax    # 0x4b8ed8
movq (%rax), %rsi
addq 0x10(%rsp), %r15
movq 0x30(%rsp), %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xd1412
movl $0xa, %edi
callq 0x17a20
incq %rbx
decq %rbp
jne 0x1b2070
movq 0x50(%rsp), %r14
incq %r14
movq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq 0x108(%rsp), %r8
callq 0x11433d
testl %eax, %eax
jns 0x1b1fff
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1b21f3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1b21fd
movl 0x24(%rsp), %ebx
movq 0x28(%rsp), %rdi
callq 0x11437f
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %al, %r10d
movq 0x306d64(%rip), %rax    # 0x4b8f80
movq (%rax), %rdi
leaq 0x1f54c3(%rip), %rsi    # 0x3a76e9
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
pushq %rbp
pushq %r10
callq 0x17ab0
addq $0x10, %rsp
movl $0x2, %edi
callq 0x17940
callq 0x65235