// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movl %esi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl $0xd8, %edi
leaq 0x3bfd79(%rip), %rsi    # 0x55773b
movl $0x54, %edx
callq 0xe80f0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x197a11
movq 0x4a45c0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37e629(%rip), %rsi    # 0x516013
leaq 0x3da9f1(%rip), %rdx    # 0x5723e2
leaq 0x3bfd60(%rip), %rcx    # 0x557758
leaq 0x3bfd3c(%rip), %r8     # 0x55773b
movl $0x55, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x197a13
jmp 0x197a15
movl 0x20(%rsp), %eax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
callq 0xa9d00
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jb 0x197a6b
movq 0x4a4566(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37e5cf(%rip), %rsi    # 0x516013
leaq 0x3bfd22(%rip), %rdx    # 0x55776d
leaq 0x3bfd06(%rip), %rcx    # 0x557758
leaq 0x3bfce2(%rip), %r8     # 0x55773b
movl $0x56, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x197a6d
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
callq 0xec720
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
addq $0x1, %rdi
movl $0x8, %esi
leaq 0x3bfc9c(%rip), %rdx    # 0x55773b
movl $0x59, %ecx
callq 0xe83c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
addq $0x1, %rdi
movl $0x8, %esi
leaq 0x3bfc6e(%rip), %rdx    # 0x55773b
movl $0x5b, %ecx
callq 0xe83c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x89a20
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x18(%rax)
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0xa8(%rax)
movq 0x10(%rsp), %rdi
callq 0xa9d00
movl $0x64, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
cmpq 0x18(%rsp), %rax
jae 0x197b66
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x38(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x60(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x68(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x48(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x58(%rax)
movq 0x8(%rsp), %rax
movb $0x0, 0x78(%rax)
movq 0x8(%rsp), %rax
movb $0x0, 0x79(%rax)
movq 0x8(%rsp), %rax
movb $0x0, 0x7a(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0xb0(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0xb8(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0xc0(%rax)
movl 0x20(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0xd0(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0xc8(%rax)
movq 0x18(%rsp), %rdi
shlq $0x4, %rdi
leaq 0x3bfaea(%rip), %rsi    # 0x55773b
movl $0x76, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0xa0(%rax)
movl $0x18, %edi
leaq 0x3bfac5(%rip), %rsi    # 0x55773b
movl $0x77, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x80(%rax)
movl $0x18, %edi
leaq 0x3bfaa0(%rip), %rsi    # 0x55773b
movl $0x78, %edx
callq 0xe80f0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x88(%rax)
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rax
movq $0x0, (%rax)
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rax
movq $0x0, 0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rax
movq $0x0, 0x8(%rax)
jmp 0x197cf1
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rax
movq $0x0, (%rax)
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rax
movq $0x0, 0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x88(%rax), %rax
movq $0x0, 0x8(%rax)
movq 0x10(%rsp), %rdi
callq 0xaebc0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x90(%rax)
movq 0x8(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x8(%rsp), %rax
movl 0xd0(%rax), %edx
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x2ca880
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x98(%rax)
movq 0x8(%rsp), %rax
movb $0x0, 0xd4(%rax)
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax)