// File: /workspace/github_c_makefile_star2_O3/findstr[P]version-database/db.c
// Function: db_tryread
dr_t
db_tryread(dr_t name)
{
	const char *p;
	dr_t d, full;
	char path[PATH_MAX];
	full = fullname(name);
	p = (char *)full->buf;
	snprintf(path, PATH_MAX, ROOT"/%c%c/%s", p[0], p[1], &p[2]);
	d = dir_readfile(path, NULL);
	if (d != NULL) {
		dr_t hash = db_hash(d);
		if (dr_cmp(hash, full) != 0) {
			fprintf(stderr, "FATAL:db_read %s content was corrupt\n",
				name->buf);
			exit(EFAULT);
		}
		dr_unref(hash);
	}
	dr_unref(full);
	return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rdi, %r14
movslq 0x4(%rdi), %r13
cmpq $0x28, %r13
jl 0x579e
incl (%r14)
movq %r14, -0x30(%rbp)
jmp 0x58d4
movsbl 0x8(%r14), %ecx
movsbl 0x9(%r14), %r8d
leaq 0x4f8e(%rip), %rdx      # 0xa73d
leaq -0x1060(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x2120
cmpl $0x1000, %eax           # imm = 0x1000
jge 0x59c4
leaq -0x1060(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0x4fd0
testl %eax, %eax
jle 0x58c3
leaq 0x8(%r14), %rcx
movq %rcx, -0x40(%rbp)
leaq 0xa(%r14), %rcx
movq %rcx, -0x48(%rbp)
addq $-0x2, %r13
movl %eax, %eax
movq %rax, -0x50(%rbp)
xorl %r15d, %r15d
movq $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %r12
cmpl %r13d, 0x4(%r12)
jge 0x5833
leaq 0x8(%r12), %rdi
movq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0x2210
testl %eax, %eax
jne 0x5894
cmpq $0x0, -0x30(%rbp)
jne 0x5994
leaq 0x8(%r12), %rdi
movq %rdi, -0x60(%rbp)
callq 0x20e0
movslq %eax, %rbx
leaq 0x2(%rbx), %rax
movq %rax, -0x58(%rbp)
leaq 0xe(%rbx), %rdi
callq 0x2200
movq %rax, -0x30(%rbp)
movl $0x1, (%rax)
movq -0x58(%rbp), %rcx
movl %ecx, 0x4(%rax)
movb $0x0, 0xa(%rax,%rbx)
movb 0x8(%r14), %cl
movb %cl, 0x8(%rax)
movb 0x9(%r14), %cl
movb %cl, 0x9(%rax)
leaq 0xa(%rax), %rdi
movq -0x60(%rbp), %rsi
movq %rbx, %rdx
callq 0x21d0
movl (%r12), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r12)
cmpl $0x1, %ecx
jg 0x58b4
testl %eax, %eax
jne 0x599d
movq %r12, %rdi
callq 0x2030
incq %r15
cmpq %r15, -0x50(%rbp)
jne 0x580f
jmp 0x58cb
movq $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2030
movq -0x30(%rbp), %rax
movsbl 0x8(%rax), %ecx
movsbl 0x9(%rax), %r8d
leaq 0xa(%rax), %r9
leaq 0x4d1a(%rip), %rdx      # 0xa606
leaq -0x1060(%rbp), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2120
movq %rbx, %rdi
xorl %esi, %esi
callq 0x52b7
movq %rax, %r15
testq %rax, %rax
je 0x5962
movq %r15, %rdi
callq 0x56cc
movq %rax, %r12
movslq 0x4(%rax), %rdx
movq -0x30(%rbp), %rax
cmpl 0x4(%rax), %edx
jne 0x59bc
movq -0x30(%rbp), %rax
leaq 0x8(%rax), %rsi
leaq 0x8(%r12), %rdi
callq 0x2210
testl %eax, %eax
jne 0x59bc
movl (%r12), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r12)
cmpl $0x1, %ecx
jg 0x5962
testl %eax, %eax
jne 0x599d
movq %r12, %rdi
callq 0x2030
movq -0x30(%rbp), %rdx
movl (%rdx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rdx)
cmpl $0x1, %ecx
jg 0x597f
testl %eax, %eax
jne 0x599d
movq -0x30(%rbp), %rdi
callq 0x2030
movq %r15, %rax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x2514
leaq 0x46dd(%rip), %rdi      # 0xa081
leaq 0x46e2(%rip), %rsi      # 0xa08d
leaq 0x46e2(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
movq %r14, %rdi
callq 0x253b
leaq 0x4d84(%rip), %rdi      # 0xa74f
leaq 0x4d8c(%rip), %rsi      # 0xa75e
leaq 0x4d8a(%rip), %rcx      # 0xa763
movl $0x33, %edx
callq 0x2130