// File: /workspace/github_c_makefile_star2_O3/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, 0x48(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, %rbx
movl %esi, %r13d
movl %edi, %r12d
movq 0x32c9d0(%rip), %rax    # 0x4b8ed8
movq (%rax), %rdx
leaq 0x1ba3c2(%rip), %rsi    # 0x3468d4
movl %r8d, %edi
callq 0x103e40
movq %rax, 0x40(%rsp)
leaq 0x2123f3(%rip), %rsi    # 0x39e919
movl $0x20, %edi
movl $0x2b, %edx
callq 0x104226
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movb $0x31, %sil
xorl %eax, %eax
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
leaq 0x2123a9(%rip), %r15    # 0x39e906
xorl %edi, %edi
xorl %ecx, %ecx
cmpb $0x31, %sil
jne 0x18c57b
movq %rdx, %rsi
shrq %cl, %rsi
incq %rdi
movq %rdi, 0x8(%r14)
orq %rsi, %rax
movq %rax, 0x18(%r14)
movb 0x1(%rcx,%r15), %sil
incq %rcx
cmpq $0x12, %rcx
jne 0x18c561
movq %rcx, (%r14)
leaq 0x212386(%rip), %rsi    # 0x39e919
movl $0x42, %edx
callq 0x104226
movq %rax, 0x10(%r14)
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rax,%r15), %edx
cmpl $0x31, %edx
je 0x18c5b5
testl %edx, %edx
jne 0x18c5bf
jmp 0x18c5c4
movq 0x10(%r14), %rdx
movb %al, (%rdx,%rcx)
incq %rcx
incq %rax
jmp 0x18c5a5
andb %r12b, %r13b
movq 0x48(%rsp), %rbp
movq %rbp, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movzbl %r13b, %edx
movzbl %r12b, %esi
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1b22b6
testq %rax, %rax
je 0x18c77f
movq %rax, %r12
xorl %ebx, %ebx
movq %rbx, 0x50(%rsp)
callq 0x1fe8e8
movq %rax, %r13
movq %rax, 0x18(%rsp)
movq %rbx, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq 0x1ef(%rip), %r9        # 0x18c814
movl $0x40, %ecx
movq %r12, %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x1b243b
movq %rax, %rbx
movq %rax, 0x30(%rsp)
movq %r12, 0x38(%rsp)
movq %r12, %rdi
callq 0x1b2295
movq %rax, %r12
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x114f10
movq %rax, %r15
testq %rax, %rax
sete %al
je 0x18c786
movb %al, 0x20(%rsp)
movq %r12, %rdi
callq 0xebcd9
movq %rax, %rdi
callq 0xd11ab
movq %r15, %rdi
movq %rax, %rsi
callq 0x1142c4
leaq 0x60(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq %r15, %rdi
movq %rbp, %r8
callq 0x11433d
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x18c7a1
xorl %ecx, %ecx
movb 0x20(%rsp), %dl
movb %dl, %cl
negl %ecx
movl %ecx, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq 0x30(%rsp), %rbx
testl %eax, %eax
je 0x18c792
movq 0x58(%rsp), %r15
movq (%r14), %rcx
cmpq %r15, %rcx
ja 0x18c6f9
movq 0x60(%rsp), %r12
addq %r12, %r15
movq %r15, %rax
subq %rcx, %rax
cmpq %r12, %rax
jae 0x18c720
movq 0x28(%rsp), %r15
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq 0x48(%rsp), %r8
callq 0x11433d
testl %eax, %eax
jns 0x18c6cc
jmp 0x18c79c
xorl %ebp, %ebp
cmpq %rcx, %rbp
jae 0x18c80f
jge 0x18c74c
leaq (%r12,%rcx), %rdx
leaq (%r12,%rbp), %rax
cmpb $-0x3, (%rax)
ja 0x18c747
incq %rax
incq %rbp
cmpq %rdx, %rax
jb 0x18c735
jmp 0x18c74c
cmpq %rbp, %rcx
jne 0x18c775
leaq -0x1(%rcx), %rbp
movq 0x18(%r14), %rdx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %r8
callq 0x1b2c4b
incq %r12
movq (%r14), %rcx
movq %r15, %rax
subq %rcx, %rax
cmpq %rax, %r12
jbe 0x18c722
jmp 0x18c6f9
incq %rax
xorl %ebp, %ebp
movq %rax, %r12
jmp 0x18c768
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x18c7c4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rax
jmp 0x18c7c4
movl 0x20(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x18c7a1
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0x18c7b3
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x1b2633
movq %r15, %rdi
callq 0x11437f
movq 0x38(%rsp), %rax
movl 0x24(%rsp), %ebp
movq %rax, %rdi
callq 0x1b224c
movq 0x10(%r14), %rdi
leaq 0x212142(%rip), %rbx    # 0x39e919
movq %rbx, %rsi
movl $0x57, %edx
callq 0x1045eb
movq %r14, %rdi
movq %rbx, %rsi
movl $0x58, %edx
callq 0x1045eb
movq 0x40(%rsp), %rdi
callq 0x1040e0
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5c0cc