// File: /workspace/github_c_makefile_star2_O0/jarun[P]nnn/src/nnn.c
// Function: du_thread
static void *du_thread(void *p_data)
{
	thread_data *pdata = (thread_data *)p_data;
	char *path[2] = {pdata->path, NULL};
	ullong_t tfiles = 0;
	blkcnt_t tblocks = 0;
	struct stat *sb;
	FTS *tree = fts_open(path, FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR, 0);
	FTSENT *node;

	while ((node = fts_read(tree))) {
		if (node->fts_info & FTS_D) {
			if (g_state.interrupt)
				break;
			continue;
		}

		sb = node->fts_statp;

		if (cfg.apparentsz) {
			if (sb->st_size && DU_TEST)
				tblocks += sb->st_size;
		} else if (sb->st_blocks && DU_TEST)
			tblocks += sb->st_blocks;

		++tfiles;
	}

	fts_close(tree);

	if (pdata->entnum >= 0)
		pdents[pdata->entnum].blocks = tblocks;

	if (!pdata->mntpoint) {
		core_blocks[pdata->core] += tblocks;
		core_files[pdata->core] += tfiles;
	} else
		core_files[pdata->core] += 1;

	pthread_mutex_lock(&running_mutex);
	threadbmp |= (1 << pdata->core);
	--active_threads;
	pthread_mutex_unlock(&running_mutex);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
movl $0x54, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x42c0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x43d0
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x1745d
movq -0x48(%rbp), %rax
movzwl 0x62(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x17379
movl 0x94bd(%rip), %eax      # 0x20824
shrl $0x8, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x17377
jmp 0x1745d
jmp 0x1733a
movq -0x48(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x38(%rbp)
movl 0x9145(%rip), %eax      # 0x204d0
shrl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x173f1
movq -0x38(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x173ef
movq -0x48(%rbp), %rax
movzwl 0x62(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x173cf
movq -0x38(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jbe 0x173df
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %edi
callq 0x171f0
testb $0x1, %al
jne 0x173df
movq -0x48(%rbp), %rax
movzwl 0x62(%rax), %eax
andl $0x6, %eax
cmpl $0x0, %eax
je 0x173ef
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x1744c
movq -0x38(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x1744a
movq -0x48(%rbp), %rax
movzwl 0x62(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x1742a
movq -0x38(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jbe 0x1743a
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %edi
callq 0x171f0
testb $0x1, %al
jne 0x1743a
movq -0x48(%rbp), %rax
movzwl 0x62(%rax), %eax
andl $0x6, %eax
cmpl $0x0, %eax
je 0x1744a
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x1744c
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1733a
movq -0x40(%rbp), %rdi
callq 0x4490
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1000(%rax)
jl 0x174b5
movq -0x30(%rbp), %rdx
movq 0x12ef2(%rip), %rax     # 0x2a370
movq -0x10(%rbp), %rcx
movslq 0x1000(%rcx), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rcx
movabsq $0xffffffffff, %rsi     # imm = 0xFFFFFFFFFF
andq %rsi, %rdx
movabsq $-0x10000000000, %rsi   # imm = 0xFFFFFF0000000000
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x1006(%rax)
jne 0x17500
movq -0x30(%rbp), %rdx
movq 0x14103(%rip), %rax     # 0x2b5d0
movq -0x10(%rbp), %rcx
movzwl 0x1004(%rcx), %ecx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rdx
movq 0x140f5(%rip), %rax     # 0x2b5e0
movq -0x10(%rbp), %rcx
movzwl 0x1004(%rcx), %ecx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x1751e
movq 0x140d9(%rip), %rax     # 0x2b5e0
movq -0x10(%rbp), %rcx
movzwl 0x1004(%rcx), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
leaq 0x140eb(%rip), %rdi     # 0x2b610
callq 0x48e0
movq -0x10(%rbp), %rax
movzwl 0x1004(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
orl 0x92aa(%rip), %eax      # 0x207ec
movl %eax, 0x92a4(%rip)      # 0x207ec
movl 0x140ba(%rip), %eax     # 0x2b608
addl $-0x1, %eax
movl %eax, 0x140b1(%rip)     # 0x2b608
leaq 0x140b2(%rip), %rdi     # 0x2b610
callq 0x45b0
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)