LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Define.cpp
// Function: replace_first_occurrence(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string replace_first_occurrence (string& s, const string& toReplace, const string& replaceWith){
    size_t pos = s.find(toReplace);
	
    if (pos == string::npos)
		return s;
    return s.replace(pos, toReplace.length(), replaceWith);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
xorl %edx, %edx
callq 0x2370
cmpq $-0x1, %rax
je 0x778f
movq 0x8(%r12), %rdx
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rcx
callq 0x20d0
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2260
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Define.cpp
// Function: findchar_exact(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
bool findchar_exact (string in1 , vector<string> chars){
	for (auto i: chars)
		if (in1 == i)
			return false;
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %r12
movq %rsp, %r14
movq %rax, %r15
cmpq %r12, %rax
je 0x77f3
movq %r14, %rdi
movq %r15, %rsi
callq 0x2260
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6db4
movl %eax, %ebp
movq %r14, %rdi
callq 0x2110
leaq 0x20(%r15), %rax
testb %bpl, %bpl
je 0x77c2
cmpq %r12, %r15
sete %al
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Define.cpp
// Function: find_in_vector(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int find_in_vector(vector<string> vect, string str){
	for (unsigned i=0; i<vect.size(); ++i){
		if (string_finder(vect[i], str))
			return i;
	}	
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %r15
xorl %ebx, %ebx
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %r13
movl %ebx, %eax
movq (%r15), %rsi
movq 0x8(%r15), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
jbe 0x78fd
shlq $0x5, %rax
addq %rax, %rsi
movq %r12, %rdi
callq 0x2260
movq %r13, %rdi
movq %r14, %rsi
callq 0x2260
movq %r12, %rdi
movq %r13, %rsi
callq 0x7630
movl %eax, %ebp
movq %r13, %rdi
callq 0x2110
movq %r12, %rdi
callq 0x2110
testb %bpl, %bpl
jne 0x7902
incl %ebx
jmp 0x78a8
pushq $-0x1
popq %rax
jmp 0x7904
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Define.cpp
// Function: remove_element_vector(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void remove_element_vector(vector<string>& vect, string str){
	auto itt = vect.begin();
	
	while (itt!=vect.end()){
		if (*itt==str)
			vect.erase (itt);
		else
			++itt;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r15
cmpq 0x8(%r14), %r15
je 0x795e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6db4
testb %al, %al
je 0x7958
movq %r14, %rdi
movq %r15, %rsi
callq 0x7ff2
jmp 0x7936
addq $0x20, %r15
jmp 0x7936
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Define.cpp
// Function: set_NT_vector(std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
void set_NT_vector (vector<NT>& vect, NT Var){
	for (int i=0; i< vect.size(); ++i){
		if ((vect[i].first == Var.first) && (vect[i].second == Var.second))
			return;
	}
	vect.push_back(Var);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsi), %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
sarq $0x6, %rax
cmpq %r13, %rax
jbe 0x79bf
addq %r12, %rdi
movq %rbx, %rsi
callq 0x6db4
testb %al, %al
je 0x79b6
movq (%r14), %rax
leaq (%rax,%r12), %rdi
addq $0x20, %rdi
movq %r15, %rsi
callq 0x6db4
testb %al, %al
jne 0x79d3
incq %r13
addq $0x40, %r12
jmp 0x797d
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7ff8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Define.cpp
// Function: make_string(std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>)
string make_string (vector<NT> vect){
	string temp = "\tLocal variables ------->\n";
	for (auto i: vect){
		if (!i.first.empty()){
			temp = temp +"\tName: "+i.first+"\tType: "+i.second+"\n";
		}
	}
	if (temp == "\tLocal variables ------->\n")
		return "\tNo Local Variable!\n";
	else
		return temp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movq %rdi, (%rsp)
leaq 0x2879(%rip), %rsi      # 0xa4ad
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %r15
movq %r15, %rdx
callq 0x31b8
movq (%rbx), %r12
movq 0x8(%rbx), %r13
leaq 0xe8(%rsp), %rbx
cmpq %r13, %r12
je 0x7d37
movq %r15, %rdi
movq %r12, %rsi
callq 0x6d24
cmpq $0x0, 0x90(%rsp)
je 0x7d26
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x2839(%rip), %rdx      # 0xa4c8
callq 0x6ddd
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x6cc2
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
leaq 0x2817(%rip), %rdx      # 0xa4d0
callq 0x6ce1
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
leaq 0xa8(%rsp), %rdx
callq 0x6cc2
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x2805(%rip), %rdx      # 0xa4eb
callq 0x6ce1
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2110
movq %r14, %rdi
callq 0x2110
leaq 0x68(%rsp), %rdi
callq 0x2110
leaq 0x48(%rsp), %rdi
callq 0x2110
leaq 0x28(%rsp), %rdi
callq 0x2110
movq %r15, %rdi
callq 0x334e
addq $0x40, %r12
jmp 0x7c58
leaq 0x276f(%rip), %rsi      # 0xa4ad
leaq 0x8(%rsp), %rdi
callq 0x6c26
testb %al, %al
je 0x7d6a
leaq 0x2785(%rip), %rsi      # 0xa4d8
leaq 0x88(%rsp), %rdx
movq (%rsp), %rdi
callq 0x31b8
movq (%rsp), %rbx
jmp 0x7db0
movq (%rsp), %rbx
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x7d91
movq %rdx, (%rbx)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x7d97
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x2110
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7e22
movq %rax, %rbx
jmp 0x7e13
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x2110
jmp 0x7df5
movq %rax, %rbx
jmp 0x7e09
movq %rax, %rbx
jmp 0x7dff
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2110
leaq 0x48(%rsp), %rdi
callq 0x2110
leaq 0x28(%rsp), %rdi
callq 0x2110
leaq 0x88(%rsp), %rdi
callq 0x334e
jmp 0x7e25
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Component.cpp
// Function: Component::set_var(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
void Component::set_var (NT Var){
	for (int i=0; i< var_st.size(); ++i){
		if ((var_st[i].first == Var.first) && (var_st[i].second == Var.second))
			return;
	}
	var_st.push_back(Var);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x38(%rdi), %r14
leaq 0x20(%rsi), %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x38(%r15), %rdi
movq 0x40(%r15), %rax
subq %rdi, %rax
sarq $0x6, %rax
cmpq %rbp, %rax
jbe 0x8569
addq %r13, %rdi
movq %rbx, %rsi
callq 0x6db4
testb %al, %al
je 0x8560
movq (%r14), %rax
leaq (%rax,%r13), %rdi
addq $0x20, %rdi
movq %r12, %rsi
callq 0x6db4
testb %al, %al
jne 0x8582
incq %rbp
addq $0x40, %r13
jmp 0x8526
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7ff8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/mehrangoli[P]Static-Data-Extractor/Component.cpp
// Function: Component::get_name_XML[abi:cxx11]()
string Component::get_name_XML (){
	string temp;
	if (name == "sc_main")
		temp = "<Global_function name = \"" + name + "\">";
	else
		temp = "<Module name = \"" + name + "\">";
	return temp;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
addq $0x50, %r14
leaq 0x1d33(%rip), %rsi      # 0xa309
movq %r14, %rdi
callq 0x6c26
testb %al, %al
je 0x860e
leaq 0x1f41(%rip), %rsi      # 0xa52a
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x9161
leaq 0x1f47(%rip), %rdx      # 0xa544
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6ce1
jmp 0x8638
leaq 0x1f32(%rip), %rsi      # 0xa547
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x9161
leaq 0x1f1b(%rip), %rdx      # 0xa544
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6ce1
leaq 0x28(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2210
movq %r14, %rdi
callq 0x2110
leaq 0x8(%rsp), %rdi
callq 0x2110
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
jmp 0x8667
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2110
jmp 0x867b
jmp 0x8678
movq %rax, %r14
movq %rbx, %rdi
callq 0x2110
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/lsm-emulation.cpp
// Function: loadfile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*, int*)
void loadfile( string filename, vector<string>* table, int* num )
{
	ifstream infile;
	infile.open( filename );

	if( infile.fail() ){
		cout << "Error opening " << filename << endl;
	}

	while( infile.peek() != EOF ){
		string line;
		getline(infile,line);
		int pos1 = line.find(" ");
		int pos2 = line.find(" ", pos1+2);
	    string data = line.substr(pos1+1, pos2-pos1-1);
		//cout << data << " " << data.size() << endl;
		table->push_back( data );
		(*num)++;
	}

	infile.close();
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rdx, (%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
leaq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x6460
pushq $0x8
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x6390
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
je 0x70e4
movq 0x2df03(%rip), %rdi     # 0x34fc8
leaq 0x1af6e(%rip), %rsi     # 0x2203a
callq 0x6410
movq %rax, %rdi
movq %r15, %rsi
callq 0x63b0
movq %rax, %rdi
callq 0x6210
leaq 0x50(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x1bd1f(%rip), %r13     # 0x22e14
leaq 0x30(%rsp), %rbp
movq %r15, %rdi
callq 0x61a0
cmpl $-0x1, %eax
je 0x71af
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x60c0
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x6760
movq %rax, %r14
movq %rax, %rbx
shlq $0x20, %rbx
movabsq $0x200000000, %rax      # imm = 0x200000000
leaq (%rbx,%rax), %rdx
sarq $0x20, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6760
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rcx, %rbx
sarq $0x20, %rbx
notl %r14d
addl %r14d, %eax
movslq %eax, %rcx
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6440
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x74c4
movq (%rsp), %rax
incl (%rax)
movq %rbp, %rdi
callq 0x61f0
movq %r12, %rdi
callq 0x61f0
jmp 0x70fa
leaq 0x50(%rsp), %rdi
callq 0x60e0
leaq 0x50(%rsp), %rdi
callq 0x6120
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x71f7
jmp 0x71d9
movq %rax, %rbx
jmp 0x71eb
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x61f0
leaq 0x10(%rsp), %rdi
callq 0x61f0
jmp 0x71fa
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x6120
movq %rbx, %rdi
callq 0x66b0
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./LegacyBF.h
// Function: LegacyBF::ReserveSpace(int, unsigned int*, unsigned int*)
char* LegacyBF::ReserveSpace(const int num_entry,
                                           uint32_t* total_bits,
                                           uint32_t* num_lines) {
  uint32_t sz = CalculateSpace(num_entry, total_bits, num_lines);
  char* data = new char[sz];
  memset(data, 0, sz);
  return data;
}

// Assembly:
pushq %rbx
callq 0x7c18
movl %eax, %ebx
movq %rbx, %rdi
callq 0x6030
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
jmp 0x6260
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./LegacyBF.h
// Function: LegacyBF::CalculateSpace(int, unsigned int*, unsigned int*)
uint32_t LegacyBF::CalculateSpace(const int num_entry,
                                                uint32_t* total_bits,
                                                uint32_t* num_lines) {
  assert(bits_per_key_);
  if (num_entry != 0) {
    uint32_t total_bits_tmp = static_cast<uint32_t>(num_entry * bits_per_key_);

    *total_bits = GetTotalBitsForLocality(total_bits_tmp);
    *num_lines = *total_bits / (CACHE_LINE_SIZE * 8);
    num_lines_ = *num_lines;
    assert(*total_bits > 0 && *total_bits % 8 == 0);
  } else {
    // filter is empty, just leave space for metadata
    *total_bits = 0;
    *num_lines = 0;
  }

  // Reserve space for Filter
  uint32_t sz = *total_bits / 8;
  sz += 5;  // 4 bytes for num_lines, 1 byte for num_probes
  return sz;
}

// Assembly:
pushq %rax
movl (%rdi), %eax
testl %eax, %eax
je 0x7c7b
testl %esi, %esi
je 0x7c6b
imull %esi, %eax
addl $0x1ff, %eax            # imm = 0x1FF
andl $0xfffffc00, %eax       # imm = 0xFFFFFC00
orl $0x200, %eax            # imm = 0x200
movl %eax, (%rdx)
shrl $0x9, %eax
movl %eax, (%rcx)
movl %eax, 0x8(%rdi)
movl (%rdx), %eax
testl %eax, %eax
je 0x7c4c
movl %eax, %ecx
andl $0x7, %ecx
je 0x7c73
leaq 0x1a658(%rip), %rdi     # 0x222ab
leaq 0x1a516(%rip), %rsi     # 0x22170
leaq 0x1a605(%rip), %rcx     # 0x22266
movl $0x99, %edx
callq 0x62a0
andl $0x0, (%rdx)
andl $0x0, (%rcx)
movl (%rdx), %eax
shrl $0x3, %eax
addl $0x5, %eax
popq %rcx
retq
leaq 0x1a5d6(%rip), %rdi     # 0x22258
leaq 0x1a4e7(%rip), %rsi     # 0x22170
leaq 0x1a5d6(%rip), %rcx     # 0x22266
movl $0x92, %edx
callq 0x62a0
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./LegacyBF.h
// Function: LegacyBF::CalculateNumEntry(unsigned int)
int LegacyBF::CalculateNumEntry(const uint32_t bytes) {
  assert(bits_per_key_);
  assert(bytes > 0);
  int high = static_cast<int>(bytes * 8 / bits_per_key_ + 1);
  int low = 1;
  int n = high;
  for (; n >= low; n--) {
    if (CalculateSpace(n) <= bytes) {
      break;
    }
  }
  assert(n < high);  // High should be an overestimation
  return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %ecx
testl %ecx, %ecx
je 0x7cee
movl %esi, %ebx
testl %esi, %esi
je 0x7d0d
movq %rdi, %r14
leal (,%rbx,8), %eax
xorl %edx, %edx
divl %ecx
movl %eax, %ebp
incl %ebp
movl %ebp, %r15d
testl %r15d, %r15d
jle 0x7cdb
movq %r14, %rdi
movl %r15d, %esi
callq 0xb268
cmpl %ebx, %eax
jbe 0x7cdb
decl %r15d
jmp 0x7cc2
cmpl %ebp, %r15d
jge 0x7d2c
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a563(%rip), %rdi     # 0x22258
leaq 0x1a474(%rip), %rsi     # 0x22170
leaq 0x1a5d0(%rip), %rcx     # 0x222d3
movl $0xb0, %edx
callq 0x62a0
leaq 0x1a5ef(%rip), %rdi     # 0x22303
leaq 0x1a455(%rip), %rsi     # 0x22170
leaq 0x1a5b1(%rip), %rcx     # 0x222d3
movl $0xb1, %edx
callq 0x62a0
leaq 0x1a5da(%rip), %rdi     # 0x2230d
leaq 0x1a436(%rip), %rsi     # 0x22170
leaq 0x1a592(%rip), %rcx     # 0x222d3
movl $0xba, %edx
callq 0x62a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::flushBFfile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char const*, unsigned int)
void db::flushBFfile(string filename, const char* sst_bf_p, uint32_t size){
	ofstream outfile(filename, ios::out);
	char buffer[sizeof(unsigned int)];
	memset(buffer, 0, sizeof(unsigned int));
	
	for(int i = 0; i < size; i++){
		memcpy(buffer, &(sst_bf_p[i]), sizeof(char));
		outfile.write(buffer, sizeof(char));
		memset(buffer, 0, sizeof(char));
	}	
	outfile.close();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl %ecx, %ebp
movq %rdx, %rbx
leaq 0x8(%rsp), %r14
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x6730
leaq 0x4(%rsp), %r15
andl $0x0, (%r15)
movl %ebp, %r13d
xorl %ebp, %ebp
pushq $0x1
popq %r12
cmpq %rbp, %r13
je 0x98fc
movb (%rbx,%rbp), %al
movb %al, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6530
movb $0x0, 0x4(%rsp)
incq %rbp
jmp 0x98d8
leaq 0x8(%rsp), %rdi
callq 0x6590
leaq 0x8(%rsp), %rdi
callq 0x65d0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9924
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x65d0
movq %rbx, %rdi
callq 0x66b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::flushIndexes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char**, int, int)
void db::flushIndexes( string filename, char** indexes, int size, int key_size){
	ofstream outfile(filename, ios::out);
	char buffer[DB_PAGE_SIZE];

	memcpy(buffer, &size, sizeof(unsigned int));
	outfile.write(buffer, sizeof(unsigned int));
	memset(buffer, 0, sizeof(unsigned int));

	memcpy(buffer, &key_size, sizeof(unsigned int));
	outfile.write(buffer, sizeof(unsigned int));
	memset(buffer, 0, sizeof(unsigned int));

	memset(buffer, 0, DB_PAGE_SIZE-2*sizeof(unsigned int));
	outfile.write(buffer, DB_PAGE_SIZE-2*sizeof(unsigned int));

	for(int i = 0 ;i < size; i++){
		memcpy(buffer, indexes[i], key_size);
		outfile.write(buffer, key_size);
		memset(buffer, 0, key_size);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1208, %rsp           # imm = 0x1208
movl %r8d, %r12d
movl %ecx, %ebx
movq %rdx, %r14
movq %rsp, %r15
pushq $0x10
popq %rdx
movq %r15, %rdi
callq 0x6730
leaq 0x200(%rsp), %rsi
movl %ebx, (%rsi)
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x6530
leaq 0x200(%rsp), %rsi
movl %r12d, (%rsi)
movq %rsp, %rdi
pushq $0x4
popq %rdx
callq 0x6530
leaq 0x200(%rsp), %r15
xorl %ebp, %ebp
movl $0xff8, %edx            # imm = 0xFF8
movq %r15, %rdi
xorl %esi, %esi
callq 0x6260
movq %rsp, %rdi
movl $0xff8, %edx            # imm = 0xFF8
movq %r15, %rsi
callq 0x6530
movslq %r12d, %r15
testl %ebx, %ebx
cmovlel %ebp, %ebx
leaq 0x200(%rsp), %r12
movq %rsp, %r13
cmpq %rbp, %rbx
je 0x99fc
movq (%r14,%rbp,8), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x6350
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6530
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x6260
incq %rbp
jmp 0x99c8
movq %rsp, %rdi
callq 0x65d0
addq $0x1208, %rsp           # imm = 0x1208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9a18
movq %rax, %rbx
movq %rsp, %rdi
callq 0x65d0
movq %rbx, %rdi
callq 0x66b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::flushfile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*)
void db::flushfile( string filename, vector<string>* table){
	ofstream outfile(filename, ios::out);
	char buffer[DB_PAGE_SIZE];

	int size = table->size();
	memcpy(buffer, &size, sizeof(unsigned int));
	outfile.write(buffer, sizeof(unsigned int));
	memset(buffer, 0, sizeof(unsigned int));

	int key_size = (table->at(0)).size();
	memcpy(buffer, &key_size, sizeof(unsigned int));
	outfile.write(buffer, sizeof(unsigned int));
	memset(buffer, 0, sizeof(unsigned int));

	memset(buffer, 0, DB_PAGE_SIZE-2*sizeof(unsigned int));
	outfile.write(buffer, DB_PAGE_SIZE-2*sizeof(unsigned int));

	for(int i = 0 ;i < size; i++){
		char* str = (char*) malloc(key_size);
		strcpy (str, table->at(i).c_str());
		memcpy(buffer, str, key_size);
		outfile.write(buffer, key_size);
		memset(buffer, 0, key_size);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1208, %rsp           # imm = 0x1208
movq %rdx, %rbx
movq %rsp, %r14
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x6730
movq 0x8(%rbx), %r13
subq (%rbx), %r13
shrq $0x5, %r13
leaq 0x200(%rsp), %rsi
movl %r13d, (%rsi)
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x6530
andl $0x0, 0x200(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x720c
movq 0x8(%rax), %r12
leaq 0x200(%rsp), %rsi
movl %r12d, (%rsi)
movq %rsp, %rdi
pushq $0x4
popq %rdx
callq 0x6530
leaq 0x200(%rsp), %r15
xorl %r14d, %r14d
movl $0xff8, %edx            # imm = 0xFF8
movq %r15, %rdi
xorl %esi, %esi
callq 0x6260
movq %rsp, %rdi
movl $0xff8, %edx            # imm = 0xFF8
movq %r15, %rsi
callq 0x6530
movslq %r12d, %r15
testl %r13d, %r13d
cmovlel %r14d, %r13d
leaq 0x200(%rsp), %r12
cmpq %r14, %r13
je 0x9b2b
movq %r15, %rdi
callq 0x6550
movq %rax, %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x720c
movq (%rax), %rsi
movq %rbp, %rdi
callq 0x63e0
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x6350
movq %rsp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6530
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x6260
incq %r14
jmp 0x9ad7
movq %rsp, %rdi
callq 0x65d0
addq $0x1208, %rsp           # imm = 0x1208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9b49
jmp 0x9b49
movq %rax, %rbx
movq %rsp, %rdi
callq 0x65d0
movq %rbx, %rdi
callq 0x66b0
// File: /workspace/github_cpp_makefile_star2_O2/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, 0x10(%rsp)
callq 0x6070
movq %rax, 0x8(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0xb67a
xorl %ebp, %ebp
leaq 0x58(%rsp), %r15
leaq 0x18(%rsp), %rbx
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
leaq 0x38(%rsp), %rcx
movq %r13, %r8
movq %r12, %r9
callq 0xb7d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64c0
movq %r15, %rdi
callq 0x61f0
cmpb $0x1, (%r12)
je 0x9c50
incl %ebp
cmpl 0xdc(%r14), %ebp
jl 0x9bac
movb $0x0, (%r12)
leaq 0x2b7f3(%rip), %rax     # 0x353e8
movb $0x1, (%rax)
incl 0x1e0(%r14)
callq 0x6070
subq 0x8(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
cvtsi2ss %rax, %xmm0
divss 0x183e4(%rip), %xmm0    # 0x22004
addss 0x188(%r14), %xmm0
movss %xmm0, 0x188(%r14)
leaq 0x187a0(%rip), %rsi     # 0x223d9
leaq 0x58(%rsp), %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x61b0
jmp 0x9cdc
incl 0x1e0(%r14)
leaq 0x2b78a(%rip), %rax     # 0x353e8
movb $0x1, (%rax)
callq 0x6070
subq 0x8(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
cvtsi2ss %rax, %xmm0
divss 0x18382(%rip), %xmm0    # 0x22004
addss 0x188(%r14), %xmm0
movss %xmm0, 0x188(%r14)
movq 0x10(%rsp), %rbx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x18(%rsp), %rcx
leaq 0x28(%rsp), %rdx
cmpq %rdx, %rcx
je 0x9cbd
movq %rcx, (%rbx)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x9cc3
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rdx, 0x18(%rsp)
andq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x61f0
leaq 0x18(%rsp), %rdi
callq 0x61f0
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9d09
movq %rax, %rbx
jmp 0x9d16
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x61f0
leaq 0x18(%rsp), %rdi
callq 0x61f0
movq %rbx, %rdi
callq 0x66b0
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::binary_search(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
int db::binary_search(string key, vector<string> & fence_pointer)
{
	int len = fence_pointer.size();
	if(len == 0){return -1;}
	if(len == 1){return 0;}
	int start = 0;
	int end = len - 1;
	int mid;

	//for (int i=0 ; i<len ; i++){
	//	cout << fence_pointer[i] << endl;;
	//}

	if(key.compare(fence_pointer[start]) < 0){ return -1;}
	if(key.compare(fence_pointer[end]) > 0){ return -1;}

	while(end - start > 1){
		mid = (start + end)/2;
		if(key.compare(fence_pointer[mid]) < 0){
			end = mid;
		} 
		else if(key.compare(fence_pointer[mid]) == 0){
			return mid;
		}
		else{
			start = mid;
		}
	}
	return start;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq (%rdx), %rsi
movq 0x8(%rdx), %r12
subq %rsi, %r12
shrq $0x5, %r12
pushq $-0x1
popq %rbp
testl %r12d, %r12d
je 0x9de5
cmpl $0x1, %r12d
jne 0x9d5d
xorl %ebp, %ebp
jmp 0x9de5
movq %rdx, %rbx
movq %r14, %rdi
callq 0x6040
testl %eax, %eax
js 0x9de5
movslq %r12d, %rax
shlq $0x5, %rax
movq (%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x20, %rsi
movq %r14, %rdi
callq 0x6040
testl %eax, %eax
jg 0x9de5
decl %r12d
xorl %ecx, %ecx
movq %r14, (%rsp)
movq %rcx, %r13
leal 0x1(%rcx), %r14d
movl %r12d, %ebp
cmpl %r14d, %ebp
jle 0x9de2
movl %ebp, %r12d
leal (%r12,%r13), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %ebp
movslq %eax, %r15
shlq $0x5, %r15
movq (%rbx), %rsi
addq %r15, %rsi
movq (%rsp), %rdi
callq 0x6040
testl %eax, %eax
js 0x9d9d
addq (%rbx), %r15
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x6040
movl %ebp, %ecx
testl %eax, %eax
jne 0x9d93
jmp 0x9de5
movl %r13d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::split_keys_sst(int, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void db::split_keys_sst(int sst_capacity, vector<string> keys_one_level, vector<vector<string> > & sst, vector<string> & fence_pointer )
{
	sst.clear();
	fence_pointer.clear();
	if(keys_one_level.size() == 0) return;
	sort(keys_one_level.begin(), keys_one_level.end());
	int start_index = 0;
	int num_keys_one_level = keys_one_level.size();
	while(true){
		int end_index = start_index + sst_capacity;
		fence_pointer.push_back(keys_one_level[start_index]);
		if(end_index >= num_keys_one_level){
			sst.push_back(vector<string> (keys_one_level.cbegin() + start_index, keys_one_level.cend()));
			break;
		}else{
			sst.push_back(vector<string> (keys_one_level.cbegin() + start_index, keys_one_level.cbegin() + end_index));
		}
		start_index = end_index;
	}	
	fence_pointer.push_back(keys_one_level.back());	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rcx, 0x8(%rsp)
movq %rcx, %rdi
callq 0xba1a
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
callq 0xbe20
movq (%r14), %rdi
movq 0x8(%r14), %rsi
cmpq %rdi, %rsi
je 0xa2ee
callq 0xe2d2
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
movslq %ebp, %r15
shrq $0x5, %rax
cltq
movq %rax, 0x18(%rsp)
movq %r15, %rbp
shlq $0x5, %rbp
xorl %r12d, %r12d
leaq 0x20(%rsp), %r13
movq %r15, %rbx
addq %r12, %rsi
movq 0x10(%rsp), %rdi
callq 0x74c4
cmpq 0x18(%rsp), %r15
jge 0xa2aa
movq (%r14), %rsi
addq %r12, %rsi
leaq (%rsi,%rbp), %rdx
movq %r13, %rdi
leaq 0x7(%rsp), %rcx
callq 0xbe28
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0xdf12
movq %r13, %rdi
callq 0x739e
movq (%r14), %rsi
addq %rbp, %r12
addq %rbx, %r15
jmp 0xa25f
addq (%r14), %r12
movq 0x8(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x7(%rsp), %rcx
movq %r12, %rsi
callq 0xbe28
leaq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0xdf12
leaq 0x20(%rsp), %rdi
callq 0x739e
movq 0x8(%r14), %rsi
addq $-0x20, %rsi
movq 0x10(%rsp), %rdi
callq 0x74c4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa301
jmp 0xa310
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x739e
jmp 0xa313
movq %rax, %rbx
movq %rbx, %rdi
callq 0x66b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::SetTreeParam()
void db::SetTreeParam()
{
	positive_counters.resize(num_levels, 0);
	qnum_histogram = new vector<int> (num_filter_units, 0); 
	lnum_histogram = new vector<int> (num_levels, 0); 

	for( int l = 0; l < num_levels; l++){
		int num_l_sst = num_sstPerLevel[l];
		cout << "set param " << num_levels << " " << num_l_sst << endl;
	}

	bf_tp_eval_histogram = new vector<int> (num_levels, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x1f8, %rdi            # imm = 0x1F8
movslq 0xdc(%rbx), %rsi
leaq 0x4(%rsp), %r15
andl $0x0, (%r15)
movq %r15, %rdx
callq 0xb398
pushq $0x18
popq %rdi
callq 0x6420
movq %rax, %r14
movslq 0x110(%rbx), %rsi
andl $0x0, (%r15)
leaq 0x4(%rsp), %rdx
leaq 0x3(%rsp), %rcx
movq %rax, %rdi
callq 0xb98a
movq %r14, 0x210(%rbx)
pushq $0x18
popq %rdi
callq 0x6420
movq %rax, %r14
movslq 0xdc(%rbx), %rsi
leaq 0x4(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x3(%rsp), %rcx
movq %rax, %rdi
callq 0xb98a
movq %r14, 0x218(%rbx)
xorl %r14d, %r14d
leaq 0x17fe4(%rip), %r15     # 0x22394
leaq 0x18a5d(%rip), %r12     # 0x22e14
movslq 0xdc(%rbx), %r13
cmpq %r13, %r14
jge 0xa40d
movq 0xe8(%rbx), %rax
movl (%rax,%r14,4), %ebp
movq 0x2abf3(%rip), %rdi     # 0x34fc8
movq %r15, %rsi
callq 0x6410
movl 0xdc(%rbx), %esi
movq %rax, %rdi
callq 0x6690
movq %rax, %rdi
movq %r12, %rsi
callq 0x6410
movq %rax, %rdi
movl %ebp, %esi
callq 0x6690
movq %rax, %rdi
callq 0x6210
incq %r14
jmp 0xa3b7
pushq $0x18
popq %rdi
callq 0x6420
movq %rax, %r14
leaq 0x4(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x3(%rsp), %rcx
movq %rax, %rdi
movq %r13, %rsi
callq 0xb98a
movq %r14, 0x228(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa44a
jmp 0xa44a
movq %rax, %rbx
movq %r14, %rdi
callq 0x63f0
movq %rbx, %rdi
callq 0x66b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./bloom_impl.h
// Function: LegacyLocalityBloomImpl<false>::EstimatedFpRate(unsigned long, unsigned long, int)
static double EstimatedFpRate(size_t keys, size_t bytes, int num_probes) {
    double bits_per_key = 8.0 * bytes / keys;
    double filter_rate = BloomMath::CacheLocalFpRate(bits_per_key, num_probes,
                                                     /*cache line bits*/ 512);
    if (!ExtraRotates) {
      // Good estimate of impact of flaw in index computation.
      // Adds roughly 0.002 around 50 bits/key and 0.001 around 100 bits/key.
      // The + 22 shifts it nicely to fit for lower bits/key.
      filter_rate += 0.1 / (bits_per_key * 0.75 + 22);
    }     // Always uses 32-bit hash
    double fingerprint_rate = BloomMath::FingerprintFpRate(keys, 32);
    return BloomMath::IndependentProbabilitySum(filter_rate, fingerprint_rate);
  }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %xmm0
movq 0x16f56(%rip), %xmm1    # 0x22110
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x16f5a(%rip), %xmm2    # 0x22120
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
mulsd 0x16ee2(%rip), %xmm3    # 0x220c0
movq %rdi, %rbx
movq %rdi, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm3
movapd %xmm3, (%rsp)
movapd %xmm3, %xmm0
movl %edx, %edi
movl $0x200, %esi            # imm = 0x200
callq 0xd350
movapd (%rsp), %xmm1
mulsd 0x16ea8(%rip), %xmm1    # 0x220c8
addsd 0x16ea8(%rip), %xmm1    # 0x220d0
movsd 0x16ea8(%rip), %xmm2    # 0x220d8
divsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, (%rsp)
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0xd3da
movsd (%rsp), %xmm2
movapd %xmm2, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm2
subsd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./FastLocalBF.h
// Function: FastLocalBF::CalculateSpace(int)
uint32_t CalculateSpace(const int num_entry)  {
    uint32_t num_cache_lines = 0;
    if (millibits_per_key_ > 0 && num_entry > 0) {
      num_cache_lines = static_cast<uint32_t>(
          (int64_t{num_entry} * millibits_per_key_ + 511999) / 512000);
    }
    return num_cache_lines * 64 + /*metadata*/ 5;
  }

// Assembly:
movslq (%rdi), %rax
testq %rax, %rax
setle %cl
testl %esi, %esi
setle %dl
orb %cl, %dl
jne 0xb5b5
movl %esi, %ecx
imulq %rcx, %rax
addq $0x7cfff, %rax          # imm = 0x7CFFF
movl $0x7d000, %ecx          # imm = 0x7D000
xorl %edx, %edx
divq %rcx
shll $0x6, %eax
orl $0x5, %eax
retq
pushq $0x5
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./FastLocalBF.h
// Function: FastLocalBF::Finish()
void Finish()  {
    uint32_t len_with_metadata =
        CalculateSpace(static_cast<uint32_t>(hash_entries_.size()));
    space_ = len_with_metadata;
    char* data = new char[len_with_metadata];
    data_ = data;
    memset(data, 0, len_with_metadata);

    assert(data);
    assert(len_with_metadata >= 5);

    uint32_t len = len_with_metadata - 5;
    if (len > 0) {
      AddAllEntries(data, len);
    }

    // See BloomFilterPolicy::GetBloomBitsReader re: metadata
    // -1 = Marker for newer Bloom implementations
    data[len] = static_cast<char>(-1);
    // 0 = Marker for this sub-implementation
    data[len + 1] = static_cast<char>(0);
    // num_probes (and 0 in upper bits for 64-byte block size)
    data[len + 2] = static_cast<char>(num_probes_);
    // rest of metadata stays zero

    hash_entries_.clear();
    assert(hash_entries_.empty());

  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0xc394
movq %rbx, %rdi
movl %eax, %esi
callq 0xb586
movl %eax, %r15d
movl %eax, 0x18(%rbx)
movl %eax, %r13d
movq %r13, %rdi
callq 0x6030
movq %rax, %r12
movq %rax, 0x10(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x6260
cmpl $0x4, %r15d
jbe 0xb79a
movl %r15d, %ebp
addl $-0x5, %ebp
je 0xb75e
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0xc520
movl %ebp, %eax
movb $-0x1, (%r12,%rax)
leal -0x4(%r15), %eax
movb $0x0, (%r12,%rax)
movb 0x4(%rbx), %al
addl $-0x3, %r15d
movb %al, (%r12,%r15)
movq %r14, %rdi
callq 0xc64c
movq 0x50(%rbx), %rax
cmpq 0x30(%rbx), %rax
jne 0xb7b3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16d9b(%rip), %rdi     # 0x2253c
leaq 0x16d15(%rip), %rsi     # 0x224bd
leaq 0x16d72(%rip), %rcx     # 0x22521
pushq $0x2c
jmp 0xb7ca
leaq 0x16d99(%rip), %rdi     # 0x22553
leaq 0x16cfc(%rip), %rsi     # 0x224bd
leaq 0x16d59(%rip), %rcx     # 0x22521
pushq $0x3d
popq %rdx
callq 0x62a0
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::read_index_size(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline int db::read_index_size( string filename ){
	//int flags = O_RDWR | O_DIRECT | O_SYNC;
	int flags = O_RDWR;
	mode_t mode=S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;//644

	int fd = open(filename.c_str(), flags, mode );
	if (fd <= 0) {
		cout << "Cannot open partiton file " << filename << endl;
    	printf("Error %s\n", strerror(errno));
		return 0;
	}

	char* buf;
	posix_memalign((void**)&buf,getpagesize(),DB_PAGE_SIZE);

	memset(buf, 0, DB_PAGE_SIZE);
	read( fd, buf, DB_PAGE_SIZE );
	
	int size;
	int key_size;
	memcpy(&size, buf, sizeof(unsigned int));	
	index_size = size;
	memcpy(&key_size, buf+sizeof(unsigned int), sizeof(unsigned int));	
	free( buf );
	if(fd > 0)
		close( fd );	
	return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rdi
xorl %ebx, %ebx
pushq $0x2
popq %rsi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x6300
testl %eax, %eax
jle 0xbaf4
movl %eax, %ebp
callq 0x66e0
movslq %eax, %rsi
movq %rsp, %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
callq 0x6230
movq (%rbx), %r15
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
xorl %esi, %esi
callq 0x6260
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r15, %rsi
callq 0x65a0
movq (%rbx), %rdi
movl (%rdi), %ebx
movl %ebx, 0x134(%r14)
callq 0x6490
movl %ebp, %edi
callq 0x6750
jmp 0xbb37
movq 0x294cd(%rip), %rdi     # 0x34fc8
leaq 0x16a71(%rip), %rsi     # 0x22573
callq 0x6410
movq %rax, %rdi
movq %r15, %rsi
callq 0x63b0
movq %rax, %rdi
callq 0x6210
callq 0x6050
movl (%rax), %edi
callq 0x6170
leaq 0x16a3c(%rip), %rdi     # 0x22569
movq %rax, %rsi
xorl %eax, %eax
callq 0x6060
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::read_bf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char*, int)
inline void db::read_bf(string filename, char* bf_buffer, int size){
	//int flags = O_RDWR | O_DIRECT;
	int flags = O_RDWR;
	mode_t mode=S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;//644

	
	int fd_ = open(filename.c_str(), flags, mode );
	if (fd_ <= 0) {
		cout << "Cannot open partiton file " << filename << endl;
    	printf("Error %s\n", strerror(errno));
	}
	
	char* buffer_;	
	posix_memalign((void**)&buffer_,DB_PAGE_SIZE,DB_PAGE_SIZE);
	memset(buffer_, 0, DB_PAGE_SIZE);

	for(int i = 0; i < size; i++){
		if ( i%DB_PAGE_SIZE == 0){
			memset(buffer_, 0, DB_PAGE_SIZE);
			read( fd_, buffer_, DB_PAGE_SIZE );
		}
		memcpy(bf_buffer+i, buffer_+(i%DB_PAGE_SIZE), sizeof(char));
	}
	//cout << "string " << blo_bf.size() << endl;
	//for(int i = 0; i < blo_bf.size(); i++){
	//	cout << hex << (unsigned int)blo_bf[i] << endl;
	//}

	if(fd_ > 0)
		close( fd_ );	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq (%rsi), %rdi
xorl %r12d, %r12d
pushq $0x2
popq %rsi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x6300
movl %eax, %ebp
testl %eax, %eax
jg 0xbd92
movq 0x29272(%rip), %rdi     # 0x34fc8
leaq 0x16816(%rip), %rsi     # 0x22573
callq 0x6410
movq %rax, %rdi
movq %r15, %rsi
callq 0x63b0
movq %rax, %rdi
callq 0x6210
callq 0x6050
movl (%rax), %edi
callq 0x6170
leaq 0x167e1(%rip), %rdi     # 0x22569
movq %rax, %rsi
xorl %eax, %eax
callq 0x6060
leaq 0x8(%rsp), %r15
movl $0x1000, %esi           # imm = 0x1000
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
callq 0x6230
movq (%r15), %r15
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
xorl %esi, %esi
callq 0x6260
testl %ebx, %ebx
cmovlel %r12d, %ebx
cmpq %r12, %rbx
je 0xbe07
movq %r12, %rax
shlq $0x34, %rax
jne 0xbdf2
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
xorl %esi, %esi
callq 0x6260
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r15, %rsi
callq 0x65a0
movq 0x8(%rsp), %r15
movl %r12d, %eax
andl $0xfff, %eax            # imm = 0xFFF
movb (%r15,%rax), %al
movb %al, (%r14,%r12)
incq %r12
jmp 0xbdc1
testl %ebp, %ebp
jle 0xbe12
movl %ebp, %edi
callq 0x6750
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./bloom_impl.h
// Function: LegacyLocalityBloomImpl<false>::AddHash(unsigned int, unsigned int, int, char*, int)
static inline void AddHash(uint32_t h, uint32_t num_lines, int num_probes,
                             char *data, int log2_cache_line_bytes) {
    const int log2_cache_line_bits = log2_cache_line_bytes + 3;

    char *data_at_offset =
        data + (GetLine(h, num_lines) << log2_cache_line_bytes);
    const uint32_t delta = (h >> 17) | (h << 15);
    for (int i = 0; i < num_probes; ++i) {
      // Mask to bit-within-cache-line address
      const uint32_t bitpos = h & ((1 << log2_cache_line_bits) - 1);
      data_at_offset[bitpos / 8] |= (1 << (bitpos % 8));
      if (ExtraRotates) {
        h = (h >> log2_cache_line_bits) | (h << (32 - log2_cache_line_bits));
      }
      h += delta;
    }
  }

// Assembly:
movl %r8d, %r9d
movq %rcx, %r10
movl %edx, %r8d
movl %edi, %eax
xorl %edx, %edx
divl %esi
movl %r9d, %ecx
shll %cl, %edx
xorl %eax, %eax
movl %edi, %esi
roll $0xf, %esi
addq %r10, %rdx
leal 0x3(%r9), %ecx
pushq $-0x1
popq %r9
shll %cl, %r9d
notl %r9d
testl %r8d, %r8d
cmovgl %r8d, %eax
pushq $0x1
popq %r8
subl $0x1, %eax
jb 0xbeb4
movl %edi, %r10d
andl %r9d, %r10d
movl %r10d, %ecx
andb $0x7, %cl
movl %r8d, %r11d
shll %cl, %r11d
shrl $0x3, %r10d
orb %r11b, (%rdx,%r10)
addl %esi, %edi
jmp 0xbe91
retq
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./bloom_impl.h
// Function: FastLocalBloomImpl::ChooseNumProbes(int)
static inline int ChooseNumProbes(int millibits_per_key) {
    // Since this implementation can (with AVX2) make up to 8 probes
    // for the same cost, we pick the most accurate num_probes, based
    // on actual tests of the implementation. Note that for higher
    // bits/key, the best choice for cache-local Bloom can be notably
    // smaller than standard bloom, e.g. 9 instead of 11 @ 16 b/k.
    if (millibits_per_key <= 2080) {
      return 1;
    } else if (millibits_per_key <= 3580) {
      return 2;
    } else if (millibits_per_key <= 5100) {
      return 3;
    } else if (millibits_per_key <= 6640) {
      return 4;
    } else if (millibits_per_key <= 8300) {
      return 5;
    } else if (millibits_per_key <= 10070) {
      return 6;
    } else if (millibits_per_key <= 11720) {
      return 7;
    } else if (millibits_per_key <= 14001) {
      // Would be something like <= 13800 but sacrificing *slightly* for
      // more settings using <= 8 probes.
      return 8;
    } else if (millibits_per_key <= 16050) {
      return 9;
    } else if (millibits_per_key <= 18300) {
      return 10;
    } else if (millibits_per_key <= 22001) {
      return 11;
    } else if (millibits_per_key <= 25501) {
      return 12;
    } else if (millibits_per_key > 50000) {
      // Top out at 24 probes (three sets of 8)
      return 24;
    } else {
      // Roughly optimal choices for remaining range
      // e.g.
      // 28000 -> 12, 28001 -> 13
      // 50000 -> 23, 50001 -> 24
      return (millibits_per_key - 1) / 2000 - 1;
    }
  }

// Assembly:
cmpl $0x821, %edi            # imm = 0x821
jge 0xbf87
pushq $0x1
jmp 0xc018
cmpl $0xdfd, %edi            # imm = 0xDFD
jae 0xbf96
pushq $0x2
jmp 0xc018
cmpl $0x13ed, %edi           # imm = 0x13ED
jae 0xbfa2
pushq $0x3
jmp 0xc018
cmpl $0x19f1, %edi           # imm = 0x19F1
jae 0xbfae
pushq $0x4
jmp 0xc018
cmpl $0x206d, %edi           # imm = 0x206D
jae 0xbfba
pushq $0x5
jmp 0xc018
cmpl $0x2757, %edi           # imm = 0x2757
jae 0xbfc6
pushq $0x6
jmp 0xc018
cmpl $0x2dc9, %edi           # imm = 0x2DC9
jae 0xbfd2
pushq $0x7
jmp 0xc018
cmpl $0x36b2, %edi           # imm = 0x36B2
jae 0xbfde
pushq $0x8
jmp 0xc018
cmpl $0x3eb3, %edi           # imm = 0x3EB3
jae 0xbfea
pushq $0x9
jmp 0xc018
cmpl $0x477d, %edi           # imm = 0x477D
jae 0xbff6
pushq $0xa
jmp 0xc018
cmpl $0x55f2, %edi           # imm = 0x55F2
jae 0xc002
pushq $0xb
jmp 0xc018
cmpl $0x639e, %edi           # imm = 0x639E
jae 0xc00e
pushq $0xc
jmp 0xc018
cmpl $0xc350, %edi           # imm = 0xC350
jbe 0xc01a
pushq $0x18
popq %rax
retq
decl %edi
movw $0x7d0, %cx             # imm = 0x7D0
movl %edi, %eax
xorl %edx, %edx
divw %cx
movzwl %ax, %eax
decl %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./bloom_impl.h
// Function: FastLocalBloomImpl::AddHashPrepared(unsigned int, int, char*)
static inline void AddHashPrepared(uint32_t h2, int num_probes,
                                     char *data_at_cache_line) {
    uint32_t h = h2;
    for (int i = 0; i < num_probes; ++i, h *= uint32_t{0x9e3779b9}) {
      // 9-bit address within 512 bit cache line
      int bitpos = h >> (32 - 9);
      data_at_cache_line[bitpos >> 3] |= (uint8_t{1} << (bitpos & 7));
    }
  }

// Assembly:
xorl %eax, %eax
testl %esi, %esi
cmovgl %esi, %eax
pushq $0x1
popq %rsi
subl $0x1, %eax
jb 0xc6b8
movl %edi, %ecx
shrl $0x17, %ecx
andb $0x7, %cl
movl %esi, %r8d
shll %cl, %r8d
imull $0x9e3779b9, %edi, %ecx # imm = 0x9E3779B9
shrl $0x1a, %edi
orb %r8b, (%rdx,%rdi)
movl %ecx, %edi
jmp 0xc694
retq
nop