// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/dbs_spaced_seeds.c
// Function: gt_spaced_seed_spec_new
GtSpacedSeedSpec *gt_spaced_seed_spec_new(GtCodetype spacedseed)
{
  uint8_t blocks_length[32] = {0}, shiftleft = 0, shiftright = 0;
  GtCodetype ss_copy, last = (GtCodetype) 1, GT_UNUSED from_blocks = 0;
  GtUword idx, block_num = 0, spec_counter = 0;
  GtSpacedSeedSpec *seed_spec;

  gt_assert(spacedseed & ((GtCodetype) 1));
  blocks_length[0] = 1;
  for (ss_copy = spacedseed >> 1; ss_copy > 0; ss_copy >>= 1)
  {
    GtCodetype current = ss_copy & (GtCodetype) 1;

    if (current != last)
    {
      block_num++;
      last = current;
    }
    gt_assert(block_num < sizeof blocks_length/sizeof blocks_length[0]);
    blocks_length[block_num]++;
  }
  block_num++;
  gt_assert(block_num % 2 == 1);
  seed_spec = gt_malloc(sizeof *seed_spec);
  seed_spec->num_specs = 1 + block_num/2;
  seed_spec->spec_tab = gt_malloc(seed_spec->num_specs *
                                  sizeof *seed_spec->spec_tab);
  gt_assert(seed_spec->spec_tab != NULL);
  last = (GtCodetype) 1;
  for (idx = 0; idx < block_num; idx++)
  {
    const uint8_t width = blocks_length[idx];
    if (last == (GtCodetype) 1)
    {
      from_blocks |= (((((GtCodetype) 1) << width) - 1) << shiftleft);
      last = 0;
      gt_assert(spec_counter < seed_spec->num_specs);
      seed_spec->spec_tab[spec_counter].extract
        = ((((GtCodetype) 1) << (2 * width)) - 1) << (2 * shiftleft);
      seed_spec->spec_tab[spec_counter++].shiftright = 2 * shiftright;
    } else
    {
      last = (GtCodetype) 1;
      shiftright += width;
    }
    shiftleft += width;
  }
  gt_assert(spec_counter == seed_spec->num_specs && from_blocks == spacedseed);
  return seed_spec;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
testb $0x1, %bl
je 0x1974cc
movb $0x1, (%rsp)
cmpq $0x2, %rbx
jae 0x197393
xorl %r12d, %r12d
jmp 0x1973d3
movl $0x1, %edx
xorl %r12d, %r12d
movq %rbx, %rax
movq %rbx, %rcx
movq %rdx, %rsi
movq %r12, %rdi
shrq %rcx
movl %ecx, %edx
andl $0x1, %edx
xorl %r12d, %r12d
cmpq %rsi, %rdx
setne %r12b
addq %rdi, %r12
cmpq $0x20, %r12
jae 0x1974c7
incb (%rsp,%r12)
cmpq $0x3, %rax
movq %rcx, %rax
ja 0x1973a1
testb $0x1, %r12b
jne 0x1974d1
leaq 0x211351(%rip), %r15    # 0x3a8735
movl $0x10, %edi
movq %r15, %rsi
movl $0x13d, %edx            # imm = 0x13D
callq 0x1092b2
movq %rax, %r14
movq %r12, %rdi
shrq %rdi
incq %rdi
movq %rdi, 0x8(%rax)
shlq $0x4, %rdi
movq %r15, %rsi
movl $0x140, %edx            # imm = 0x140
callq 0x1092b2
movq %rax, (%r14)
testq %rax, %rax
je 0x1974d6
movl $0x1, %ecx
xorl %edx, %edx
xorl %r9d, %r9d
xorl %r8d, %r8d
xorl %r10d, %r10d
xorl %edi, %edi
movzbl (%rsp,%r10), %esi
cmpq $0x1, %rcx
jne 0x197493
cmpq 0x8(%r14), %r8
jae 0x1974c2
movq $-0x1, %r11
movl %esi, %ecx
shlq %cl, %r11
notq %r11
movl %edx, %ecx
shlq %cl, %r11
leal (%rsi,%rsi), %ecx
movq $-0x1, %r15
shlq %cl, %r15
orq %r11, %rdi
notq %r15
movzbl %dl, %ecx
addl %ecx, %ecx
shlq %cl, %r15
movq %r8, %rcx
shlq $0x4, %rcx
movq %r15, (%rax,%rcx)
movzbl %r9b, %r11d
addl %r11d, %r11d
incq %r8
movl %r11d, 0x8(%rax,%rcx)
xorl %ecx, %ecx
jmp 0x19749b
addb %sil, %r9b
movl $0x1, %ecx
addb %dl, %sil
incq %r10
movl %esi, %edx
cmpq %r12, %r10
jbe 0x197435
cmpq 0x8(%r14), %r8
jne 0x1974db
cmpq %rbx, %rdi
jne 0x1974db
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x5dbb0
callq 0x5db3e
callq 0x5dc5b
callq 0x5db77
callq 0x5dc22
callq 0x5dbe9