// File: /workspace/github_c_makefile_star2_O3/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, 0x5b642(%rip)     # 0x6b6c0
leaq 0x39c63(%rip), %rdi     # 0x49ce8
leaq 0x5b644(%rip), %rsi     # 0x6b6d0
callq 0xf270
testq %rax, %rax
je 0x10391
leaq 0x5b62f(%rip), %rdi     # 0x6b6d0
callq 0xf220
movq %rax, 0x5c623(%rip)     # 0x6c6d0
leaq 0x34d4f(%rip), %rdi     # 0x44e03
callq 0xf370
movq %rax, %r15
leaq 0x34d4f(%rip), %rdi     # 0x44e12
callq 0xf370
testq %rax, %rax
je 0x100d4
movq %rax, 0x561ec(%rip)     # 0x662c0
leaq 0x34d47(%rip), %r12     # 0x44e22
leaq 0x4d8fe(%rip), %r13     # 0x5d9e0
movq 0x55e7f(%rip), %rbp     # 0x65f68
movl %ebx, %edi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xf350
cmpl $0x67, %eax
jg 0x10113
cmpl $0x44, %eax
jne 0x10120
movq (%rbp), %rax
movq %rax, 0x561af(%rip)     # 0x662c0
jmp 0x100e9
cmpl $0x76, %eax
jne 0x10130
incl 0x5c5ce(%rip)           # 0x6c6ec
jmp 0x100e9
cmpl $-0x1, %eax
je 0x10158
cmpl $0x42, %eax
jne 0x100e9
movq (%rbp), %r15
jmp 0x100e9
cmpl $0x68, %eax
jne 0x100e9
movq 0x5b584(%rip), %rsi     # 0x6b6c0
movq 0x5617d(%rip), %rdx     # 0x662c0
leaq 0x34d16(%rip), %rdi     # 0x44e60
xorl %eax, %eax
callq 0xf050
xorl %edi, %edi
callq 0xf120
movq 0x55dd1(%rip), %rax     # 0x65f30
movl (%rax), %r13d
cmpl %ebx, %r13d
je 0x10448
testq %r15, %r15
je 0x101a5
leaq 0x5b559(%rip), %rsi     # 0x6b6d0
movq %r15, %rdi
callq 0xf270
testq %rax, %rax
je 0x103dc
leaq 0x5b541(%rip), %rdi     # 0x6b6d0
callq 0xf220
movq %rax, 0x5c535(%rip)     # 0x6c6d0
movq 0x55d8e(%rip), %rax     # 0x65f30
movl (%rax), %r13d
movslq %r13d, %rax
movq (%r14,%rax,8), %r12
leaq 0x4d58d(%rip), %rbp     # 0x5d740
leaq 0x3c65d(%rip), %r15     # 0x4c817
movq %r12, %rdi
movq %r15, %rsi
callq 0xf3a0
testl %eax, %eax
je 0x10202
movq 0x20(%rbp), %r15
addq $0x20, %rbp
testq %r15, %r15
jne 0x101ba
leaq 0x33f0e(%rip), %rdx     # 0x440eb
xorl %r15d, %r15d
movl $0x1, %edi
xorl %esi, %esi
movq %r12, %rcx
xorl %eax, %eax
callq 0xf570
movq 0x55d38(%rip), %rax     # 0x65f30
movl (%rax), %r13d
leaq 0x4d59e(%rip), %rbp     # 0x5d7a0
incl %r13d
movq 0x55d24(%rip), %rax     # 0x65f30
movl %r13d, (%rax)
movq %r15, 0x5c4c2(%rip)     # 0x6c6d8
movq 0x10(%rbp), %rax
testq %rax, %rax
je 0x10226
movl %ebx, %edi
movq %r14, %rsi
callq *%rax
movq 0x56093(%rip), %r15     # 0x662c0
movl 0x8(%rbp), %r12d
movq %r15, %rdi
movl $0x4, %esi
callq 0xf470
movl %eax, %r13d
leaq 0x5c498(%rip), %rsi     # 0x6c6e0
movq %r15, %rdi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0xf140
testl %eax, %eax
jne 0x103b0
leaq 0x35123(%rip), %rdi     # 0x45387
callq 0x113cc
leaq 0x35131(%rip), %rdi     # 0x453a1
callq 0x113cc
leaq 0x3513e(%rip), %rdi     # 0x453ba
callq 0x113cc
leaq 0x3514e(%rip), %rdi     # 0x453d6
callq 0x113cc
leaq 0x35163(%rip), %rdi     # 0x453f7
callq 0x113cc
testl %r13d, %r13d
je 0x10305
movq 0x5c43b(%rip), %rdi     # 0x6c6e0
callq 0xf320
movq %rax, %r15
leaq 0x35199(%rip), %rsi     # 0x4544d
movq %rax, %rdi
movl $0x1, %edx
xorl %eax, %eax
callq 0x1196a
testl %eax, %eax
js 0x1045f
movq %r15, %rdi
callq 0xf2c0
movq %rax, %r15
movq %rax, %rdi
callq 0x113cc
movq %r15, %rdi
callq 0xf1d0
xorl %r15d, %r15d
leaq 0x4d790(%rip), %r12     # 0x5da80
movq (%r15,%r12), %rdi
callq 0x113cc
addq $0x8, %r15
cmpq $0x20, %r15
jne 0x102f0
jmp 0x1035f
leaq 0x3512d(%rip), %r12     # 0x45439
movq %rsp, %r13
movq 0x5c3ca(%rip), %rdi     # 0x6c6e0
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xf4a0
cmpl $0x5, %eax
je 0x1030f
testl %eax, %eax
jne 0x10418
movq (%rsp), %rdi
callq 0x113a4
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xf240
movq %rax, %r12
movq (%rsp), %rdi
callq 0xf290
testq %r12, %r12
jle 0x103fb
movq 0x55bca(%rip), %rax     # 0x65f30
movslq (%rax), %rax
subl %eax, %ebx
leaq (%r14,%rax,8), %rsi
movl %ebx, %edi
callq *0x18(%rbp)
movq 0x5c365(%rip), %rdi     # 0x6c6e0
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 0x33d2c(%rip), %rdx     # 0x440cb
movl $0x1, %edi
xorl %eax, %eax
callq 0xf570
jmp 0x1009a
movq 0x5c329(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x34fa4(%rip), %rdx     # 0x45367
movl $0x1, %edi
xorl %esi, %esi
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xf570
jmp 0x1025d
callq 0xf380
movl (%rax), %esi
leaq 0x34a51(%rip), %rdx     # 0x44e3b
movl $0x1, %edi
xorl %eax, %eax
callq 0xf570
jmp 0x10188
leaq 0x3500e(%rip), %rdx     # 0x45410
movl $0x1, %edi
xorl %esi, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x1035f
movq 0x5c2c1(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x3416f(%rip), %rdx     # 0x4459a
leaq 0x35007(%rip), %r8      # 0x45439
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x10336
leaq 0x349db(%rip), %rdx     # 0x44e2a
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0xf570
callq 0x110e2
movl $0x1, %edi
callq 0xf120