// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
cmpb $0x0, 0xa9(%rdi)
je 0x7336
movq %rdi, %r14
movl $0xf000, %eax           # imm = 0xF000
andl 0x28(%rdi), %eax
addl $0xfffff000, %eax       # imm = 0xFFFFF000
movb $0x2d, %cl
cmpl $0xbfff, %eax           # imm = 0xBFFF
ja 0x725a
shrl $0xc, %eax
leaq 0x2081(%rip), %rcx      # 0x92d8
movb (%rax,%rcx), %cl
movb %cl, (%rbx)
movl 0x28(%r14), %edx
btl $0x8, %edx
movl $0x2d, %eax
movl $0x72, %ecx
movl $0x72, %esi
cmovael %eax, %esi
testb %dl, %dl
movl $0x77, %edi
cmovnsl %eax, %edi
movb %sil, 0x1(%rbx)
movb %dil, 0x2(%rbx)
testb $0x40, %dl
movl $0x78, %edx
cmovel %eax, %edx
movb %dl, 0x3(%rbx)
movl 0x28(%r14), %edx
testb $0x20, %dl
movl $0x72, %esi
cmovel %eax, %esi
movl $0x77, %edi
movb %sil, 0x4(%rbx)
testb $0x10, %dl
movl $0x77, %esi
cmovel %eax, %esi
movb %sil, 0x5(%rbx)
testb $0x8, %dl
movl $0x78, %edx
cmovel %eax, %edx
movb %dl, 0x6(%rbx)
movl 0x28(%r14), %edx
testb $0x4, %dl
cmovel %eax, %ecx
movl $0x78, %esi
testb $0x2, %dl
cmovel %eax, %edi
movb %cl, 0x7(%rbx)
testb $0x1, %dl
cmovel %eax, %esi
movb %dil, 0x8(%rbx)
movb %sil, 0x9(%rbx)
movb $0x20, 0xa(%rbx)
movl 0x2c(%r14), %edi
callq 0x3210
movq %rax, %r12
movl 0x30(%r14), %edi
callq 0x3290
movq %rax, %r15
leaq 0x68(%r14), %rdi
movq %rsp, %rsi
callq 0x3100
leaq 0xb(%rbx), %rdi
testq %r12, %r12
je 0x7354
movq (%r12), %rdx
leaq 0x1f63(%rip), %rsi      # 0x9290
xorl %eax, %eax
callq 0x3680
jmp 0x7366
movups 0x1f40(%rip), %xmm0     # 0x927d
movups %xmm0, 0x10(%rbx)
movups 0x1f25(%rip), %xmm0     # 0x926d
movups %xmm0, (%rbx)
movl $0x3f3f3a, 0x1f(%rbx)   # imm = 0x3F3F3A
jmp 0x73c1
movl 0x2c(%r14), %edx
leaq 0x1f38(%rip), %rsi      # 0x9297
xorl %eax, %eax
callq 0x3680
cltq
leaq 0xb(%rax), %r12
leaq (%rbx,%rax), %rdi
addq $0xb, %rdi
testq %r15, %r15
je 0x738c
movq (%r15), %rdx
leaq 0x1f0d(%rip), %rsi      # 0x9290
xorl %eax, %eax
callq 0x3680
jmp 0x739e
movl 0x30(%r14), %edx
leaq 0x1f00(%rip), %rsi      # 0x9297
xorl %eax, %eax
callq 0x3680
cltq
addq %r12, %rbx
addq %rax, %rbx
leaq 0x1ef1(%rip), %rdx      # 0x929e
movq %rsp, %rcx
movl $0x14, %esi
movq %rbx, %rdi
callq 0x35a0
movb $0x0, (%rax,%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq