// File: /workspace/github_cpp_makefile_star2_O2/chahk0129[P]hash_bench/./index/extendible_hash.h
// Function: ExtendibleHash<char [32]>::Utilization()
double ExtendibleHash<Key_t>::Utilization(void){
    size_t sum = 0;
    size_t cnt = 0;
    for(size_t i=0; i<dir->capacity; cnt++){
	auto target = dir->_[i];
	auto stride = pow(2, dir->depth - target->local_depth);
	auto pattern = (i >> (dir->depth - target->local_depth));
	for(unsigned j=0; j<Segment<Key_t>::kNumSlot; ++j){
	    size_t key_hash;
	    if constexpr(sizeof(Key_t) > 8){
		key_hash = hash_funcs[0](target->_[j].key, sizeof(Key_t) ,f_seed);
		if(((key_hash >> (8*sizeof(size_t) - target->local_depth)) == pattern) && (memcmp(target->_[j].key, INVALID<Key_t>, sizeof(Key_t)) != 0)){
		    sum++;
		}
	    }
	    else{
		key_hash = hash_funcs[0](&target->_[j].key, sizeof(Key_t), f_seed);
		if(((key_hash >> (8*sizeof(key_hash)-target->local_depth)) == pattern) && (memcmp(&target->_[j].key, &INVALID<Key_t>, sizeof(Key_t)) != 0)){
		    sum++;
		}
	    }
	}
	i += stride;
    }
    return ((double)sum) / ((double)cnt * Segment<Key_t>::kNumSlot)*100.0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r15
xorl %r13d, %r13d
movq 0x40ba(%rip), %xmm3     # 0xc010
movapd 0x40c2(%rip), %xmm2     # 0xc020
pushq $0x20
popq %r14
xorl %ecx, %ecx
xorl %ebp, %ebp
movq %rdi, 0x8(%rsp)
movq 0x8(%r15), %rax
cmpq 0x10(%rax), %r13
jae 0x807e
movq %rcx, 0x18(%rsp)
movq (%rax), %rcx
movq 0x18(%rax), %rax
movq (%rcx,%r13,8), %rbx
subq 0xa000(%rbx), %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x2190
movapd %xmm0, 0x20(%rsp)
movq 0x8(%r15), %rax
movl 0x18(%rax), %ecx
subl 0xa000(%rbx), %ecx
movq %r13, 0x10(%rsp)
shrq %cl, %r13
xorl %r15d, %r15d
cmpq $0xa000, %r15           # imm = 0xA000
je 0x801a
leaq (%rbx,%r15), %r12
movl $0xc70697, %edx         # imm = 0xC70697
movq %r12, %rdi
movq %r14, %rsi
callq 0x2040
movb 0xa000(%rbx), %dl
xorl %ecx, %ecx
subb %dl, %cl
shrq %cl, %rax
cmpq %r13, %rax
jne 0x8014
movq %r12, %rdi
leaq 0xc2db(%rip), %rsi      # 0x142e0
movq %r14, %rdx
callq 0x2200
cmpl $0x1, %eax
sbbq $-0x1, %rbp
addq $0x28, %r15
jmp 0x7fcc
movsd 0x10(%rsp), %xmm0
movsd 0x3fe8(%rip), %xmm3     # 0xc010
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x3fed(%rip), %xmm2     # 0xc020
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x4013(%rip), %xmm0     # 0xc070
cvttsd2si %xmm0, %r13
sarq $0x3f, %rcx
andq %rcx, %r13
orq %rax, %r13
movq 0x18(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %r15
jmp 0x7f6b
movq %rbp, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x3f91(%rip), %xmm2     # 0xc020
subpd %xmm2, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rcx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x3fb8(%rip), %xmm2     # 0xc078
divsd %xmm2, %xmm0
mulsd 0x3fb4(%rip), %xmm0     # 0xc080
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop