// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/diagbandseed.c
// Function: gt_diagbandseed_get_kmers
static GtKmerPosList *gt_diagbandseed_get_kmers(
                                   const GtEncseq *encseq,
                                   unsigned int spacedseedweight,
                                   unsigned int seedlength,
                                   const GtSpacedSeedSpec *spaced_seed_spec,
                                   GtReadmode readmode,
                                   GtUword seqrange_start,
                                   GtUword seqrange_end,
                                   const GtKmerPosListEncodeInfo *encode_info,
                                   bool debug_kmer,
                                   bool verbose,
                                   GtUword known_size,
                                   FILE *stream)
{
  GtKmerPosList *kmerpos_list;
  GtDiagbandseedProcKmerInfo pkinfo;
  GtRange specialrange;
  GtTimer *timer = NULL;
  GtUword kmerpos_list_len, totallength;

  gt_assert(encseq != NULL);
  totallength = gt_encseq_total_length(encseq);
  if (known_size > 0)
  {
    kmerpos_list_len = known_size;
  } else
  {
    kmerpos_list_len = gt_seed_extend_numofkmers(encseq, seedlength,
                                                 seqrange_start, seqrange_end);
    gt_assert(kmerpos_list_len > 0);
  }
  kmerpos_list = gt_kmerpos_list_new(kmerpos_list_len,encode_info);
  if (verbose) {
    GtBitcount_type bits_kmerpos;

    if (encode_info != NULL)
    {
      bits_kmerpos = encode_info->bits_kmerpos;
    } else
    {
      bits_kmerpos = sizeof (GtDiagbandseedKmerPos) * CHAR_BIT;
    }
    fprintf(stream, "# start fetching %u-mers (%hu bits/" GT_WU " bytes each, "
                    "expect " GT_WU ", allocate %.0f MB) ...\n",
            seedlength,
            bits_kmerpos,
            (GtUword) gt_kmerpos_list_elem_size(kmerpos_list),
            kmerpos_list_len,
            GT_MEGABYTES(kmerpos_list_len *
                         gt_kmerpos_list_elem_size(kmerpos_list)));
    timer = gt_timer_new();
    gt_timer_start(timer);
  }
  pkinfo.kmerpos_list_ref = kmerpos_list;
  pkinfo.current_seqnum = seqrange_start;
  pkinfo.current_endpos = 0;
  pkinfo.encseq = encseq;
  pkinfo.spacedseedweight = spacedseedweight;
  pkinfo.seedlength = seedlength;
  pkinfo.spaced_seed_spec = spaced_seed_spec;
  pkinfo.readmode = readmode;
  if (seqrange_end + 1 == gt_encseq_num_of_sequences(encseq))
  {
    pkinfo.last_specialpos = totallength;
  } else
  {
    /* start position of following sequence, minus separator position */
    pkinfo.last_specialpos
      = gt_encseq_seqstartpos(encseq, seqrange_end + 1) - 1;
  }
  pkinfo.prev_separator = gt_encseq_seqstartpos(encseq, seqrange_start);
  if (gt_encseq_has_specialranges(encseq)) {
    pkinfo.sri = gt_specialrangeiterator_new(encseq, true);
    while (gt_specialrangeiterator_next(pkinfo.sri, &specialrange) &&
           specialrange.end < pkinfo.prev_separator)
       /* Nothing */;
    specialrange.start = pkinfo.prev_separator;
    pkinfo.specialrange = &specialrange;
    pkinfo.next_separator
      = gt_diagbandseed_update_separatorpos(pkinfo.specialrange,
                                            pkinfo.sri,
                                            pkinfo.encseq,
                                            totallength,
                                            pkinfo.readmode);
  } else {
    pkinfo.sri = NULL;
    pkinfo.specialrange = NULL;
    pkinfo.next_separator = pkinfo.last_specialpos;
  }

  if (gt_encseq_has_twobitencoding(encseq) && gt_encseq_wildcards(encseq) == 0)
  {
    /* Use fast access to encseq, requires 2bit-enc and absence of wildcards. */
    gt_getencseqkmers_twobitencoding_slice(encseq,
                                           readmode,
                                           seedlength,
                                           seedlength,
                                           false,
                                           gt_diagbandseed_processkmercode,
                                           (void *) &pkinfo,
                                           NULL,
                                           NULL,
                                           pkinfo.prev_separator,
                                           pkinfo.last_specialpos);
  } else {
    /* Use GtKmercodeiterator for encseq access */
    gt_diagbandseed_get_kmers_kciter(&pkinfo);
  }
  if (gt_encseq_has_specialranges(encseq)) {
    gt_specialrangeiterator_delete(pkinfo.sri);
  }
  /* reduce size of array to number of entries */
  gt_kmerpos_list_reduce_size(kmerpos_list);
  if (debug_kmer)
  {
    gt_kmerpos_list_show(stream,kmerpos_list);
  }
  if (verbose)
  {
    fprintf(stream, "# ... collected " GT_WU " %u-mers ",
            gt_kmerpos_list_num_entries(kmerpos_list),seedlength);
    gt_timer_show_formatted(timer, GT_DIAGBANDSEED_FMT, stream);
    gt_timer_start(timer);
  }
  gt_kmerpos_list_sort(kmerpos_list);
  kmerpos_list->longest_code_run
    = gt_diagbandseed_longest_code_run(kmerpos_list);
  if (verbose) {
    fprintf(stream, "# ... sorted " GT_WU " %u-mers ",
            gt_kmerpos_list_num_entries(kmerpos_list),seedlength);
    gt_timer_show_formatted(timer, GT_DIAGBANDSEED_FMT, stream);
    gt_timer_delete(timer);
  }

  return kmerpos_list;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %r8d, 0x3c(%rsp)
movq %rcx, 0xc0(%rsp)
movl %esi, 0x4c(%rsp)
testq %rdi, %rdi
je 0x199498
movq %r9, %r12
movl %edx, %r14d
movq %rdi, %r15
movq 0x130(%rsp), %rbp
movq 0x110(%rsp), %r13
callq 0xec1d8
movq %rax, 0x50(%rsp)
testq %rbp, %rbp
movq %r14, 0x40(%rsp)
jne 0x198f94
movq %r15, %rdi
callq 0xf0b87
movq %rax, %r14
movq %r15, %rdi
callq 0xec1d8
movq %rax, %rbp
movq %r15, %rdi
movq %r12, 0x30(%rsp)
movq %r12, %rsi
callq 0xefce0
movq %r15, %rdi
movq %rax, %r15
leaq 0x1(%r13), %rbx
movq %rdi, %r12
callq 0xec1e8
movq %rbp, 0xb0(%rsp)
cmpq %rax, %rbx
je 0x198f18
movq %r12, %rdi
movq %rbx, %rsi
callq 0xefce0
movq %rax, %rbp
decq %rbp
subq %r15, %rbp
jb 0x19949d
movq %r13, %rbx
subq 0x30(%rsp), %rbx
incq %rbx
movq 0x40(%rsp), %rax
leal -0x1(%rax), %r15d
movq %r12, %rdi
callq 0xf034b
cmpq %r15, %rax
ja 0x198f4d
movq %r12, %rdi
callq 0xf034b
movq %rax, %r15
incq %r15
imulq %rbx, %r15
leaq 0x1(%rbp), %rax
cmpq %r15, %rax
jb 0x1994a2
imulq %rbp, %r14
movq %r14, %rax
xorl %edx, %edx
divq 0xb0(%rsp)
cmpq %rbp, %rax
cmovaeq %rbp, %rax
decq %r15
cmpq %rax, %r15
cmovbeq %rax, %r15
subq %r15, %rbp
movq %r12, %r15
movq 0x30(%rsp), %r12
je 0x1994a7
movq 0x118(%rsp), %rbx
leaq 0x210129(%rip), %rsi    # 0x3a90cc
movl $0x30, %edi
movl $0x195, %edx            # imm = 0x195
callq 0x1092b2
movq %rax, %r14
movq $0x0, 0x18(%rax)
movq %rbp, 0x10(%rax)
testq %rbx, %rbx
je 0x198fec
movq $0x0, (%r14)
leaq (,%rbp,8), %rdi
leaq 0x2100f0(%rip), %rsi    # 0x3a90cc
movl $0x19e, %edx            # imm = 0x19E
callq 0x1092b2
movq %rax, 0x8(%r14)
jmp 0x19900f
movq $0x0, 0x8(%r14)
movq %rbp, %rdi
shlq $0x4, %rdi
leaq 0x2100ca(%rip), %rsi    # 0x3a90cc
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x1092b2
movq %rax, (%r14)
movq %rbx, 0x28(%r14)
cmpb $0x0, 0x128(%rsp)
je 0x19902d
testq %rbx, %rbx
je 0x199040
movzwl (%rbx), %ecx
movl $0x8, %r8d
jmp 0x19904b
movq $0x0, 0x30(%rsp)
movq %r12, %rbx
movq 0x40(%rsp), %r12
jmp 0x1990b1
movl $0x80, %ecx
movl $0x10, %r8d
movq %r12, %rbx
movq %r8, %rax
imulq %rbp, %rax
movq %rax, %xmm1
punpckldq 0x1b787e(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b7886(%rip), %xmm1   # 0x3508f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x1b7882(%rip), %xmm0   # 0x350900
leaq 0x210337(%rip), %rsi    # 0x3a93bc
movq 0x138(%rsp), %rdi
movq 0x40(%rsp), %r12
movl %r12d, %edx
movq %rbp, %r9
movb $0x1, %al
callq 0x17ab0
callq 0x1226a4
movq %rax, 0x30(%rsp)
movq %rax, %rdi
callq 0x122733
movq %r14, 0x58(%rsp)
movl %ebx, 0x60(%rsp)
movl $0x0, 0x64(%rsp)
movq %r15, 0x68(%rsp)
movl 0x4c(%rsp), %eax
movl %eax, 0x98(%rsp)
movl %r12d, 0x9c(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0xa8(%rsp)
incq %r13
movq %r15, %rdi
callq 0xec1e8
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %r13
je 0x19911b
movq %r15, %rdi
movq %r13, %rsi
callq 0xefce0
decq %rax
movq %rax, 0x80(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xefce0
movq %rax, 0x88(%rsp)
movq %r15, %rdi
callq 0xef27f
testb %al, %al
movq 0x138(%rsp), %rbp
je 0x1991b5
movq %r15, %rdi
movl $0x1, %esi
callq 0xef3d9
movq %rax, 0x70(%rsp)
leaq 0xc8(%rsp), %rbx
movq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0xef451
movq 0x88(%rsp), %rcx
testb %al, %al
je 0x199187
cmpq %rcx, 0xd0(%rsp)
jb 0x199164
movq %rcx, 0xc8(%rsp)
movq %rbx, 0x78(%rsp)
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rsi
movl 0xa8(%rsp), %r8d
movq %rbx, %rdi
movq 0x50(%rsp), %rcx
callq 0x19ae42
jmp 0x1991c7
xorpd %xmm0, %xmm0
movupd %xmm0, 0x70(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %r15, %rdi
callq 0xed91a
testb %al, %al
movq %r15, 0xb8(%rsp)
je 0x1991f4
movq %r15, %rdi
callq 0xf0c8a
testq %rax, %rax
je 0x199290
movl 0x9c(%rsp), %eax
movq 0x80(%rsp), %r15
subq %rax, %r15
jb 0x1992d1
incq %r15
movq 0x68(%rsp), %rdi
movl 0x60(%rsp), %esi
callq 0xefce0
movq %rax, %rbx
movq 0x68(%rsp), %rdi
movl 0xa8(%rsp), %esi
movl 0x9c(%rsp), %edx
movq %rax, %rcx
callq 0x1f7dc2
movq %rax, %r13
cmpq %r15, %rbx
jae 0x199279
movb $0x1, %r12b
movq %r13, %rdi
callq 0x1f7f9f
movb (%rax), %bpl
testb %bpl, %bpl
jne 0x19926e
movq 0x8(%rax), %rcx
movzbl %r12b, %esi
andl $0x1, %esi
leaq 0x58(%rsp), %rdi
movq %rbx, %rdx
callq 0x19aed4
incq %rbx
movl %ebp, %r12d
cmpq %r15, %rbx
jb 0x199246
movq %r13, %rdi
callq 0x1f827b
movq 0x40(%rsp), %r12
movq 0x138(%rsp), %rbp
jmp 0x1992d1
leaq 0x58(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x30(%rax), %rdx
movq %rcx, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x1c18(%rip), %r9       # 0x19aed4
movq %r15, %rdi
movl 0x3c(%rsp), %esi
movl %r12d, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x2003a1
movq 0xb8(%rsp), %rdi
callq 0xef27f
testb %al, %al
je 0x1992ec
movq 0x70(%rsp), %rdi
callq 0xefa48
testq %r14, %r14
je 0x199493
movq 0x18(%r14), %rsi
cmpq 0x10(%r14), %rsi
ja 0x199493
movq %r12, %r13
movb 0x120(%rsp), %bl
jae 0x19934f
xorl %r15d, %r15d
cmpq $0x0, 0x28(%r14)
setne %r15b
sete %cl
movl $0x208, %edx            # imm = 0x208
movl $0x202, %eax            # imm = 0x202
cmovel %edx, %eax
movq (%r14,%r15,8), %rdi
addb $0x3, %cl
shlq %cl, %rsi
leaq 0x20fd90(%rip), %rdx    # 0x3a90cc
movl %eax, %ecx
callq 0x1094e6
movq %rax, (%r14,%r15,8)
movq 0x18(%r14), %rax
movq %rax, 0x10(%r14)
testb %bl, %bl
je 0x1993d0
cmpq $0x0, 0x18(%r14)
je 0x1993d0
movl $0xc, %r12d
leaq 0x21033e(%rip), %rbx    # 0x3a96a5
xorl %r15d, %r15d
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x1993a3
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rax
movb 0x20(%rdi), %cl
movb 0x24(%rdi), %sil
movq %rax, %rdx
shrq %cl, %rdx
movq %rax, %r8
movl %esi, %ecx
shrq %cl, %r8
andl 0x10(%rdi), %r8d
movb 0x28(%rdi), %cl
shrq %cl, %rax
addl 0x8(%rdi), %r8d
andl 0x18(%rdi), %eax
jmp 0x1993b4
movq (%r14), %rax
movq -0xc(%rax,%r12), %rdx
movl -0x4(%rax,%r12), %r8d
movl (%rax,%r12), %eax
movq %rbp, %rdi
movq %rbx, %rsi
movl %eax, %ecx
xorl %eax, %eax
callq 0x17ab0
incq %r15
addq $0x10, %r12
cmpq 0x18(%r14), %r15
jb 0x19936a
movq %r14, %rdi
cmpb $0x0, 0x128(%rsp)
je 0x19946d
callq 0x19cb36
leaq 0x210025(%rip), %rsi    # 0x3a9412
movq %rbp, %rdi
movq %rax, %rdx
movq %r13, %r15
movl %r15d, %ecx
xorl %eax, %eax
callq 0x17ab0
leaq 0x2107ab(%rip), %rbx    # 0x3a9bb2
movq 0x30(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1227b4
movq %r12, %rdi
callq 0x122733
movq %r14, %rdi
callq 0x19cb46
movq %r14, %rdi
callq 0x19cb6c
movq %rax, 0x20(%r14)
movq %r14, %rdi
callq 0x19cb36
leaq 0x20ffea(%rip), %rsi    # 0x3a942f
movq %rbp, %rdi
movq %rax, %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x17ab0
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1227b4
movq %r12, %rdi
callq 0x122d79
jmp 0x19947e
callq 0x19cb46
movq %r14, %rdi
callq 0x19cb6c
movq %rax, 0x20(%r14)
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5df79
callq 0x5e05d
callq 0x5e024
callq 0x5dfeb
callq 0x5dfb2