// File: /workspace/github_c_makefile_star2_O2/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 0x139dff
movl %edi, %eax
andl $-0x3, %eax
cmpl $0x1, %eax
jne 0x139cf3
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %r13
movq %rcx, %rdi
movq %r8, %rsi
callq 0x19128d
movq %rax, %rbx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1912dd
movq %rax, %r15
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1913a4
movq %rax, %r14
movq %rbx, (%rsp)
subq %rbx, %r15
incq %r15
cmpq $0x1f, %r12
jbe 0x139d34
pushq $0x40
popq %r12
jmp 0x139d7a
cmpl $0x2, %edi
je 0x139dff
movq 0x2fe265(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ab306(%rip), %rsi    # 0x2e5013
leaq 0x2063d2(%rip), %rdx    # 0x3400e6
leaq 0x2063f9(%rip), %rcx    # 0x340114
leaq 0x20619a(%rip), %r8     # 0x33febc
movl $0x2e1, %r9d            # imm = 0x2E1
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq %r13, %rdi
callq 0x75487
movl %eax, %eax
cvtsi2sd %rax, %xmm0
cvtsi2sd %r12, %xmm1
callq 0x17d10
callq 0x170f0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x1adfba(%rip), %xmm0   # 0x2e7d20
cvttsd2si %xmm0, %rdi
andq %rcx, %rdi
orq %rax, %rdi
callq 0xa0f91
movzwl %ax, %r12d
movq %r15, %rdi
callq 0xa0f91
movq %rax, %r15
movq %r14, %rdi
callq 0xa0f91
movq %rax, %r14
movl $0xffff, %r13d          # imm = 0xFFFF
movl %r15d, %ebp
andl %r13d, %ebp
andl %r14d, %r13d
leal (%r12,%r13), %ebx
addl %ebp, %ebx
cmpl $0x40, %ebx
ja 0x139dff
leaq 0x20610b(%rip), %rsi    # 0x33febc
pushq $0x30
popq %rdi
movl $0x2d3, %edx            # imm = 0x2D3
callq 0x93160
movw %bx, (%rax)
pushq $0x40
popq %rcx
subl %r12d, %ecx
movl %ecx, 0x20(%rax)
subl %ebp, %ecx
movl %ecx, 0x24(%rax)
movq (%rsp), %rdx
movq %rdx, 0x8(%rax)
subl %r13d, %ecx
movl %ecx, 0x28(%rax)
pushq $-0x1
popq %rdx
movq %rdx, %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 0x139e01
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq