// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %r9, 0x30(%rsp)
movq %rcx, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movl %esi, %r13d
movl %edi, %ebx
movq 0x3021d7(%rip), %rax    # 0x437eb0
movq (%rax), %rdx
leaq 0x1b0bf1(%rip), %rsi    # 0x2e68d4
movl %r8d, %edi
callq 0x92b50
movq %rax, %r12
leaq 0x208f97(%rip), %rsi    # 0x33ec8c
pushq $0x20
popq %rdi
pushq $0x2b
popq %rdx
callq 0x93160
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
xorl %eax, %eax
leaq 0x208f50(%rip), %r15    # 0x33ec66
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorl %edi, %edi
xorl %esi, %esi
cmpq $0x12, %rsi
je 0x135d52
movb (%rsi,%r15), %cl
incq %rsi
movq %rsi, (%r14)
cmpb $0x31, %cl
jne 0x135d24
leal -0x1(%rsi), %ecx
movq %rdx, %r8
shrq %cl, %r8
incq %rdi
movq %rdi, 0x8(%r14)
orq %r8, %rax
movq %rax, 0x18(%r14)
jmp 0x135d24
leaq 0x208f33(%rip), %rsi    # 0x33ec8c
pushq $0x42
popq %rdx
callq 0x93160
movq %rax, 0x10(%r14)
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rax,%r15), %edx
cmpl $0x31, %edx
je 0x135d79
testl %edx, %edx
jne 0x135d83
jmp 0x135d88
movq 0x10(%r14), %rdx
movb %al, (%rdx,%rcx)
incq %rcx
incq %rax
jmp 0x135d69
xorl %ebp, %ebp
testq %r14, %r14
sete %r15b
je 0x135e66
andb %bl, %r13b
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, (%rsp)
movzbl %r13b, %edx
movzbl %bl, %esi
movq 0x28(%rsp), %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x15fd30
movq %rax, %rdi
testq %rax, %rax
movb %r15b, %bpl
pushq $0x1
popq %rbx
movl %ebp, %r15d
cmovel %ebx, %r15d
testb %r15b, %r15b
jne 0x135f6b
movl %ebp, %r13d
movq %r12, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movq %rdi, 0x48(%rsp)
callq 0x1b2268
movq 0x48(%rsp), %r15
testq %r15, %r15
je 0x135fec
movq %rax, %rbp
movq %rax, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x1fb(%rip), %r9        # 0x13601a
pushq $0x40
popq %rcx
movq %r15, %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x15febd
movq %rax, 0x38(%rsp)
movq %r15, %rdi
callq 0x15fcad
movq %rax, %r15
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0xa70d0
testq %rax, %rax
cmovel %ebx, %r13d
testb %r13b, %r13b
je 0x135e70
movq 0x40(%rsp), %r12
jmp 0x135f63
xorl %edi, %edi
movb $0x1, %r15b
jmp 0x135f6b
movq %rax, %r12
movl %r13d, 0x20(%rsp)
movq %r15, %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x56c48
movq %r12, 0x28(%rsp)
movq %r12, %rdi
movq %rax, %rsi
callq 0xa61a8
movq 0x28(%rsp), %r15
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq 0x30(%rsp), %r8
callq 0xa62e5
testl %eax, %eax
js 0x135f35
movq 0x38(%rsp), %rbx
je 0x135f3f
movq 0x58(%rsp), %r12
movq (%r14), %rcx
cmpq %r12, %rcx
ja 0x135e98
movq 0x60(%rsp), %r15
addq %r15, %r12
xorl %r13d, %r13d
movq %r12, %rax
subq %rcx, %rax
cmpq %rax, %r15
ja 0x135e98
cmpq %rcx, %r13
jae 0x135fb6
leaq (%r15,%rcx), %rdx
leaq (%r15,%r13), %rsi
cmpq %rdx, %rsi
jae 0x135f17
cmpb $-0x3, (%rsi)
ja 0x135f07
incq %r13
jmp 0x135ef4
cmpq %r13, %rcx
je 0x135f17
addq %r13, %r15
incq %r15
xorl %r13d, %r13d
jmp 0x135ee2
leaq -0x1(%rcx), %r13
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %r8
callq 0x160816
incq %r15
movq (%r14), %rcx
jmp 0x135edc
movb $0x1, %r13b
movq 0x38(%rsp), %rbx
jmp 0x135f44
movl 0x20(%rsp), %r13d
testq %rbx, %rbx
movq 0x40(%rsp), %r12
je 0x135f5b
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x1600dc
movq %r15, %rdi
callq 0xa6389
movl %r13d, %r15d
movq 0x48(%rsp), %rdi
callq 0x15fc68
testq %r14, %r14
je 0x135f99
movq 0x10(%r14), %rdi
leaq 0x208d0c(%rip), %rbx    # 0x33ec8c
pushq $0x57
popq %rdx
movq %rbx, %rsi
callq 0x936f9
pushq $0x58
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x936f9
movq %r12, %rdi
callq 0x92fd0
movzbl %r15b, %eax
negl %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x301fab(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af04c(%rip), %rsi    # 0x2e5013
leaq 0x208cd9(%rip), %rdx    # 0x33eca7
leaq 0x208cdf(%rip), %rcx    # 0x33ecb4
leaq 0x208cf5(%rip), %r8     # 0x33ecd1
pushq $0x50
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x301f75(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1af016(%rip), %rsi    # 0x2e5013
leaq 0x211c3c(%rip), %rdx    # 0x347c40
leaq 0x208c6e(%rip), %rcx    # 0x33ec79
leaq 0x208c7a(%rip), %r8     # 0x33ec8c
movl $0xef, %r9d
jmp 0x135fe0