// File: /workspace/github_c_makefile_star2_O2/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 $0xe8, %rsp
movq %r9, 0x38(%rsp)
movl %r8d, 0x34(%rsp)
movq %rcx, 0x78(%rsp)
movl %esi, 0x54(%rsp)
testq %rdi, %rdi
je 0x13a5d9
movl %edx, %ebp
movq 0x140(%rsp), %rbx
movq 0x120(%rsp), %r13
movq %rdi, 0x28(%rsp)
callq 0x7055e
movq %rax, 0x58(%rsp)
testq %rbx, %rbx
jne 0x13a0ba
movq %rbp, 0x48(%rsp)
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x760bc
movq %rax, %r14
movq %rbx, %rdi
callq 0x7055e
movq %rax, %r12
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
callq 0x74d9c
movq %rax, %r15
leaq 0x1(%r13), %rbp
movq %rbx, %rdi
callq 0x705a1
movq %r12, 0x40(%rsp)
movq %r12, %rbx
cmpq %rax, %rbp
je 0x13a040
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x74d9c
movq %rax, %rbx
decq %rbx
subq %r15, %rbx
jb 0x13a60a
movq %r13, %rbp
subq 0x38(%rsp), %rbp
incq %rbp
movq 0x48(%rsp), %rax
leal -0x1(%rax), %r15d
movq 0x28(%rsp), %rdi
callq 0x7557f
cmpq %r15, %rax
ja 0x13a079
movq 0x28(%rsp), %rdi
callq 0x7557f
movq %rax, %r15
incq %r15
imulq %rbp, %r15
leaq 0x1(%rbx), %rax
cmpq %r15, %rax
jb 0x13a638
imulq %rbx, %r14
movq %r14, %rax
xorl %edx, %edx
divq 0x40(%rsp)
cmpq %rbx, %rax
cmovaeq %rbx, %rax
decq %r15
cmpq %rax, %r15
cmovbeq %rax, %r15
subq %r15, %rbx
movq 0x48(%rsp), %rbp
je 0x13a666
movb 0x138(%rsp), %r12b
movq 0x128(%rsp), %r15
leaq 0x205deb(%rip), %rsi    # 0x33febc
pushq $0x30
popq %rdi
movl $0x195, %edx            # imm = 0x195
callq 0x93160
movq %rax, %r14
andq $0x0, 0x18(%rax)
movq %rbx, 0x10(%rax)
testq %r15, %r15
je 0x13a125
andq $0x0, (%r14)
leaq (,%rbx,8), %rdi
leaq 0x205dba(%rip), %rsi    # 0x33febc
movl $0x19e, %edx            # imm = 0x19E
callq 0x93160
movq %rax, 0x8(%r14)
movq %r15, 0x28(%r14)
testb %r12b, %r12b
je 0x13a1c1
movzwl (%r15), %ecx
pushq $0x8
jmp 0x13a156
andq $0x0, 0x8(%r14)
movq %rbx, %rdi
shlq $0x4, %rdi
leaq 0x205d84(%rip), %rsi    # 0x33febc
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x93160
movq %rax, (%r14)
andq $0x0, 0x28(%r14)
testb %r12b, %r12b
je 0x13a1c1
movl $0x80, %ecx
pushq $0x10
popq %r8
movq 0x28(%rsp), %r15
movq 0x38(%rsp), %r12
movq %r8, %rax
imulq %rbx, %rax
movq %rax, %xmm1
punpckldq 0x1ad76a(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1ad772(%rip), %xmm1   # 0x2e78f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x1ad76e(%rip), %xmm0   # 0x2e7900
leaq 0x206013(%rip), %rsi    # 0x3401ac
movq 0x148(%rsp), %rdi
movl %ebp, %edx
movq %rbx, %r9
movb $0x1, %al
callq 0x17a50
callq 0xaf478
movq %rax, 0x40(%rsp)
movq %rax, %rdi
callq 0xaf4d6
jmp 0x13a1d4
movq $0x0, 0x40(%rsp)
movq 0x28(%rsp), %r15
movq 0x38(%rsp), %r12
movq %r14, 0x80(%rsp)
movl %r12d, 0x88(%rsp)
andl $0x0, 0x8c(%rsp)
movq %r15, 0x90(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0xc0(%rsp)
movl %ebp, 0xc4(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0xc8(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0xd0(%rsp)
incq %r13
movq %r15, %rdi
callq 0x705a1
movq 0x58(%rsp), %rbx
cmpq %rax, %r13
je 0x13a244
movq %r15, %rdi
movq %r13, %rsi
callq 0x74d9c
movq %rax, %rbx
decq %rbx
movq %rbx, 0xa8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x74d9c
movq %r15, %r13
movq %rax, %r15
movq %rax, 0xb0(%rsp)
movq %r13, %rdi
callq 0x740a6
testb %al, %al
je 0x13a2e5
movq %rbp, %r12
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0x741f0
movq %rax, %r13
movq %rax, 0x98(%rsp)
leaq 0xd8(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7428b
testb %al, %al
je 0x13a2ab
cmpq %r15, 0xe0(%rsp)
jb 0x13a292
movq %r15, 0xd8(%rsp)
movq %rbp, 0xa0(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq 0x28(%rsp), %r13
movq %r13, %rdx
movq 0x58(%rsp), %rcx
movl 0x34(%rsp), %r8d
callq 0x13c109
movq %rax, 0xb8(%rsp)
movq %r12, %rbp
jmp 0x13a2fa
xorpd %xmm0, %xmm0
movupd %xmm0, 0x98(%rsp)
movq %rbx, 0xb8(%rsp)
movq %r13, %rdi
callq 0x72478
movl %ebp, %ecx
testb %al, %al
je 0x13a328
movq %r13, %rdi
callq 0x7628b
movq 0xa8(%rsp), %rbx
testq %rax, %rax
je 0x13a3b9
movl 0xc4(%rsp), %ecx
movl %ecx, %eax
subq %rax, %rbx
jb 0x13a3f7
movq %rbp, 0x48(%rsp)
incq %rbx
leaq 0x80(%rsp), %r15
movq 0x10(%r15), %rdi
movl 0x8(%r15), %esi
callq 0x74d9c
movq %rax, %rbp
movq 0x10(%r15), %rdi
movl 0x50(%r15), %esi
movl 0x44(%r15), %edx
movq %rax, %rcx
callq 0x19f20f
movq %rax, %r15
movb $0x1, %r13b
cmpq %rbx, %rbp
jae 0x13a3a5
movq %r15, %rdi
callq 0x19f495
movb (%rax), %r12b
testb %r12b, %r12b
jne 0x13a39d
movq 0x8(%rax), %rcx
movzbl %r13b, %esi
andl $0x1, %esi
leaq 0x80(%rsp), %rdi
movq %rbp, %rdx
callq 0x13c1b5
incq %rbp
movl %r12d, %r13d
jmp 0x13a36d
movq %r15, %rdi
callq 0x19f83e
movq 0x48(%rsp), %rbp
movq 0x28(%rsp), %r13
jmp 0x13a3f7
leaq 0x80(%rsp), %rax
movq 0x30(%rax), %rcx
movq %rbx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x1dd1(%rip), %r9       # 0x13c1b5
movq %r13, %rdi
movl 0x34(%rsp), %esi
movl %ebp, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x1a9262
movq %r13, %rdi
callq 0x740a6
testb %al, %al
je 0x13a410
movq 0x98(%rsp), %rdi
callq 0x74a09
testq %r14, %r14
je 0x13a5a8
movq 0x18(%r14), %rsi
cmpq 0x10(%r14), %rsi
ja 0x13a5a8
movb 0x130(%rsp), %bl
jae 0x13a470
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 0x205a5f(%rip), %rdx    # 0x33febc
movl %eax, %ecx
callq 0x93472
movq %rax, (%r14,%r15,8)
movq 0x18(%r14), %rsi
movq %rsi, 0x10(%r14)
testb %bl, %bl
je 0x13a4e2
leaq 0x20601a(%rip), %rbx    # 0x340495
leaq 0x60(%rsp), %r12
xorl %r15d, %r15d
xorl %r13d, %r13d
cmpq %rsi, %r13
jae 0x13a4e2
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x13a4a6
movq 0x8(%r14), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x13e10a
jmp 0x13a4b5
movq (%r14), %rax
movupd (%rax,%r15), %xmm0
movapd %xmm0, 0x60(%rsp)
movq 0x60(%rsp), %rdx
movl 0x6c(%rsp), %ecx
movl 0x68(%rsp), %r8d
movq 0x148(%rsp), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x17a50
incq %r13
movq 0x18(%r14), %rsi
addq $0x10, %r15
jmp 0x13a486
movq %r14, %rdi
cmpb $0x0, 0x138(%rsp)
je 0x13a582
callq 0x13df4d
leaq 0x205d03(%rip), %rsi    # 0x340202
movq 0x148(%rsp), %r15
movq %r15, %rdi
movq %rax, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x17a50
leaq 0x2063f5(%rip), %rbx    # 0x340912
movq 0x40(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xaf5b6
movq %r12, %rdi
callq 0xaf4d6
movq %r14, %rdi
callq 0x13df90
movq %r14, %rdi
callq 0x13dfb6
movq %rax, 0x20(%r14)
movq %r14, %rdi
callq 0x13df4d
leaq 0x205cc4(%rip), %rsi    # 0x34021f
movq %r15, %rdi
movq %rax, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x17a50
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xaf5b6
movq %r12, %rdi
callq 0xafc5b
jmp 0x13a593
callq 0x13df90
movq %r14, %rdi
callq 0x13dfb6
movq %rax, 0x20(%r14)
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2fd9b9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1aaa5a(%rip), %rsi    # 0x2e5013
leaq 0x205e6f(%rip), %rdx    # 0x34042f
leaq 0x205eb2(%rip), %rcx    # 0x340479
leaq 0x2058ee(%rip), %r8     # 0x33febc
movl $0x1fa, %r9d            # imm = 0x1FA
jmp 0x13a692
movq 0x2fd988(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1aaa29(%rip), %rsi    # 0x2e5013
leaq 0x205cc1(%rip), %rdx    # 0x3402b2
leaq 0x205b85(%rip), %rcx    # 0x34017d
leaq 0x2058bd(%rip), %r8     # 0x33febc
movl $0x346, %r9d            # imm = 0x346
jmp 0x13a692
movq 0x2fd957(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1aa9f8(%rip), %rsi    # 0x2e5013
leaq 0x205c17(%rip), %rdx    # 0x340239
leaq 0x205c24(%rip), %rcx    # 0x34024d
leaq 0x20588c(%rip), %r8     # 0x33febc
movl $0x186, %r9d            # imm = 0x186
jmp 0x13a692
movq 0x2fd929(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1aa9ca(%rip), %rsi    # 0x2e5013
leaq 0x205c17(%rip), %rdx    # 0x340267
leaq 0x205bf6(%rip), %rcx    # 0x34024d
leaq 0x20585e(%rip), %r8     # 0x33febc
movl $0x18a, %r9d            # imm = 0x18A
jmp 0x13a692
movq 0x2fd8fb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1aa99c(%rip), %rsi    # 0x2e5013
leaq 0x205b19(%rip), %rdx    # 0x340197
leaq 0x205af8(%rip), %rcx    # 0x34017d
leaq 0x205830(%rip), %r8     # 0x33febc
movl $0x34f, %r9d            # imm = 0x34F
xorl %eax, %eax
callq 0x17a50
callq 0x17390