// File: chlunde[P]qtar/qtar.cc
// Function: Traverser<CScan>::addpath(us_dirent&)
void addpath(struct us_dirent& file) {
		std::string fq = file.fq();
		std::string rel = fq.substr(root.length() + 1);
		std::string uname, gname;
		const struct stat& st = file.stat();
		uname = lookup_uname(st.st_uid);
		gname = lookup_gname(st.st_gid);
#if 0
		std::cout << "addPATH " << fq << "\t" << file.d_ino << "\t" << file.is_file() << std::endl;
#endif
		struct archive_entry *entry = archive_entry_new();

		archive_entry_copy_stat(entry, &file.stat());
		if (uname.size())
			archive_entry_set_uname(entry, uname.c_str());
		if (gname.size())
			archive_entry_set_gname(entry, gname.c_str());
		archive_entry_set_pathname(entry, rel.c_str());
		int r = archive_write_header(a, entry);
		if (r != ARCHIVE_OK)
			errx(EXIT_FAILURE, "archive_write_header failed: %s, %s", rel.c_str(), archive_error_string(a));
		archive_entry_free(entry);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x61b0
movq -0x108(%rbp), %rdi
addq $0x8, %rdi
callq 0x3410
movq -0x100(%rbp), %rsi
movq %rax, %rdx
incq %rdx
leaq -0x50(%rbp), %rdi
movq $-0x1, %rcx
callq 0x32d0
jmp 0x7211
leaq -0x80(%rbp), %rdi
callq 0x33a0
leaq -0xa0(%rbp), %rdi
callq 0x33a0
movq -0x10(%rbp), %rdi
callq 0x5440
movq %rax, -0x110(%rbp)
jmp 0x7238
movq -0x108(%rbp), %rsi
movq -0x110(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movl 0x1c(%rax), %edx
leaq -0xc8(%rbp), %rdi
callq 0x8d60
jmp 0x7265
leaq -0x80(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
movq %rsi, -0x118(%rbp)
callq 0x3370
movq -0x118(%rbp), %rdi
callq 0x31c0
movq -0x108(%rbp), %rsi
movq -0xa8(%rbp), %rax
movl 0x20(%rax), %edx
leaq -0xe8(%rbp), %rdi
callq 0x8f00
jmp 0x72a7
leaq -0xa0(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
movq %rsi, -0x128(%rbp)
callq 0x3370
movq -0x128(%rbp), %rdi
callq 0x31c0
callq 0x3060
movq %rax, -0x120(%rbp)
jmp 0x72db
movq -0x120(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5440
movq %rax, -0x130(%rbp)
jmp 0x7309
movq -0x130(%rbp), %rsi
movq -0x138(%rbp), %rdi
callq 0x3110
jmp 0x731e
leaq -0x80(%rbp), %rdi
callq 0x31f0
cmpq $0x0, %rax
je 0x7397
movq -0xf0(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3130
movq -0x140(%rbp), %rdi
movq %rax, %rsi
callq 0x31d0
jmp 0x7355
jmp 0x7397
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x74bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x31c0
leaq -0x80(%rbp), %rdi
callq 0x31c0
leaq -0x50(%rbp), %rdi
callq 0x31c0
jmp 0x74bd
leaq -0xa0(%rbp), %rdi
callq 0x31f0
cmpq $0x0, %rax
je 0x73d6
movq -0xf0(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3130
movq -0x148(%rbp), %rdi
movq %rax, %rsi
callq 0x33c0
jmp 0x73d4
jmp 0x73d6
movq -0xf0(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3130
movq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0x3170
jmp 0x73fe
movq -0x108(%rbp), %rax
movq (%rax), %rdi
movq -0xf0(%rbp), %rsi
callq 0x33e0
movl %eax, -0x154(%rbp)
jmp 0x741c
movl -0x154(%rbp), %eax
movl %eax, -0xf4(%rbp)
cmpl $0x0, -0xf4(%rbp)
je 0x747f
leaq -0x50(%rbp), %rdi
callq 0x3130
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x168(%rbp)
movq (%rax), %rdi
callq 0x3250
movq %rax, -0x160(%rbp)
jmp 0x745c
movq -0x160(%rbp), %rcx
movq -0x168(%rbp), %rdx
leaq 0x5bef(%rip), %rsi      # 0xd060
xorl %eax, %eax
movl $0x1, %edi
callq 0x34d0
jmp 0x747f
movq -0xf0(%rbp), %rdi
callq 0x3070
jmp 0x748d
leaq -0xa0(%rbp), %rdi
callq 0x31c0
leaq -0x80(%rbp), %rdi
callq 0x31c0
leaq -0x50(%rbp), %rdi
callq 0x31c0
leaq -0x30(%rbp), %rdi
callq 0x31c0
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x31c0
movq -0x58(%rbp), %rdi
callq 0x3480
nop