// File: /workspace/github_c_makefile_star2_O3/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 0x62ecc(%rip), %rax     # 0x742f0
movslq (%rax), %rsi
cmpl %esi, 0x5b31b(%rip)     # 0x6c748
jge 0x11791
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movq 0x5b2dd(%rip), %rdi     # 0x6c728
shlq $0x3, %rsi
callq 0xf490
movq %rax, 0x5b2cd(%rip)     # 0x6c728
testq %rax, %rax
je 0x11792
movq 0x5b28d(%rip), %rdi     # 0x6c6f8
callq 0x113a4
movslq 0x5b2d1(%rip), %rbx     # 0x6c748
leaq 0x62e72(%rip), %rax     # 0x742f0
cmpl (%rax), %ebx
jge 0x11765
leaq (%rbx,%rbx), %rax
leaq (%rax,%rax,4), %r15
incq %r15
leaq 0x90(%rsp), %rbp
leaq 0x62e58(%rip), %rax     # 0x742f8
movq (%rax), %rax
movq $-0x1, %r14
cmpl $-0x1, -0x8(%rax,%r15,8)
je 0x116da
movq (%rax,%r15,8), %rdi
movq %rsp, %rsi
callq 0xf4e0
testl %eax, %eax
js 0x11709
movq 0x58(%rsp), %r12
leaq 0x62e22(%rip), %rax     # 0x742f8
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
movq %rbp, %rsi
callq 0xf270
testq %rax, %rax
je 0x11716
movq 0x5b1db(%rip), %r13     # 0x6c6d0
movq %rbp, %rdi
leaq 0x5a1d1(%rip), %rsi     # 0x6b6d0
movq %r13, %rdx
callq 0xf190
testl %eax, %eax
jne 0x116da
cmpb $0x2f, 0x90(%rsp,%r13)
jne 0x116da
leaq 0x91(%rsp), %rax
addq %rax, %r13
movq 0x5b1f8(%rip), %rax     # 0x6c728
movq $0x0, (%rax,%rbx,8)
cmpl $0x2, 0x5b1ad(%rip)     # 0x6c6ec
jge 0x11723
movq 0x5b1c4(%rip), %r14     # 0x6c710
movq %r14, %rdi
leaq 0x32ea8(%rip), %rsi     # 0x443fe
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 0x1173d
movq 0x5b18e(%rip), %rdi     # 0x6c710
callq 0x113a4
cmpl $0x64, %eax
jne 0x11633
movq 0x5b179(%rip), %rdi     # 0x6c710
xorl %esi, %esi
callq 0xf240
movq 0x5b183(%rip), %rcx     # 0x6c728
movq %rax, (%rcx,%rbx,8)
movq 0x5b160(%rip), %rdi     # 0x6c710
movl $0x1, %esi
callq 0xf240
movq %rax, %r14
movq 0x5b14c(%rip), %r12     # 0x6c710
movq %r12, %rdi
callq 0xf110
movq %r12, %rdi
callq 0xf080
cmpq %r14, %rbp
je 0x116e5
movq 0x5b13c(%rip), %r14     # 0x6c720
movq %r14, %rdi
leaq 0x32e10(%rip), %rsi     # 0x443fe
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 0x1175b
movq 0x5b109(%rip), %rdi     # 0x6c720
callq 0x113a4
movq 0x5b0fd(%rip), %r14     # 0x6c720
movq %r14, %rdi
callq 0xf110
movq %r14, %rdi
callq 0xf080
movq 0x5b0d6(%rip), %r14     # 0x6c710
movq %r14, %rdi
callq 0xf110
movq %r14, %rdi
callq 0xf080
movq 0x5b0c7(%rip), %r14     # 0x6c718
movq %r14, %rdi
leaq 0x32da3(%rip), %rsi     # 0x443fe
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 0x11747
movq 0x5b094(%rip), %r14     # 0x6c718
movq %r14, %rdi
leaq 0x32dde(%rip), %rsi     # 0x4446c
callq 0xf480
movq %r14, %rdi
movl %eax, %esi
movq %rbp, %rdx
callq 0xf250
testl %eax, %eax
jne 0x11751
movq 0x5b069(%rip), %rdi     # 0x6c718
callq 0x113a4
movq 0x5b05d(%rip), %r14     # 0x6c718
movq %r14, %rdi
callq 0xf110
movq %r14, %rdi
callq 0xf080
movq 0x5b00e(%rip), %rdi     # 0x6c6e0
callq 0xf550
movq %rax, %r14
movq 0x5b047(%rip), %rax     # 0x6c728
movq %r14, (%rax,%rbx,8)
incq %rbx
leaq 0x62c01(%rip), %rax     # 0x742f0
movslq (%rax), %rax
addq $0xa, %r15
cmpq %rax, %rbx
leaq 0x90(%rsp), %rbp
jl 0x11499
jmp 0x11765
movq %rbx, %rdi
callq 0xf706
jmp 0x114ca
movq %rbx, %rdi
callq 0xf737
jmp 0x114ee
xorl %edi, %edi
xorl %esi, %esi
leaq 0x32d31(%rip), %rdx     # 0x4445f
movq %r13, %rcx
xorl %eax, %eax
callq 0xf570
jmp 0x11545
callq 0xf768
jmp 0x1157b
callq 0xf7c6
jmp 0x1167d
callq 0xf7f5
jmp 0x116a8
callq 0xf797
jmp 0x11610
movq 0x5af94(%rip), %rdi     # 0x6c700
callq 0x113a4
leaq 0x62b78(%rip), %rax     # 0x742f0
movl (%rax), %eax
movl %eax, 0x5afc8(%rip)     # 0x6c748
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xf6ec
jmp 0x11464