// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10b0, %rsp           # imm = 0x10B0
movl 0x81057(%rip), %eax     # 0x94b88
leaq 0x88be8(%rip), %rcx     # 0x9c720
cmpl (%rcx), %eax
jl 0x13b41
jmp 0x13eb9
movq 0x81020(%rip), %rdi     # 0x94b68
leaq 0x88bd1(%rip), %rax     # 0x9c720
movslq (%rax), %rsi
shlq $0x3, %rsi
callq 0x12460
movq %rax, 0x81006(%rip)     # 0x94b68
cmpq $0x0, 0x80ffe(%rip)     # 0x94b68
jne 0x13b86
callq 0x12350
movl (%rax), %esi
movl $0x1, %edi
leaq 0x5b037(%rip), %rdx     # 0x6ebb6
movb $0x0, %al
callq 0x131c0
movq 0x80fab(%rip), %rdi     # 0x94b38
callq 0x13a70
movl 0x80ff0(%rip), %eax     # 0x94b88
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x88b7b(%rip), %rcx     # 0x9c720
cmpl (%rcx), %eax
jge 0x13e9e
movq $0x0, -0x10a8(%rbp)
leaq 0x88b69(%rip), %rax     # 0x9c728
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, (%rax)
je 0x13d17
leaq 0x88b4b(%rip), %rax     # 0x9c728
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
leaq -0x98(%rbp), %rsi
callq 0x124b0
cmpl $0x0, %eax
jge 0x13c33
callq 0x12350
movl (%rax), %esi
leaq 0x88b1a(%rip), %rax     # 0x9c728
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movl $0x1, %edi
leaq 0x5389d(%rip), %rdx     # 0x674c9
movb $0x0, %al
callq 0x131c0
movq -0x40(%rbp), %rax
movq %rax, -0x10a8(%rbp)
leaq 0x88ae3(%rip), %rax     # 0x9c728
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
leaq -0x10a0(%rbp), %rsi
callq 0x12240
cmpq $0x0, %rax
jne 0x13c9c
callq 0x12350
movl (%rax), %esi
leaq 0x88ab1(%rip), %rax     # 0x9c728
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movl $0x1, %edi
leaq 0x5383d(%rip), %rdx     # 0x674d2
movb $0x0, %al
callq 0x131c0
leaq -0x10a0(%rbp), %rdi
movq 0x80e66(%rip), %rdx     # 0x94b10
leaq 0x7fe5f(%rip), %rsi     # 0x93b10
callq 0x12170
cmpl $0x0, %eax
jne 0x13cfd
movq 0x80e4e(%rip), %rax     # 0x94b10
movsbl -0x10a0(%rbp,%rax), %eax
cmpl $0x2f, %eax
jne 0x13cfd
leaq -0x10a0(%rbp), %rax
addq 0x80e33(%rip), %rax     # 0x94b10
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
movq 0x80e79(%rip), %rax     # 0x94b68
movslq -0x4(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x13d15
movq 0x80e64(%rip), %rax     # 0x94b68
movslq -0x4(%rbp), %rcx
movq $-0x1, (%rax,%rcx,8)
jmp 0x13e90
jmp 0x13d2f
movq 0x80e4a(%rip), %rax     # 0x94b68
movslq -0x4(%rbp), %rcx
movq $-0x1, (%rax,%rcx,8)
jmp 0x13e90
cmpl $0x1, 0x80df6(%rip)     # 0x94b2c
jle 0x13d51
movq -0xa0(%rbp), %rcx
xorl %esi, %esi
leaq 0x53797(%rip), %rdx     # 0x674df
movl %esi, %edi
movb $0x0, %al
callq 0x131c0
movq 0x80df8(%rip), %rdi     # 0x94b50
movq -0xa0(%rbp), %rdx
leaq 0x53718(%rip), %rsi     # 0x6747e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x14000
movq 0x80dd9(%rip), %rdi     # 0x94b50
callq 0x13a70
cmpl $0x64, %eax
jne 0x13e15
movq 0x80dc4(%rip), %rdi     # 0x94b50
xorl %esi, %esi
callq 0x12210
movq %rax, %rdx
movq 0x80dcb(%rip), %rax     # 0x94b68
movslq -0x4(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x80da4(%rip), %rdi     # 0x94b50
movl $0x1, %esi
callq 0x12210
movq %rax, -0x10b0(%rbp)
movq 0x80d8c(%rip), %rdi     # 0x94b50
callq 0x14080
movq -0x10a8(%rbp), %rax
cmpq -0x10b0(%rbp), %rax
jne 0x13dde
jmp 0x13e90
movq 0x80d7b(%rip), %rdi     # 0x94b60
movq -0xa0(%rbp), %rdx
leaq 0x5368b(%rip), %rsi     # 0x6747e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x14000
movq 0x80d5c(%rip), %rdi     # 0x94b60
callq 0x13a70
movq 0x80d50(%rip), %rdi     # 0x94b60
callq 0x14080
movq 0x80d34(%rip), %rdi     # 0x94b50
callq 0x14080
movq 0x80d30(%rip), %rdi     # 0x94b58
movq -0xa0(%rbp), %rdx
leaq 0x53648(%rip), %rsi     # 0x6747e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x14000
movq 0x80d11(%rip), %rdi     # 0x94b58
movq -0x10a8(%rbp), %rdx
leaq 0x53697(%rip), %rsi     # 0x674ec
callq 0x140b0
movq 0x80cf7(%rip), %rdi     # 0x94b58
callq 0x13a70
movq 0x80ceb(%rip), %rdi     # 0x94b58
callq 0x14080
movq 0x80ca7(%rip), %rdi     # 0x94b20
callq 0x12520
movq %rax, %rdx
movq 0x80ce0(%rip), %rax     # 0x94b68
movslq -0x4(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x13b9b
movq 0x80c9b(%rip), %rdi     # 0x94b40
callq 0x13a70
leaq 0x8886f(%rip), %rax     # 0x9c720
movl (%rax), %eax
movl %eax, 0x80ccf(%rip)     # 0x94b88
addq $0x10b0, %rsp           # imm = 0x10B0
popq %rbp
retq
nopw %cs:(%rax,%rax)