// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/hm3/btreeindex/btreeindexbuilder_impl.h
// Function: hm3::btreeindex::BTreeIndexBuilder<hm3::DiskTable>::createFromList(StringRef const&, hm3::DiskTable const&)
bool BTreeIndexBuilder<LIST>::createFromList(const StringRef &filename, const LIST &list){
	auto const count = list.getCount();

	levels_ = calcDepth1__(count);

	printf("Records          : %zu\n",		size_t{ count }	);
	printf("Branching Factor : %u (const)\n",	BRANCHES	);
	printf("Tree Depth       : %u\n",		levels_		);

	file_indx_.open(filenameIndx(filename),	std::ios::out | std::ios::binary);
	file_data_.open(filenameData(filename),	std::ios::out | std::ios::binary);

	current_ = 0;

	for(level_type level = 0; level < levels_; ++level){
		printf("Processing level %u...\n", level);

		reorder(list, 0, count, level);
	}

	file_indx_.close();
	file_data_.close();

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0x8(%rdx), %r15
testq %r15, %r15
je 0x271f
movb $0x1, %dl
movq %r15, %rcx
movl %edx, %eax
cmpq $0x80, %rcx
jb 0x2721
addq $-0x7f, %rcx
movq %rcx, %rsi
shrq $0x7, %rsi
leal 0x1(%rax), %edx
cmpq $0x7f, %rcx
movq %rsi, %rcx
ja 0x26fb
jmp 0x2721
xorl %eax, %eax
leal -0x1(%rax), %ecx
cmpb $0x2, %al
movzbl %cl, %eax
movl $0x1, %ecx
cmovael %eax, %ecx
movzbl %cl, %eax
movw %ax, 0x408(%rbx)
leaq 0x28dd(%rip), %rdi      # 0x501f
xorl %r13d, %r13d
movq %r15, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x28e1(%rip), %rdi      # 0x5037
movl $0x80, %esi
xorl %eax, %eax
callq 0x2030
movzwl 0x408(%rbx), %esi
leaq 0x28e6(%rip), %rdi      # 0x5056
xorl %eax, %eax
callq 0x2030
movups (%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x5, 0x30(%rsp)
leaq 0x28f4(%rip), %rax      # 0x5085
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %eax, %eax
addq 0x20(%rsp,%rax), %r13
addq $0x10, %rax
cmpq $0x20, %rax
jne 0x27ac
movq %rsp, %rdi
movq %r13, %rsi
callq 0x2270
movl $0x8, %ebp
movq %rsp, %r13
movq 0x18(%rsp,%rbp), %rdx
movq 0x20(%rsp,%rbp), %rsi
movq %r13, %rdi
callq 0x2050
addq $0x10, %rbp
cmpq $0x28, %rbp
jne 0x27ce
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x14, %edx
callq 0x20c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2815
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movups (%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x5, 0x30(%rsp)
leaq 0x285c(%rip), %rax      # 0x508b
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
xorl %esi, %esi
xorl %eax, %eax
addq 0x20(%rsp,%rax), %rsi
addq $0x10, %rax
cmpq $0x20, %rax
jne 0x284f
movq %rsp, %rdi
callq 0x2270
leaq 0x200(%rbx), %r12
movl $0x8, %ebp
movq %rsp, %r13
movq 0x18(%rsp,%rbp), %rdx
movq 0x20(%rsp,%rbp), %rsi
movq %r13, %rdi
callq 0x2050
addq $0x10, %rbp
cmpq $0x28, %rbp
jne 0x2875
movq %rsp, %rsi
movq %r12, %rdi
movl $0x14, %edx
callq 0x20c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x28bc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movq $0x0, 0x400(%rbx)
cmpw $0x0, 0x408(%rbx)
je 0x2912
xorl %r13d, %r13d
leaq 0x2792(%rip), %rbp      # 0x506d
movzbl %r13b, %r13d
movq %rbp, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x2a18
incb %r13b
movzbl %r13b, %eax
cmpw %ax, 0x408(%rbx)
ja 0x28db
movq %rbx, %rdi
callq 0x2220
movq %r12, %rdi
callq 0x2220
movb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x293d
jmp 0x293d
jmp 0x293d
jmp 0x293d
jmp 0x293d
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x295b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x22c0
nop