// File: /workspace/github_c_makefile_star2_O0/lmcilroy[P]lzm/lzdata.c
// Function: main
int
main(int argc, char **argv)
{
	struct lzdata_args args;
	int ret = 0;
	int err;
	int c;

	args.file_size = FILE_SIZE;
	args.chunk_size = CHUNK_SIZE;
	args.min_lit_len = 0;
	args.max_lit_len = 0;
	args.min_match_len = 0;
	args.max_match_len = 0;
	args.min_offset = 0;
	args.max_offset = 0;
	args.verbose = false;
	args.match_prob = MATCH_PROB;
	args.lit_len_scale = LEN_SCALE;
	args.match_len_scale = LEN_SCALE;
	args.random_seed = 0;

	while ((c = getopt_long(argc, argv, "hv", long_opts, NULL)) != EOF) {
		switch (c) {
		case FILESIZE:
			args.file_size = strtoul(optarg, NULL, 0);
			if (args.chunk_size == 0) {
				fprintf(stderr, "Error: file size is zero");
				exit(1);
			}
			args.file_size <<= 20;
			break;
		case CHUNKSIZE:
			args.chunk_size = strtoul(optarg, NULL, 0);
			if (args.chunk_size == 0) {
				fprintf(stderr, "Error: chunk size is zero");
				exit(1);
			}
			args.chunk_size <<= 10;
			break;
		case MINLITLEN:
			args.min_lit_len = strtoul(optarg, NULL, 0);
			if (args.min_lit_len == 0) {
				fprintf(stderr, "Error: bad min lit len");
				exit(1);
			}
			break;
		case MAXLITLEN:
			args.max_lit_len = strtoul(optarg, NULL, 0);
			if (args.max_lit_len == 0) {
				fprintf(stderr, "Error: bad max lit len");
				exit(1);
			}
			break;
		case MINMATCHLEN:
			args.min_match_len = strtoul(optarg, NULL, 0);
			if (args.min_match_len == 0) {
				fprintf(stderr, "Error: bad min match len");
				exit(1);
			}
			break;
		case MAXMATCHLEN:
			args.max_match_len = strtoul(optarg, NULL, 0);
			if (args.max_match_len == 0) {
				fprintf(stderr, "Error: bad max match len");
				exit(1);
			}
			break;
		case MINOFFSET:
			args.min_offset = strtoul(optarg, NULL, 0);
			if (args.min_offset == 0) {
				fprintf(stderr, "Error: bad min offset");
				exit(1);
			}
			break;
		case MAXOFFSET:
			args.max_offset = strtoul(optarg, NULL, 0);
			if (args.max_offset == 0) {
				fprintf(stderr, "Error: bad max offset");
				exit(1);
			}
			break;
		case MATCHPROB:
			args.match_prob = strtod(optarg, NULL);
			if (args.match_prob < 0.0 || args.match_prob > 1.0) {
				fprintf(stderr, "Error: bad match prob");
				exit(1);
			}
			break;
		case LITLENSCALE:
			args.lit_len_scale = strtod(optarg, NULL);
			if (args.lit_len_scale < 0.0) {
				fprintf(stderr, "Error: bad lit len scale");
				exit(1);
			}
			break;
		case MATCHLENSCALE:
			args.match_len_scale = strtod(optarg, NULL);
			if (args.match_len_scale < 0.0) {
				fprintf(stderr, "Error: bad match len scale");
				exit(1);
			}
			break;
		case RANDOMSEED:
			args.random_seed = strtoul(optarg, NULL, 0);
			break;
		case 'v':
		case VERBOSE:
			args.verbose = true;
			break;
		case 'h':
		case HELP:
		default:
			usage();
			exit(1);
			break;
		}
	}

	if (args.min_lit_len == 0)
		args.min_lit_len = 1;
	if (args.max_lit_len == 0)
		args.max_lit_len = args.chunk_size;
	if (args.min_match_len == 0)
		args.min_match_len = MIN_MATCH;
	if (args.max_match_len == 0)
		args.max_match_len = args.chunk_size;
	if (args.min_offset == 0)
		args.min_offset = 1;
	if (args.max_offset == 0)
		args.max_offset = args.chunk_size;

	if (args.min_lit_len > args.max_lit_len) {
		fprintf(stderr, "Error: min lit length > max lit length\n");
		exit(1);
	}

	if (args.min_match_len > args.max_match_len) {
		fprintf(stderr, "Error: min match length > max match length\n");
		exit(1);
	}

	if (args.min_offset > args.max_offset) {
		fprintf(stderr, "Error: min offset > max offset\n");
		exit(1);
	}

	if (optind == argc) {
		usage();
		exit(1);
	}

	if (args.verbose == true) {
		printf("File size: %lu\n", args.file_size);
		printf("Chunk size: %u\n", args.chunk_size);
		printf("Min lit len: %u\n", args.min_lit_len);
		printf("Max lit len: %u\n", args.max_lit_len);
		printf("Min match len: %u\n", args.min_match_len);
		printf("Max match len: %u\n", args.max_match_len);
		printf("Min offset: %u\n", args.min_offset);
		printf("Max offset: %u\n", args.max_offset);
		printf("Match probability: %.4f\n", args.match_prob);
		printf("Lit len scale: %.4f\n", args.lit_len_scale);
		printf("Match len scale: %.4f\n", args.match_len_scale);
		printf("Random seed: %lu\n", args.random_seed);
	}

	srand48(args.random_seed);

	while (optind < argc) {
		args.filename = argv[optind];
		err = process_file(&args);
		if (ret == 0)
			ret = err;
		optind++;
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x84(%rbp)
movq $0x6400000, -0x78(%rbp) # imm = 0x6400000
movl $0x400000, -0x70(%rbp)  # imm = 0x400000
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x68(%rbp)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x54(%rbp)
movsd 0x1d65(%rip), %xmm0     # 0x3010
movsd %xmm0, -0x50(%rbp)
movsd 0x1d50(%rip), %xmm0     # 0x3008
movsd %xmm0, -0x48(%rbp)
movsd 0x1d43(%rip), %xmm0     # 0x3008
movsd %xmm0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x1f20(%rip), %rdx      # 0x3200
leaq 0x3dc9(%rip), %rcx      # 0x50b0
xorl %eax, %eax
movl %eax, %r8d
callq 0x1070
movl %eax, -0x8c(%rbp)
cmpl $-0x1, %eax
je 0x168e
movl -0x8c(%rbp), %eax
movq %rax, -0x98(%rbp)
subq $0x76, %rax
ja 0x167a
movq -0x98(%rbp), %rax
leaq 0x1cfb(%rip), %rcx      # 0x3020
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x3ca3(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movq %rax, -0x78(%rbp)
cmpl $0x0, -0x70(%rbp)
jne 0x136f
movq 0x3ca4(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1ea5(%rip), %rsi      # 0x3203
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
movq -0x78(%rbp), %rax
shlq $0x14, %rax
movq %rax, -0x78(%rbp)
jmp 0x1689
movq 0x3c51(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x70(%rbp)
jne 0x13c0
movq 0x3c53(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1e6d(%rip), %rsi      # 0x321c
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
movl -0x70(%rbp), %eax
shll $0xa, %eax
movl %eax, -0x70(%rbp)
jmp 0x1689
movq 0x3c03(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jne 0x140e
movq 0x3c05(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1e39(%rip), %rsi      # 0x3236
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x3bbe(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x68(%rbp)
jne 0x1453
movq 0x3bc0(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1e0b(%rip), %rsi      # 0x324d
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x3b79(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x1498
movq 0x3b7b(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1ddd(%rip), %rsi      # 0x3264
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x3b34(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x60(%rbp)
jne 0x14dd
movq 0x3b36(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1db1(%rip), %rsi      # 0x327d
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x3aef(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x1522
movq 0x3af1(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1d85(%rip), %rsi      # 0x3296
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x3aaa(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
jne 0x1567
movq 0x3aac(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1d56(%rip), %rsi      # 0x32ac
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x3a65(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1050
movsd %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x50(%rbp), %xmm0
ja 0x15a1
movsd -0x50(%rbp), %xmm0
movsd 0x1a7d(%rip), %xmm1     # 0x3018
ucomisd %xmm1, %xmm0
jbe 0x15c3
movq 0x3a50(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1d10(%rip), %rsi      # 0x32c2
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x3a09(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1050
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x160c
movq 0x3a07(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1cdd(%rip), %rsi      # 0x32d8
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x39c3(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1050
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x40(%rbp), %xmm0
jbe 0x1652
movq 0x39c1(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1cb0(%rip), %rsi      # 0x32f1
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
jmp 0x1689
movq 0x397d(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10e0
movq %rax, -0x38(%rbp)
jmp 0x1689
movl $0x1, -0x54(%rbp)
jmp 0x1689
jmp 0x167a
callq 0x18d0
movl $0x1, %edi
callq 0x1100
jmp 0x12d2
cmpl $0x0, -0x6c(%rbp)
jne 0x169b
movl $0x1, -0x6c(%rbp)
cmpl $0x0, -0x68(%rbp)
jne 0x16a7
movl -0x70(%rbp), %eax
movl %eax, -0x68(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x16b4
movl $0x4, -0x64(%rbp)
cmpl $0x0, -0x60(%rbp)
jne 0x16c0
movl -0x70(%rbp), %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x16cd
movl $0x1, -0x5c(%rbp)
cmpl $0x0, -0x58(%rbp)
jne 0x16d9
movl -0x70(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x68(%rbp), %eax
jbe 0x1703
movq 0x3910(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1c1a(%rip), %rsi      # 0x330c
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
movl -0x64(%rbp), %eax
cmpl -0x60(%rbp), %eax
jbe 0x172d
movq 0x38e6(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1c18(%rip), %rsi      # 0x3334
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
movl -0x5c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jbe 0x1757
movq 0x38bc(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0x1c1a(%rip), %rsi      # 0x3360
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x1100
movq 0x3872(%rip), %rax      # 0x4fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x1774
callq 0x18d0
movl $0x1, %edi
callq 0x1100
cmpl $0x1, -0x54(%rbp)
jne 0x1852
movq -0x78(%rbp), %rsi
leaq 0x1bf7(%rip), %rdi      # 0x3380
movb $0x0, %al
callq 0x1080
movl -0x70(%rbp), %esi
leaq 0x1bf6(%rip), %rdi      # 0x3390
movb $0x0, %al
callq 0x1080
movl -0x6c(%rbp), %esi
leaq 0x1bf5(%rip), %rdi      # 0x33a0
movb $0x0, %al
callq 0x1080
movl -0x68(%rbp), %esi
leaq 0x1bf5(%rip), %rdi      # 0x33b1
movb $0x0, %al
callq 0x1080
movl -0x64(%rbp), %esi
leaq 0x1bf5(%rip), %rdi      # 0x33c2
movb $0x0, %al
callq 0x1080
movl -0x60(%rbp), %esi
leaq 0x1bf7(%rip), %rdi      # 0x33d5
movb $0x0, %al
callq 0x1080
movl -0x5c(%rbp), %esi
leaq 0x1bf9(%rip), %rdi      # 0x33e8
movb $0x0, %al
callq 0x1080
movl -0x58(%rbp), %esi
leaq 0x1bf8(%rip), %rdi      # 0x33f8
movb $0x0, %al
callq 0x1080
movsd -0x50(%rbp), %xmm0
leaq 0x1bf5(%rip), %rdi      # 0x3408
movb $0x1, %al
callq 0x1080
movsd -0x48(%rbp), %xmm0
leaq 0x1bfb(%rip), %rdi      # 0x3421
movb $0x1, %al
callq 0x1080
movsd -0x40(%rbp), %xmm0
leaq 0x1bfd(%rip), %rdi      # 0x3436
movb $0x1, %al
callq 0x1080
movq -0x38(%rbp), %rsi
leaq 0x1c02(%rip), %rdi      # 0x344d
movb $0x0, %al
callq 0x1080
movq -0x38(%rbp), %rdi
callq 0x10c0
movq 0x376e(%rip), %rax      # 0x4fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jge 0x18ba
movq -0x10(%rbp), %rax
movq 0x375c(%rip), %rcx      # 0x4fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x19b0
movl %eax, -0x88(%rbp)
cmpl $0x0, -0x84(%rbp)
jne 0x18a3
movl -0x88(%rbp), %eax
movl %eax, -0x84(%rbp)
movq 0x3726(%rip), %rax      # 0x4fd0
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x371a(%rip), %rax      # 0x4fd0
movl %ecx, (%rax)
jmp 0x185b
movl -0x84(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)