// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/main.c
// Function: main
int main(int argc, char **argv)
{
	struct file_device dev;
	struct ufat uf;
	struct options opt;
	int err;

	if (parse_options(argc, argv, &opt) < 0)
		return -1;

	srandom(opt.seed);

	if (file_device_open(&dev, opt.filename, opt.log2_bs,
			     opt.flags & OPTION_MKFS) < 0)
		return -1;

	if (opt.flags & OPTION_MKFS) {
		err = ufat_mkfs(&dev.base, opt.num_blocks);
		if (err < 0) {
			fprintf(stderr, "ufat_mkfs: %s\n", ufat_strerror(err));
			file_device_close(&dev);
			return -1;
		}
	}

	err = ufat_open(&uf, &dev.base);
	if (err) {
		fprintf(stderr, "ufat_open: %s\n", ufat_strerror(err));
		file_device_close(&dev);
		return -1;
	}

	if (!opt.command) {
		FILE *out = open_output(opt.out_file);

		if (!out) {
			err = -1;
		} else {
			show_info(out, &uf.bpb);
			err = close_output(opt.out_file, out);
		}
	} else {
		err = opt.command->func(&uf, &opt);
	}

	ufat_close(&uf);
	file_device_close(&dev);

	if (opt.flags & OPTION_STATISTICS)
		dump_stats(&uf.stat);

	return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2218, %rsp           # imm = 0x2218
movq %rsi, %r12
movl %edi, %ebp
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%rsp)
movups %xmm0, 0x78(%rsp)
movups %xmm0, 0x68(%rsp)
movups %xmm0, 0x58(%rsp)
pushq $0x9
popq %r15
movq $0x0, 0x20(%rsp)
leaq 0x1d98(%rip), %r13      # 0x620c
leaq 0x5845(%rip), %rbx      # 0x9cc0
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
xorl %r14d, %r14d
movl %r14d, 0x8(%rsp)
orl $0x1, %r14d
movl %ebp, %edi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x10e0
testl %eax, %eax
js 0x45ac
leal -0x4d(%rax), %ecx
cmpl $0x9, %ecx
jbe 0x44ee
cmpl $0x62, %eax
je 0x4505
cmpl $0x69, %eax
je 0x4593
cmpl $0x6f, %eax
je 0x457a
cmpl $0x3f, %eax
je 0x499e
cmpl $0x48, %eax
jne 0x44a1
jmp 0x4a72
leaq 0x1cbf(%rip), %rdx      # 0x61b4
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl %r14d, 0x8(%rsp)
jmp 0x44a1
movq 0x5acc(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x11c0
testl %eax, %eax
je 0x4a53
xorl %r15d, %r15d
cmpl $0x2, %eax
jb 0x44a1
testb $0x1, %al
jne 0x49d0
shrl %eax
incl %r15d
jmp 0x451f
movl 0x8(%rsp), %r14d
orl $0x2, %r14d
movq 0x5a91(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x11c0
movl %eax, 0xc(%rsp)
jmp 0x4498
movl 0x8(%rsp), %r14d
orl $0x4, %r14d
movq 0x5a70(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x1130
movq %rax, 0x20(%rsp)
jmp 0x4498
movq 0x5a57(%rip), %rax      # 0x9fd8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movl 0x8(%rsp), %r14d
jmp 0x4498
movq 0x5a3e(%rip), %rax      # 0x9fd8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x8(%rsp), %r14d
jmp 0x4498
movl %r15d, 0x54(%rsp)
movl 0x8(%rsp), %ebx
movl %ebx, 0x50(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x58(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x59ea(%rip), %rax      # 0x9fd0
movslq (%rax), %rax
subl %eax, %ebp
jle 0x4961
leaq (%r12,%rax,8), %r13
movq (%r13), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x78(%rsp)
cmpl $0x1, %ebp
jne 0x4620
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rsp)
andl $0x0, 0x90(%rsp)
xorl %r14d, %r14d
jmp 0x4684
movq 0x8(%r13), %r12
leaq 0x5715(%rip), %r14      # 0x9d40
xorl %ecx, %ecx
leaq 0x10(%rcx), %rbx
cmpq $0xa0, %rbx
je 0x4656
movq (%rcx,%r14), %rdi
movq %r12, %rsi
callq 0x1040
movq %rbx, %rcx
testl %eax, %eax
jne 0x462d
addq %rbx, %r14
addq $-0x10, %r14
jmp 0x4659
xorl %r14d, %r14d
movq %r14, 0x80(%rsp)
addq $0x10, %r13
movq %r13, 0x88(%rsp)
addl $-0x2, %ebp
movl %ebp, 0x90(%rsp)
testq %r14, %r14
movl 0x8(%rsp), %ebx
je 0x49b3
movl 0xc(%rsp), %edi
callq 0x1070
movl %r15d, 0x28(%rsp)
leaq 0x1779(%rip), %rax      # 0x5e12
movq %rax, 0x30(%rsp)
leaq 0x1806(%rip), %rax      # 0x5eab
movq %rax, 0x38(%rsp)
andl $0x0, 0x48(%rsp)
testb $0x4, %bl
jne 0x46f1
leaq 0x26bb(%rip), %rsi      # 0x6d76
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x11a0
movq %rax, 0x40(%rsp)
testq %rax, %rax
jne 0x472f
callq 0x1060
cmpl $0xd, (%rax)
jne 0x4990
movl $0x1, 0x48(%rsp)
leaq 0x247a(%rip), %rsi      # 0x6b69
jmp 0x46fd
leaq 0x267a(%rip), %rsi      # 0x6d72
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x11a0
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x4990
testb $0x4, %bl
je 0x472f
leaq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3a7c
testl %eax, %eax
js 0x49ee
leaq 0x98(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x15c7
testl %eax, %eax
jne 0x4976
testq %r14, %r14
je 0x4764
leaq 0x98(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq *0x8(%r14)
jmp 0x4881
movq 0x18(%rsp), %rdi
callq 0x4a82
testq %rax, %rax
je 0x4959
movq %rax, %rbx
movl 0xc0(%rsp), %edx
leaq 0x26a5(%rip), %rsi      # 0x6e2d
movq %rax, %rdi
xorl %eax, %eax
callq 0x1140
movb 0xc4(%rsp), %cl
pushq $0x1
popq %rdx
shll %cl, %edx
leaq 0x26ab(%rip), %rsi      # 0x6e50
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movq 0xd0(%rsp), %rdx
leaq 0x26b2(%rip), %rsi      # 0x6e70
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movq 0xc8(%rsp), %rdx
leaq 0x26bb(%rip), %rsi      # 0x6e92
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movl 0xd8(%rsp), %edx
leaq 0x26c5(%rip), %rsi      # 0x6eb4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movq 0xe0(%rsp), %rdx
leaq 0x26cc(%rip), %rsi      # 0x6ed4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movl 0xe8(%rsp), %edx
leaq 0x26d6(%rip), %rsi      # 0x6ef6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movq 0xf0(%rsp), %rdx
leaq 0x26dd(%rip), %rsi      # 0x6f16
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movq 0xf8(%rsp), %rdx
leaq 0x26e6(%rip), %rsi      # 0x6f38
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movl 0x100(%rsp), %edx
leaq 0x26f0(%rip), %rsi      # 0x6f5a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
movq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ae8
movl %eax, %ebx
leaq 0x98(%rsp), %rdi
callq 0x1a82
movq 0x40(%rsp), %rdi
callq 0x10c0
testb $0x1, 0x50(%rsp)
je 0x4a20
movq 0x574c(%rip), %r14      # 0x9ff8
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x1120
movq (%r14), %rdi
movl 0xa0(%rsp), %edx
movl 0xa8(%rsp), %ecx
leaq 0x26c4(%rip), %rsi      # 0x6f93
xorl %eax, %eax
callq 0x1140
movq (%r14), %rdi
movl 0xa4(%rsp), %edx
movl 0xac(%rsp), %ecx
leaq 0x26d3(%rip), %rsi      # 0x6fc1
xorl %eax, %eax
callq 0x1140
movq (%r14), %rdi
movl 0xb8(%rsp), %edx
movl 0xbc(%rsp), %ecx
leaq 0x26e2(%rip), %rsi      # 0x6fef
xorl %eax, %eax
callq 0x1140
movq (%r14), %rdi
movl 0xb0(%rsp), %edx
movl 0xb4(%rsp), %ecx
leaq 0x26df(%rip), %rsi      # 0x700b
xorl %eax, %eax
callq 0x1140
movl 0xb0(%rsp), %eax
movl 0xb4(%rsp), %ecx
movq (%r14), %rsi
addl %eax, %ecx
jne 0x4a34
pushq $0xa
popq %rdi
callq 0x1120
jmp 0x4a20
pushq $-0x1
popq %rbx
jmp 0x4883
movq 0x5690(%rip), %rax      # 0x9ff8
movq (%rax), %rcx
leaq 0x18bb(%rip), %rdi      # 0x622d
pushq $0x17
jmp 0x49e3
movq 0x567b(%rip), %rcx      # 0x9ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0x1a87
leaq 0x185d(%rip), %rsi      # 0x61eb
jmp 0x4a06
leaq 0x23e3(%rip), %rdi      # 0x6d7a
callq 0x11b0
jmp 0x4a1d
movq 0x5653(%rip), %rax      # 0x9ff8
movq (%rax), %rcx
leaq 0x1867(%rip), %rdi      # 0x6216
pushq $0x16
jmp 0x49e3
movq 0x563e(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x1881(%rip), %rsi      # 0x6245
movq %r12, %rdx
xorl %eax, %eax
callq 0x1140
jmp 0x4a1d
movq 0x5621(%rip), %rax      # 0x9ff8
movq (%rax), %rcx
leaq 0x1ed8(%rip), %rdi      # 0x68b9
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
callq 0x11e0
jmp 0x4a1d
movq 0x5603(%rip), %rcx      # 0x9ff8
movq (%rcx), %rbx
movl %eax, %edi
callq 0x1a87
leaq 0x17d6(%rip), %rsi      # 0x61dc
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1140
movq 0x40(%rsp), %rdi
callq 0x10c0
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x2218, %rsp           # imm = 0x2218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
imull $0x64, %eax, %eax
xorl %edx, %edx
divl %ecx
leaq 0x25e4(%rip), %rcx      # 0x7026
movq %rsi, %rdi
movq %rcx, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x1140
jmp 0x4a20
movq 0x559e(%rip), %rax      # 0x9ff8
movq (%rax), %rcx
leaq 0x1e32(%rip), %rdi      # 0x6896
pushq $0x22
jmp 0x49e3
callq 0x4b4c
jmp 0x4a7b
movq (%r12), %rdi
callq 0x4b3b
xorl %edi, %edi
callq 0x11d0