// File: /workspace/github_c_makefile_star2_O1/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 0x4f2d3(%rip), %r14     # 0x5f840
movq (%rbx,%r14), %rdi
callq 0x113c7
addq $0x8, %rbx
cmpq $0x10, %rbx
jne 0x1056d
leaq 0x34d46(%rip), %rbx     # 0x452cd
leaq 0x5e16a(%rip), %r14     # 0x6e6f8
movq 0x5e14b(%rip), %rdi     # 0x6e6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x1058e
testl %eax, %eax
jne 0x1076e
leaq 0x34d1c(%rip), %rbx     # 0x452dd
leaq 0x5e138(%rip), %r14     # 0x6e700
movq 0x5e111(%rip), %rdi     # 0x6e6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x105c8
testl %eax, %eax
jne 0x1079e
leaq 0x34ce9(%rip), %rbx     # 0x452e4
leaq 0x5e106(%rip), %r14     # 0x6e708
movq 0x5e0d7(%rip), %rdi     # 0x6e6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x10602
testl %eax, %eax
jne 0x107ce
leaq 0x34d45(%rip), %rbx     # 0x4537a
leaq 0x5e0d4(%rip), %r14     # 0x6e710
movq 0x5e09d(%rip), %rdi     # 0x6e6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x1063c
testl %eax, %eax
jne 0x107fe
leaq 0x34d3a(%rip), %rbx     # 0x453a9
leaq 0x5e0a2(%rip), %r14     # 0x6e718
movq 0x5e063(%rip), %rdi     # 0x6e6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x10676
testl %eax, %eax
jne 0x1082e
leaq 0x34d36(%rip), %rbx     # 0x453df
leaq 0x5e070(%rip), %r14     # 0x6e720
movq 0x5e029(%rip), %rdi     # 0x6e6e0
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq %r14, %r8
xorl %r9d, %r9d
callq 0xf0f0
cmpl $0x5, %eax
je 0x106b0
testl %eax, %eax
jne 0x1085e
movq 0x5e00d(%rip), %rsi     # 0x6e6f0
leaq 0x57bde(%rip), %rdi     # 0x682c8
callq 0x11e2c
movq 0x5e002(%rip), %rdi     # 0x6e6f8
callq 0x1139f
leaq 0x34d02(%rip), %rdi     # 0x45404
callq 0x113c7
movq 0x5dff2(%rip), %rdi     # 0x6e700
callq 0x1139f
movq 0x5dfee(%rip), %rdi     # 0x6e708
callq 0xf290
movq 0x5dfea(%rip), %rdi     # 0x6e710
callq 0xf290
movq 0x5dfe6(%rip), %rdi     # 0x6e718
callq 0xf290
movq 0x5dfe2(%rip), %rdi     # 0x6e720
callq 0xf290
movq 0x5dfae(%rip), %rdi     # 0x6e6f8
callq 0xf290
movq 0x5dfaa(%rip), %rdi     # 0x6e700
callq 0xf290
movq 0x5dfc6(%rip), %rdi     # 0x6e728
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf210
movq 0x5df6b(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x34e19(%rip), %rdx     # 0x4559a
leaq 0x34b45(%rip), %r8      # 0x452cd
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x105ba
movq 0x5df3b(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x34de9(%rip), %rdx     # 0x4559a
leaq 0x34b25(%rip), %r8      # 0x452dd
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x105f4
movq 0x5df0b(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x34db9(%rip), %rdx     # 0x4559a
leaq 0x34afc(%rip), %r8      # 0x452e4
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x1062e
movq 0x5dedb(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x34d89(%rip), %rdx     # 0x4559a
leaq 0x34b62(%rip), %r8      # 0x4537a
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x10668
movq 0x5deab(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x34d59(%rip), %rdx     # 0x4559a
leaq 0x34b61(%rip), %r8      # 0x453a9
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x106a2
movq 0x5de7b(%rip), %rdi     # 0x6e6e0
callq 0xf3d0
leaq 0x34d29(%rip), %rdx     # 0x4559a
leaq 0x34b67(%rip), %r8      # 0x453df
movl $0x1, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x106dc