// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/kmer_database.c
// Function: gt_kmer_database_new
GtKmerDatabase* gt_kmer_database_new(unsigned int alpabet_size,
                                     unsigned int kmer_size,
                                     GtUword sb_max_nu_kmers,
                                     GtEncseq *encseq)
{
  GtKmerDatabase *kdb = gt_malloc(sizeof (*kdb));
  gt_assert(encseq != NULL);
  gt_assert((GtUword) kmer_size < gt_encseq_total_length(encseq));
  kdb->nu_kmer_codes = gt_power_for_small_exponents(alpabet_size, kmer_size);
  kdb->offset = gt_calloc((size_t) (kdb->nu_kmer_codes + 1),
                         sizeof (*kdb->offset));
  kdb->seen_kmer_counts = gt_calloc((size_t) (kdb->nu_kmer_codes + 1),
                              sizeof (*kdb->seen_kmer_counts));
  kdb->deleted_positions = gt_bittab_new(kdb->nu_kmer_codes);
  kdb->positions = NULL;
  kdb->unique_ids = NULL;
  kdb->sb.max_nu_kmers = sb_max_nu_kmers;
  /* may need upper bound */
  kdb->initial_size = gt_encseq_total_length(encseq) / (GtUword) 100;
  if (kdb->initial_size < sb_max_nu_kmers)
    kdb->initial_size = sb_max_nu_kmers;

  kdb->seen_kmers = 0;
  kdb->current_size = 0;
  kdb->min_nu_occ = 0;
  kdb->min_code = kdb->nu_kmer_codes + 1;
  kdb->cutoff = 0;
  kdb->min_cutoff = 0;
  kdb->mean_fraction = 0;
  kdb->cutoff_is_set = false;
  kdb->mean_cutoff = false;
  kdb->prune_is_set = false;
  kdb->last_size = 0;
  kdb->sb.kmer_count = 0;
  kdb->sb.preprocessed_kmer_count = 0;
  kdb->sb.offset = 0;
  kdb->sb.kmer_size = kmer_size;
  kdb->sb.intervals_kmer_count = 0;
  kdb->sb.kmers = gt_malloc((size_t) sb_max_nu_kmers *
                            sizeof (*kdb->sb.kmers));
  kdb->sb.intervals = gt_malloc(sizeof (*kdb->sb.intervals));
  kdb->sb.ids = gt_malloc(sizeof (*kdb->sb.ids));
  GT_INITARRAY(kdb->sb.intervals, GtRange);
  GT_INITARRAY(kdb->sb.ids, GtUword);
  kdb->sb.es = gt_encseq_ref(encseq);
  kdb->sb.kmer_iter =
      gt_kmercodeiterator_encseq_new(kdb->sb.es, GT_READMODE_FORWARD,
                                     kdb->sb.kmer_size, 0);
  kdb->sb.printed = false;
  return kdb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movl %edi, %r12d
leaq 0x23148a(%rip), %rsi    # 0x3253f3
pushq $0x54
popq %rdx
movl $0xd8, %edi
callq 0x93160
testq %r14, %r14
je 0xf40ec
movq %rax, %rbx
movl %ebp, %r13d
movq %r14, %rdi
callq 0x7055e
cmpq %r13, %rax
jbe 0xf4116
movl %r12d, %edi
movl %ebp, %esi
callq 0x95871
movq %rax, 0x28(%rbx)
leaq 0x1(%rax), %rdi
leaq 0x231444(%rip), %r12    # 0x3253f3
pushq $0x8
popq %r13
pushq $0x59
popq %rcx
movq %r13, %rsi
movq %r12, %rdx
callq 0x9334a
movq %rax, (%rbx)
movq 0x28(%rbx), %rdi
incq %rdi
pushq $0x5b
popq %rcx
movq %r13, %rsi
movq %r12, %rdx
callq 0x9334a
movq %rax, 0x8(%rbx)
movq 0x28(%rbx), %rdi
callq 0x5e0b0
movq %rax, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movq %r15, 0xa8(%rbx)
movq %r14, %rdi
callq 0x7055e
pushq $0x64
popq %rcx
xorl %edx, %edx
divq %rcx
cmpq %r15, %rax
cmovbeq %r15, %rax
movq %rax, 0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movq 0x28(%rbx), %rax
incq %rax
movq %rax, 0x68(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
andq $0x0, 0x70(%rbx)
andl $0x0, 0x77(%rbx)
movups %xmm0, 0xb0(%rbx)
movups %xmm0, 0xc0(%rbx)
movl %ebp, 0xd0(%rbx)
shlq $0x4, %r15
pushq $0x76
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x93160
movq %rax, 0xa0(%rbx)
pushq $0x18
popq %r15
pushq $0x77
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x93160
movq %rax, 0x80(%rbx)
pushq $0x78
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x93160
movq %rax, 0x88(%rbx)
movq 0x80(%rbx), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x73cbe
movq %rax, 0x90(%rbx)
movl 0xd0(%rbx), %edx
movq %rax, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x19f20f
movq %rax, 0x98(%rbx)
movb $0x0, 0xd4(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x343e75(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f0f16(%rip), %rsi    # 0x2e5013
leaq 0x24c1ae(%rip), %rdx    # 0x3402b2
leaq 0x231305(%rip), %rcx    # 0x325410
leaq 0x2312e1(%rip), %r8     # 0x3253f3
pushq $0x55
jmp 0xf413e
movq 0x343e4b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1f0eec(%rip), %rsi    # 0x2e5013
leaq 0x2312f7(%rip), %rdx    # 0x325425
leaq 0x2312db(%rip), %rcx    # 0x325410
leaq 0x2312b7(%rip), %r8     # 0x3253f3
pushq $0x56
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390