// File: /workspace/github_c_makefile_star2_O3/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)
testq %rdi, %rdi
je 0x190ec7
movl %edx, %r13d
movl %esi, 0x5c(%rsp)
movq %rcx, 0xc0(%rsp)
movq %r9, 0x40(%rsp)
movq 0x130(%rsp), %r12
movq %rdi, 0x30(%rsp)
callq 0xe7b9c
movq %rax, 0x60(%rsp)
testq %r12, %r12
jne 0x190991
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0xec58b
movq %rax, %r14
movq %rbx, %rdi
callq 0xe7b9c
movq %rax, %r12
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
callq 0xeb6ee
movq %rax, %r15
movq 0x110(%rsp), %rax
leaq 0x1(%rax), %rbp
movq %rbx, %rdi
movq %r12, %rbx
callq 0xe7bac
cmpq %rax, %rbp
je 0x19091d
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0xeb6ee
movq %rax, %r12
decq %r12
subq %r15, %r12
jb 0x190ecc
movq 0x110(%rsp), %rbp
subq 0x40(%rsp), %rbp
incq %rbp
leal -0x1(%r13), %r15d
movq 0x30(%rsp), %rdi
callq 0xebd4a
cmpq %r15, %rax
ja 0x190956
movq 0x30(%rsp), %rdi
callq 0xebd4a
movq %rax, %r15
incq %r15
imulq %rbp, %r15
leaq 0x1(%r12), %rax
cmpq %r15, %rax
jb 0x190ed1
imulq %r12, %r14
movq %r14, %rax
xorl %edx, %edx
divq %rbx
cmpq %r12, %rax
cmovaeq %r12, %rax
decq %r15
cmpq %rax, %r15
cmovbeq %rax, %r15
subq %r15, %r12
je 0x190ed6
movq 0x138(%rsp), %rbp
movb 0x128(%rsp), %bl
movq 0x118(%rsp), %r15
leaq 0x20f22d(%rip), %rsi    # 0x39fbdc
movl $0x30, %edi
movl $0x195, %edx            # imm = 0x195
callq 0x104226
movq %rax, %r14
movq $0x0, 0x18(%rax)
movq %r12, 0x10(%rax)
testq %r15, %r15
je 0x190a18
movq $0x0, (%r14)
leaq (,%r12,8), %rdi
leaq 0x20f1f4(%rip), %rsi    # 0x39fbdc
movl $0x19e, %edx            # imm = 0x19E
callq 0x104226
movq %rax, 0x8(%r14)
movq %r15, 0x28(%r14)
testb %bl, %bl
je 0x190abb
movzwl (%r15), %ecx
movl $0x8, %r8d
movq 0x30(%rsp), %r15
movq 0x40(%rsp), %rbx
jmp 0x190a60
xorl %r15d, %r15d
movq %r15, 0x8(%r14)
movq %r12, %rdi
shlq $0x4, %rdi
leaq 0x20f1af(%rip), %rsi    # 0x39fbdc
movl $0x1a4, %edx            # imm = 0x1A4
callq 0x104226
movq %rax, (%r14)
movq $0x0, 0x48(%rsp)
movq %r15, 0x28(%r14)
testb %bl, %bl
movq 0x30(%rsp), %r15
movq 0x40(%rsp), %rbx
je 0x190ace
movl $0x80, %ecx
movl $0x10, %r8d
movq %r8, %rax
imulq %r12, %rax
movq %rax, %xmm1
punpckldq 0x1b6e6c(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b6e74(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x1b6e70(%rip), %xmm0   # 0x347900
leaq 0x20f435(%rip), %rsi    # 0x39fecc
movq %rbp, %rdi
movl %r13d, %edx
movq %r12, %r9
movb $0x1, %al
callq 0x17ab0
callq 0x11c954
movq %rax, 0x48(%rsp)
movq %rax, %rdi
callq 0x11c9e3
jmp 0x190ace
movq $0x0, 0x48(%rsp)
movq 0x30(%rsp), %r15
movq 0x40(%rsp), %rbx
movq %r14, 0x68(%rsp)
movl %ebx, 0x70(%rsp)
movl $0x0, 0x74(%rsp)
movq %r15, 0x78(%rsp)
movl 0x5c(%rsp), %eax
movl %eax, 0xa8(%rsp)
movq %r13, 0x50(%rsp)
movl %r13d, 0xac(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0xb8(%rsp)
movq 0x110(%rsp), %r13
incq %r13
movq %r15, %rdi
callq 0xe7bac
movq 0x60(%rsp), %r12
cmpq %rax, %r13
je 0x190b45
movq %r15, %rdi
movq %r13, %rsi
callq 0xeb6ee
movq %rax, %r12
decq %r12
movq %r12, 0x90(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xeb6ee
movq %rax, %rbx
movq %rax, 0x98(%rsp)
movq %r15, %rdi
callq 0xeacd6
testb %al, %al
je 0x190bec
movq %r15, %rdi
movl $0x1, %esi
callq 0xeae2c
movq %rax, %r15
movq %rax, 0x80(%rsp)
leaq 0xc8(%rsp), %rbp
movq 0x50(%rsp), %r13
movq %r15, %rdi
movq %rbp, %rsi
callq 0xeae9a
testb %al, %al
je 0x190bad
cmpq %rbx, 0xd0(%rsp)
jb 0x190b94
movq %rbx, 0xc8(%rsp)
movq %rbp, 0x88(%rsp)
movq %rbp, %rdi
movq %r15, %rsi
movq 0x30(%rsp), %r15
movq %r15, %rdx
movq 0x60(%rsp), %rcx
movl 0x3c(%rsp), %r8d
callq 0x19284f
movq %rax, 0xa0(%rsp)
movq 0x138(%rsp), %rbp
jmp 0x190c06
xorpd %xmm0, %xmm0
movupd %xmm0, 0x80(%rsp)
movq %r12, 0xa0(%rsp)
movq 0x50(%rsp), %r13
movq %r15, %rdi
callq 0xe935b
movl %r13d, %ecx
testb %al, %al
je 0x190c35
movq %r15, %rdi
callq 0xec68e
movq 0x90(%rsp), %r12
testq %rax, %rax
je 0x190cc9
movl 0xac(%rsp), %ecx
movl %ecx, %eax
subq %rax, %r12
jb 0x190d06
incq %r12
movq 0x78(%rsp), %rdi
movl 0x70(%rsp), %esi
callq 0xeb6ee
movq %rax, %rbx
movq 0x78(%rsp), %rdi
movl 0xb8(%rsp), %esi
movl 0xac(%rsp), %edx
movq %rax, %rcx
callq 0x1ee606
movq %rax, %rbp
cmpq %r12, %rbx
jae 0x190cad
movb $0x1, %r15b
movq %rbp, %rdi
callq 0x1ee7e3
movb (%rax), %r13b
testb %r13b, %r13b
jne 0x190ca2
movq 0x8(%rax), %rcx
movzbl %r15b, %esi
andl $0x1, %esi
leaq 0x68(%rsp), %rdi
movq %rbx, %rdx
callq 0x1928c9
incq %rbx
movl %r13d, %r15d
cmpq %r12, %rbx
jb 0x190c7a
movq %rbp, %rdi
callq 0x1eeaa9
movq 0x50(%rsp), %r13
movq 0x138(%rsp), %rbp
movq 0x30(%rsp), %r15
jmp 0x190d06
leaq 0x68(%rsp), %rax
movq 0x30(%rax), %rcx
movq %r12, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x1bd8(%rip), %r9       # 0x1928c9
movq %r15, %rdi
movl 0x3c(%rsp), %esi
movl %r13d, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x1f6c0f
movq %r15, %rdi
callq 0xeacd6
testb %al, %al
je 0x190d1f
movq 0x80(%rsp), %rdi
callq 0xeb455
testq %r14, %r14
je 0x190ec2
movq 0x18(%r14), %rsi
cmpq 0x10(%r14), %rsi
ja 0x190ec2
movb 0x120(%rsp), %bl
jae 0x190d7f
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 0x20ee70(%rip), %rdx    # 0x39fbdc
movl %eax, %ecx
callq 0x104461
movq %rax, (%r14,%r15,8)
movq 0x18(%r14), %rsi
movq %rsi, 0x10(%r14)
testq %rsi, %rsi
setne %al
andb %al, %bl
cmpb $0x1, %bl
jne 0x190e02
movl $0xc, %r15d
leaq 0x20f41c(%rip), %rbx    # 0x3a01b5
xorl %r12d, %r12d
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x190dd5
movq 0x8(%r14), %rax
movq (%rax,%r12,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 0x190de6
movq (%r14), %rax
movq -0xc(%rax,%r15), %rdx
movl -0x4(%rax,%r15), %r8d
movl (%rax,%r15), %eax
movq %rbp, %rdi
movq %rbx, %rsi
movl %eax, %ecx
xorl %eax, %eax
callq 0x17ab0
incq %r12
addq $0x10, %r15
cmpq 0x18(%r14), %r12
jb 0x190d9c
movq %r14, %rdi
cmpb $0x0, 0x128(%rsp)
je 0x190e9c
callq 0x194533
leaq 0x20f103(%rip), %rsi    # 0x39ff22
movq %rbp, %rdi
movq %rax, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x17ab0
leaq 0x20f7fc(%rip), %rbx    # 0x3a0632
movq 0x48(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x11ca64
movq %r15, %rdi
callq 0x11c9e3
movq %r14, %rdi
callq 0x194543
movq %r14, %rdi
callq 0x194569
movq %rax, 0x20(%r14)
movq %r14, %rdi
callq 0x194533
leaq 0x20f0cb(%rip), %rsi    # 0x39ff3f
movq %rbp, %rdi
movq %rax, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x17ab0
movq %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x11ca64
movq %r15, %rdi
callq 0x11d054
jmp 0x190ead
callq 0x194543
movq %r14, %rdi
callq 0x194569
movq %rax, 0x20(%r14)
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5cc22
callq 0x5cd06
callq 0x5cccd
callq 0x5cc94
callq 0x5cc5b