// File: /workspace/github_cpp_makefile_star2_O1/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 0x7e7a
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 0x7e5f
cmpl $0x2, %ecx
jb 0x7ed1
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 0x7ec8
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 0x7e8c
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 0x7f21
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x7f2c
movq %r14, %rdi
movq %r15, %rdx
callq 0xc466
decl %r12d
jne 0x7efd
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %r15
cmpq %r15, %r14
je 0x7fdb
movl 0x2c(%rsp), %edi
callq 0x83db
movq %rax, %r12
cmpl $0x0, (%r14)
jle 0x7f8b
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 0x7f6c
movq (%r12), %rax
movq %r12, %rdi
callq *0x20(%rax)
movsd %xmm0, 0x50(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x7fb6
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x7fc5
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0xc5a2
movl $0x8, %esi
movq %r12, %rdi
callq 0x21c0
addq $0x4, %r14
jmp 0x7f4c
xorl %r15d, %r15d
movq 0xbfdb(%rip), %rbx      # 0x13fc0
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 0x7fe5
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8042
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8059
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 0x808d
jmp 0x8073
jmp 0x8073
jmp 0x8073
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x808d
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x80a4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x22e0