// File: /workspace/github_c_makefile_star2_O0/findstr[P]version-database/db.c
// Function: fullname
static dr_t
fullname(dr_t name)
{
	dr_t full, *list;
	int i, n, off, size;
	char *p, path[PATH_MAX];
	size = name->size;
	if (size >= 2 * HASH_SIZE)
		return dr_ref(name);
	p = (char *)name->buf;
	off = snprintf(path, PATH_MAX, ROOT"/%c%c/", p[0], p[1]);
	assert(off < PATH_MAX);
	n = dir_scan(path, &list, 1);
	p += 2;
	size -= 2;
	full = NULL;
	for (i = 0; i < n; i++) {
		dr_t d;
		d = list[i];
		if (d->size >= size || memcmp(d->buf, p, size) == 0) {
			int len;
			if (full != NULL) {
				fprintf(stderr, "FATAL: '%s' name too short\n",
					p - 2);
				exit(EINVAL);
			}
			len = strlen((char *)d->buf);
			full = dr_new(len + 2, NULL);
			full->buf[0] = p[-2];
			full->buf[1] = p[-1];
			memcpy(&full->buf[2], d->buf, len);
		}
		dr_unref(d);
	}
	free(list);
	return full;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1050, %rsp           # imm = 0x1050
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x30(%rbp)
cmpl $0x28, -0x30(%rbp)
jl 0x5c01
movq -0x10(%rbp), %rdi
callq 0x63e0
movq %rax, -0x8(%rbp)
jmp 0x5db6
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
leaq -0x1040(%rbp), %rdi
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
movq -0x38(%rbp), %rax
movsbl 0x1(%rax), %r8d
movl $0x1000, %esi           # imm = 0x1000
leaq 0x6b06(%rip), %rdx      # 0xc736
movb $0x0, %al
callq 0x2110
movl %eax, -0x2c(%rbp)
cmpl $0x1000, -0x2c(%rbp)    # imm = 0x1000
jge 0x5c45
jmp 0x5c64
leaq 0x6afc(%rip), %rdi      # 0xc748
leaq 0x6b04(%rip), %rsi      # 0xc757
movl $0x33, %edx
leaq 0x6afd(%rip), %rcx      # 0xc75c
callq 0x2120
leaq -0x1040(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x4fe0
movl %eax, -0x28(%rbp)
movq -0x38(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x38(%rbp)
movl -0x30(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x30(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x5da5
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x1048(%rbp)
movq -0x1048(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x30(%rbp), %eax
jge 0x5cef
movq -0x1048(%rbp), %rdi
addq $0x8, %rdi
movq -0x38(%rbp), %rsi
movslq -0x30(%rbp), %rdx
callq 0x2180
cmpl $0x0, %eax
jne 0x5d8b
cmpq $0x0, -0x18(%rbp)
je 0x5d20
movq 0xa2fb(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
addq $-0x2, %rdx
leaq 0x6a61(%rip), %rsi      # 0xc770
movb $0x0, %al
callq 0x21a0
movl $0x16, %edi
callq 0x2270
movq -0x1048(%rbp), %rdi
addq $0x8, %rdi
callq 0x20d0
movl %eax, -0x104c(%rbp)
movl -0x104c(%rbp), %edi
addl $0x2, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5a70
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movb -0x2(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x38(%rbp), %rax
movb -0x1(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x9(%rax)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
addq $0x2, %rdi
movq -0x1048(%rbp), %rsi
addq $0x8, %rsi
movslq -0x104c(%rbp), %rdx
callq 0x21d0
movq -0x1048(%rbp), %rdi
callq 0x5e30
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5ca0
movq -0x20(%rbp), %rdi
callq 0x2030
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1050, %rsp           # imm = 0x1050
popq %rbp
retq
nopw %cs:(%rax,%rax)