// File: /workspace/github_cpp_makefile_star2_O3/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 0xd5b6
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 0xd728
movq %rbx, %rdi
movq %r15, %rsi
callq 0x54b0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xaad0
callq 0x53d0
cmpb $0x1, (%r12)
je 0xab68
incl %ebp
cmpl 0xdc(%r14), %ebp
jl 0xaa99
movb $0x0, (%r12)
leaq 0x2e8e6(%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 0x1e4d6(%rip), %xmm0    # 0x29004
addss 0x188(%r14), %xmm0
movss %xmm0, 0x188(%r14)
movq 0x30(%rsp), %r14
leaq 0x10(%r14), %rax
movq %rax, (%r14)
leaq 0x1e906(%rip), %rdx     # 0x29459
movq %r14, %rdi
movq %rdx, %rsi
leaq 0x18(%rsp), %rbx
callq 0xf95c
jmp 0xac08
incl 0x1e0(%r14)
leaq 0x2e862(%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 0x1e459(%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 0xabe6
movq %rcx, (%r14)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%r14)
jmp 0xabec
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 0xac1b
callq 0x53d0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xac2a
callq 0x53d0
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xac43
movq %rax, %rbx
jmp 0xac59
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xac59
callq 0x53d0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xac6d
callq 0x53d0
movq %rbx, %rdi
callq 0x56b0
nop