// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]ufat/main.c
// Function: cmd_fstat
static int cmd_fstat(struct ufat *uf, const struct options *opt)
{
	FILE *out;
	struct ufat_dirent ent;
	char can_name[UFAT_LFN_MAX_UTF8];
	int err;

	if (!opt->argc) {
		fprintf(stderr, "You must specify a file path\n");
		return -1;
	}

	if (require_file(uf, opt->argv[0], &ent) < 0)
		return -1;

	out = open_output(opt->out_file);
	if (!out)
		return -1;

	err = ufat_get_filename(uf, &ent, can_name, sizeof(can_name));
	if (err < 0)
		fprintf(stderr, "ufat_get_filename: %s\n",
			ufat_strerror(err));
	else
		fprintf(out, "Filename:               %s\n", can_name);

	fprintf(out, "Entry block/offset:     %llu/%d\n",
		ent.dirent_block, ent.dirent_pos);

	if (ent.lfn_block != UFAT_BLOCK_NONE)
		fprintf(out, "LFN start block/offset: %llu/%d\n",
			ent.lfn_block, ent.lfn_pos);

	fprintf(out, "Short name:             %s", ent.short_name);
	if (ent.short_ext[0])
		fprintf(out, ".%s\n", ent.short_ext);
	else
		fprintf(out, "\n");
	fprintf(out, "Attributes:             0x%02x (", ent.attributes);
	print_attributes(out, ent.attributes);
	fprintf(out, ")\n");
	fprintf(out, "Creation date/time:     ");
	print_date(out, ent.create_date);
	fprintf(out, " ");
	print_time(out, ent.create_time);
	fprintf(out, "\n");
	fprintf(out, "Modification date/time: ");
	print_date(out, ent.modify_date);
	fprintf(out, " ");
	print_time(out, ent.modify_time);
	fprintf(out, "\n");
	fprintf(out, "Last access date:       ");
	print_date(out, ent.access_date);
	fprintf(out, "\n");
	fprintf(out, "First cluster:          %u\n", ent.first_cluster);
	fprintf(out, "Size:                   %u\n", ent.file_size);

	return close_output(opt->out_file, out);
}

// Assembly:
subq $0x378, %rsp            # imm = 0x378
movq %rdi, 0x368(%rsp)
movq %rsi, 0x360(%rsp)
movq 0x360(%rsp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x99cd
movq 0x664c(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x31e5(%rip), %rsi      # 0xcb9b
movb $0x0, %al
callq 0x2120
movl $0xffffffff, 0x374(%rsp) # imm = 0xFFFFFFFF
jmp 0x9d22
movq 0x368(%rsp), %rdi
movq 0x360(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rsi
leaq 0x310(%rsp), %rdx
callq 0xad00
cmpl $0x0, %eax
jge 0x9a06
movl $0xffffffff, 0x374(%rsp) # imm = 0xFFFFFFFF
jmp 0x9d22
movq 0x360(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x9330
movq %rax, 0x358(%rsp)
cmpq $0x0, 0x358(%rsp)
jne 0x9a3a
movl $0xffffffff, 0x374(%rsp) # imm = 0xFFFFFFFF
jmp 0x9d22
movq 0x368(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x310(%rsp), %rsi
movl $0x300, %ecx            # imm = 0x300
callq 0x4c00
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jge 0x9a92
movq 0x658d(%rip), %rax      # 0xfff8
movq (%rax), %rax
movq %rax, (%rsp)
movl 0xc(%rsp), %edi
callq 0x2c40
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0x3130(%rip), %rsi      # 0xcbb9
movb $0x0, %al
callq 0x2120
jmp 0x9aad
movq 0x358(%rsp), %rdi
leaq 0x10(%rsp), %rdx
leaq 0x312a(%rip), %rsi      # 0xcbd0
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movq 0x310(%rsp), %rdx
movl 0x318(%rsp), %ecx
leaq 0x3121(%rip), %rsi      # 0xcbec
movb $0x0, %al
callq 0x2120
cmpq $-0x1, 0x320(%rsp)
je 0x9b02
movq 0x358(%rsp), %rdi
movq 0x320(%rsp), %rdx
movl 0x328(%rsp), %ecx
leaq 0x3112(%rip), %rsi      # 0xcc0d
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
leaq 0x310(%rsp), %rdx
addq $0x1c, %rdx
leaq 0x3111(%rip), %rsi      # 0xcc2e
movb $0x0, %al
callq 0x2120
cmpb $0x0, 0x335(%rsp)
je 0x9b52
movq 0x358(%rsp), %rdi
leaq 0x310(%rsp), %rdx
addq $0x25, %rdx
leaq 0x3100(%rip), %rsi      # 0xcc49
movb $0x0, %al
callq 0x2120
jmp 0x9b68
movq 0x358(%rsp), %rdi
leaq 0x36d4(%rip), %rsi      # 0xd235
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movl 0x33c(%rsp), %edx
leaq 0x30d0(%rip), %rsi      # 0xcc4e
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movl 0x33c(%rsp), %esi
callq 0xb040
movq 0x358(%rsp), %rdi
leaq 0x368c(%rip), %rsi      # 0xd234
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
leaq 0x30b1(%rip), %rsi      # 0xcc6f
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movzwl 0x340(%rsp), %esi
callq 0xafa0
movq 0x358(%rsp), %rdi
leaq 0x30cf(%rip), %rsi      # 0xccb8
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movzwl 0x342(%rsp), %esi
callq 0xaff0
movq 0x358(%rsp), %rdi
leaq 0x3621(%rip), %rsi      # 0xd235
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
leaq 0x305e(%rip), %rsi      # 0xcc88
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movzwl 0x344(%rsp), %esi
callq 0xafa0
movq 0x358(%rsp), %rdi
leaq 0x3063(%rip), %rsi      # 0xccb8
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movzwl 0x346(%rsp), %esi
callq 0xaff0
movq 0x358(%rsp), %rdi
leaq 0x35b5(%rip), %rsi      # 0xd235
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
leaq 0x300b(%rip), %rsi      # 0xcca1
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movzwl 0x348(%rsp), %esi
callq 0xafa0
movq 0x358(%rsp), %rdi
leaq 0x3574(%rip), %rsi      # 0xd235
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movl 0x34c(%rsp), %edx
leaq 0x2fdc(%rip), %rsi      # 0xccba
movb $0x0, %al
callq 0x2120
movq 0x358(%rsp), %rdi
movl 0x350(%rsp), %edx
leaq 0x2fdb(%rip), %rsi      # 0xccd6
movb $0x0, %al
callq 0x2120
movq 0x360(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x358(%rsp), %rsi
callq 0x9500
movl %eax, 0x374(%rsp)
movl 0x374(%rsp), %eax
addq $0x378, %rsp            # imm = 0x378
retq
nopw %cs:(%rax,%rax)