// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %edi, %edi
je 0x190704
movl %edi, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x1906ff
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %r13
movq %rcx, %rdi
movq %r8, %rsi
callq 0x1e2426
movq %rax, %rbx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1e2443
movq %rax, %r15
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1e24a4
movq %rax, %r14
movq %rbx, (%rsp)
subq %rbx, %r15
incq %r15
movl $0x40, %ebp
cmpq $0x1f, %r12
ja 0x19066d
movq %r13, %rdi
callq 0xebcb6
movl %eax, %eax
cvtsi2sd %rax, %xmm0
cvtsi2sd %r12, %xmm1
callq 0x17d90
callq 0x17100
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x1b76c6(%rip), %xmm0   # 0x347d20
cvttsd2si %xmm0, %rdi
andq %rcx, %rdi
orq %rax, %rdi
callq 0x10fea3
movzwl %ax, %ebp
movq %r15, %rdi
callq 0x10fea3
movq %rax, %r15
movq %r14, %rdi
callq 0x10fea3
movq %rax, %r14
movl $0xffff, %r12d          # imm = 0xFFFF
movl %r15d, %r13d
andl %r12d, %r13d
andl %r14d, %r12d
leal (%r12,%rbp), %ebx
addl %r13d, %ebx
cmpl $0x40, %ebx
ja 0x190704
leaq 0x20f537(%rip), %rsi    # 0x39fbdc
movl $0x30, %edi
movl $0x2d3, %edx            # imm = 0x2D3
callq 0x104226
movw %bx, (%rax)
movl $0x40, %ecx
subl %ebp, %ecx
movl %ecx, 0x20(%rax)
subl %r13d, %ecx
movl %ecx, 0x24(%rax)
movq (%rsp), %rdx
movq %rdx, 0x8(%rax)
subl %r12d, %ecx
movl %ecx, 0x28(%rax)
movq $-0x1, %rdx
movq $-0x1, %rsi
movl %r15d, %ecx
shlq %cl, %rsi
movl %r14d, %ecx
shlq %cl, %rdx
notq %rsi
movq %rsi, 0x10(%rax)
notq %rdx
movq %rdx, 0x18(%rax)
jmp 0x190706
cmpl $0x2, %edi
jne 0x190715
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5cbb0