// File: /workspace/github_c_makefile_star2_O1/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
movq %r15, %rdi
movl $0x2f, %esi
callq 0xf1e0
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmoveq %r15, %rcx
movq %rcx, 0x5d652(%rip)     # 0x6d6c0
leaq 0x3acc3(%rip), %rdi     # 0x4ad38
leaq 0x5d654(%rip), %rsi     # 0x6d6d0
callq 0xf270
testq %rax, %rax
je 0x1036d
leaq 0x5d63f(%rip), %rdi     # 0x6d6d0
callq 0xf220
movq %rax, 0x5e633(%rip)     # 0x6e6d0
leaq 0x35d5f(%rip), %rdi     # 0x45e03
callq 0xf370
movq %rax, %r15
leaq 0x35d5f(%rip), %rdi     # 0x45e12
callq 0xf370
testq %rax, %rax
je 0x100c4
movq %rax, 0x581fc(%rip)     # 0x682c0
leaq 0x35d57(%rip), %r12     # 0x45e22
leaq 0x4f90e(%rip), %r13     # 0x5f9e0
movq 0x57e8f(%rip), %rbp     # 0x67f68
movl %ebx, %edi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xf350
cmpl $0x67, %eax
jg 0x10103
cmpl $0x44, %eax
jne 0x10110
movq (%rbp), %rax
movq %rax, 0x581bf(%rip)     # 0x682c0
jmp 0x100d9
cmpl $0x76, %eax
jne 0x10120
incl 0x5e5de(%rip)           # 0x6e6ec
jmp 0x100d9
cmpl $-0x1, %eax
je 0x10148
cmpl $0x42, %eax
jne 0x100d9
movq (%rbp), %r15
jmp 0x100d9
cmpl $0x68, %eax
jne 0x100d9
movq 0x5d594(%rip), %rsi     # 0x6d6c0
movq 0x5818d(%rip), %rdx     # 0x682c0
leaq 0x35d26(%rip), %rdi     # 0x45e60
xorl %eax, %eax
callq 0xf050
xorl %edi, %edi
callq 0xf120
movq 0x57de1(%rip), %r12     # 0x67f30
cmpl %ebx, (%r12)
je 0x10454
testq %r15, %r15
je 0x10189
leaq 0x5d56b(%rip), %rsi     # 0x6d6d0
movq %r15, %rdi
callq 0xf270
testq %rax, %rax
je 0x103e8
leaq 0x5d553(%rip), %rdi     # 0x6d6d0
callq 0xf220
movq %rax, 0x5e547(%rip)     # 0x6e6d0
movslq (%r12), %rax
movq (%r14,%rax,8), %r12
leaq 0x3d6cf(%rip), %r15     # 0x4d867
movq %r12, %rdi
movq %r15, %rsi
callq 0xf3a0
leaq 0x4f596(%rip), %rbp     # 0x5f740
testl %eax, %eax
je 0x101d4
movq 0x20(%rbp), %r15
testq %r15, %r15
sete %r13b
je 0x103b8
addq $0x20, %rbp
movq %r12, %rdi
movq %r15, %rsi
callq 0xf3a0
testl %eax, %eax
jne 0x101ae
jmp 0x101d7
xorl %r13d, %r13d
testb %r13b, %r13b
movq 0x57d4f(%rip), %r12     # 0x67f30
jne 0x103c6
incl (%r12)
movq %r15, 0x5e4e6(%rip)     # 0x6e6d8
movq 0x10(%rbp), %rax
testq %rax, %rax
je 0x10202
movl %ebx, %edi
movq %r14, %rsi
callq *%rax
movq 0x580b7(%rip), %r15     # 0x682c0
movl 0x8(%rbp), %r12d
movq %r15, %rdi
movl $0x4, %esi
callq 0xf470
movl %eax, %r13d
leaq 0x5e4bc(%rip), %rsi     # 0x6e6e0
movq %r15, %rdi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0xf140
testl %eax, %eax
jne 0x1038c
leaq 0x36147(%rip), %rdi     # 0x46387
callq 0x113c7
leaq 0x36155(%rip), %rdi     # 0x463a1
callq 0x113c7
leaq 0x36162(%rip), %rdi     # 0x463ba
callq 0x113c7
leaq 0x36172(%rip), %rdi     # 0x463d6
callq 0x113c7
leaq 0x36187(%rip), %rdi     # 0x463f7
callq 0x113c7
testl %r13d, %r13d
je 0x102e1
movq 0x5e45f(%rip), %rdi     # 0x6e6e0
callq 0xf320
movq %rax, %r15
leaq 0x361bd(%rip), %rsi     # 0x4644d
movq %rax, %rdi
movl $0x1, %edx
xorl %eax, %eax
callq 0x11965
testl %eax, %eax
js 0x1046b
movq %r15, %rdi
callq 0xf2c0
movq %rax, %r15
movq %rax, %rdi
callq 0x113c7
movq %r15, %rdi
callq 0xf1d0
xorl %r15d, %r15d
leaq 0x4f7b4(%rip), %r12     # 0x5fa80
movq (%r15,%r12), %rdi
callq 0x113c7
addq $0x8, %r15
cmpq $0x20, %r15
jne 0x102cc
jmp 0x1033b
leaq 0x36151(%rip), %r12     # 0x46439
movq %rsp, %r13
movq 0x5e3ee(%rip), %rdi     # 0x6e6e0
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xf4a0
cmpl $0x5, %eax
je 0x102eb
testl %eax, %eax
jne 0x10424
movq (%rsp), %rdi
callq 0x1139f
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xf240
movq %rax, %r12
movq (%rsp), %rdi
callq 0xf290
testq %r12, %r12
jle 0x10407
movq 0x57bee(%rip), %rax     # 0x67f30
movslq (%rax), %rax
subl %eax, %ebx
leaq (%r14,%rax,8), %rsi
movl %ebx, %edi
callq *0x18(%rbp)
movq 0x5e389(%rip), %rdi     # 0x6e6e0
callq 0xf030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xf380
movl (%rax), %esi
leaq 0x34d50(%rip), %rdx     # 0x450cb
movl $0x1, %edi
xorl %eax, %eax
callq 0xf570
jmp 0x1008a
movq 0x5e34d(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x35fc8(%rip), %rdx     # 0x46367
movl $0x1, %edi
xorl %esi, %esi
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xf570
jmp 0x10239
leaq 0x4f3e1(%rip), %rbp     # 0x5f7a0
movq 0x57b6a(%rip), %r12     # 0x67f30
movslq (%r12), %rax
movq (%r14,%rax,8), %rcx
leaq 0x34d16(%rip), %rdx     # 0x450eb
movl $0x1, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0xf570
jmp 0x101e7
callq 0xf380
movl (%rax), %esi
leaq 0x35a45(%rip), %rdx     # 0x45e3b
movl $0x1, %edi
xorl %eax, %eax
callq 0xf570
jmp 0x10176
leaq 0x36002(%rip), %rdx     # 0x46410
movl $0x1, %edi
xorl %esi, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x1033b
movq 0x5e2b5(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x35163(%rip), %rdx     # 0x4559a
leaq 0x35ffb(%rip), %r8      # 0x46439
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x10312
leaq 0x359cf(%rip), %rdx     # 0x45e2a
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0xf570
callq 0x110dd
movl $0x1, %edi
callq 0xf120