// File: /workspace/github_c_makefile_star2_O2/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, 0x28(%rsp)
movq %rcx, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdi, %r13
movq 0x108(%rsp), %r14
andq $0x0, 0x30(%rsp)
testq %r14, %r14
je 0x15f956
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
jne 0x15fc30
leaq 0xe0(%rsp), %rax
leaq 0xd0(%rsp), %rcx
movb (%rcx), %dl
movb %dl, 0xf(%rsp)
movq 0x8(%rcx), %rcx
movq %rcx, 0x50(%rsp)
movb (%rax), %cl
movb %cl, 0xe(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa70d0
movq %rax, %rbx
xorl %ecx, %ecx
testq %rax, %rax
sete %al
je 0x15fbd4
movb %al, %cl
negl %ecx
movl %ecx, 0x1c(%rsp)
movq 0x28(%rsp), %rdi
callq 0x56c48
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa61a8
cmpb $0x0, 0x100(%rsp)
leaq 0x38(%rsp), %rax
movl $0x0, %ecx
cmovneq %rax, %rcx
testq %r13, %r13
cmovneq %rax, %rcx
movq %rcx, 0x60(%rsp)
movq $0x0, 0x20(%rsp)
movq %rbx, 0x40(%rsp)
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movq %r14, %r8
callq 0xa62e5
testl %eax, %eax
js 0x15fbd9
je 0x15fbde
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x88(%rsp), %r12
movq 0x30(%rsp), %rbx
leaq 0x1e8024(%rip), %rdi    # 0x347a60
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x17070
testq %rbx, %rbx
je 0x15fa63
cmpb $0x0, (%rbx)
je 0x15fa63
leaq 0x1dd989(%rip), %rdi    # 0x33d3e2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17070
pushq $0xa
popq %rdi
callq 0x179c0
movq 0x10(%rsp), %rbx
leaq (%rbx,%r12), %rax
movq %rax, 0x80(%rsp)
subq $0x1, %r12
jb 0x15fbbd
subq $0x8, %rsp
movq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq 0x78(%rsp), %rcx
movq 0x68(%rsp), %r8
movq %rbx, %r9
pushq 0x88(%rsp)
callq *0x88(%rsp)
addq $0x10, %rsp
testq %rax, %rax
je 0x15fbb5
movq %rax, %r14
movq 0x38(%rsp), %r15
testq %r13, %r13
je 0x15fb03
movq %r12, 0x58(%rsp)
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x15faf9
leaq (%r15,%r12), %rbp
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x70bf6
movzbl (%rbx,%r12), %r9d
cmpb %al, %r9b
jne 0x15fbfe
incq %r12
jmp 0x15fad0
movq 0x38(%rsp), %r15
movq 0x58(%rsp), %r12
cmpq %r14, 0x50(%rsp)
seta %cl
cmpq %r14, 0x48(%rsp)
setb %al
testb %cl, 0xf(%rsp)
jne 0x15fbb5
andb 0xe(%rsp), %al
jne 0x15fbb5
movq %r12, %rbp
movq %rbx, %r12
subq 0x10(%rsp), %r12
cmpb $0x0, 0xf8(%rsp)
je 0x15fb4d
leaq 0x1e7c01(%rip), %rdi    # 0x347744
movq %r12, %rsi
xorl %eax, %eax
callq 0x17070
leaq 0x1fc8ba(%rip), %rdi    # 0x35c40e
movq %r14, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0x100(%rsp)
je 0x15fb79
leaq 0x1f0d5c(%rip), %rdi    # 0x3508cb
movq %r15, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0xf0(%rsp)
je 0x15fbaa
pushq $0x20
popq %rdi
callq 0x179c0
movq 0x2d831e(%rip), %rax    # 0x437eb0
movq (%rax), %rsi
addq 0x10(%rsp), %r12
movq 0x28(%rsp), %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x5703f
pushq $0xa
popq %rdi
callq 0x179c0
movq %rbp, %r12
incq %rbx
jmp 0x15fa7c
incq 0x20(%rsp)
movq 0x108(%rsp), %r14
movq 0x40(%rsp), %rbx
jmp 0x15f9ed
pushq $-0x1
popq %rbp
jmp 0x15fbea
pushq $-0x1
popq %rbp
jmp 0x15fbe2
movl 0x1c(%rsp), %ebp
movq %rbx, %rdi
callq 0xa6389
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %al, %r10d
movq 0x2d835f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1e7e56(%rip), %rsi    # 0x347a69
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
pushq %rbp
pushq %r10
callq 0x17a50
popq %rcx
popq %rdx
pushq $0x2
popq %rdi
callq 0x178f0
movq 0x2d8331(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1853d2(%rip), %rsi    # 0x2e5013
leaq 0x185577(%rip), %rdx    # 0x2e51bf
leaq 0x1e7ddb(%rip), %rcx    # 0x347a2a
leaq 0x1e7df1(%rip), %r8     # 0x347a47
movl $0xec, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390