// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
testb $0x1, %bl
je 0x1384f6
movb $0x1, (%rsp)
pushq $0x1
popq %rcx
xorl %r12d, %r12d
movq %rbx, %rax
cmpq $0x2, %rax
jb 0x138394
shrq %rax
movl %eax, %edx
andl $0x1, %edx
xorl %esi, %esi
cmpq %rcx, %rdx
setne %sil
addq %rsi, %r12
cmpq $0x20, %r12
jae 0x138490
incb (%rsp,%r12)
movq %rdx, %rcx
jmp 0x138367
testb $0x1, %r12b
jne 0x138524
leaq 0x207197(%rip), %r15    # 0x33f53c
pushq $0x10
popq %rdi
movq %r15, %rsi
movl $0x13d, %edx            # imm = 0x13D
callq 0x93160
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 0x93160
movq %rax, (%r14)
testq %rax, %rax
je 0x138552
orq $0x1, %r12
pushq $0x1
popq %r8
xorl %edi, %edi
pushq $-0x1
popq %r9
movq %r8, %rcx
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %r15d, %r15d
xorl %edx, %edx
cmpq %r11, %r12
je 0x13846b
movzbl (%rsp,%r11), %esi
cmpq $0x1, %rcx
jne 0x13845b
cmpq 0x8(%r14), %r10
jae 0x1384be
movq %r9, %r13
movl %esi, %ecx
shlq %cl, %r13
notq %r13
movl %edx, %ecx
shlq %cl, %r13
leal (%rsi,%rsi), %ecx
movq %r9, %rbp
shlq %cl, %rbp
orq %r13, %rdi
notq %rbp
movzbl %dl, %ecx
addl %ecx, %ecx
shlq %cl, %rbp
movq %r10, %rcx
shlq $0x4, %rcx
movq %rbp, (%rax,%rcx)
movzbl %r15b, %ebp
addl %ebp, %ebp
incq %r10
movl %ebp, 0x8(%rax,%rcx)
xorl %ecx, %ecx
jmp 0x138461
addb %sil, %r15b
movq %r8, %rcx
addb %dl, %sil
incq %r11
movl %esi, %edx
jmp 0x1383fe
cmpq 0x8(%r14), %r10
jne 0x138583
cmpq %rbx, %rdi
jne 0x138583
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2ffad1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1acb72(%rip), %rsi    # 0x2e5013
leaq 0x2070e7(%rip), %rdx    # 0x33f58f
leaq 0x2070c8(%rip), %rcx    # 0x33f577
leaq 0x207086(%rip), %r8     # 0x33f53c
movl $0x138, %r9d            # imm = 0x138
jmp 0x1384ea
movq 0x2ffaa3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1acb44(%rip), %rsi    # 0x2e5013
leaq 0x207121(%rip), %rdx    # 0x33f5f7
leaq 0x20709a(%rip), %rcx    # 0x33f577
leaq 0x207058(%rip), %r8     # 0x33f53c
movl $0x14a, %r9d            # imm = 0x14A
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2ffa6b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1acb0c(%rip), %rsi    # 0x2e5013
leaq 0x20704b(%rip), %rdx    # 0x33f559
leaq 0x207062(%rip), %rcx    # 0x33f577
leaq 0x207020(%rip), %r8     # 0x33f53c
movl $0x12d, %r9d            # imm = 0x12D
jmp 0x1384ea
movq 0x2ffa3d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1acade(%rip), %rsi    # 0x2e5013
leaq 0x20708c(%rip), %rdx    # 0x33f5c8
leaq 0x207034(%rip), %rcx    # 0x33f577
leaq 0x206ff2(%rip), %r8     # 0x33f53c
movl $0x13c, %r9d            # imm = 0x13C
jmp 0x1384ea
movq 0x2ffa0f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1acab0(%rip), %rsi    # 0x2e5013
leaq 0x207071(%rip), %rdx    # 0x33f5db
leaq 0x207006(%rip), %rcx    # 0x33f577
leaq 0x206fc4(%rip), %r8     # 0x33f53c
movl $0x141, %r9d            # imm = 0x141
jmp 0x1384ea
movq 0x2ff9de(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1aca7f(%rip), %rsi    # 0x2e5013
leaq 0x207080(%rip), %rdx    # 0x33f61b
leaq 0x206fd5(%rip), %rcx    # 0x33f577
leaq 0x206f93(%rip), %r8     # 0x33f53c
movl $0x155, %r9d            # imm = 0x155
jmp 0x1384ea