// File: /workspace/github_c_makefile_star2_O2/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 $0x88, %rsp
movl %r9d, %r15d
movl %r8d, %r12d
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
movq 0xc0(%rsp), %r13
andq $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
testq %r13, %r13
je 0x1b6d74
movq %r13, %rdi
callq 0x89eb7
testb %al, %al
jne 0x1b718c
movq %r14, %rdi
movq %r13, %rsi
callq 0x2cd22e
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x1b6df2
movq %rax, %r13
testb %r12b, %r12b
je 0x1b6d99
movq %r13, %rdi
callq 0x2cd3a9
testb %r15b, %r15b
je 0x1b6da6
movq %r13, %rdi
callq 0x2cd6cf
testb $0x4, %bpl
je 0x1b6dd9
movq %r13, %rdi
callq 0x2cd407
testb %al, %al
jne 0x1b6dd9
movq %r13, %rdi
movq %r14, %rsi
movq 0xc0(%rsp), %rdx
callq 0x2cd46c
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x1b7123
movq %r13, %rdi
callq 0x2cd407
testb %al, %al
je 0x1b6dfa
movq $0x0, (%rsp)
xorl %r14d, %r14d
jmp 0x1b6e2d
movb $0x1, %r15b
jmp 0x1b70e3
movq %r13, %rdi
callq 0x2cd424
movq %r14, %rdi
movl %eax, %esi
movq 0xc0(%rsp), %rdx
callq 0x1b5bf6
movq %rax, 0x10(%rsp)
testq %rax, %rax
sete %r15b
je 0x1b711f
movq %rax, %r14
movq %r15, (%rsp)
andq $0x0, 0x78(%rsp)
movq %r13, %rdi
callq 0x2cd41a
movq %rax, %r12
movq %r13, %rdi
callq 0x2cd41f
movq %rax, %r15
movq %rax, 0x50(%rsp)
movq %r13, %rdi
callq 0x2cd410
movq %rax, 0x40(%rsp)
movq %r13, %rdi
callq 0x2cd415
movq %rax, 0x48(%rsp)
movl %ebp, 0x58(%rsp)
movl %ebx, 0x5c(%rsp)
callq 0x56967
movq %rax, %rbx
movq %rax, 0x60(%rsp)
leaq 0x1a62ef(%rip), %rbp    # 0x35d173
pushq $0x3a
popq %rdx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x93160
movq %rax, %r12
movq %rax, 0x30(%rsp)
pushq $0x3c
popq %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x93160
movq %rax, %rbp
movq %rax, 0x38(%rsp)
movq 0x8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0xa70d0
movq %rax, %r13
testq %rax, %rax
movzbl (%rsp), %eax
pushq $0x1
popq %rcx
cmovnel %eax, %ecx
movq %rcx, (%rsp)
testb %cl, %cl
je 0x1b6ee3
movq (%rsp), %r15
jmp 0x1b70a4
movq %rbx, %rdi
callq 0x56c48
movq %r13, %rdi
movq %rax, %rsi
callq 0xa61a8
movq $0x0, 0x8(%rsp)
leaq 0x68(%rsp), %rbp
movq 0xc0(%rsp), %r12
movq %r13, 0x70(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
leaq 0x80(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movq %r12, %r8
callq 0xa62e5
testl %eax, %eax
js 0x1b707f
movq 0x10(%rsp), %r14
je 0x1b7089
movq 0x80(%rsp), %rbx
cmpq %rbx, %r15
ja 0x1b7075
movq 0x20(%rsp), %r13
movq 0x18(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rbp
addq %rbp, %rbx
xorl %eax, %eax
movq %rbp, %r12
movq %rbx, %rcx
subq %r15, %rcx
cmpq %rcx, %r12
ja 0x1b7063
movq %r15, %rdx
subq %rax, %rdx
jbe 0x1b7128
addq %r12, %rax
leaq (%r12,%r15), %rsi
cmpq %rsi, %rax
jae 0x1b6faf
cmpb $-0x3, (%rax)
ja 0x1b6fa0
incq %rax
decq %rdx
jmp 0x1b6f8e
testq %rdx, %rdx
je 0x1b6faf
movq %rax, %r12
incq %r12
xorl %eax, %eax
jmp 0x1b6f72
testb $0x1, 0x5c(%rsp)
je 0x1b6ff1
movq %r12, %rdi
movq %r13, %rsi
leaq 0x30(%rsp), %rdx
movq %r14, %rcx
callq 0x1b6cdc
testq %rax, %rax
je 0x1b6ff1
movq %r13, %rdi
movq 0x28(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rax, %rcx
movq %rbp, %r8
movq %r12, %r9
pushq $0x1
pushq 0x10(%rsp)
callq 0x1b71ba
popq %rax
popq %rcx
testb $0x2, 0x5c(%rsp)
je 0x1b7050
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1b7154
movq 0x50(%rsp), %rdx
movq %r12, %rsi
callq 0x18dd8d
movq 0x38(%rsp), %rdi
movq %r13, %rsi
leaq 0x30(%rsp), %rdx
movq %r14, %rcx
callq 0x1b6cdc
testq %rax, %rax
je 0x1b7050
movq %r13, %rdi
movq 0x28(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %rax, %rcx
movq %rbp, %r8
movq %r12, %r9
pushq $0x0
pushq 0x10(%rsp)
callq 0x1b71ba
popq %rax
popq %rcx
movq %r15, %rax
decq %rax
incq %r12
movq 0x50(%rsp), %r15
jmp 0x1b6f6c
movq 0xc0(%rsp), %r12
movq 0x70(%rsp), %r13
leaq 0x68(%rsp), %rbp
incq 0x8(%rsp)
jmp 0x1b6f11
movb $0x1, %r15b
movq 0x10(%rsp), %r14
jmp 0x1b708d
movq (%rsp), %r15
movq %r13, %rdi
callq 0xa6389
movq 0x60(%rsp), %rbx
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %rbp
movq %rbx, %rdi
callq 0x568b5
leaq 0x1a60c0(%rip), %rbx    # 0x35d173
pushq $0x44
popq %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x936f9
pushq $0x45
popq %rdx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x936f9
testq %r14, %r14
sete %al
testb %al, %al
jne 0x1b70e3
leaq 0x10(%rsp), %rdi
callq 0x1b5d1a
cmpq $0x0, 0x18(%rsp)
je 0x1b70f5
leaq 0x18(%rsp), %rdi
callq 0x2cd62d
cmpq $0x0, 0x20(%rsp)
je 0x1b7107
leaq 0x20(%rsp), %rdi
callq 0x2cd436
movzbl %r15b, %eax
negl %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x1b70d5
movb $0x1, %r15b
jmp 0x1b70f5
movq 0x280e39(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12deda(%rip), %rsi    # 0x2e5013
leaq 0x187b67(%rip), %rdx    # 0x33eca7
leaq 0x187b6d(%rip), %rcx    # 0x33ecb4
leaq 0x187b83(%rip), %r8     # 0x33ecd1
pushq $0x50
popq %r9
jmp 0x1b7180
movq 0x280e0d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12deae(%rip), %rsi    # 0x2e5013
leaq 0x1a601e(%rip), %rdx    # 0x35d18a
leaq 0x1a6034(%rip), %rcx    # 0x35d1a7
leaq 0x1a5ff9(%rip), %r8     # 0x35d173
movl $0xbd, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x280dd5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12de76(%rip), %rsi    # 0x2e5013
leaq 0x12e01b(%rip), %rdx    # 0x2e51bf
leaq 0x1a5fbb(%rip), %rcx    # 0x35d166
leaq 0x1a5fc1(%rip), %r8     # 0x35d173
movl $0xe4, %r9d
jmp 0x1b7180