// File: /workspace/github_cpp_makefile_star2_O2/chlunde[P]qtar/qtar.cc
// Function: Traverser<CScan>::heapwalk(us_dirent&)
void heapwalk(struct us_dirent& dirent) {
//		std::cout << "heapwalk " << dirent.d_ino << "\t" << dirent.d_name << std::endl;

		if (dirent.is_file() || dirent.is_link()) {
			queuefile(dirent);
			return;
		}

		std::string path;
		if (dirent.d_name != ".") {
			path = dirent.parent + "/" + dirent.d_name;
		} else  {
			path = dirent.parent;
		}

#if 0
		static long long a;
		std::cout << (long long)(dirent.d_ino - a) << std::endl;
		a = dirent.d_ino;
#endif
		if (dirent.is_unknown()) {
			struct stat& buf = dirent.stat();

			if (S_ISDIR(buf.st_mode)) {
				dirent.set_is_dir();
			} else {
				dirent.set_is_file();
				queuefile(dirent);
				return;
			}
		}

		std::vector<struct us_dirent> l;
		if (dir_read(path, l) < 0) {
			//dirent.set_is_file();
			//addfile(dirent);
			std::cerr << "Error!" << std::endl;
			return;
		}

		sort(l.begin(), l.end());

		addpath(dirent);

		dirent.set_is_dir();
		//queue.push_back(dirent);

		for (std::vector<struct us_dirent>::iterator it = l.begin(); it != l.end(); ++it) {
			if (it->d_name == "." || it->d_name == "..")
				continue;

			if (!use_getdents_type)
				it->set_is_unknown();

			if (it->is_file()) {
				queuefile(*it);
			} else {
				dirheap.push(*it);
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x48(%rsi), %eax
orl $0x2, %eax
cmpl $0xa, %eax
jne 0x30f3
movq %rbx, %rdi
movq %r14, %rsi
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3836
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%r14), %r15
leaq 0x2f4f(%rip), %rsi      # 0x605e
movq %r15, %rdi
callq 0x38c4
leaq 0x28(%r14), %rsi
testb %al, %al
je 0x3164
leaq 0x2f2e(%rip), %rdx      # 0x6054
leaq 0x50(%rsp), %rdi
callq 0x35c8
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
callq 0x35a9
leaq 0x30(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x22a0
movq %r15, %rdi
callq 0x2120
leaq 0x50(%rsp), %rdi
callq 0x2120
jmp 0x316e
leaq 0x30(%rsp), %rdi
callq 0x2170
cmpb $0x0, 0x48(%r14)
jne 0x3196
movq %r14, %rdi
callq 0x2e66
movl $0xf000, %ecx           # imm = 0xF000
andl 0x18(%rax), %ecx
cmpl $0x4000, %ecx           # imm = 0x4000
jne 0x3299
movb $0x4, 0x48(%r14)
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x30(%rsp), %rdi
callq 0x53ac
testl %eax, %eax
js 0x325a
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x3ab7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x38ce
movb $0x4, 0x48(%r14)
movq (%rsp), %r14
leaq 0x28(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x2e76(%rip), %r12      # 0x605e
leaq 0x2e6e(%rip), %r13      # 0x605d
leaq 0x70(%rsp), %rbp
cmpq 0x8(%rsp), %r14
je 0x3275
leaq 0x8(%r14), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x2775
testb %al, %al
jne 0x3251
movq %r15, %rdi
movq %r13, %rsi
callq 0x2775
testb %al, %al
jne 0x3251
cmpb $0x8, 0x48(%r14)
jne 0x3231
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3836
jmp 0x3251
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2ef2
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x3600
movq %rbp, %rdi
callq 0x2c62
addq $0xe8, %r14
jmp 0x31f4
movq 0x6d8f(%rip), %rdi      # 0x9ff0
leaq 0x2dee(%rip), %rsi      # 0x6056
callq 0x2220
movq %rax, %rdi
callq 0x2130
movq %rsp, %rdi
callq 0x3a96
leaq 0x30(%rsp), %rdi
callq 0x2120
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x8, 0x48(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3836
jmp 0x327d
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2120
jmp 0x32df
jmp 0x32be
jmp 0x32be
movq %rax, %rbx
jmp 0x32df
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2c62
jmp 0x32d7
jmp 0x32d4
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3a96
leaq 0x30(%rsp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2390
nop