// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::Get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool*)
string db::Get( string key, bool * result )
{
	std::chrono::time_point<std::chrono::high_resolution_clock>  total_end;
	std::chrono::time_point<std::chrono::high_resolution_clock>  total_start = high_resolution_clock::now();

	string value;
	BFHash bfHash(key);
	//for ( int i=0 ; i<num_levels ; i++ ){
	int i = 0;

	while(true){

		value = GetLevel( i, bfHash, key, result );
		if ( *result == true ){
			num_lookups++;
			BFHash::reset = true;
 			total_end = high_resolution_clock::now();
			total_duration += duration_cast<microseconds>(total_end - total_start);
			return value;
		}
		i++;
		if(i >= num_levels){
			break;
		}

	}
	*result = false;
	BFHash::reset = true;

	num_lookups++;
 	total_end = high_resolution_clock::now();
	total_duration += duration_cast<microseconds>(total_end - total_start);
	
	return "";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, 0x30(%rsp)
callq 0x5080
movq %rax, 0x28(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0xd6da
xorl %ebp, %ebp
leaq 0x58(%rsp), %r15
leaq 0x8(%rsp), %rbx
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
leaq 0x38(%rsp), %rcx
movq %r13, %r8
movq %r12, %r9
callq 0xd84c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x54b0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xabaa
callq 0x53d0
cmpb $0x1, (%r12)
je 0xac42
incl %ebp
cmpl 0xdc(%r14), %ebp
jl 0xab73
movb $0x0, (%r12)
leaq 0x2e80c(%rip), %rax     # 0x393d8
movb $0x1, (%rax)
incl 0x1e0(%r14)
callq 0x5080
subq 0x28(%rsp), %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
cvtsi2ss %rdx, %xmm0
divss 0x1e3fc(%rip), %xmm0    # 0x29004
addss 0x188(%r14), %xmm0
movss %xmm0, 0x188(%r14)
movq 0x30(%rsp), %r14
leaq 0x10(%r14), %rax
movq %rax, (%r14)
leaq 0x1e82c(%rip), %rdx     # 0x29459
movq %r14, %rdi
movq %rdx, %rsi
leaq 0x18(%rsp), %rbx
callq 0xfa70
jmp 0xace2
incl 0x1e0(%r14)
leaq 0x2e788(%rip), %rax     # 0x393d8
movb $0x1, (%rax)
callq 0x5080
subq 0x28(%rsp), %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
cvtsi2ss %rdx, %xmm0
divss 0x1e37f(%rip), %xmm0    # 0x29004
addss 0x188(%r14), %xmm0
movss %xmm0, 0x188(%r14)
movq 0x30(%rsp), %r14
leaq 0x10(%r14), %rax
movq %rax, (%r14)
movq 0x8(%rsp), %rcx
leaq 0x18(%rsp), %rbx
cmpq %rbx, %rcx
je 0xacc0
movq %rcx, (%r14)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%r14)
jmp 0xacc6
movups (%rbx), %xmm0
movups %xmm0, (%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%r14)
movq %rbx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xacf5
callq 0x53d0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xad04
callq 0x53d0
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xad1d
movq %rax, %rbx
jmp 0xad33
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xad33
callq 0x53d0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xad47
callq 0x53d0
movq %rbx, %rdi
callq 0x56b0
nop