// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/tyr-search.c
// Function: gt_tyrsearch
int gt_tyrsearch(const char *tyrindexname,
                 const GtStrArray *queryfilenames,
                 unsigned int showmode,
                 unsigned int searchstrand,
                 bool verbose,
                 bool performtest,
                 GtError *err)
{
  Tyrindex *tyrindex;
  Tyrcountinfo *tyrcountinfo = NULL;
  Tyrbckinfo *tyrbckinfo = NULL;
  bool haserr = false;

  gt_error_check(err);
  tyrindex = gt_tyrindex_new(tyrindexname,err);
  if (tyrindex == NULL)
  {
    haserr = true;
  } else
  {
    if (verbose)
    {
      gt_tyrindex_show(tyrindex);
    }
    if (performtest)
    {
      gt_tyrindex_check(tyrindex);
    }
  }
  if (!haserr)
  {
    gt_assert(tyrindex != NULL);
    if ((showmode & SHOWCOUNTS) && !gt_tyrindex_isempty(tyrindex))
    {
      tyrcountinfo = gt_tyrcountinfo_new(tyrindex,tyrindexname,err);
      if (tyrcountinfo == NULL)
      {
        haserr = true;
      }
    }
  }
  if (!haserr)
  {
    gt_assert(tyrindex != NULL);
    if (!gt_tyrindex_isempty(tyrindex))
    {
      tyrbckinfo = gt_tyrbckinfo_new(tyrindexname,
                                     gt_tyrindex_alphasize(tyrindex),
                                     err);
      if (tyrbckinfo == NULL)
      {
        haserr = true;
      }
    }
  }
  if (!haserr)
  {
    const GtUchar *query;
    GtUword querylen;
    char *desc = NULL;
    uint64_t unitnum;
    int retval;
    Tyrsearchinfo tyrsearchinfo;
    GtSeqIterator *seqit;

    gt_assert(tyrindex != NULL);
    gt_tyrsearchinfo_init(&tyrsearchinfo,tyrindex,showmode,searchstrand);
    seqit = gt_seq_iterator_sequence_buffer_new(queryfilenames, err);
    if (!seqit)
      haserr = true;
    if (!haserr)
    {
      gt_seq_iterator_set_symbolmap(seqit,
                                 gt_alphabet_symbolmap(tyrsearchinfo.dnaalpha));
      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;
        }
        singleseqtyrsearch(tyrindex,
                           tyrcountinfo,
                           &tyrsearchinfo,
                           tyrbckinfo,
                           unitnum,
                           query,
                           querylen,
                           desc);
      }
      gt_seq_iterator_delete(seqit);
    }
    gt_tyrsearchinfo_delete(&tyrsearchinfo);
  }
  if (tyrbckinfo != NULL)
  {
    gt_tyrbckinfo_delete(&tyrbckinfo);
  }
  if (tyrcountinfo != NULL)
  {
    gt_tyrcountinfo_delete(&tyrcountinfo);
  }
  if (tyrindex != NULL)
  {
    gt_tyrindex_delete(&tyrindex);
  }
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %r9d, %r12d
movl %r8d, %r13d
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, 0x40(%rsp)
movq %rdi, %rbx
movq 0x100(%rsp), %r14
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %rax, 0x18(%rsp)
testq %r14, %r14
je 0x20c51d
movq %r14, %rdi
callq 0x101a9a
testb %al, %al
jne 0x20c9ab
movq %rbx, %rdi
movq %r14, %rsi
callq 0x336476
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x20c553
testb %r13b, %r13b
je 0x20c53f
movq %rax, %rdi
callq 0x33663d
testb %r12b, %r12b
je 0x20c54e
movq 0x8(%rsp), %rdi
callq 0x33697a
xorl %r12d, %r12d
jmp 0x20c556
movb $0x1, %r12b
testb %r12b, %r12b
jne 0x20c59e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x20c9b0
testb $0x4, %r15b
je 0x20c59e
callq 0x33669b
testb %al, %al
jne 0x20c59e
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x336700
movq %rax, 0x20(%rsp)
testq %rax, %rax
movzbl %r12b, %eax
movl $0x1, %r12d
cmovnel %eax, %r12d
testb %r12b, %r12b
jne 0x20c5e7
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x20c9b5
callq 0x33669b
testb %al, %al
jne 0x20c5e7
movq 0x8(%rsp), %rdi
callq 0x3366b8
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0x20b497
movq %rax, 0x18(%rsp)
testq %rax, %rax
movzbl %r12b, %eax
movl $0x1, %r12d
cmovnel %eax, %r12d
testb %r12b, %r12b
jne 0x20c953
movq $0x0, 0x68(%rsp)
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
je 0x20c9ba
movl %r12d, %r14d
movq %rbx, %rdi
callq 0x3366ae
movq %rax, %r13
movq %rbx, %rdi
callq 0x3366b3
movq %rax, %r12
movq %rax, 0xa0(%rsp)
movq %rbx, %rdi
callq 0x3366a4
movq %rax, 0x90(%rsp)
movq %rbx, %rdi
callq 0x3366a9
movq %rax, 0x98(%rsp)
movl %r15d, 0xa8(%rsp)
movl %ebp, 0xac(%rsp)
callq 0xd340f
movq %rax, %rbx
movq %rax, 0xb0(%rsp)
leaq 0x1b9d21(%rip), %r15    # 0x3c638f
movq %r13, %rdi
movq %r15, %rsi
movl $0x3a, %edx
callq 0x1092b2
movq %rax, 0x80(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl $0x3c, %edx
callq 0x1092b2
movq %rax, 0x88(%rsp)
movq 0x40(%rsp), %rdi
movq 0x100(%rsp), %r15
movq %r15, %rsi
callq 0x11a648
movq %rax, %r13
testq %rax, %rax
movzbl %r14b, %eax
movl $0x1, %r12d
cmovnel %eax, %r12d
testb %r12b, %r12b
jne 0x20c915
movq %rbx, %rdi
callq 0xd3700
movq %r13, %rdi
movq %rax, %rsi
callq 0x119998
leaq 0x78(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %r13, %rdi
movq %r15, %r8
callq 0x119a11
movb $0x1, %bl
testl %eax, %eax
js 0x20c90a
leaq 0x80(%rsp), %rcx
movq 0x8(%rcx), %rbx
movq 0x20(%rcx), %r15
movq %r15, %rdx
negq %rdx
movq %rdx, 0xb8(%rsp)
movl 0x2c(%rcx), %ecx
movl %ecx, 0x14(%rsp)
movq $0x0, 0x30(%rsp)
movl %r12d, 0x4c(%rsp)
movq %r13, 0xc0(%rsp)
movq %rbx, 0x50(%rsp)
testl %eax, %eax
je 0x20c907
movq 0x70(%rsp), %rcx
cmpq %rcx, %r15
movl 0x14(%rsp), %r12d
ja 0x20c8ca
movq %rcx, %rax
movq 0x78(%rsp), %rcx
addq %rcx, %rax
addq 0xb8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %rcx, 0x28(%rsp)
cmpq %rcx, %rax
jb 0x20c8ca
movq 0x8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x28(%rsp), %rbp
xorl %r14d, %r14d
cmpq %r15, %r14
jae 0x20c9a1
movq %r15, %r13
jge 0x20c7df
leaq (%r15,%rbp), %rax
cmpb $-0x3, (%rbp,%r14)
ja 0x20c7dc
leaq (%r14,%rbp), %rcx
incq %rcx
incq %r14
cmpq %rax, %rcx
jb 0x20c7c0
movq %r15, %r13
jmp 0x20c7df
movq %r14, %r13
cmpq %r15, %r13
jne 0x20c8b6
testb $0x1, %r12b
je 0x20c839
movq %rbp, %rdi
movq 0x38(%rsp), %rsi
leaq 0x80(%rsp), %rdx
movq 0x60(%rsp), %rcx
callq 0x20c484
movq 0x38(%rsp), %rdi
testq %rax, %rax
je 0x20c839
movq 0x58(%rsp), %rsi
leaq 0x80(%rsp), %rdx
movq %rax, %rcx
movq 0x28(%rsp), %r8
movq %rbp, %r9
pushq $0x1
pushq 0x38(%rsp)
callq 0x20c9bf
addq $0x10, %rsp
leaq -0x1(%r15), %r14
movl $0x1, %r13d
testb $0x2, %r12b
je 0x20c8bc
testq %rbx, %rbx
je 0x20c9a6
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1e923a
movq %rbx, %rdi
movq 0x38(%rsp), %r12
movq %r12, %rsi
leaq 0x80(%rsp), %rbx
movq %rbx, %rdx
movq 0x60(%rsp), %rcx
callq 0x20c484
testq %rax, %rax
je 0x20c8aa
movq %r12, %rdi
movq 0x58(%rsp), %rsi
movq %rbx, %rdx
movq %rax, %rcx
movq 0x28(%rsp), %r8
movq %rbp, %r9
pushq $0x0
pushq 0x38(%rsp)
callq 0x20c9bf
addq $0x10, %rsp
movq 0x50(%rsp), %rbx
movl 0x14(%rsp), %r12d
jmp 0x20c8bc
incq %r13
xorl %r14d, %r14d
addq %r13, %rbp
cmpq 0x40(%rsp), %rbp
jbe 0x20c7ae
incq 0x30(%rsp)
movq 0xc0(%rsp), %r13
movq %r13, %rdi
leaq 0x78(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq 0x100(%rsp), %r8
callq 0x119a11
testl %eax, %eax
movl 0x4c(%rsp), %r12d
jns 0x20c747
movb $0x1, %bl
jmp 0x20c90a
movl %r12d, %ebx
movq %r13, %rdi
callq 0x119a53
movl %ebx, %r12d
movq 0xb0(%rsp), %rdi
callq 0xd335d
movq 0x80(%rsp), %rdi
leaq 0x1b9a5e(%rip), %rbx    # 0x3c638f
movq %rbx, %rsi
movl $0x44, %edx
callq 0x109670
movq 0x88(%rsp), %rdi
movq %rbx, %rsi
movl $0x45, %edx
callq 0x109670
cmpq $0x0, 0x18(%rsp)
je 0x20c965
leaq 0x18(%rsp), %rdi
callq 0x20b58e
cmpq $0x0, 0x20(%rsp)
je 0x20c977
leaq 0x20(%rsp), %rdi
callq 0x33689b
cmpq $0x0, 0x8(%rsp)
je 0x20c989
leaq 0x8(%rsp), %rdi
callq 0x3366ca
movzbl %r12b, %eax
negl %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x819fc
callq 0x81a33
callq 0x81951
callq 0x8198a
callq 0x819c3
callq 0x81a6c