// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/cgr_spacedseed.c
// Function: gt_matchspacedseed
int gt_matchspacedseed(bool withesa,
                    bool docompare,
                    const char *inputindex,
                    const GtStrArray *queryfilenames,
                    bool verbose,
                    GtError *err)
{
  Genericindex *genericindex = NULL;
  bool haserr = false;
  Spacedseed *spse;
  GtLogger *logger;

  logger = gt_logger_new(verbose, GT_LOGGER_DEFLT_PREFIX, stdout);
  /*
  spse = spacedseed_new("11011011000011011",err);
  */
  spse = spacedseed_new("111001001001010111",err);
  if (spse == NULL)
  {
    haserr = true;
  }
  if (!haserr)
  {
    genericindex = genericindex_new(inputindex,withesa,
                                    withesa && docompare,false,false,
                                    0,logger,err);
    if (genericindex == NULL)
    {
      haserr = true;
    }
  }
  if (!haserr && docompare)
  {
    gt_assert(genericindex != NULL);
    gt_assert(spse != NULL);
    /*
    iteroverallwords(genericindex->suffixarray->encseq,spse->seedwidth,
          0,gt_encseq_total_length(genericindex->suffixarray->encseq));
    iteroverallwords2(genericindex->suffixarray->encseq,spse->seedwidth,
            0,
            gt_encseq_total_length(genericindex->suffixarray->encseq));
    */
  }
  if (!haserr)
  {
    GtSeqIterator *seqit;
    const GtUchar *query;
    GtUword querylen;
    char *desc = NULL;
    int retval;
    Limdfsresources *limdfsresources = NULL;
    const AbstractDfstransformer *dfst;
    const GtEncseq *encseq;

    dfst = gt_spse_AbstractDfstransformer();
    gt_assert(genericindex != NULL);
    limdfsresources = gt_newLimdfsresources(genericindex,
                                         true,
                                         0,
                                         (GtUword) GT_INTWORDSIZE,
                                         false, /* keepexpandedonstack */
                                         cgr_showmatch,
                                         NULL, /* processmatch info */
                                         NULL, /* processresult */
                                         NULL, /* processresult info */
                                         dfst);
    encseq = genericindex_getencseq(genericindex);
    seqit = gt_seq_iterator_sequence_buffer_new(queryfilenames, err);
    if (!seqit)
      haserr = true;
    if (!haserr)
    {
      GtAlphabet *a = gt_encseq_alphabet(encseq);
      gt_seq_iterator_set_symbolmap(seqit, gt_alphabet_symbolmap(a));
      for (/*Nothing*/; /* Nothing */; /*Nothing*/)
      {
        retval = gt_seq_iterator_next(seqit,
                                     &query,
                                     &querylen,
                                     &desc,
                                     err);
        if (retval < 0)
        {
          haserr = true;
          break;
        }
        if (retval == 0)
        {
          break;
        }
        singlequerymatchspacedseed(limdfsresources,
                                   dfst,
                                   query,
                                   querylen,
                                   spse);
      }
      if (limdfsresources != NULL)
      {
        gt_freeLimdfsresources(&limdfsresources,dfst);
      }
      gt_seq_iterator_delete(seqit);
    }
  }
  genericindex_delete(genericindex);
  spacedseed_delete(spse);
  gt_logger_delete(logger);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, 0x50(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, %rbx
movl %esi, %r13d
movl %edi, %r12d
movq 0x32f310(%rip), %rax    # 0x4c3ee8
movq (%rax), %rdx
leaq 0x1bacf2(%rip), %rsi    # 0x34f8d4
movl %r8d, %edi
callq 0x108ed0
movq %rax, 0x48(%rsp)
leaq 0x21321b(%rip), %rsi    # 0x3a7e11
movl $0x20, %edi
movl $0x2b, %edx
callq 0x1092b2
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movb $0x31, %dl
xorl %ecx, %ecx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x2131d7(%rip), %r15    # 0x3a7dfe
cmpb $0x31, %dl
jne 0x194c3a
incq 0x8(%r14)
movq %rax, %rdx
shrq %cl, %rdx
orq %rdx, 0x18(%r14)
movb 0x1(%rcx,%r15), %dl
incq %rcx
cmpq $0x12, %rcx
jne 0x194c27
movq %rcx, (%r14)
movq 0x8(%r14), %rdi
leaq 0x2131bb(%rip), %rsi    # 0x3a7e11
movl $0x42, %edx
callq 0x1092b2
movq %rax, 0x10(%r14)
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rax,%r15), %edx
cmpl $0x31, %edx
je 0x194c78
testl %edx, %edx
jne 0x194c82
jmp 0x194c87
movq 0x10(%r14), %rdx
movb %al, (%rdx,%rcx)
incq %rcx
incq %rax
jmp 0x194c68
andb %r12b, %r13b
movq 0x50(%rsp), %rbp
movq %rbp, 0x8(%rsp)
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
movzbl %r13b, %edx
movzbl %r12b, %esi
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1bae8e
testq %rax, %rax
sete %r15b
je 0x194e88
xorl %ebx, %ebx
movq %rbx, 0x58(%rsp)
movq %rbx, 0x30(%rsp)
movq %rax, %r12
callq 0x208078
movq %rax, %r13
movq %rax, 0x18(%rsp)
movq %rbx, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq 0x1eb(%rip), %r9        # 0x194edc
movl $0x40, %ecx
movq %r12, %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x1bb007
movq %rax, 0x30(%rsp)
movq %r12, 0x70(%rsp)
movq %r12, %rdi
callq 0x1bae6d
movq %rax, %rbx
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x11a648
xorl %ecx, %ecx
movq %rax, %r12
testq %rax, %rax
movb %r15b, %cl
movl $0x1, %eax
cmovel %eax, %ecx
testb %cl, %cl
je 0x194d49
movl %ecx, %r15d
jmp 0x194e83
movl %ecx, 0x44(%rsp)
movq %rbx, %rdi
callq 0xf02da
movq %rax, %rdi
callq 0xd3700
movq %r12, %rdi
movq %rax, %rsi
callq 0x119998
leaq 0x68(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x58(%rsp), %rcx
movq %r12, %rdi
movq %rbp, %r8
callq 0x119a11
movb $0x1, 0x2f(%rsp)
testl %eax, %eax
js 0x194e61
movq %r12, 0x38(%rsp)
testl %eax, %eax
je 0x194e59
movq 0x60(%rsp), %r15
movq (%r14), %rcx
cmpq %r15, %rcx
ja 0x194e2e
movq 0x68(%rsp), %rbx
addq %rbx, %r15
movq %r15, %rax
subq %rcx, %rax
cmpq %rbx, %rax
jb 0x194e2e
movq 0x30(%rsp), %r12
xorl %ebp, %ebp
cmpq %rcx, %rbp
jae 0x194ed7
movq %rcx, %rax
jge 0x194df6
leaq (%rbx,%rcx), %rax
cmpb $-0x3, (%rbx,%rbp)
ja 0x194df3
leaq (%rbx,%rbp), %rdx
incq %rdx
incq %rbp
cmpq %rax, %rdx
jb 0x194dd9
movq %rcx, %rax
jmp 0x194df6
movq %rbp, %rax
cmpq %rcx, %rax
jne 0x194e18
leaq -0x1(%rcx), %rbp
movq 0x18(%r14), %rdx
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %r8
callq 0x1bb7f8
movl $0x1, %eax
jmp 0x194e1d
incq %rax
xorl %ebp, %ebp
addq %rax, %rbx
movq (%r14), %rcx
movq %r15, %rax
subq %rcx, %rax
cmpq %rax, %rbx
jbe 0x194dc7
movq 0x38(%rsp), %r12
movq %r12, %rdi
leaq 0x68(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x58(%rsp), %rcx
movq 0x50(%rsp), %r8
callq 0x119a11
testl %eax, %eax
jns 0x194d94
jmp 0x194e61
movl 0x44(%rsp), %eax
movb %al, 0x2f(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x194e76
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x1bb202
movq %r12, %rdi
callq 0x119a53
movb 0x2f(%rsp), %r15b
movq 0x70(%rsp), %rax
movq %rax, %rdi
callq 0x1bae24
movq 0x10(%r14), %rdi
leaq 0x212f76(%rip), %rbx    # 0x3a7e11
movq %rbx, %rsi
movl $0x57, %edx
callq 0x109670
movq %r14, %rdi
movq %rbx, %rsi
movl $0x58, %edx
callq 0x109670
movq 0x48(%rsp), %rdi
callq 0x10916a
movzbl %r15b, %eax
negl %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5d3ea