// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/semind.c
// Function: update_stream
static void update_stream(void)
{
	if (semind_streams_nr >= input_stream_nr)
		return;

	semind_streams = realloc(semind_streams, input_stream_nr * sizeof(struct semind_streams));
	if (!semind_streams)
		semind_error(1, errno, "realloc");

	sqlite_run(lock_stmt);

	for (int i = semind_streams_nr; i < input_stream_nr; i++) {
		struct stat st;
		const char *filename;
		char fullname[PATH_MAX];
		sqlite3_int64 cur_mtime = 0;

		if (input_streams[i].fd != -1) {
			/*
			 * FIXME: Files in the input_streams may be duplicated.
			 */
			if (stat(input_streams[i].name, &st) < 0)
				semind_error(1, errno, "stat: %s", input_streams[i].name);

			cur_mtime = st.st_mtime;

			if (!realpath(input_streams[i].name, fullname))
				semind_error(1, errno, "realpath: %s", input_streams[i].name);

			if (!strncmp(fullname, cwd, n_cwd) && fullname[n_cwd] == '/') {
				filename = fullname + n_cwd + 1;
				semind_streams[i].id = 0;
			} else {
				semind_streams[i].id = -1;
				continue;
			}
		} else {
			semind_streams[i].id = -1;
			continue;
		}

		if (semind_verbose > 1)
			message("filename: %s", filename);

		sqlite_bind_text(select_file_stmt, "@name", filename, -1);

		if (sqlite_run(select_file_stmt) == SQLITE_ROW) {
			sqlite3_int64 old_mtime;

			semind_streams[i].id = sqlite3_column_int64(select_file_stmt, 0);
			old_mtime = sqlite3_column_int64(select_file_stmt, 1);

			sqlite_reset_stmt(select_file_stmt);

			if (cur_mtime == old_mtime)
				continue;

			sqlite_bind_text(delete_file_stmt, "@name", filename, -1);
			sqlite_run(delete_file_stmt);
			sqlite_reset_stmt(delete_file_stmt);
		}

		sqlite_reset_stmt(select_file_stmt);

		sqlite_bind_text(insert_file_stmt,  "@name",  filename, -1);
		sqlite_bind_int64(insert_file_stmt, "@mtime", cur_mtime);
		sqlite_run(insert_file_stmt);
		sqlite_reset_stmt(insert_file_stmt);

		semind_streams[i].id = sqlite3_last_insert_rowid(semind_db);
	}

	sqlite_run(unlock_stmt);

	semind_streams_nr = input_stream_nr;
}

