// File: /workspace/github_cpp_makefile_star2_O1/nmmmnu[P]HM3/hm3/main/db_lsm.cc
// Function: main
int main(int argc, char **argv){
	if (argc <= 3){
		printUsage(argv[0]);
		return 1;
	}

	// =======================

	const auto op		= argv[1];
	const auto path		= argv[2];

	size_t const keyCount	= (size_t) argc - 3;
	char **keys		= & argv[3];

	// =======================

	using DirectoryTableLoader = hm3::tableloader::DirectoryTableLoader;
	using MyLSMTable = hm3::LSMTable<DirectoryTableLoader::container_type>;

	DirectoryTableLoader dl{ path };
	MyLSMTable mtlist(*dl);

	// =======================

	switch(op[0]){
	case 'r':	return op_filesearch(mtlist, keyCount, keys);
	case 'l':	return op_list(mtlist, keyCount, keys);
	}

	printUsage(argv[0]);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %rbx
cmpl $0x3, %edi
jg 0x2537
movq (%rbx), %rdi
callq 0x284a
movl $0x1, %ebx
jmp 0x27db
movq 0x8(%rbx), %r15
movq 0x10(%rbx), %r14
movl %edi, %ebp
testq %r14, %r14
je 0x2550
movq %r14, %rdi
callq 0x20b0
jmp 0x2559
leaq 0x4ab5(%rip), %r14      # 0x700c
xorl %eax, %eax
leaq -0x3(%rbp), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, 0x8(%rsi)
leaq 0xa0(%rsp), %rdi
callq 0x2a64
leaq 0xc0(%rsp), %r14
movq %r14, (%rsp)
movzbl (%r15), %eax
cmpl $0x6c, %eax
je 0x2618
cmpl $0x72, %eax
jne 0x27a1
cmpq $0x0, 0x8(%rsp)
je 0x27b0
movl $0x3, %r15d
leaq 0xd8(%rsp), %r14
leaq 0x20(%rsp), %r12
movq (%rbx,%r15,8), %r13
testq %r13, %r13
je 0x25cf
movq %r13, %rdi
callq 0x20b0
jmp 0x25d8
leaq 0x4a36(%rip), %r13      # 0x700c
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movq %r14, %rdi
movq %rsp, %rsi
movq %r12, %rdx
callq 0x2c1c
cmpq $0x0, 0xd8(%rsp)
je 0x2603
movq %r14, %rdi
callq 0x488c
movq %r14, %rdi
callq 0x469c
incq %r15
cmpq %r15, %rbp
jne 0x25bc
jmp 0x2795
cmpq $0x0, 0x8(%rsp)
je 0x27b0
xorl %r12d, %r12d
leaq 0x20(%rsp), %r13
leaq 0xd8(%rsp), %rbp
leaq 0x60(%rsp), %r14
movq 0x18(%rbx,%r12,8), %r15
testq %r15, %r15
je 0x264d
movq %r15, %rdi
callq 0x20b0
jmp 0x2656
leaq 0x49b8(%rip), %r15      # 0x700c
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %r15, 0x18(%rsp)
cmpq $0x1, %rax
jne 0x2687
cmpb $0x2d, (%r15)
jne 0x2687
movq (%rsp), %rsi
movb $0x0, 0xd8(%rsp)
movq %r13, %rdi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x2d16
jmp 0x269a
movq (%rsp), %rsi
movq %r13, %rdi
leaq 0x10(%rsp), %rdx
xorl %ecx, %ecx
callq 0x34e2
movq (%rsp), %rsi
movb $0x1, 0x60(%rsp)
movq %rbp, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x2d16
movq %r14, %rdi
movq %r13, %rsi
callq 0x367e
leaq 0x38(%rsp), %rax
movups (%rax), %xmm0
leaq 0x78(%rsp), %rax
movups %xmm0, (%rax)
leaq 0x88(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x371a
movl $0xa, %r15d
movq %r14, %rdi
movq %rbp, %rsi
callq 0x3872
testb %al, %al
jne 0x271e
movq 0x80(%rsp), %rax
testq %rax, %rax
jne 0x2707
movq %r14, %rdi
callq 0x393a
movq %rax, %rdi
callq 0x488c
decq %r15
je 0x271e
movq %r14, %rdi
callq 0x2c9c
jmp 0x26e3
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x273b
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %r14, %rdi
callq 0x3014
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x2760
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbp, %rdi
callq 0x3014
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x277f
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %r13, %rdi
callq 0x3014
incq %r12
cmpq 0x8(%rsp), %r12
jne 0x2639
xorl %ebx, %ebx
leaq 0xc0(%rsp), %r14
jmp 0x27b2
movq (%rbx), %rdi
movl $0x1, %ebx
callq 0x284a
jmp 0x27b2
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x2afe
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27db
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x21c0
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x280c
jmp 0x280c
movq %rax, %rbx
jmp 0x282b
movq %rax, %rbx
jmp 0x281e
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3014
jmp 0x281e
movq %rax, %rbx
jmp 0x2835
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2cf4
leaq 0xd8(%rsp), %rdi
callq 0x2cf4
leaq 0x20(%rsp), %rdi
callq 0x2cf4
leaq 0xa0(%rsp), %rdi
callq 0x2ad6
movq %rbx, %rdi
callq 0x22e0