// File: /workspace/github_cpp_makefile_star2_O3/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 0x2848
movl $0x1, %ebx
jmp 0x27d6
movq 0x8(%rbx), %r15
movq 0x10(%rbx), %r14
movl %edi, %eax
movq %rax, (%rsp)
testq %r14, %r14
je 0x2554
movq %r14, %rdi
callq 0x20b0
jmp 0x255d
leaq 0x4ab1(%rip), %r14      # 0x700c
xorl %eax, %eax
leaq 0x58(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, 0x8(%rsi)
leaq 0x20(%rsp), %rdi
callq 0x2a62
leaq 0x40(%rsp), %r14
movq %r14, 0x18(%rsp)
movzbl (%r15), %eax
cmpl $0x6c, %eax
je 0x2604
cmpl $0x72, %eax
jne 0x27a6
movl $0x3, %r14d
leaq 0xd8(%rsp), %r15
leaq 0x18(%rsp), %r12
leaq 0x58(%rsp), %r13
movq (%rbx,%r14,8), %rbp
testq %rbp, %rbp
je 0x25ba
movq %rbp, %rdi
callq 0x20b0
jmp 0x25c3
leaq 0x4a4b(%rip), %rbp      # 0x700c
xorl %eax, %eax
movq %rax, 0x58(%rsp)
movq %rbp, 0x60(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2c24
cmpq $0x0, 0xd8(%rsp)
je 0x25ee
movq %r15, %rdi
callq 0x48b0
movq %r15, %rdi
callq 0x46c0
incq %r14
cmpq %r14, (%rsp)
jne 0x25a7
jmp 0x279d
addq $-0x3, (%rsp)
xorl %r14d, %r14d
leaq 0x58(%rsp), %r13
leaq 0xd8(%rsp), %rbp
leaq 0x98(%rsp), %r15
movq 0x18(%rbx,%r14,8), %r12
testq %r12, %r12
je 0x2669
movq %r12, %rdi
callq 0x20b0
movq %rax, 0x8(%rsp)
movq %r12, 0x10(%rsp)
cmpq $0x1, %rax
jne 0x267e
cmpb $0x2d, (%r12)
jne 0x267e
movb $0x0, 0xd8(%rsp)
movq %r13, %rdi
leaq 0x40(%rsp), %r12
movq %r12, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x2cfc
jmp 0x2695
movq $0x0, 0x8(%rsp)
leaq 0x4993(%rip), %rax      # 0x700c
movq %rax, 0x10(%rsp)
movq %r13, %rdi
leaq 0x40(%rsp), %r12
movq %r12, %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x34f0
movb $0x1, 0x98(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x2cfc
movq %r15, %rdi
movq %r13, %rsi
callq 0x3692
leaq 0x70(%rsp), %rax
movups (%rax), %xmm0
leaq 0xb0(%rsp), %rax
movups %xmm0, (%rax)
leaq 0xc0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x372e
movl $0xa, %r12d
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3886
testb %al, %al
jne 0x2721
movq 0xb8(%rsp), %rax
testq %rax, %rax
jne 0x270a
movq %r15, %rdi
callq 0x3924
movq %rax, %rdi
callq 0x48b0
decq %r12
je 0x2721
movq %r15, %rdi
callq 0x2c82
jmp 0x26e6
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x273e
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %r15, %rdi
callq 0x3010
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x2763
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbp, %rdi
callq 0x3010
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2788
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %r13, %rdi
callq 0x3010
incq %r14
cmpq (%rsp), %r14
jne 0x2621
xorl %ebx, %ebx
leaq 0x40(%rsp), %r14
jmp 0x27b3
movq (%rbx), %rdi
movl $0x1, %ebx
callq 0x2848
movq %r14, %rdi
callq 0x2afc
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27d6
movq 0x30(%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 0x280a
jmp 0x280a
movq %rax, %rbx
jmp 0x282c
movq %rax, %rbx
jmp 0x281f
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x3010
jmp 0x281f
movq %rax, %rbx
jmp 0x2836
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x2cda
leaq 0xd8(%rsp), %rdi
callq 0x2cda
leaq 0x58(%rsp), %rdi
callq 0x2cda
leaq 0x20(%rsp), %rdi
callq 0x2ad4
movq %rbx, %rdi
callq 0x22e0