// Assembly:
leaq 0x64ed1(%rip), %rax     # 0x762f0
movslq (%rax), %rsi
cmpl %esi, 0x5d320(%rip)     # 0x6e748
jge 0x1178c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movq 0x5d2e2(%rip), %rdi     # 0x6e728
shlq $0x3, %rsi
callq 0xf490
movq %rax, 0x5d2d2(%rip)     # 0x6e728
testq %rax, %rax
je 0x1178d
movq 0x5d292(%rip), %rdi     # 0x6e6f8
callq 0x1139f
movslq 0x5d2d6(%rip), %rbx     # 0x6e748
leaq 0x64e77(%rip), %rax     # 0x762f0
cmpl (%rax), %ebx
jge 0x11760
leaq (%rbx,%rbx), %rax
leaq (%rax,%rax,4), %r15
incq %r15
leaq 0x90(%rsp), %rbp
leaq 0x64e5d(%rip), %rax     # 0x762f8
movq (%rax), %rax
movq $-0x1, %r14
cmpl $-0x1, -0x8(%rax,%r15,8)
je 0x116d5
movq (%rax,%r15,8), %rdi
movq %rsp, %rsi
callq 0xf4e0
testl %eax, %eax
js 0x11704
movq 0x58(%rsp), %r12
leaq 0x64e27(%rip), %rax     # 0x762f8
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
movq %rbp, %rsi
callq 0xf270
testq %rax, %rax
je 0x11711
movq 0x5d1e0(%rip), %r13     # 0x6e6d0
movq %rbp, %rdi
leaq 0x5c1d6(%rip), %rsi     # 0x6d6d0
movq %r13, %rdx
callq 0xf190
testl %eax, %eax
jne 0x116d5
cmpb $0x2f, 0x90(%rsp,%r13)
jne 0x116d5
leaq 0x91(%rsp), %rax
addq %rax, %r13
movq 0x5d1fd(%rip), %rax     # 0x6e728
movq $0x0, (%rax,%rbx,8)
cmpl $0x2, 0x5d1b2(%rip)     # 0x6e6ec
jge 0x1171e
movq 0x5d1c9(%rip), %r14     # 0x6e710
movq %r14, %rdi
leaq 0x33ead(%rip), %rsi     # 0x453fe
callq 0xf480
movq %r14, %rdi
movl %eax, %esi
movq %r13, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0xf2e0
testl %eax, %eax
movq %r12, %rbp
jne 0x11738
movq 0x5d193(%rip), %rdi     # 0x6e710
callq 0x1139f
cmpl $0x64, %eax
jne 0x1162e
movq 0x5d17e(%rip), %rdi     # 0x6e710
xorl %esi, %esi
callq 0xf240
movq 0x5d188(%rip), %rcx     # 0x6e728
movq %rax, (%rcx,%rbx,8)
movq 0x5d165(%rip), %rdi     # 0x6e710
movl $0x1, %esi
callq 0xf240
movq %rax, %r14
movq 0x5d151(%rip), %r12     # 0x6e710
movq %r12, %rdi
callq 0xf110
movq %r12, %rdi
callq 0xf080
cmpq %r14, %rbp
je 0x116e0
movq 0x5d141(%rip), %r14     # 0x6e720
movq %r14, %rdi
leaq 0x33e15(%rip), %rsi     # 0x453fe
callq 0xf480
movq %r14, %rdi
movl %eax, %esi
movq %r13, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0xf2e0
testl %eax, %eax
jne 0x11756
movq 0x5d10e(%rip), %rdi     # 0x6e720
callq 0x1139f
movq 0x5d102(%rip), %r14     # 0x6e720
movq %r14, %rdi
callq 0xf110
movq %r14, %rdi
callq 0xf080
movq 0x5d0db(%rip), %r14     # 0x6e710
movq %r14, %rdi
callq 0xf110
movq %r14, %rdi
callq 0xf080
movq 0x5d0cc(%rip), %r14     # 0x6e718
movq %r14, %rdi
leaq 0x33da8(%rip), %rsi     # 0x453fe
callq 0xf480
movq %r14, %rdi
movl %eax, %esi
movq %r13, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0xf2e0
testl %eax, %eax
jne 0x11742
movq 0x5d099(%rip), %r14     # 0x6e718
movq %r14, %rdi
leaq 0x33de3(%rip), %rsi     # 0x4546c
callq 0xf480
movq %r14, %rdi
movl %eax, %esi
movq %rbp, %rdx
callq 0xf250
testl %eax, %eax
jne 0x1174c
movq 0x5d06e(%rip), %rdi     # 0x6e718
callq 0x1139f
movq 0x5d062(%rip), %r14     # 0x6e718
movq %r14, %rdi
callq 0xf110
movq %r14, %rdi
callq 0xf080
movq 0x5d013(%rip), %rdi     # 0x6e6e0
callq 0xf550
movq %rax, %r14
movq 0x5d04c(%rip), %rax     # 0x6e728
movq %r14, (%rax,%rbx,8)
incq %rbx
leaq 0x64c06(%rip), %rax     # 0x762f0
movslq (%rax), %rax
addq $0xa, %r15
cmpq %rax, %rbx
leaq 0x90(%rsp), %rbp
jl 0x11494
jmp 0x11760
movq %rbx, %rdi
callq 0xf706
jmp 0x114c5
movq %rbx, %rdi
callq 0xf737
jmp 0x114e9
xorl %edi, %edi
xorl %esi, %esi
leaq 0x33d36(%rip), %rdx     # 0x4545f
movq %r13, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x11540
callq 0xf768
jmp 0x11576
callq 0xf7c6
jmp 0x11678
callq 0xf7f5
jmp 0x116a3
callq 0xf797
jmp 0x1160b
movq 0x5cf99(%rip), %rdi     # 0x6e700
callq 0x1139f
leaq 0x64b7d(%rip), %rax     # 0x762f0
movl (%rax), %eax
movl %eax, 0x5cfcd(%rip)     # 0x6e748
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xf6ec
jmp 0x1145f