// File: /workspace/github_cpp_makefile_star2_O1/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 0x366b
movq %rbx, %rdi
movq %r14, %rsi
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x413c
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%r14), %rdi
leaq 0x49d4(%rip), %rsi      # 0x805e
callq 0x20c0
testl %eax, %eax
je 0x36fb
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3e7a
leaq 0x499b(%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 0x370b
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x3713
leaq 0x28(%r14), %rsi
leaq 0x40(%rsp), %rdi
callq 0x2170
jmp 0x3766
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 0x374f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2250
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x3766
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2250
cmpb $0x0, 0x48(%r14)
jne 0x37a8
movq %r14, %rdi
callq 0x33c4
movl $0xf000, %ebp           # imm = 0xF000
andl 0x18(%rax), %ebp
cmpl $0x4000, %ebp           # imm = 0x4000
jne 0x378c
movb $0x4, 0x48(%r14)
jmp 0x379c
movb $0x8, 0x48(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x413c
cmpl $0x4000, %ebp           # imm = 0x4000
jne 0x399b
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
leaq 0x40(%rsp), %rdi
callq 0x6cfc
testl %eax, %eax
js 0x394d
movq (%rsp), %r15
movq 0x8(%rsp), %r12
cmpq %r12, %r15
je 0x3814
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 0x4517
movq %r15, %rdi
movq %r12, %rsi
callq 0x467c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4272
movb $0x4, 0x48(%r14)
movq (%rsp), %r14
cmpq 0x8(%rsp), %r14
je 0x3993
leaq 0x28(%rbx), %rbp
leaq 0x4820(%rip), %r15      # 0x805e
leaq 0x4818(%rip), %r12      # 0x805d
leaq 0x8(%r14), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x20c0
testl %eax, %eax
je 0x3939
movq %r13, %rdi
movq %r12, %rsi
callq 0x20c0
testl %eax, %eax
je 0x3939
cmpb $0x8, 0x48(%r14)
jne 0x3886
movq %rbx, %rdi
movq %r14, %rsi
callq 0x413c
jmp 0x3939
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 0x3e7a
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x3e7a
leaq 0x48(%r14), %rsi
movl $0x99, %edx
leaq 0xa8(%rsp), %rdi
callq 0x2200
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3f0a
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x391d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2250
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3939
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2250
addq $0xe8, %r14
cmpq 0x8(%rsp), %r14
jne 0x3845
jmp 0x3993
movq 0x769c(%rip), %rbx      # 0xaff0
leaq 0x46fb(%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 0x766a(%rip), %rdi      # 0xaff0
callq 0x2030
movq %rax, %rdi
callq 0x2190
movq %rsp, %rdi
callq 0x44e8
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x39b7
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
jmp 0x39eb
jmp 0x39eb
jmp 0x39cf
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a2d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2250
jmp 0x3a2d
movq %rax, %rbx
jmp 0x3a2d
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x31ac
jmp 0x3a25
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3a25
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2250
jmp 0x3a25
jmp 0x3a22
movq %rax, %rbx
movq %rsp, %rdi
callq 0x44e8
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x3a49
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x2390
nop