// File: /workspace/github_c_makefile_star2_O0/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 %rbx
subq $0x140, %rsp            # imm = 0x140
movq %rcx, 0x70(%rsp)
movl %edx, %eax
movq 0x70(%rsp), %rdx
movl %eax, 0x7c(%rsp)
movl %esi, %eax
movl 0x7c(%rsp), %esi
movl %eax, 0x80(%rsp)
movq %rdi, %r10
movl 0x80(%rsp), %edi
movq 0x178(%rsp), %rax
movq 0x170(%rsp), %rax
movb 0x168(%rsp), %al
movb 0x160(%rsp), %cl
movq 0x158(%rsp), %r11
movq 0x150(%rsp), %r11
movq %r10, 0x138(%rsp)
movl %edi, 0x134(%rsp)
movl %esi, 0x130(%rsp)
movq %rdx, 0x128(%rsp)
movl %r8d, 0x124(%rsp)
movq %r9, 0x118(%rsp)
andb $0x1, %cl
movb %cl, 0x117(%rsp)
andb $0x1, %al
movb %al, 0x116(%rsp)
movq $0x0, 0x98(%rsp)
cmpq $0x0, 0x138(%rsp)
jne 0x20e98d
movq 0x42d644(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3076ad(%rip), %rsi    # 0x516013
leaq 0x363a75(%rip), %rdx    # 0x5723e2
leaq 0x3638fc(%rip), %rcx    # 0x572270
leaq 0x363619(%rip), %r8     # 0x571f94
movl $0x346, %r9d            # imm = 0x346
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x20e98f
movq 0x138(%rsp), %rdi
callq 0xa9d00
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x170(%rsp)
jbe 0x20e9c1
movq 0x170(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x20ea34
movq 0x138(%rsp), %rdi
movl 0x130(%rsp), %esi
movq 0x118(%rsp), %rdx
movq 0x150(%rsp), %rcx
callq 0x2119a0
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x90(%rsp)
ja 0x20ea30
movq 0x42d5a1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x30760a(%rip), %rsi    # 0x516013
leaq 0x36387a(%rip), %rdx    # 0x57228a
leaq 0x363859(%rip), %rcx    # 0x572270
leaq 0x363576(%rip), %r8     # 0x571f94
movl $0x34f, %r9d            # imm = 0x34F
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x20ea32
jmp 0x20ea34
movq 0x90(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0x211c60
movq %rax, 0x108(%rsp)
testb $0x1, 0x116(%rsp)
je 0x20eb55
cmpq $0x0, 0x158(%rsp)
je 0x20ea7f
movq 0x158(%rsp), %rax
movw (%rax), %ax
movw %ax, 0x86(%rsp)
jmp 0x20ea89
movw $0x80, 0x86(%rsp)
movq 0x178(%rsp), %rax
movq %rax, 0x50(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0x58(%rsp)
movzwl 0x86(%rsp), %eax
movl %eax, 0x5c(%rsp)
movq 0x108(%rsp), %rdi
callq 0x211d70
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x108(%rsp), %rdi
callq 0x211d70
movq 0x50(%rsp), %rdi
movl 0x58(%rsp), %edx
movl 0x5c(%rsp), %ecx
movq 0x60(%rsp), %r8
movq 0x68(%rsp), %r9
movq %rax, %rsi
movq %r9, %rax
imulq %rsi, %rax
movq %rax, %xmm0
movaps 0x309e2a(%rip), %xmm1   # 0x518930
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x309e2e(%rip), %xmm1   # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x309df7(%rip), %xmm1   # 0x518920
divsd %xmm1, %xmm0
leaq 0x36376b(%rip), %rsi    # 0x57229f
movb $0x1, %al
callq 0x199f0
callq 0x121340
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rdi
callq 0x1213f0
movq 0x108(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x118(%rsp), %rax
movl %eax, 0xb8(%rsp)
movl $0x0, 0xbc(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0xc0(%rsp)
movl 0x134(%rsp), %eax
movl %eax, 0xf0(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0xf4(%rsp)
movq 0x128(%rsp), %rax
movq %rax, 0xf8(%rsp)
movl 0x124(%rsp), %eax
movl %eax, 0x100(%rsp)
movq 0x150(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x138(%rsp), %rdi
callq 0xa9d50
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jne 0x20ec06
movq 0x88(%rsp), %rax
movq %rax, 0xd8(%rsp)
jmp 0x20ec2b
movq 0x138(%rsp), %rdi
movq 0x150(%rsp), %rsi
addq $0x1, %rsi
callq 0xb0530
subq $0x1, %rax
movq %rax, 0xd8(%rsp)
movq 0x138(%rsp), %rdi
movq 0x118(%rsp), %rsi
callq 0xb0530
movq %rax, 0xe0(%rsp)
movq 0x138(%rsp), %rdi
callq 0xaf360
testb $0x1, %al
jne 0x20ec5e
jmp 0x20ed16
movq 0x138(%rsp), %rdi
movl $0x1, %esi
callq 0xaf650
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xaf770
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x47(%rsp)
jne 0x20ec9c
jmp 0x20ecb3
movq 0xa8(%rsp), %rax
cmpq 0xe0(%rsp), %rax
setb %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x20ecbd
jmp 0x20ecbf
jmp 0x20ec78
movq 0xe0(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0x88(%rsp), %rcx
movl 0x100(%rsp), %r8d
callq 0x211da0
movq %rax, 0xe8(%rsp)
jmp 0x20ed3e
movq $0x0, 0xc8(%rsp)
movq $0x0, 0xd0(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x138(%rsp), %rdi
callq 0xac6d0
testb $0x1, %al
jne 0x20ed51
jmp 0x20edcc
movq 0x138(%rsp), %rdi
callq 0xb2880
cmpq $0x0, %rax
jne 0x20edcc
movq 0x138(%rsp), %rdi
movl 0x124(%rsp), %esi
movl 0x130(%rsp), %edx
movl 0x130(%rsp), %ecx
movq 0xe0(%rsp), %r10
movq 0xd8(%rsp), %rax
xorl %r8d, %r8d
leaq 0x3105(%rip), %r9       # 0x211ea0
leaq 0xb0(%rsp), %r11
xorl %ebx, %ebx
movq %r11, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x2ddf00
jmp 0x20edd9
leaq 0xb0(%rsp), %rdi
callq 0x2121a0
movq 0x138(%rsp), %rdi
callq 0xaf360
testb $0x1, %al
jne 0x20edec
jmp 0x20edf9
movq 0xc8(%rsp), %rdi
callq 0xafc80
movq 0x108(%rsp), %rdi
callq 0x2122f0
testb $0x1, 0x117(%rsp)
je 0x20ee25
movq 0x178(%rsp), %rdi
movq 0x108(%rsp), %rsi
callq 0x2123e0
testb $0x1, 0x116(%rsp)
je 0x20ee8f
movq 0x178(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x108(%rsp), %rdi
callq 0x2124a0
movq 0x38(%rsp), %rdi
movq %rax, %rdx
movl 0x130(%rsp), %ecx
leaq 0x363496(%rip), %rsi    # 0x5722f5
movb $0x0, %al
callq 0x199f0
movq 0x98(%rsp), %rdi
movq 0x178(%rsp), %rdx
leaq 0x363d0f(%rip), %rsi    # 0x572b8c
callq 0x121520
movq 0x98(%rsp), %rdi
callq 0x1213f0
movq 0x108(%rsp), %rdi
callq 0x2124f0
movq 0x108(%rsp), %rdi
callq 0x212530
movq %rax, %rcx
movq 0x108(%rsp), %rax
movq %rcx, 0x20(%rax)
testb $0x1, 0x116(%rsp)
je 0x20ef22
movq 0x178(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x108(%rsp), %rdi
callq 0x2124a0
movq 0x30(%rsp), %rdi
movq %rax, %rdx
movl 0x130(%rsp), %ecx
leaq 0x363420(%rip), %rsi    # 0x572312
movb $0x0, %al
callq 0x199f0
movq 0x98(%rsp), %rdi
movq 0x178(%rsp), %rdx
leaq 0x363c7c(%rip), %rsi    # 0x572b8c
callq 0x121520
movq 0x98(%rsp), %rdi
callq 0x121f00
movq 0x108(%rsp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbx
retq
nopw %cs:(%rax,%rax)