// File: /workspace/github_cpp_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x48(%rsi), %eax
orl $0x2, %eax
cmpl $0xa, %eax
jne 0x3687
movq %rbx, %rdi
movq %r14, %rsi
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4120
leaq 0x50(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
leaq 0x8(%r14), %rdi
leaq 0x49b7(%rip), %rsi      # 0x805e
callq 0x20c0
testl %eax, %eax
je 0x3718
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3e58
leaq 0x497e(%rip), %rsi      # 0x8054
leaq 0x20(%rsp), %rdi
callq 0x23e0
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
leaq 0x20(%rsp), %rdi
callq 0x20d0
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3728
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x3730
leaq 0x28(%r14), %rsi
leaq 0x40(%rsp), %rdi
callq 0x2170
jmp 0x3783
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rsp, %r15
movq %rdx, 0x8(%r15)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x22b0
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x376c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2250
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x3783
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2250
cmpb $0x0, 0x48(%r14)
jne 0x37ab
movq %r14, %rdi
callq 0x33d8
movl $0xf000, %ecx           # imm = 0xF000
andl 0x18(%rax), %ecx
cmpl $0x4000, %ecx           # imm = 0x4000
jne 0x39cc
movb $0x4, 0x48(%r14)
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
leaq 0x40(%rsp), %rdi
callq 0x6c68
testl %eax, %eax
js 0x3950
movq (%rsp), %r15
movq 0x8(%rsp), %r12
cmpq %r12, %r15
je 0x3817
movq %r12, %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $0x34f72c234f72c235, %rcx # imm = 0x34F72C234F72C235
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x44fb
movq %r15, %rdi
movq %r12, %rsi
callq 0x4660
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4256
movb $0x4, 0x48(%r14)
movq (%rsp), %r14
cmpq 0x8(%rsp), %r14
je 0x3996
leaq 0x28(%rbx), %rbp
leaq 0x481d(%rip), %r15      # 0x805e
leaq 0x4815(%rip), %r12      # 0x805d
leaq 0x8(%r14), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x20c0
testl %eax, %eax
je 0x393c
movq %r13, %rdi
movq %r12, %rsi
callq 0x20c0
testl %eax, %eax
je 0x393c
cmpb $0x8, 0x48(%r14)
jne 0x3889
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4120
jmp 0x393c
movq (%r14), %rax
movq %rax, 0x60(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x3e58
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x3e58
leaq 0x48(%r14), %rsi
movl $0x99, %edx
leaq 0xa8(%rsp), %rdi
callq 0x2200
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3eee
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x3920
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2250
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x393c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2250
addq $0xe8, %r14
cmpq 0x8(%rsp), %r14
jne 0x3848
jmp 0x3996
movq 0x7699(%rip), %rbx      # 0xaff0
leaq 0x46f8(%rip), %rsi      # 0x8056
movl $0x6, %edx
movq %rbx, %rdi
callq 0x2280
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq 0x7667(%rip), %rdi      # 0xaff0
callq 0x2030
movq %rax, %rdi
callq 0x2190
movq %rsp, %rdi
callq 0x44cc
leaq 0x50(%rsp), %rbp
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x39ba
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2250
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x8, 0x48(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4120
jmp 0x39a3
jmp 0x3a00
jmp 0x3a00
jmp 0x39e4
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a42
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2250
jmp 0x3a42
movq %rax, %rbx
jmp 0x3a42
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x31ac
jmp 0x3a3a
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3a3a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2250
jmp 0x3a3a
jmp 0x3a37
movq %rax, %rbx
movq %rsp, %rdi
callq 0x44cc
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x3a5e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x2390