// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/semind.c
// Function: main
int main(int argc, char **argv)
{
	static const struct command commands[] = {
		{
			.name          = "add",
			.dbflags       = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
			.parse_cmdline = parse_cmdline_add,
			.handler       = command_add
		},
		{
			.name          = "rm",
			.dbflags       = SQLITE_OPEN_READWRITE,
			.parse_cmdline = parse_cmdline_rm,
			.handler       = command_rm
		},
		{
			.name          = "search",
			.dbflags       = SQLITE_OPEN_READONLY,
			.parse_cmdline = parse_cmdline_search,
			.handler       = command_search
		},
		{ .name = NULL },
	};
	const struct command *cmd;

	if (!(progname = rindex(argv[0], '/')))
		progname = argv[0];
	else
		progname++;

	if (!realpath(".", cwd))
		semind_error(1, errno, "unable to get current directory");
	n_cwd = strlen(cwd);

	parse_cmdline(argc, argv);

	for (cmd = commands; cmd->name && strcmp(argv[optind], cmd->name); cmd++);
	if (!cmd->name)
		semind_error(1, 0, "unknown command: %s", argv[optind]);
	optind++;

	semind_command = cmd->name;

	if (cmd->parse_cmdline)
		cmd->parse_cmdline(argc, argv);

	open_database(semind_dbfile, cmd->dbflags);
	cmd->handler(argc - optind, argv + optind);

	sqlite3_close(semind_db);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
movq (%rsi), %r15
pushq $0x2f
popq %rsi
movq %r15, %rdi
callq 0xf1e0
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmoveq %r15, %rcx
movq %rcx, 0x56034(%rip)     # 0x656d0
leaq 0x33645(%rip), %rdi     # 0x42ce8
leaq 0x56036(%rip), %rsi     # 0x656e0
callq 0xf270
testq %rax, %rax
jne 0xf6cc
callq 0xf390
movl (%rax), %esi
leaq 0x2da09(%rip), %rdx     # 0x3d0cb
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x10384
leaq 0x5600d(%rip), %rdi     # 0x656e0
callq 0xf220
movq %rax, 0x57001(%rip)     # 0x666e0
leaq 0x2e71d(%rip), %rdi     # 0x3de03
callq 0xf380
movq %rax, %r15
leaq 0x2e71d(%rip), %rdi     # 0x3de12
callq 0xf380
testq %rax, %rax
je 0xf706
movq %rax, 0x50bca(%rip)     # 0x602d0
leaq 0x2e715(%rip), %r12     # 0x3de22
leaq 0x482dc(%rip), %r13     # 0x579f0
movq 0x5085d(%rip), %rbp     # 0x5ff78
movl %ebx, %edi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xf360
cmpl $0x44, %eax
je 0xf754
cmpl $0x76, %eax
je 0xf74c
cmpl $-0x1, %eax
je 0xf767
cmpl $0x42, %eax
je 0xf761
cmpl $0x68, %eax
jne 0xf71b
jmp 0xf9b7
incl 0x56faa(%rip)           # 0x666fc
jmp 0xf71b
movq (%rbp), %rax
movq %rax, 0x50b71(%rip)     # 0x602d0
jmp 0xf71b
movq (%rbp), %r15
jmp 0xf71b
movq 0x507d2(%rip), %r12     # 0x5ff40
movl (%r12), %r13d
cmpl %ebx, %r13d
je 0xf9da
testq %r15, %r15
je 0xf7c3
leaq 0x55f59(%rip), %rsi     # 0x656e0
movq %r15, %rdi
callq 0xf270
testq %rax, %rax
jne 0xf7ac
callq 0xf390
movl (%rax), %esi
leaq 0x2e699(%rip), %rdx     # 0x3de3b
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x10384
leaq 0x55f2d(%rip), %rdi     # 0x656e0
callq 0xf220
movq %rax, 0x56f21(%rip)     # 0x666e0
movl (%r12), %r13d
movslq %r13d, %rax
movq (%r14,%rax,8), %r12
leaq 0x47f7f(%rip), %rbp     # 0x57750
movq (%rbp), %r15
testq %r15, %r15
je 0xf7ef
movq %r12, %rdi
movq %r15, %rsi
callq 0xf3b0
testl %eax, %eax
je 0xf818
addq $0x20, %rbp
jmp 0xf7d1
leaq 0x2d8f5(%rip), %rdx     # 0x3d0eb
pushq $0x1
popq %rdi
xorl %esi, %esi
movq %r12, %rcx
xorl %eax, %eax
callq 0x10384
movq 0x50734(%rip), %rax     # 0x5ff40
movl (%rax), %r13d
leaq 0x47f9a(%rip), %rbp     # 0x577b0
jmp 0xf81f
movq 0x50721(%rip), %rax     # 0x5ff40
incl %r13d
movl %r13d, (%rax)
movq %r15, 0x56ebc(%rip)     # 0x666e8
movq 0x10(%rbp), %rax
testq %rax, %rax
je 0xf83c
movl %ebx, %edi
movq %r14, %rsi
callq *%rax
movq 0x50a8d(%rip), %r15     # 0x602d0
movl 0x8(%rbp), %r12d
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0xf480
movl %eax, %r13d
leaq 0x56e94(%rip), %rsi     # 0x666f0
movq %r15, %rdi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0xf140
testl %eax, %eax
je 0xf892
movq 0x56e7c(%rip), %rdi     # 0x666f0
callq 0xf3e0
leaq 0x2eae7(%rip), %rdx     # 0x3e367
pushq $0x1
popq %rdi
xorl %esi, %esi
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x10384
leaq 0x2eaee(%rip), %rdi     # 0x3e387
callq 0x10817
leaq 0x2eafc(%rip), %rdi     # 0x3e3a1
callq 0x10817
leaq 0x2eb09(%rip), %rdi     # 0x3e3ba
callq 0x10817
leaq 0x2eb19(%rip), %rdi     # 0x3e3d6
callq 0x10817
leaq 0x2eb2e(%rip), %rdi     # 0x3e3f7
callq 0x10817
testl %r13d, %r13d
je 0xf938
movq 0x56e16(%rip), %rdi     # 0x666f0
callq 0xf330
movq %rax, %r15
leaq 0x2eb64(%rip), %rsi     # 0x3e44d
pushq $0x1
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x10d1e
testl %eax, %eax
js 0xf9f1
movq %r15, %rdi
callq 0xf2c0
movq %rax, %r15
movq %rax, %rdi
callq 0x10817
movq %r15, %rdi
callq 0xf1d0
xorl %r15d, %r15d
leaq 0x4816d(%rip), %r12     # 0x57a90
cmpq $0x20, %r15
je 0xf985
movq (%r15,%r12), %rdi
callq 0x10817
addq $0x8, %r15
jmp 0xf923
leaq 0x2eafa(%rip), %rdi     # 0x3e439
movq %rsp, %r12
movq %r12, %rsi
callq 0x10cc3
movq (%r12), %rdi
callq 0x107c8
movq (%r12), %rdi
xorl %esi, %esi
callq 0xf240
movq %rax, %r13
movq (%r12), %rdi
callq 0xf290
testq %r13, %r13
jg 0xf985
leaq 0x2ea9a(%rip), %rdx     # 0x3e410
pushq $0x1
popq %rdi
xorl %esi, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0x10384
movq 0x505b4(%rip), %rax     # 0x5ff40
movslq (%rax), %rax
subl %eax, %ebx
leaq (%r14,%rax,8), %rsi
movl %ebx, %edi
callq *0x18(%rbp)
movq 0x56d4f(%rip), %rdi     # 0x666f0
callq 0xf030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x55d12(%rip), %rsi     # 0x656d0
movq 0x5090b(%rip), %rdx     # 0x602d0
leaq 0x2e494(%rip), %rdi     # 0x3de60
xorl %eax, %eax
callq 0xf050
xorl %edi, %edi
callq 0xf120
leaq 0x2e449(%rip), %rdx     # 0x3de2a
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x10384
callq 0x10497
pushq $0x1
popq %rdi
callq 0xf120