// File: /workspace/github_c_makefile_star2_O1/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 $0x88, %rsp
movq %r9, %rbx
movq %r8, 0x18(%rsp)
movq %rcx, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdi, %r13
movq 0xf8(%rsp), %r14
movq $0x0, 0x10(%rsp)
testq %r14, %r14
je 0x1bab29
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0x1bae1e
leaq 0xd0(%rsp), %rax
leaq 0xc0(%rsp), %rcx
movb (%rcx), %dl
movb %dl, 0x7(%rsp)
movq 0x8(%rcx), %rcx
movq %rcx, 0x58(%rsp)
movb (%rax), %cl
movb %cl, 0x5(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11a648
movq %rax, %rbx
testq %rax, %rax
sete %al
je 0x1badd1
movb %al, 0x4(%rsp)
movq 0x18(%rsp), %rdi
callq 0xd3700
movq %rbx, %rdi
movq %rax, %rsi
callq 0x119998
leaq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %r8
callq 0x119a11
testl %eax, %eax
js 0x1badbd
testq %r13, %r13
setne %dl
xorl %ecx, %ecx
orb 0xf0(%rsp), %dl
movb %dl, 0x6(%rsp)
leaq 0x38(%rsp), %rdx
cmoveq %rcx, %rdx
movq %rdx, 0x60(%rsp)
xorl %r14d, %r14d
movq %rbx, 0x40(%rsp)
testl %eax, %eax
je 0x1badc2
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rbp
movq 0x10(%rsp), %rbx
leaq 0x1f60a4(%rip), %rdi    # 0x3b0c9c
movq %r14, 0x48(%rsp)
movq %r14, %rsi
xorl %eax, %eax
callq 0x17070
testq %rbx, %rbx
je 0x1bac22
cmpb $0x0, (%rbx)
je 0x1bac22
leaq 0x1eb945(%rip), %rdi    # 0x3a655d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17070
movl $0xa, %edi
callq 0x17a20
testq %rbp, %rbp
je 0x1bad89
movq 0x8(%rsp), %rbx
leaq (%rbx,%rbp), %rax
movq %rax, 0x80(%rsp)
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 0x1bad7d
movq %rax, %r14
movq %rbp, 0x20(%rsp)
testq %r13, %r13
je 0x1bacb7
movq 0x38(%rsp), %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rbp
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xec603
movzbl (%rbx,%r12), %r9d
cmpb %al, %r9b
jne 0x1bade8
incq %r12
cmpq %r12, %r14
jne 0x1bac90
cmpb $0x0, 0x6(%rsp)
je 0x1bacc5
movq 0x38(%rsp), %r12
jmp 0x1bacc8
xorl %r12d, %r12d
movq 0x20(%rsp), %rbp
cmpq %r14, 0x58(%rsp)
seta %cl
cmpq %r14, 0x50(%rsp)
setb %al
testb %cl, 0x7(%rsp)
jne 0x1bad7d
andb 0x5(%rsp), %al
jne 0x1bad7d
movq %rbx, %r15
subq 0x8(%rsp), %r15
cmpb $0x0, 0xe8(%rsp)
je 0x1bad14
leaq 0x1f5c76(%rip), %rdi    # 0x3b0980
movq %r15, %rsi
xorl %eax, %eax
callq 0x17070
leaq 0x20a911(%rip), %rdi    # 0x3c562c
movq %r14, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0xf0(%rsp)
je 0x1bad40
leaq 0x1fed4d(%rip), %rdi    # 0x3b9a83
movq %r12, %rsi
xorl %eax, %eax
callq 0x17070
cmpb $0x0, 0xe0(%rsp)
je 0x1bad73
movl $0x20, %edi
callq 0x17a20
movq 0x30918d(%rip), %rax    # 0x4c3ee8
movq (%rax), %rsi
addq 0x8(%rsp), %r15
movq 0x18(%rsp), %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xd394b
movl $0xa, %edi
callq 0x17a20
incq %rbx
decq %rbp
jne 0x1bac46
movq 0x48(%rsp), %r14
incq %r14
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq 0xf8(%rsp), %r8
callq 0x119a11
testl %eax, %eax
jns 0x1babd5
movb $0x1, %bpl
jmp 0x1badc7
movb 0x4(%rsp), %bpl
movq %rbx, %rdi
callq 0x119a53
movl %ebp, %eax
movzbl %al, %eax
negl %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %al, %r10d
movq 0x30918d(%rip), %rax    # 0x4c3f80
movq (%rax), %rdi
leaq 0x1f5ea8(%rip), %rsi    # 0x3b0ca5
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 0x669f4
nop