// File: /workspace/github_cpp_makefile_star2_O2/ChnMasterOG[P]KmerGO2/kmc_api/kmc_file.cpp
// Function: CKMCFile::KmerCount()
uint64 CKMCFile::KmerCount(void)
{
	if(is_opened)
		if((min_count == original_min_count) && (max_count == original_max_count))
			return total_kmers;
		else
		{
			uint32 count;
			uint32 int_counter;
			uint64 aux_kmerCount = 0;

			if(is_opened == opened_for_RA)
			{
				uchar *ptr = sufix_file_buf;
				
				for(uint64 i = 0; i < total_kmers; i++)		
				{
					ptr += sufix_size;
					int_counter = *ptr;
					ptr++;

					for(uint32 b = 1; b < counter_size; b ++)
					{
						uint32 aux = 0x000000ff & *(ptr);
						aux = aux << 8 * ( b);
						int_counter = aux | int_counter;
						ptr++;
					}
					
					if(mode == 0)
						count = int_counter;
					else
						memcpy(&count, &int_counter, counter_size);
	
					if((count >= min_count) && (count <= max_count))
						aux_kmerCount++;
				}
			}
			else //opened_for_listing
			{
				CKmerAPI kmer(kmer_length);
				float count;
				RestartListing();
				for(uint64 i = 0; i < total_kmers; i++)		
				{
					ReadNextKmer(kmer, count);
					if((count >= min_count) && (count <= max_count))
						aux_kmerCount++;
				}
				RestartListing();
			}
			return aux_kmerCount;
		}
	else
		return 0 ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl (%rdi), %eax
testl %eax, %eax
je 0x41110b
movq %rdi, %r14
movl 0x8c(%rdi), %ecx
movl %ecx, 0x18(%rsp)
cmpl 0xb0(%rdi), %ecx
jne 0x41104d
movq 0x90(%r14), %rcx
cmpq 0xb8(%r14), %rcx
jne 0x41104d
movq 0x98(%r14), %rbx
jmp 0x4111ac
cmpl $0x1, %eax
jne 0x411112
movq 0x60(%r14), %r13
movq 0x98(%r14), %rax
movq %rax, 0x28(%rsp)
movl 0xa8(%r14), %ebp
movl 0x80(%r14), %r15d
movl 0x7c(%r14), %eax
movl %eax, 0x14(%rsp)
movq 0x90(%r14), %rax
movq %rax, 0x20(%rsp)
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq 0x28(%rsp), %r12
je 0x4111ac
movzbl (%r13,%rbp), %eax
addq %rbp, %r13
movl %eax, 0xc(%rsp)
pushq $0x8
popq %rcx
pushq $0x1
popq %r14
cmpl %r15d, %r14d
jae 0x4110c7
movzbl (%r13,%r14), %edx
shll %cl, %edx
orl %edx, %eax
movl %eax, 0xc(%rsp)
incq %r14
addl $0x8, %ecx
jmp 0x4110ac
cmpl $0x0, 0x14(%rsp)
je 0x4110e6
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
movq %r15, %rdx
callq 0x401080
movl 0x10(%rsp), %eax
jmp 0x4110ea
movl %eax, 0x10(%rsp)
addq %r14, %r13
cmpl 0x18(%rsp), %eax
setae %cl
movl %eax, %eax
cmpq %rax, 0x20(%rsp)
setae %al
andb %cl, %al
movzbl %al, %eax
addq %rax, %rbx
incq %r12
jmp 0x41108d
xorl %ebx, %ebx
jmp 0x4111ac
movl 0x78(%r14), %esi
leaq 0x30(%rsp), %rdi
callq 0x407f72
movq %r14, %rdi
callq 0x410ef0
xorl %ebx, %ebx
leaq 0x30(%rsp), %r15
leaq 0x1c(%rsp), %r12
xorl %r13d, %r13d
cmpq 0x98(%r14), %r13
jae 0x41119a
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4109aa
movl 0x8c(%r14), %eax
cvtsi2ss %rax, %xmm1
movss 0x1c(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x411195
movq 0x90(%r14), %rax
testq %rax, %rax
js 0x411178
cvtsi2ss %rax, %xmm1
jmp 0x41118d
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jb 0x411195
incq %rbx
incq %r13
jmp 0x411137
movq %r14, %rdi
callq 0x410ef0
leaq 0x30(%rsp), %rdi
callq 0x40825c
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4111c0
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x40825c
movq %rbx, %rdi
callq 0x4b8e10
nop