// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/diagbandseed.c
// Function: gt_kmerpos_encode_info_new
static GtKmerPosListEncodeInfo *gt_kmerpos_encode_info_new(
                                       GtDiagbandseedBaseListType kmplt,
                                       const GtEncseq *encseq,
                                       GtUword spacedseedweight,
                                       const GtSequencePartsInfo *seqranges,
                                       GtUword idx)
{
  if (kmplt == GT_DIAGBANDSEED_BASE_LIST_STRUCT)
  {
    return NULL;
  } else
  {
    if (kmplt == GT_DIAGBANDSEED_BASE_LIST_ULONG ||
        kmplt == GT_DIAGBANDSEED_BASE_LIST_UNDEFINED)
    {
      GtBitcount_type bits_code, bits_seqnum, bits_endpos;
      const int allbits = sizeof (GtUword) * CHAR_BIT;
      GtUword seqrange_start = gt_sequence_parts_info_start_get(seqranges,idx),
              seqrange_end = gt_sequence_parts_info_end_get(seqranges,idx),
              max_endpos = gt_sequence_parts_info_max_length_get(seqranges,idx),
              numofsequences = seqrange_end - seqrange_start + 1;

      if (spacedseedweight >= 32)
      {
        bits_code = 64;
      } else
      {
        GtUword num_different_kmers
          = ceil(pow((double) gt_encseq_alphabetnumofchars(encseq),
                     (double) spacedseedweight));
        bits_code = (GtBitcount_type) gt_radixsort_bits(num_different_kmers);
      }
      bits_seqnum = (GtBitcount_type) gt_radixsort_bits(numofsequences);
      bits_endpos = (GtBitcount_type) gt_radixsort_bits(max_endpos);
      if (bits_code + bits_seqnum + bits_endpos <= 64)
      {
        GtKmerPosListEncodeInfo *encode_info = gt_malloc(sizeof *encode_info);

        encode_info->bits_kmerpos = bits_code + bits_seqnum + bits_endpos;
        encode_info->shift_code = allbits - bits_code;
        encode_info->shift_seqnum = encode_info->shift_code - bits_seqnum;
        encode_info->first_seqnum = seqrange_start;
        encode_info->shift_endpos = encode_info->shift_seqnum - bits_endpos;
        encode_info->mask_seqnum = (((GtCodetype) 1) << bits_seqnum) - 1;
        encode_info->mask_endpos = (((GtCodetype) 1) << bits_endpos) - 1;
        return encode_info;
      }
      return NULL;
    } else
    {
      gt_assert(kmplt == GT_DIAGBANDSEED_BASE_LIST_BYTESTRING);
      return NULL;
    }
  }
}

// Assembly:
subq $0x78, %rsp
movl %edi, 0x6c(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %r8, 0x48(%rsp)
cmpl $0x0, 0x6c(%rsp)
jne 0x20e401
movq $0x0, 0x70(%rsp)
jmp 0x20e660
cmpl $0x1, 0x6c(%rsp)
je 0x20e413
cmpl $0x3, 0x6c(%rsp)
jne 0x20e614
movl $0x40, 0x3c(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x2b00f0
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x2b0170
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x2b0290
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
subq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
cmpq $0x20, 0x58(%rsp)
jb 0x20e47b
movw $0x40, 0x46(%rsp)
jmp 0x20e4f8
movq 0x60(%rsp), %rdi
callq 0xb0e80
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movaps 0x30a49d(%rip), %xmm2   # 0x518930
movq 0x58(%rsp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x30a49b(%rip), %xmm2   # 0x518940
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
callq 0x19cb0
callq 0x190e0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x30a89b(%rip), %xmm1   # 0x518d70
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x1019c0
movw %ax, 0x46(%rsp)
movq 0x18(%rsp), %rdi
callq 0x1019c0
movw %ax, 0x44(%rsp)
movq 0x20(%rsp), %rdi
callq 0x1019c0
movw %ax, 0x42(%rsp)
movzwl 0x46(%rsp), %eax
movzwl 0x44(%rsp), %ecx
addl %ecx, %eax
movzwl 0x42(%rsp), %ecx
addl %ecx, %eax
cmpl $0x40, %eax
jg 0x20e609
movl $0x30, %edi
leaq 0x363a56(%rip), %rsi    # 0x571f94
movl $0x2d3, %edx            # imm = 0x2D3
callq 0xe80f0
movq %rax, 0x8(%rsp)
movzwl 0x46(%rsp), %eax
movzwl 0x44(%rsp), %ecx
addl %ecx, %eax
movzwl 0x42(%rsp), %ecx
addl %ecx, %eax
movw %ax, %cx
movq 0x8(%rsp), %rax
movw %cx, (%rax)
movzwl 0x46(%rsp), %eax
movl $0x40, %ecx
subl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x8(%rsp), %rax
movl 0x20(%rax), %ecx
movzwl 0x44(%rsp), %eax
subl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x24(%rax)
movq 0x30(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
movl 0x24(%rax), %ecx
movzwl 0x42(%rsp), %eax
subl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x28(%rax)
movzwl 0x44(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
subq $0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movzwl 0x42(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
subq $0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x20e660
movq $0x0, 0x70(%rsp)
jmp 0x20e660
jmp 0x20e616
cmpl $0x2, 0x6c(%rsp)
je 0x20e655
movq 0x42d97c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3079e5(%rip), %rsi    # 0x516013
leaq 0x363ba4(%rip), %rdx    # 0x5721d9
leaq 0x363bcb(%rip), %rcx    # 0x572207
leaq 0x363951(%rip), %r8     # 0x571f94
movl $0x2e1, %r9d            # imm = 0x2E1
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x20e657
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw (%rax,%rax)