// File: /workspace/github_cpp_makefile_star2_O3/chahk0129[P]hash_bench/./bench/benchmark.hpp
// Function: benchmark_t<unsigned long>::utilization(int, Pair<unsigned long>*, int)
inline void benchmark_t<Key_t>::utilization(int index_type, Pair<Key_t>* init_kv, int init_num){
    gen_input(init_kv, init_num);
    std::random_shuffle(init_kv, init_kv+init_num);
    std::vector<int> num_records;
    int base = 0;
    int num_iter = 100;
    for(int i=0; i<num_iter; i++){
	base += 1000;
	num_records.push_back(base);
    }

    std::vector<double> utils;
    for(auto& it: num_records){
	Hash<Key_t>* hashtable = getInstance<Key_t>(index_type);
	for(int i=0; i<it; i++){
	    hashtable->Insert(init_kv[i].key, init_kv[i].value);
	}
	double util = hashtable->Utilization();
	utils.push_back(util);
	delete hashtable;
    }

    for(int i=0; i<num_iter; i++)
	std::cout << utils[i] << std::endl;
	//std::cout << "num( " << num_records[i] << " ), util( " << utils[i] << " %)" << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movl %esi, 0x2c(%rsp)
testl %ecx, %ecx
jle 0x8d08
movl %ecx, %eax
leaq 0x8(%rbx), %rdx
negq %rax
movl $0x1, %esi
movq %rsi, -0x8(%rdx)
movq %rsi, (%rdx)
addq $0x10, %rdx
leaq (%rax,%rsi), %rdi
incq %rdi
incq %rsi
cmpq $0x1, %rdi
jne 0x8ced
cmpl $0x2, %ecx
jb 0x8d5f
movslq %ecx, %r14
shlq $0x4, %r14
movl $0x10, %r15d
callq 0x2060
cltq
movq %r15, %rcx
sarq $0x4, %rcx
incq %rcx
cqto
idivq %rcx
shlq $0x4, %rdx
cmpq %rdx, %r15
je 0x8d56
leaq (%rbx,%r15), %rax
addq %rbx, %rdx
movups (%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rdx)
addq $0x10, %r15
cmpq %r15, %r14
jne 0x8d1a
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
leaq 0xc(%rsp), %r15
movl $0x0, (%r15)
movl $0x64, %r12d
movl $0x3e8, %r13d           # imm = 0x3E8
movl 0xc(%rsp), %eax
addl %r13d, %eax
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x8daf
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x8dba
movq %r14, %rdi
movq %r15, %rdx
callq 0xd21e
decl %r12d
jne 0x8d8b
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r15
cmpq %r15, %r14
je 0x8e69
movl 0x2c(%rsp), %edi
callq 0x9267
movq %rax, %r12
cmpl $0x0, (%r14)
jle 0x8e19
movq %rbx, %r13
xorl %ebp, %ebp
movq 0x8(%r13), %rdx
movq (%r12), %rax
movq %r12, %rdi
movq %r13, %rsi
callq *(%rax)
incq %rbp
movslq (%r14), %rax
addq $0x10, %r13
cmpq %rax, %rbp
jl 0x8dfa
movq (%r12), %rax
movq %r12, %rdi
callq *0x20(%rax)
movsd %xmm0, 0x50(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x8e44
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x8e53
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0xd35a
movl $0x8, %esi
movq %r12, %rdi
callq 0x21c0
addq $0x4, %r14
jmp 0x8dda
xorl %r15d, %r15d
movq 0xc14d(%rip), %rbx      # 0x14fc0
movq 0x30(%rsp), %rax
movsd (%rax,%r15,8), %xmm0
movq %rbx, %rdi
callq 0x2280
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
incq %r15
cmpq $0x64, %r15
jne 0x8e73
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8ed0
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8ee7
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x8f1b
jmp 0x8f01
jmp 0x8f01
jmp 0x8f01
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8f1b
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8f32
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x22e0