// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq %rdx, %r14
movl %esi, %ebp
movq (%rcx), %rbx
movq %rcx, 0x8(%rsp)
movq 0x8(%rcx), %r15
cmpq %rbx, %r15
je 0xb252
movq %rbx, %r12
movq %r12, %rdi
callq 0x698e
addq $0x18, %r12
cmpq %r15, %r12
jne 0xb238
movq 0x8(%rsp), %rax
movq %rbx, 0x8(%rax)
movq %r13, %rdi
callq 0xdf6c
movq %r13, %r15
movq (%r14), %r13
movq 0x8(%r14), %r12
movq %r12, %rax
subq %r13, %rax
je 0xb372
sarq $0x5, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x10b75
movq %r13, %rdi
movq %r12, %rsi
callq 0x10c49
movq (%r14), %rsi
movq 0x8(%r14), %rbx
subq %rsi, %rbx
shrq $0x5, %rbx
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0x6b8a
cmpl %ebp, %ebx
jle 0xb324
movslq %ebp, %r15
movslq %ebx, %rax
movq %rax, 0x18(%rsp)
movq %r15, %rbp
shlq $0x5, %rbp
xorl %ebx, %ebx
leaq 0x20(%rsp), %r13
xorl %r12d, %r12d
movq (%r14), %rsi
addq %rbx, %rsi
leaq (%rsi,%rbp), %rdx
movq %r13, %rdi
leaq 0x7(%rsp), %rcx
callq 0xdfb2
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x10696
movq %r13, %rdi
callq 0x698e
movq (%r14), %rsi
addq %rbp, %rsi
addq %rbx, %rsi
movq 0x10(%rsp), %rdi
callq 0x6b8a
addq %r15, %r12
addq %rbp, %rbx
leaq (%r15,%r12), %rax
cmpq 0x18(%rsp), %rax
jl 0xb2d2
jmp 0xb327
xorl %r12d, %r12d
shlq $0x5, %r12
addq (%r14), %r12
movq 0x8(%r14), %rdx
leaq 0x20(%rsp), %rdi
leaq 0x7(%rsp), %rcx
movq %r12, %rsi
callq 0xdfb2
leaq 0x20(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x10696
movq 0x10(%rsp), %rbx
leaq 0x20(%rsp), %rdi
callq 0x698e
movq 0x8(%r14), %rsi
addq $-0x20, %rsi
movq %rbx, %rdi
callq 0x6b8a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb38a
jmp 0xb385
movq %rax, %rbx
jmp 0xb397
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x698e
movq %rbx, %rdi
callq 0x56b0
nop