// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/semind.c
// Function: command_add
static void command_add(int argc, char **argv)
{
	static struct reporter reporter = {
		.r_symdef = r_symdef,
		.r_symbol = r_symbol,
		.r_memdef = r_memdef,
		.r_member = r_member,
	};

	open_temp_database();

	sqlite_prepare_persistent(
		"BEGIN IMMEDIATE",
		&lock_stmt);

	sqlite_prepare_persistent(
		"COMMIT",
		&unlock_stmt);

	sqlite_prepare_persistent(
		"INSERT OR IGNORE INTO tempdb.semind "
		"(context, symbol, kind, mode, file, line, column) "
		"VALUES (@context, @symbol, @kind, @mode, @file, @line, @column)",
		&insert_rec_stmt);

	sqlite_prepare_persistent(
		"SELECT id, mtime FROM file WHERE name == @name",
		&select_file_stmt);

	sqlite_prepare_persistent(
		"INSERT INTO file (name, mtime) VALUES (@name, @mtime)",
		&insert_file_stmt);

	sqlite_prepare_persistent(
		"DELETE FROM file WHERE name == @name",
		&delete_file_stmt);

	dissect(&reporter, semind_filelist);

	sqlite_run(lock_stmt);
	sqlite_command("INSERT OR IGNORE INTO semind SELECT * FROM tempdb.semind");
	sqlite_run(unlock_stmt);

	sqlite3_finalize(insert_rec_stmt);
	sqlite3_finalize(select_file_stmt);
	sqlite3_finalize(insert_file_stmt);
	sqlite3_finalize(delete_file_stmt);
	sqlite3_finalize(lock_stmt);
	sqlite3_finalize(unlock_stmt);
	free(semind_streams);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x4d2df(%rip), %r14     # 0x5d840
movq (%rbx,%r14), %rdi
callq 0x113cc
addq $0x8, %rbx
cmpq $0x10, %rbx
jne 0x10561
leaq 0x33d52(%rip), %rbx     # 0x442cd
leaq 0x5c176(%rip), %r14     # 0x6c6f8
movq 0x5c157(%rip), %rdi     # 0x6c6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x10582
testl %eax, %eax
jne 0x10762
leaq 0x33d28(%rip), %rbx     # 0x442dd
leaq 0x5c144(%rip), %r14     # 0x6c700
movq 0x5c11d(%rip), %rdi     # 0x6c6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x105bc
testl %eax, %eax
jne 0x10792
leaq 0x33cf5(%rip), %rbx     # 0x442e4
leaq 0x5c112(%rip), %r14     # 0x6c708
movq 0x5c0e3(%rip), %rdi     # 0x6c6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x105f6
testl %eax, %eax
jne 0x107c2
leaq 0x33d51(%rip), %rbx     # 0x4437a
leaq 0x5c0e0(%rip), %r14     # 0x6c710
movq 0x5c0a9(%rip), %rdi     # 0x6c6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x10630
testl %eax, %eax
jne 0x107f2
leaq 0x33d46(%rip), %rbx     # 0x443a9
leaq 0x5c0ae(%rip), %r14     # 0x6c718
movq 0x5c06f(%rip), %rdi     # 0x6c6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x1066a
testl %eax, %eax
jne 0x10822
leaq 0x33d42(%rip), %rbx     # 0x443df
leaq 0x5c07c(%rip), %r14     # 0x6c720
movq 0x5c035(%rip), %rdi     # 0x6c6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x106a4
testl %eax, %eax
jne 0x10852
movq 0x5c019(%rip), %rsi     # 0x6c6f0
leaq 0x55bea(%rip), %rdi     # 0x662c8
callq 0x11dcc
movq 0x5c00e(%rip), %rdi     # 0x6c6f8
callq 0x113a4
leaq 0x33d0e(%rip), %rdi     # 0x44404
callq 0x113cc
movq 0x5bffe(%rip), %rdi     # 0x6c700
callq 0x113a4
movq 0x5bffa(%rip), %rdi     # 0x6c708
callq 0xf290
movq 0x5bff6(%rip), %rdi     # 0x6c710
callq 0xf290
movq 0x5bff2(%rip), %rdi     # 0x6c718
callq 0xf290
movq 0x5bfee(%rip), %rdi     # 0x6c720
callq 0xf290
movq 0x5bfba(%rip), %rdi     # 0x6c6f8
callq 0xf290
movq 0x5bfb6(%rip), %rdi     # 0x6c700
callq 0xf290
movq 0x5bfd2(%rip), %rdi     # 0x6c728
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf210
movq 0x5bf77(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x33e25(%rip), %rdx     # 0x4459a
leaq 0x33b51(%rip), %r8      # 0x442cd
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x105ae
movq 0x5bf47(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x33df5(%rip), %rdx     # 0x4459a
leaq 0x33b31(%rip), %r8      # 0x442dd
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x105e8
movq 0x5bf17(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x33dc5(%rip), %rdx     # 0x4459a
leaq 0x33b08(%rip), %r8      # 0x442e4
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x10622
movq 0x5bee7(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x33d95(%rip), %rdx     # 0x4459a
leaq 0x33b6e(%rip), %r8      # 0x4437a
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x1065c
movq 0x5beb7(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x33d65(%rip), %rdx     # 0x4459a
leaq 0x33b6d(%rip), %r8      # 0x443a9
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x10696
movq 0x5be87(%rip), %rdi     # 0x6c6e0
callq 0xf3d0
leaq 0x33d35(%rip), %rdx     # 0x4459a
leaq 0x33b73(%rip), %r8      # 0x443df
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x106d0