// File: /workspace/github_c_makefile_star2_O1/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 0x56e7
movq %r14, -0x30(%rbp)
testq %r14, %r14
je 0x5822
incl (%r14)
movq %r14, -0x30(%rbp)
jmp 0x5822
movsbl 0x8(%r14), %ecx
movsbl 0x9(%r14), %r8d
leaq 0x5045(%rip), %rdx      # 0xa73d
leaq -0x1060(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x2120
cmpl $0x1000, %eax           # imm = 0x1000
jge 0x5922
leaq -0x1060(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0x1, %edx
callq 0x4f04
testl %eax, %eax
jle 0x5811
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 0x577c
leaq 0x8(%r12), %rdi
movq -0x48(%rbp), %rsi
movq %r13, %rdx
callq 0x2200
testl %eax, %eax
jne 0x57dd
cmpq $0x0, -0x30(%rbp)
jne 0x58f2
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 0x21f0
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 0x21c0
testq %r12, %r12
je 0x5802
movl (%r12), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r12)
cmpl $0x1, %ecx
jg 0x5802
testl %eax, %eax
jne 0x58fb
movq %r12, %rdi
callq 0x2030
incq %r15
cmpq %r15, -0x50(%rbp)
jne 0x5758
jmp 0x5819
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 0x4dcc(%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 0x51ea
movq %rax, %r15
testq %rax, %rax
je 0x58b9
movq %r15, %rdi
callq 0x5608
movq %rax, %r12
movslq 0x4(%rax), %rdx
movq -0x30(%rbp), %rax
cmpl 0x4(%rax), %edx
jne 0x591a
movq -0x30(%rbp), %rax
leaq 0x8(%rax), %rsi
leaq 0x8(%r12), %rdi
callq 0x2200
testl %eax, %eax
jne 0x591a
testq %r12, %r12
je 0x58b9
movl (%r12), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r12)
cmpl $0x1, %ecx
jg 0x58b9
testl %eax, %eax
jne 0x58fb
movq %r12, %rdi
callq 0x2030
cmpq $0x0, -0x30(%rbp)
je 0x58dd
movq -0x30(%rbp), %rdx
movl (%rdx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rdx)
cmpl $0x1, %ecx
jg 0x58dd
testl %eax, %eax
jne 0x58fb
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 0x2507
leaq 0x477f(%rip), %rdi      # 0xa081
leaq 0x4784(%rip), %rsi      # 0xa08d
leaq 0x4784(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
movq %r14, %rdi
callq 0x252e
leaq 0x4e26(%rip), %rdi      # 0xa74f
leaq 0x4e2e(%rip), %rsi      # 0xa75e
leaq 0x4e2c(%rip), %rcx      # 0xa763
movl $0x33, %edx
callq 0x2130