// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/kmer_database.c
// Function: gt_kmer_database_preprocess_buffer
static void gt_kmer_database_preprocess_buffer(GtKmerDatabase *kdb)
{
  GtUword current_kmer_count,
          current_kmer_code,
          i = 0,
          size_sb,
          kmercode;
  GT_UNUSED GtUword startpos;

  gt_assert(kdb != NULL);

  size_sb = kdb->sb.kmer_count;
  kdb->sb.preprocessed_kmer_count = size_sb;

  if (size_sb > 0) {
    while (i < size_sb) {
      gt_kmer_database_decode_kmer(kdb->sb.kmers[i].a, kmercode, startpos);
      current_kmer_code = kmercode;
      current_kmer_count = 0;
      while (i < size_sb && current_kmer_code == kmercode) {
        current_kmer_count++;
        i++;
        if (i < size_sb)
          gt_kmer_database_decode_kmer(kdb->sb.kmers[i].a, kmercode, startpos);
      }
      if (kdb->seen_kmer_counts[current_kmer_code] == 0)
        kdb->seen_kmers++;
      kdb->seen_kmer_counts[current_kmer_code] += current_kmer_count;
      kdb->seen_kmer_counts[kdb->nu_kmer_codes] += current_kmer_count;
      if (kdb->cutoff_is_set &&
          gt_bittab_bit_is_set(kdb->deleted_positions, current_kmer_code)) {
        if (kdb->mean_cutoff && kdb->seen_kmer_counts[current_kmer_code] <
            kdb->cutoff / GT_KMER_DATABASE_RESTORE_BUFFFER)
          gt_bittab_unset_bit(kdb->deleted_positions, current_kmer_code);
        else
          kdb->sb.preprocessed_kmer_count -= current_kmer_count;
      }
    }
  }
  if (kdb->mean_cutoff) {
    kdb->cutoff = (gt_kmer_database_get_mean_nu_of_occ(kdb) /
                   kdb->mean_fraction) * GT_KMER_DATABASE_DELETE_BUFFFER;
    if (kdb->cutoff < kdb->min_cutoff)
      kdb->cutoff = kdb->min_cutoff;
    else if (kdb->cutoff < gt_kmer_database_get_min_nu_of_occ(kdb))
      kdb->cutoff = gt_kmer_database_get_min_nu_of_occ(kdb);
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x19b702
movq 0x4a08cf(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x37a938(%rip), %rsi    # 0x516013
leaq 0x3bc0c0(%rip), %rdx    # 0x5577a2
leaq 0x3bca7d(%rip), %rcx    # 0x558166
leaq 0x3bc04b(%rip), %r8     # 0x55773b
movl $0xb8, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x19b704
movq 0x40(%rsp), %rax
movq 0xb0(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0xb8(%rax)
cmpq $0x0, 0x20(%rsp)
jbe 0x19b938
jmp 0x19b734
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
jae 0x19b936
movq 0x40(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0xa0(%rax), %rcx
movq 0x28(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x28(%rsp), %rcx
xorl %eax, %eax
cmpq 0x20(%rsp), %rcx
movb %al, 0xf(%rsp)
jae 0x19b7c8
movq 0x30(%rsp), %rax
cmpq 0x18(%rsp), %rax
sete %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x19b7d2
jmp 0x19b84d
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
jae 0x19b848
movq 0x40(%rsp), %rax
movq 0xa0(%rax), %rax
movq 0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0xa0(%rax), %rcx
movq 0x28(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movq %rax, 0x10(%rsp)
jmp 0x19b7a5
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x19b873
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x40(%rax)
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rsp), %rcx
movq 0x28(%rcx), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x40(%rsp), %rax
testb $0x1, 0x78(%rax)
je 0x19b931
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x30(%rsp), %rsi
callq 0x8a780
testb $0x1, %al
jne 0x19b8d1
jmp 0x19b931
movq 0x40(%rsp), %rax
testb $0x1, 0x79(%rax)
je 0x19b914
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x40(%rsp), %rcx
movq 0x48(%rcx), %rcx
shrq %rcx
cmpq %rcx, %rax
jae 0x19b914
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x30(%rsp), %rsi
callq 0x89ba0
jmp 0x19b92f
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rax
movq 0xb8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0xb8(%rax)
jmp 0x19b931
jmp 0x19b734
jmp 0x19b938
movq 0x40(%rsp), %rax
testb $0x1, 0x79(%rax)
je 0x19b9d1
movq 0x40(%rsp), %rdi
callq 0x199ad0
movq 0x40(%rsp), %rcx
xorl %edx, %edx
divq 0x58(%rcx)
movq %rax, %rcx
shlq $0x0, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x40(%rsp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x19b994
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x48(%rax)
jmp 0x19b9cf
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rdi
callq 0x199bc0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x19b9cd
movq 0x40(%rsp), %rdi
callq 0x199bc0
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x48(%rax)
jmp 0x19b9cf
jmp 0x19b9d1
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)