LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 (%rdx), %rsi
movq 0x8(%rdx), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x22f0
cmpq $-0x1, %rax
je 0xaebd
movq 0x8(%r12), %rdx
movq (%r15), %rcx
movq 0x8(%r15), %r8
movq %r14, %rdi
movq %rax, %rsi
callq 0x2200
movq %rax, %r14
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3a5a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, %r15
movq (%rdi), %rdi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rdi, 0x8(%r15)
je 0xb15f
movq %rsi, %r14
xorl %ecx, %ecx
leaq 0x38(%rsp), %r13
leaq 0x8(%rsp), %r12
xorl %ebx, %ebx
shlq $0x5, %rcx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%rdi,%rcx), %rsi
movq 0x8(%rdi,%rcx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3a5a
movq %r13, 0x28(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x3a5a
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rcx
movq %r12, %rdi
xorl %edx, %edx
callq 0x22f0
movq %rax, %rbp
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xb118
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb134
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
cmpq $-0x1, %rbp
jne 0xb15d
incl %ebx
movq (%r15), %rdi
movq 0x8(%r15), %rdx
subq %rdi, %rdx
sarq $0x5, %rdx
movq %rbx, %rcx
cmpq %rbx, %rdx
ja 0xb0af
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xb15f
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb18d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %r15
movq %rdi, 0x10(%rsp)
movq 0x8(%rdi), %r12
subq %r15, %r12
setne %bpl
je 0xb297
sarq $0x6, %r12
movq 0x8(%rsi), %rcx
xorl %r14d, %r14d
cmpq $0x1, %r12
sbbq %r12, %r14
addq $0x28, %r15
movl $0x1, %ebx
movq %rsi, %r13
movq %rcx, 0x8(%rsp)
movq -0x20(%r15), %rdx
cmpq %rcx, %rdx
jne 0xb27c
testq %rdx, %rdx
je 0xb255
movq (%r13), %rsi
movq -0x28(%r15), %rdi
callq 0x21e0
movq 0x8(%rsp), %rcx
movq %r13, %rsi
testl %eax, %eax
jne 0xb27c
movq (%r15), %rdx
cmpq 0x28(%rsi), %rdx
jne 0xb27c
testq %rdx, %rdx
je 0xb2af
movq 0x20(%r13), %rsi
movq -0x8(%r15), %rdi
callq 0x21e0
movq 0x8(%rsp), %rcx
movq %r13, %rsi
testl %eax, %eax
je 0xb2af
cmpq %rbx, %r12
seta %bpl
addq $0x40, %r15
leaq (%r14,%rbx), %rax
incq %rax
incq %rbx
cmpq $0x1, %rax
jne 0xb22e
movq 0x10(%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbf72
testb $0x1, %bpl
je 0xb297
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
subq $0x18, %rsp
movq 0x38(%rdi), %r15
movq %rdi, 0x10(%rsp)
movq 0x40(%rdi), %r12
subq %r15, %r12
setne %bpl
je 0xc6e4
sarq $0x6, %r12
movq 0x8(%rsi), %rcx
xorl %r14d, %r14d
cmpq $0x1, %r12
sbbq %r12, %r14
addq $0x28, %r15
movl $0x1, %ebx
movq %rsi, %r13
movq %rcx, 0x8(%rsp)
movq -0x20(%r15), %rdx
cmpq %rcx, %rdx
jne 0xc6c9
testq %rdx, %rdx
je 0xc6a2
movq (%r13), %rsi
movq -0x28(%r15), %rdi
callq 0x21e0
movq 0x8(%rsp), %rcx
movq %r13, %rsi
testl %eax, %eax
jne 0xc6c9
movq (%r15), %rdx
cmpq 0x28(%rsi), %rdx
jne 0xc6c9
testq %rdx, %rdx
je 0xc700
movq 0x20(%r13), %rsi
movq -0x8(%r15), %rdi
callq 0x21e0
movq 0x8(%rsp), %rcx
movq %r13, %rsi
testl %eax, %eax
je 0xc700
cmpq %rbx, %r12
seta %bpl
addq $0x40, %r15
leaq (%r14,%rbx), %rax
incq %rax
incq %rbx
cmpq $0x1, %rax
jne 0xc67b
movq 0x10(%rsp), %rdi
addq $0x38, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbf72
testb $0x1, %bpl
je 0xc6e4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
addq $0x50, %r14
leaq 0x2b8e(%rip), %rsi      # 0xf2ff
movq %r14, %rdi
callq 0x20a0
testl %eax, %eax
je 0xc7a0
leaq 0x2db9(%rip), %rsi      # 0xf53d
movq %rsp, %rdi
movq %r14, %rdx
callq 0xdf61
leaq 0x2da4(%rip), %rsi      # 0xf53a
movq %rsp, %rdi
callq 0x2340
jmp 0xc7c1
leaq 0x2d79(%rip), %rsi      # 0xf520
movq %rsp, %rdi
movq %r14, %rdx
callq 0xdf61
leaq 0x2d81(%rip), %rsi      # 0xf53a
movq %rsp, %rdi
callq 0x2340
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc7e8
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0xc7ef
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2220
movq (%r14), %rdi
cmpq %r15, %rdi
je 0xc82b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc846
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xc857
jmp 0xc877
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc87a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0xc87a
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xc88d
movq (%r15), %rsi
incq %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x73b4
movl %eax, %ebx
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
jmp 0x5240
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7415
testl %esi, %esi
je 0x7405
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 0x73e6
andl $0x7, %eax
je 0x740b
leaq 0x21f3e(%rip), %rdi     # 0x2932b
leaq 0x21dfc(%rip), %rsi     # 0x291f0
leaq 0x21eeb(%rip), %rcx     # 0x292e6
movl $0x99, %edx
callq 0x5280
xorl %eax, %eax
movl %eax, (%rdx)
movl %eax, (%rcx)
movl (%rdx), %eax
shrl $0x3, %eax
addl $0x5, %eax
popq %rcx
retq
leaq 0x21ebc(%rip), %rdi     # 0x292d8
leaq 0x21dcd(%rip), %rsi     # 0x291f0
leaq 0x21ebc(%rip), %rcx     # 0x292e6
movl $0x92, %edx
callq 0x5280
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %ecx
testl %ecx, %ecx
je 0x74b1
movl %esi, %ebx
testl %esi, %esi
je 0x74d0
leal (,%rbx,8), %eax
xorl %edx, %edx
divl %ecx
leal 0x1(%rax), %ebp
movl %ebp, %r15d
cmpl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
ja 0x749a
movq %rdi, %r14
leaq 0x4(%rsp), %r12
movq %rsp, %r13
movl %ebp, %r15d
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x73b4
cmpl %ebx, %eax
jbe 0x749a
leal -0x1(%r15), %eax
cmpl $0x1, %r15d
movl %eax, %r15d
jg 0x7475
xorl %r15d, %r15d
cmpl %ebp, %r15d
jge 0x74ef
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21e20(%rip), %rdi     # 0x292d8
leaq 0x21d31(%rip), %rsi     # 0x291f0
leaq 0x21e8d(%rip), %rcx     # 0x29353
movl $0xb0, %edx
callq 0x5280
leaq 0x21eac(%rip), %rdi     # 0x29383
leaq 0x21d12(%rip), %rsi     # 0x291f0
leaq 0x21e6e(%rip), %rcx     # 0x29353
movl $0xb1, %edx
callq 0x5280
leaq 0x21e97(%rip), %rdi     # 0x2938d
leaq 0x21cf3(%rip), %rsi     # 0x291f0
leaq 0x21e4f(%rip), %rcx     # 0x29353
movl $0xba, %edx
callq 0x5280
// File: /workspace/github_cpp_makefile_star2_O1/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), %rdi
movl $0x10, %edx
callq 0x5730
movl $0x0, 0x4(%rsp)
testl %ebp, %ebp
je 0xa7da
movl %ebp, %r12d
xorl %r13d, %r13d
leaq 0x8(%rsp), %r14
leaq 0x4(%rsp), %r15
movb (%rbx,%r13), %al
movb %al, 0x4(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x5510
movb $0x0, 0x4(%rsp)
incq %r13
cmpq %r13, %r12
jne 0xa7b5
leaq 0x8(%rsp), %rdi
callq 0x5570
movq 0x2e7c5(%rip), %rax     # 0x38fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x5350
leaq 0x100(%rsp), %rdi
callq 0x5160
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa82a
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x55c0
movq %rbx, %rdi
callq 0x56b0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14d
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsp, %r15
movq %r15, %rdi
movl $0x10, %edx
callq 0x5730
leaq 0x200(%rsp), %rsi
movl %ebp, (%rsi)
movl $0x4, %edx
movq %r15, %rdi
callq 0x5510
leaq 0x200(%rsp), %rsi
movl %r14d, (%rsi)
movq %rsp, %rdi
movl $0x4, %edx
callq 0x5510
leaq 0x200(%rsp), %r15
movl $0xff8, %edx            # imm = 0xFF8
movq %r15, %rdi
xorl %esi, %esi
callq 0x5240
movq %rsp, %rdi
movl $0xff8, %edx            # imm = 0xFF8
movq %r15, %rsi
callq 0x5510
testl %ebp, %ebp
jle 0xa908
movslq %r14d, %r14
movl %ebp, %r13d
xorl %ebp, %ebp
leaq 0x200(%rsp), %r15
movq %rsp, %r12
movq (%rbx,%rbp,8), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x5330
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5510
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x5240
incq %rbp
cmpq %rbp, %r13
jne 0xa8d6
movq 0x2e6a1(%rip), %rax     # 0x38fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x8(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, (%rsp,%rcx)
callq 0x5350
leaq 0xf8(%rsp), %rdi
callq 0x5160
addq $0x1208, %rsp           # imm = 0x1208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa94d
movq %rax, %rbx
movq %rsp, %rdi
callq 0x55c0
movq %rbx, %rdi
callq 0x56b0
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %r12d, %r12d
je 0xae10
cmpl $0x1, %r12d
jne 0xad87
xorl %ebp, %ebp
jmp 0xae10
movq %rdx, %rbx
movq %r14, %rdi
callq 0x5050
testl %eax, %eax
js 0xae10
movslq %r12d, %rax
shlq $0x5, %rax
movq (%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x20, %rsi
movq %r14, %rdi
callq 0x5050
testl %eax, %eax
jg 0xae10
xorl %ebp, %ebp
cmpl $0x3, %r12d
jl 0xae10
decl %r12d
xorl %r13d, %r13d
leal (%r12,%r13), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movslq %ebp, %r15
shlq $0x5, %r15
movq (%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x5050
testl %eax, %eax
js 0xadff
addq (%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5050
movl %ebp, %r13d
testl %eax, %eax
jne 0xae02
jmp 0xae10
movl %ebp, %r12d
movl %r12d, %eax
subl %r13d, %eax
movl %r13d, %ebp
cmpl $0x1, %eax
jg 0xadc2
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
xorl %ebp, %ebp
leaq 0x4(%rsp), %r15
movl %ebp, (%r15)
movq %r15, %rdx
callq 0xd368
movl $0x18, %edi
callq 0x5410
movq %rax, %r14
movslq 0x110(%rbx), %rsi
movl %ebp, (%r15)
leaq 0x4(%rsp), %rdx
leaq 0x3(%rsp), %rcx
movq %rax, %rdi
callq 0xda4a
movq %r14, 0x210(%rbx)
movl $0x18, %edi
callq 0x5410
movq %rax, %r14
movslq 0xdc(%rbx), %rsi
leaq 0x4(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x3(%rsp), %rcx
movq %rax, %rdi
callq 0xda4a
movq %r14, 0x218(%rbx)
movl 0xdc(%rbx), %r13d
testl %r13d, %r13d
jle 0xb5ed
xorl %r15d, %r15d
movq 0x2da71(%rip), %r14     # 0x38fd0
leaq 0x1e8be(%rip), %r12     # 0x29e24
movq 0xe8(%rbx), %rax
movl (%rax,%r15,4), %ebp
movl $0xa, %edx
movq %r14, %rdi
leaq 0x1de94(%rip), %rsi     # 0x29414
callq 0x5470
movl 0xdc(%rbx), %esi
movq %r14, %rdi
callq 0x5680
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x5470
movq %r13, %rdi
movl %ebp, %esi
callq 0x5680
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r13, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
incq %r15
movslq 0xdc(%rbx), %r13
cmpq %r13, %r15
jl 0xb566
movl $0x18, %edi
callq 0x5410
movq %rax, %r14
movslq %r13d, %rsi
leaq 0x4(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x3(%rsp), %rcx
movq %rax, %rdi
callq 0xda4a
movq %r14, 0x228(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb62f
jmp 0xb62f
movq %rax, %rbx
movq %r14, %rdi
callq 0x53d0
movq %rbx, %rdi
callq 0x56b0
// File: /workspace/github_cpp_makefile_star2_O1/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:
subq $0x38, %rsp
movq %rsi, %xmm3
movq 0x1c089(%rip), %xmm1    # 0x29160
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movapd 0x1c08d(%rip), %xmm2    # 0x29170
subpd %xmm2, %xmm3
movapd %xmm3, %xmm0
unpckhpd %xmm3, %xmm0            # xmm0 = xmm0[1],xmm3[1]
addsd %xmm3, %xmm0
mulsd 0x1c01d(%rip), %xmm0    # 0x29118
movq %rdi, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm1
unpckhpd %xmm3, %xmm1            # xmm1 = xmm1[1],xmm3[1]
addsd %xmm3, %xmm1
movapd %xmm1, 0x10(%rsp)
divsd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
movl %edx, %edi
movl $0x200, %esi            # imm = 0x200
callq 0xfb00
movsd %xmm0, 0x8(%rsp)
movsd 0x1bfa2(%rip), %xmm0    # 0x290e0
callq 0x53a0
movapd 0x10(%rsp), %xmm1
mulsd 0x1bfcf(%rip), %xmm1    # 0x29120
ucomisd 0x1bfcf(%rip), %xmm1    # 0x29128
movapd 0x1c01f(%rip), %xmm0    # 0x29180
xorpd %xmm1, %xmm0
jbe 0xd17e
callq 0x56c0
movapd %xmm0, %xmm1
movsd 0x1bfc0(%rip), %xmm0    # 0x29138
subsd %xmm1, %xmm0
jmp 0xd18e
mulsd %xmm1, %xmm0
mulsd 0x1bfa6(%rip), %xmm0    # 0x29130
addsd %xmm1, %xmm0
movapd 0x20(%rsp), %xmm1
mulsd 0x1bf4c(%rip), %xmm1    # 0x290e8
addsd 0x1bf4c(%rip), %xmm1    # 0x290f0
movsd 0x1bf4c(%rip), %xmm2    # 0x290f8
divsd %xmm1, %xmm2
addsd 0x8(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm2
subsd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x38, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x68(%rdi), %rax
movq %rax, %rdx
subq 0x48(%rdi), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rax
adcq $-0x1, %rdx
movslq (%rdi), %rcx
movl $0x5, %r14d
testq %rcx, %rcx
jle 0xd7b4
shlq $0x6, %rdx
movq 0x50(%rbx), %rsi
subq 0x58(%rbx), %rsi
movq 0x40(%rbx), %rax
shrq $0x3, %rsi
subq 0x30(%rbx), %rax
shrq $0x3, %rax
addq %rsi, %rax
addq %rdx, %rax
testl %eax, %eax
jle 0xd7b4
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
imulq %rcx, %rax
addq $0x7cfff, %rax          # imm = 0x7CFFF
shrq $0xc, %rax
movabsq $0x20c49ba5e353f7d, %rcx # imm = 0x20C49BA5E353F7D
mulq %rcx
movq %rdx, %r14
shll $0x6, %r14d
orl $0x5, %r14d
leaq 0x20(%rbx), %r15
movl %r14d, 0x18(%rbx)
movl %r14d, %r13d
movq %r13, %rdi
callq 0x5030
movq %rax, %r12
movq %rax, 0x10(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x5240
movl %r14d, %ebp
addl $-0x5, %ebp
je 0xd7f0
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0xe536
movl %ebp, %eax
movb $-0x1, (%r12,%rax)
leal -0x4(%r14), %eax
movb $0x0, (%r12,%rax)
movb 0x4(%rbx), %al
addl $-0x3, %r14d
movb %al, (%r12,%r14)
movq %r15, %rdi
callq 0xe704
movq 0x50(%rbx), %rax
cmpq 0x30(%rbx), %rax
jne 0xd82c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bd2c(%rip), %rdi     # 0x2955f
leaq 0x1bca6(%rip), %rsi     # 0x294e0
leaq 0x1bd03(%rip), %rcx     # 0x29544
movl $0x3d, %edx
callq 0x5280
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x52f0
testl %eax, %eax
jle 0xdccc
movl %eax, %ebp
callq 0x56e0
movslq %eax, %rsi
movq %rsp, %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
callq 0x5200
movq (%rbx), %r15
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
xorl %esi, %esi
callq 0x5240
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r15, %rsi
callq 0x5590
movq (%rbx), %rdi
movl (%rdi), %ebx
movl %ebx, 0x134(%r14)
callq 0x5490
movl %ebp, %edi
callq 0x5740
jmp 0xdd3d
movq 0x2b2fd(%rip), %r14     # 0x38fd0
leaq 0x1b8a5(%rip), %rsi     # 0x2957f
movl $0x1a, %edx
movq %r14, %rdi
callq 0x5470
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x5470
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
callq 0x5060
movl (%rax), %edi
callq 0x5170
leaq 0x1b842(%rip), %rdi     # 0x29575
movq %rax, %rsi
xorl %eax, %eax
callq 0x5070
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14d
movq %rdx, %rbx
movq %rsi, %r15
movq (%rsi), %rdi
movl $0x2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x52f0
movl %eax, %ebp
testl %eax, %eax
jg 0xdff8
movq 0x2b042(%rip), %r12     # 0x38fd0
leaq 0x1b5ea(%rip), %rsi     # 0x2957f
movl $0x1a, %edx
movq %r12, %rdi
callq 0x5470
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x5470
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
callq 0x5060
movl (%rax), %edi
callq 0x5170
leaq 0x1b587(%rip), %rdi     # 0x29575
movq %rax, %rsi
xorl %eax, %eax
callq 0x5070
leaq 0x8(%rsp), %r15
movl $0x1000, %esi           # imm = 0x1000
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
callq 0x5200
movq (%r15), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x5240
testl %r14d, %r14d
jle 0xe072
movl %r14d, %r15d
xorl %r12d, %r12d
movq %r12, %rax
shlq $0x34, %rax
jne 0xe055
movq 0x8(%rsp), %r14
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq 0x5240
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
callq 0x5590
movq 0x8(%rsp), %rax
movl %r12d, %ecx
andl $0xfff, %ecx            # imm = 0xFFF
movb (%rax,%rcx), %al
movb %al, (%rbx,%r12)
incq %r12
cmpq %r12, %r15
jne 0xe029
testl %ebp, %ebp
jle 0xe07d
movl %ebp, %edi
callq 0x5740
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::QueryFilter(int, int, std::vector<unsigned long, std::allocator<unsigned long>>*, char**)
inline bool db::QueryFilter( int i, int bf_no, vector<uint64_t>* hash_digests, char** bf_list)
{
	bool result = true;
	int tmp_filter_size = filter_size;
	int tmp_num_lines = num_lines;
/*	
	if(i == num_levels - 1 && bf_no == num_sstPerLevel[i]-1){
		tmp_filter_size = last_filter_size;
	}
*/	
	if(i == num_levels - 1 && bf_no == num_sstPerLevel[i]-1){
		tmp_num_lines = last_num_lines;
	}


	if(fastlocal_bf){
		for(int blo = 0; blo < num_filter_units; blo++){
			if(!FastLocalBF::MayMatch(hash_digests->at(blo), tmp_filter_size, num_probes, bf_list[blo])) return false;
		}
	}else{
		for(int blo = 0; blo < num_filter_units; blo++){
			if(!LegacyBF::MayMatch(hash_digests->at(blo), tmp_num_lines, num_probes, bf_list[blo])) return false;
		}
	}
	

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
movl 0xdc(%rdi), %eax
movl 0x128(%rdi), %ebp
decl %eax
cmpl %esi, %eax
jne 0xe7e7
movslq %esi, %rax
movq 0xe8(%r15), %rcx
movl (%rcx,%rax,4), %eax
decl %eax
cmpl %edx, %eax
jne 0xe7e7
movl 0x12c(%r15), %ebp
movl 0x110(%r15), %eax
cmpb $0x0, 0x10c(%r15)
je 0xe848
testl %eax, %eax
jle 0xe88d
movl 0x120(%r15), %ebp
xorl %r12d, %r12d
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
jbe 0xe898
movq (%rax,%r12,8), %rdi
movl 0x130(%r15), %edx
movq (%rbx,%r12,8), %rcx
movl %ebp, %esi
callq 0xf0aa
testb %al, %al
je 0xe88f
incq %r12
movslq 0x110(%r15), %rcx
cmpq %rcx, %r12
jl 0xe80a
jmp 0xe88f
testl %eax, %eax
jle 0xe88d
xorl %r12d, %r12d
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
jbe 0xe898
movq (%rax,%r12,8), %rdi
movl 0x130(%r15), %edx
movq (%rbx,%r12,8), %rcx
movl %ebp, %esi
callq 0xf122
testb %al, %al
je 0xe88f
incq %r12
movslq 0x110(%r15), %rcx
cmpq %rcx, %r12
jl 0xe84f
jmp 0xe88f
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a7d4(%rip), %rdi     # 0x29073
movq %r12, %rsi
xorl %eax, %eax
callq 0x55d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::GetFromIndex(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline int db::GetFromIndex( int l, int bf_no, string key )
{
	char** index = blk_fp_prime[l][bf_no];

	int index_pos = binary_search(key, index, blk_size_prime[l][bf_no]);
	//cout << key << " " << l << " " << index_pos << endl;
	return index_pos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x160(%rdi), %rax
movslq %esi, %r14
movq (%rax,%r14,8), %rax
movslq %edx, %r13
movq (%rax,%r13,8), %r12
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x6bf6
movq 0x168(%rbx), %rax
movq (%rax,%r14,8), %rax
movslq (%rax,%r13,4), %r13
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r13, %r13
je 0xe979
cmpl $0x1, %r13d
jne 0xe910
xorl %ebx, %ebx
jmp 0xe979
movq 0x8(%rsp), %r14
movq (%r12), %rsi
movq %r14, %rdi
callq 0x5550
testl %eax, %eax
js 0xe979
movq -0x8(%r12,%r13,8), %rsi
movq %r14, %rdi
callq 0x5550
testl %eax, %eax
jg 0xe979
xorl %ebx, %ebx
cmpl $0x3, %r13d
jl 0xe979
decq %r13
xorl %ebp, %ebp
leal (%rbp,%r13), %eax
movl %eax, %ebx
shrl $0x1f, %ebx
addl %eax, %ebx
sarl %ebx
movslq %ebx, %rax
movq (%r12,%rax,8), %rsi
movq %r14, %rdi
callq 0x5550
testl %eax, %eax
jns 0xe969
movl %ebx, %r13d
jmp 0xe96d
movl %ebx, %ebp
je 0xe979
movl %r13d, %eax
subl %ebp, %eax
movl %ebp, %ebx
cmpl $0x1, %eax
jg 0xe943
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xe988
callq 0x53d0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/./bloom_impl.h
// Function: FastLocalBF::MayMatch(unsigned long, int, int, char const*)
static inline void PrepareHash(uint32_t h1, uint32_t len_bytes,
                                 const char *data,
                                 uint32_t /*out*/ *byte_offset) {
    uint32_t bytes_to_cache_line = fastrange32(len_bytes >> 6,h1) << 6;
    PREFETCH(data + bytes_to_cache_line, 0 /* rw */, 1 /* locality */);
    PREFETCH(data + bytes_to_cache_line + 63, 0 /* rw */, 1 /* locality */);
    *byte_offset = bytes_to_cache_line;
  }

// Assembly:
shrl $0x6, %esi
movl %edi, %eax
imulq %rax, %rsi
shrq $0x1a, %rsi
andl $-0x40, %esi
prefetcht2 (%rcx,%rsi)
prefetcht2 0x3f(%rcx,%rsi)
testl %edx, %edx
setle %al
jle 0xf121
addq %rsi, %rcx
movq %rdi, %rsi
shrq $0x37, %rsi
movq %rdi, %r8
shrq $0x3a, %r8
movzbl (%rcx,%r8), %r8d
andl $0x7, %esi
btl %esi, %r8d
jae 0xf121
shrq $0x20, %rdi
movl $0x1, %esi
movl %esi, %eax
cmpl %esi, %edx
je 0xf11c
imull $0x9e3779b9, %edi, %edi # imm = 0x9E3779B9
movl %edi, %r8d
shrl $0x17, %r8d
movl %edi, %esi
shrl $0x1a, %esi
movzbl (%rcx,%rsi), %r9d
andl $0x7, %r8d
leal 0x1(%rax), %esi
btl %r8d, %r9d
jb 0xf0f2
cmpl %edx, %eax
setge %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/./LegacyBF.h
// Function: LegacyBF::MayMatch(unsigned long, int, int, char*)
static bool MayMatch(uint64_t hash_digest, int num_lines, int num_probes, char* data) {  // originally BloomHash is used, to make it compatible with sharing hashing, change it with GetSliceHash64
    uint32_t hash = Lower32of64(hash_digest);
    //std::cout << Lower32of64(hash_digest) << std::endl;
    //std::cout << hash << std::endl;
    uint32_t byte_offset;
    LegacyBloomImpl::PrepareHashMayMatch(
        hash, num_lines, data, /*out*/ &byte_offset, 6);
    return LegacyBloomImpl::HashMayMatchPrepared(
        hash, num_probes, data + byte_offset, 6);
  }

// Assembly:
movl %edx, %r8d
movl %edi, %eax
xorl %edx, %edx
divl %esi
shll $0x6, %edx
prefetcht2 (%rcx,%rdx)
prefetcht2 0x3f(%rcx,%rdx)
testl %r8d, %r8d
setle %al
jle 0xf191
addq %rdx, %rcx
movl %edi, %edx
shrl $0x3, %edx
andl $0x3f, %edx
movzbl (%rcx,%rdx), %edx
movl %edi, %esi
andl $0x7, %esi
btl %esi, %edx
jae 0xf191
movl %edi, %eax
shrl $0x11, %eax
leal (%rax,%rdi), %edx
movl $0x1, %edi
movl %edi, %esi
cmpl %edi, %r8d
je 0xf18b
movl %edx, %edi
shrl $0x3, %edi
andl $0x3f, %edi
movzbl (%rcx,%rdi), %r9d
movl %edx, %r10d
andl $0x7, %r10d
addl %eax, %edx
leal 0x1(%rsi), %edi
btl %r10d, %r9d
jb 0xf165
cmpl %r8d, %esi
setge %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/./bloom_impl.h
// Function: BloomMath::CacheLocalFpRate(double, int, int)
static double CacheLocalFpRate(double bits_per_key, int num_probes,
                                 int cache_line_bits) {
    double keys_per_cache_line = cache_line_bits / bits_per_key;
    // A reasonable estimate is the average of the FP rates for one standard
    // deviation above and below the mean bucket occupancy. See
    // https://github.com/facebook/rocksdb/wiki/RocksDB-Bloom-Filter#the-math
    double keys_stddev = std::sqrt(keys_per_cache_line);
    double crowded_fp = StandardFpRate(
        cache_line_bits / (keys_per_cache_line + keys_stddev), num_probes);
    double uncrowded_fp = StandardFpRate(
        cache_line_bits / (keys_per_cache_line - keys_stddev), num_probes);
    return (crowded_fp + uncrowded_fp) / 2;
  }

// Assembly:
pushq %rbx
subq $0x30, %rsp
movl %edi, %ebx
cvtsi2sd %esi, %xmm1
movsd %xmm1, 0x8(%rsp)
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
movsd %xmm1, (%rsp)
jb 0xfb2d
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
jmp 0xfb3b
movapd %xmm1, %xmm0
callq 0x5310
movsd (%rsp), %xmm1
movsd %xmm0, 0x10(%rsp)
movapd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd 0x8(%rsp), %xmm1
divsd %xmm2, %xmm1
movl %ebx, %eax
negl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%rsp)
divsd %xmm1, %xmm0
callq 0x56c0
movsd 0x195c3(%rip), %xmm3    # 0x29138
subsd %xmm0, %xmm3
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
movsd %xmm1, 0x18(%rsp)
movapd %xmm3, %xmm0
callq 0x56a0
movsd %xmm0, 0x28(%rsp)
movsd (%rsp), %xmm1
subsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd 0x20(%rsp), %xmm0
divsd %xmm2, %xmm0
callq 0x56c0
movsd 0x19577(%rip), %xmm1    # 0x29138
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x56a0
addsd 0x28(%rsp), %xmm0
mulsd 0x1954e(%rip), %xmm0    # 0x29130
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/BF_bit.cpp
// Function: BFHash::prepareHashFuncs(HashType)
void BFHash:: prepareHashFuncs(HashType ht){
   ht_ = ht;
   filter_unit_hash_funcs_ = vector<HashType> (num_filter_units_,  ht);
   hash_digests_ = new vector<uint64_t> (num_filter_units_, 0);
   filter_unit_seeds_ = vector<uint32_t> (1, 0xbc9f1d34);
   uint32_t last_seed = 0xbc9f1d34;
   for(int i = 1; i < num_filter_units_; i++){
      last_seed = (last_seed << 17 | last_seed >> 15) + last_seed;
      filter_unit_seeds_.push_back(last_seed);
   }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
leaq 0x2c(%rsp), %rdx
movl %edi, (%rdx)
movl %edi, 0x27eab(%rip)     # 0x393dc
movslq 0x27e98(%rip), %rsi     # 0x393d0
leaq 0x10(%rsp), %rbx
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
callq 0x11c98
movq 0x27f1f(%rip), %rdi     # 0x39470
movaps (%rbx), %xmm0
movq 0x10(%rbx), %rax
movq %rdi, (%rbx)
movups 0x27f16(%rip), %xmm1    # 0x39478
movaps %xmm0, 0x27f07(%rip)    # 0x39470
movq %rax, 0x27f10(%rip)     # 0x39480
movups %xmm1, 0x8(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
testq %rdi, %rdi
je 0x1158c
callq 0x53d0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1159b
callq 0x53d0
movl $0x18, %edi
callq 0x5410
movq %rax, %rbx
movslq 0x27e21(%rip), %rsi     # 0x393d0
leaq 0x10(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0xf(%rsp), %rcx
movq %rax, %rdi
callq 0xd250
movq %rbx, 0x27ed1(%rip)     # 0x394a0
movl $0x4, %edi
callq 0x5410
movl $0xbc9f1d34, (%rax)     # imm = 0xBC9F1D34
movq 0x27ea2(%rip), %rdi     # 0x39488
movq %rax, 0x27e9b(%rip)     # 0x39488
addq $0x4, %rax
movq %rax, 0x27e98(%rip)     # 0x39490
movq %rax, 0x27e99(%rip)     # 0x39498
testq %rdi, %rdi
je 0x11609
callq 0x53d0
movl $0xbc9f1d34, 0x10(%rsp) # imm = 0xBC9F1D34
cmpl $0x2, 0x27db8(%rip)     # 0x393d0
jl 0x1166e
movl $0x1, %ebp
leaq 0x27e62(%rip), %rbx     # 0x39488
leaq 0x10(%rsp), %r14
movl 0x10(%rsp), %ecx
movl %ecx, %eax
roll $0x11, %eax
addl %ecx, %eax
movl %eax, 0x10(%rsp)
movq 0x27e4f(%rip), %rsi     # 0x39490
cmpq 0x27e50(%rip), %rsi     # 0x39498
je 0x11659
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x27e39(%rip)     # 0x39490
jmp 0x11664
movq %rbx, %rdi
movq %r14, %rdx
callq 0x11d32
incl %ebp
cmpl 0x27d64(%rip), %ebp     # 0x393d0
jl 0x1162b
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x53d0
movq %r14, %rdi
callq 0x56b0
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/BF_bit.cpp
// Function: get_index(unsigned long, int, int, int*)
void get_index( uint64_t hash_digest, int BF_index, int BF_size, int *index )
{

  uint64_t m_int_hash = hash_digest;
  index[0] = m_int_hash % BF_size;
  // get BF indices
  uint64_t delta = (m_int_hash << 17 | m_int_hash >> 15);
  for( uint32_t n=1 ; n<BF_index ; n++ ){
    m_int_hash = m_int_hash + delta; 
    index[n] =  m_int_hash % BF_size;
  }

  return;
}

// Assembly:
movslq %edx, %r8
movq %rdi, %rax
xorl %edx, %edx
divq %r8
movl %edx, (%rcx)
cmpl $0x2, %esi
jb 0x11c51
movq %rdi, %rax
shlq $0x11, %rax
movq %rdi, %xmm0
shrq $0xf, %rdi
orq %rax, %rdi
movl %esi, %eax
leaq 0x2(%rax), %rsi
andq $-0x4, %rsi
addq $-0x2, %rax
pshufd $0x44, %xmm0, %xmm4     # xmm4 = xmm0[0,1,0,1]
movq %rdi, %xmm0
movdqa 0x176db(%rip), %xmm1    # 0x291c0
pshufd $0x44, %xmm0, %xmm2     # xmm2 = xmm0[0,1,0,1]
movdqa %xmm2, %xmm3
pmuludq %xmm1, %xmm3
movdqa %xmm2, %xmm5
psrlq $0x20, %xmm5
pmuludq %xmm1, %xmm5
psllq $0x20, %xmm5
pslldq $0x8, %xmm0             # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
paddq %xmm4, %xmm3
paddq %xmm5, %xmm3
paddq %xmm4, %xmm0
movdqa %xmm2, %xmm4
psllq $0x2, %xmm4
movq %rax, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
xorl %edi, %edi
movdqa 0x1765e(%rip), %xmm6    # 0x29190
movdqa 0x17666(%rip), %xmm7    # 0x291a0
pxor %xmm7, %xmm5
pcmpeqd %xmm8, %xmm8
movq %rdi, %xmm9
pshufd $0x44, %xmm9, %xmm9     # xmm9 = xmm9[0,1,0,1]
movdqa %xmm9, %xmm10
por %xmm6, %xmm10
pxor %xmm7, %xmm10
movdqa %xmm10, %xmm11
pcmpgtd %xmm5, %xmm11
pcmpeqd %xmm5, %xmm10
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
pand %xmm11, %xmm10
pshufd $0xf5, %xmm11, %xmm11   # xmm11 = xmm11[1,1,3,3]
por %xmm10, %xmm11
movdqa %xmm0, %xmm10
paddq %xmm2, %xmm10
movd %xmm11, %eax
notl %eax
testb $0x1, %al
je 0x11ba5
movq %xmm10, %rax
xorl %edx, %edx
divq %r8
movl %edx, 0x4(%rcx,%rdi,4)
pxor %xmm8, %xmm11
pextrw $0x4, %xmm11, %eax
testb $0x1, %al
je 0x11bc8
pshufd $0xee, %xmm10, %xmm10   # xmm10 = xmm10[2,3,2,3]
movq %xmm10, %rax
xorl %edx, %edx
divq %r8
movl %edx, 0x8(%rcx,%rdi,4)
por %xmm1, %xmm9
movdqa %xmm3, %xmm10
paddq %xmm2, %xmm10
pxor %xmm7, %xmm9
movdqa %xmm9, %xmm11
pcmpgtd %xmm5, %xmm11
pcmpeqd %xmm5, %xmm9
pshufd $0xf5, %xmm9, %xmm12    # xmm12 = xmm9[1,1,3,3]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm11, %xmm9    # xmm9 = xmm11[1,1,3,3]
por %xmm12, %xmm9
pxor %xmm8, %xmm9
pextrw $0x0, %xmm9, %eax
testb $0x1, %al
je 0x11c1e
movq %xmm10, %rax
xorl %edx, %edx
divq %r8
movl %edx, 0xc(%rcx,%rdi,4)
pextrw $0x4, %xmm9, %eax
testb $0x1, %al
je 0x11c3c
pshufd $0xee, %xmm10, %xmm9    # xmm9 = xmm10[2,3,2,3]
movq %xmm9, %rax
xorl %edx, %edx
divq %r8
movl %edx, 0x10(%rcx,%rdi,4)
addq $0x4, %rdi
paddq %xmm4, %xmm0
paddq %xmm4, %xmm3
cmpq %rdi, %rsi
jne 0x11b43
retq
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/./args.hxx
// Function: args::ArgumentParser::ParseCLI(int, char const* const*)
bool ParseCLI(const int argc, const char * const * argv)
            {
                if (Prog().empty())
                {
                    Prog(argv[0]);
                }
                const std::vector<std::string> args(argv + 1, argv + argc);
                return ParseArgs(args) == std::end(args);
            }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
cmpq $0x0, 0x2c0(%rdi)
jne 0x15550
movq (%r14), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x51b0
leaq 0x2b8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5230
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15550
callq 0x53d0
movslq %ebp, %rax
leaq (%r14,%rax,8), %rdx
addq $0x8, %r14
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rcx
movq %r14, %rsi
callq 0x1ce14
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %r15
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x70(%rax)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1cf5a
leaq 0x8(%rsp), %rdi
cmpq 0x8(%rdi), %rax
sete %bl
callq 0x6982
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x155d8
callq 0x53d0
jmp 0x155d8
jmp 0x155d5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6982
jmp 0x155d8
movq %rax, %rbx
movq %rbx, %rdi
callq 0x56b0
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/./args.hxx
// Function: args::ArgumentParser::SetArgumentSeparations(bool, bool, bool, bool)
void SetArgumentSeparations(
                const bool allowJoinedShortValue_,
                const bool allowJoinedLongValue_,
                const bool allowSeparateShortValue_,
                const bool allowSeparateLongValue_)
            {
                this->allowJoinedShortValue = allowJoinedShortValue_;
                this->allowJoinedLongValue = allowJoinedLongValue_;
                this->allowSeparateShortValue = allowSeparateShortValue_;
                this->allowSeparateLongValue = allowSeparateLongValue_;

                this->helpParams.longSeparator = allowJoinedLongValue ? longseparator : " ";
                this->helpParams.shortSeparator = allowJoinedShortValue ? "" : " ";
            }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movb %sil, 0x1f8(%rdi)
movb %dl, 0x1f9(%rdi)
movb %cl, 0x1fa(%rdi)
movb %r8b, 0x1fb(%rdi)
leaq 0x18(%rsp), %rax
testl %edx, %edx
je 0x15fb0
movq %rax, -0x10(%rax)
movq 0x1b8(%rbx), %rsi
movq 0x1c0(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x6bf6
jmp 0x15fcc
movq %rax, -0x10(%rax)
leaq 0x13e69(%rip), %rsi     # 0x29e24
leaq 0x13e63(%rip), %rdx     # 0x29e25
leaq 0x8(%rsp), %rdi
callq 0xfa70
leaq 0x298(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x54b0
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15ff2
callq 0x53d0
movzbl 0x1f8(%rbx), %r8d
leaq 0x13458(%rip), %rax     # 0x29459
leaq 0x13e1c(%rip), %rcx     # 0x29e24
testq %r8, %r8
cmovneq %rax, %rcx
movq 0x280(%rbx), %rdx
addq $0x278, %rbx            # imm = 0x278
xorq $0x1, %r8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x55f0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/BU-DiSC[P]BF-Shared-Hashing/./args.hxx
// Function: args::Command::GetCommands()
virtual std::vector<Command*> GetCommands() override
            {
                if (selectedCommand != nullptr)
                {
                    return selectedCommand->GetCommands();
                }

                if (Matched())
                {
                    return Group::GetCommands();
                }

                return { this };
            }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x130(%rsi), %rsi
testq %rsi, %rsi
je 0x168aa
movq (%rsi), %rax
movq %rbx, %rdi
callq *0x28(%rax)
jmp 0x168de
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
testb %al, %al
je 0x168c4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x17016
jmp 0x168de
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x19f9e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop