// File: /workspace/github_c_makefile_star2_O0/cglindkamp[P]dfm/src/filedata.c
// Function: filedata_format_output
void filedata_format_output(const struct filedata *filedata, char *buffer)
{
	if(!filedata->is_stat_valid) {
		strcpy(buffer, "?????????? ? ? ????""-??""-?? ??:??:??");
		return;
	}


	buffer[0] = filetype_character(&filedata->stat);
	permission_characters(buffer + 1, (filedata->stat.st_mode >> 6) & 7);
	permission_characters(buffer + 4, (filedata->stat.st_mode >> 3) & 7);
	permission_characters(buffer + 7,  filedata->stat.st_mode       & 7);
	buffer[10] = ' ';

	size_t length = 11;

	struct passwd *passwd = getpwuid(filedata->stat.st_uid);
	struct group *group = getgrgid(filedata->stat.st_gid);
	struct tm modification_time;
	localtime_r(&filedata->stat.st_mtime, &modification_time);

	if(passwd)
		length += sprintf(buffer + length, "%.32s ", passwd->pw_name);
	else
		length += sprintf(buffer + length, "%.32d ", filedata->stat.st_uid);
	if(group)
		length += sprintf(buffer + length, "%.32s ", group->gr_name);
	else
		length += sprintf(buffer + length, "%.32d ", filedata->stat.st_gid);

	length += strftime(buffer + length, sizeof("1970-01-01 00:00:00"), "%F %T", &modification_time);

	buffer[length] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0xa9(%rax)
jne 0x95d2
movq -0x10(%rbp), %rdi
leaq 0x3c5a(%rip), %rsi      # 0xd222
callq 0x3110
jmp 0x975f
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x9770
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
shrl $0x6, %eax
andl $0x7, %eax
movsbl %al, %esi
callq 0x9810
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
shrl $0x3, %eax
andl $0x7, %eax
movsbl %al, %esi
callq 0x9810
movq -0x10(%rbp), %rdi
addq $0x7, %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x7, %eax
movsbl %al, %esi
callq 0x9810
movq -0x10(%rbp), %rax
movb $0x20, 0xa(%rax)
movq $0xb, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x3210
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edi
callq 0x3290
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
addq $0x58, %rdi
leaq -0x60(%rbp), %rsi
callq 0x3100
cmpq $0x0, -0x20(%rbp)
je 0x96b0
movq -0x10(%rbp), %rdi
addq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x3ba8(%rip), %rsi      # 0xd245
movb $0x0, %al
callq 0x3680
cltq
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x96d7
movq -0x10(%rbp), %rdi
addq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %edx
leaq 0x3b86(%rip), %rsi      # 0xd24c
movb $0x0, %al
callq 0x3680
cltq
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9707
movq -0x10(%rbp), %rdi
addq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
leaq 0x3b51(%rip), %rsi      # 0xd245
movb $0x0, %al
callq 0x3680
cltq
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x972e
movq -0x10(%rbp), %rdi
addq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edx
leaq 0x3b2f(%rip), %rsi      # 0xd24c
movb $0x0, %al
callq 0x3680
cltq
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq -0x18(%rbp), %rdi
movl $0x14, %esi
leaq 0x3b11(%rip), %rdx      # 0xd253
leaq -0x60(%rbp), %rcx
callq 0x35a0
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)