// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::GetFromData(int, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool*)
inline string db::GetFromData( int i, int bf_no, int index_pos, string key, bool * result )
{
	vector <string> data_block;
	vector <string> filter;
	string sst_data_filename = data_dir + "level_" + to_string(i) + "-sst_" + to_string(bf_no) + ".txt";

	
	//auto data_start = high_resolution_clock::now();
	read_data( sst_data_filename, index_pos, key.size(), data_block );
	//auto data_end = high_resolution_clock::now();
	//data_duration += duration_cast<microseconds>(data_end - data_start);	
	int found = -1;
	for ( int k=0 ; k<data_block.size() ; k++){
		string data_entry = data_block[k].substr( 0, key.size() );
		if(data_entry.compare(key) == 0){
			found = k;
		}
	}
	if ( found == -1 ){
		*result = false;
		return "";
	}
	else {
		*result = true;
		return key; 
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %r9, %r14
movl %r8d, %ebp
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
addq $0x60, %rsi
leaq 0x15ad7(%rip), %rdx     # 0x22387
leaq 0xb8(%rsp), %rdi
callq 0xb278
leaq 0x98(%rsp), %rdi
movl %r13d, %esi
callq 0xb620
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0xb5b9
leaq 0x15a9d(%rip), %rdx     # 0x2238e
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xb514
leaq 0x78(%rsp), %rdi
movl %r12d, %esi
callq 0xb620
leaq 0x20(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0xb5b9
leaq 0x163bc(%rip), %rdx     # 0x22ced
leaq 0x118(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xb514
leaq 0x20(%rsp), %rdi
callq 0x61f0
leaq 0x78(%rsp), %rdi
callq 0x61f0
leaq 0xf8(%rsp), %rdi
callq 0x61f0
leaq 0xd8(%rsp), %rdi
callq 0x61f0
leaq 0x98(%rsp), %rdi
callq 0x61f0
leaq 0xb8(%rsp), %rdi
callq 0x61f0
leaq 0x58(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x6570
movl 0x8(%r14), %ecx
leaq 0x58(%rsp), %rsi
movq %rsp, %r8
movq %r15, %rdi
movl %ebp, %edx
callq 0xcca2
leaq 0x58(%rsp), %rdi
callq 0x61f0
pushq $-0x1
popq %rbp
xorl %r13d, %r13d
leaq 0x20(%rsp), %r15
xorl %r12d, %r12d
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0xca13
addq %r13, %rsi
movq 0x8(%r14), %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x6440
movq %r15, %rdi
movq %r14, %rsi
callq 0x6040
testl %eax, %eax
cmovel %r12d, %ebp
movq %r15, %rdi
callq 0x61f0
incq %r12
addq $0x20, %r13
jmp 0xc9cb
movq 0x170(%rsp), %rax
cmpl $-0x1, %ebp
je 0xca30
movb $0x1, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6500
jmp 0xca47
movb $0x0, (%rax)
leaq 0x1599f(%rip), %rsi     # 0x223d9
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x61b0
leaq 0x118(%rsp), %rdi
callq 0x61f0
leaq 0x40(%rsp), %rdi
callq 0x739e
movq %rsp, %rdi
callq 0x739e
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcb01
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0xcafa
jmp 0xcb01
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x61f0
jmp 0xca9e
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x61f0
jmp 0xcaad
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x61f0
jmp 0xcabf
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x61f0
jmp 0xcad1
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x61f0
leaq 0xb8(%rsp), %rdi
jmp 0xcb0c
movq %rax, %rbx
jmp 0xcade
movq %rax, %rbx
jmp 0xcb11
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x61f0
jmp 0xcb04
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x61f0
leaq 0x40(%rsp), %rdi
callq 0x739e
movq %rsp, %rdi
callq 0x739e
movq %rbx, %rdi
callq 0x66b0
nop