// File: /workspace/github_cpp_makefile_star2_O3/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 0x2733
xorl %edx, %edx
movq %r15, %rcx
movl %edx, %eax
cmpq $0x80, %rcx
jb 0x271d
addq $-0x7f, %rcx
movq %rcx, %rsi
shrq $0x7, %rsi
leal 0x1(%rax), %edx
cmpq $0x7f, %rcx
movq %rsi, %rcx
ja 0x26fb
leal 0x1(%rax), %ecx
cmpb $0x2, %cl
movzbl %al, %eax
movl $0x1, %ecx
cmovael %eax, %ecx
movzbl %cl, %eax
jmp 0x2737
movw $0x1, %ax
movw %ax, 0x408(%rbx)
leaq 0x28da(%rip), %rdi      # 0x501f
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
movq %r12, 0x40(%rsp)
movups (%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x5, 0x30(%rsp)
leaq 0x28ef(%rip), %rax      # 0x5085
movq %rax, 0x38(%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
movq 0x20(%rsp), %rsi
addq $0x5, %rsi
movq %rsp, %rdi
callq 0x2270
movl $0x8, %r12d
movq %rsp, %r13
movq 0x18(%rsp,%r12), %rdx
movq 0x20(%rsp,%r12), %rsi
movq %r13, %rdi
callq 0x2050
addq $0x10, %r12
cmpq $0x28, %r12
jne 0x27ca
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x14, %edx
callq 0x20c0
movq (%rsp), %rdi
cmpq %rbp, %rdi
movq 0x40(%rsp), %r12
je 0x2811
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movups (%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x5, 0x30(%rsp)
leaq 0x2860(%rip), %rax      # 0x508b
movq %rax, 0x38(%rsp)
movq %rsp, %rdi
movq %rbp, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq 0x20(%rsp), %rsi
addq $0x5, %rsi
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 0x285f
movq %rsp, %rsi
movq %r12, %rdi
movl $0x14, %edx
callq 0x20c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x28a6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movq $0x0, 0x400(%rbx)
cmpw $0x0, 0x408(%rbx)
je 0x28fc
xorl %r13d, %r13d
leaq 0x27a8(%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 0x2a0e
incb %r13b
movzbl %r13b, %eax
cmpw %ax, 0x408(%rbx)
ja 0x28c5
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 0x2925
jmp 0x2925
jmp 0x2938
jmp 0x2938
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
jne 0x2944
jmp 0x2951
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2951
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x22c0
nop