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

	args.format = LZM_FORMAT_1;
	args.level = LZM_LEVEL_DEF;
	args.compress = true;
	args.console = false;
	args.clobber = false;
	args.recurse = false;
	args.remove = true;
	args.benchmark = false;
	args.verbose = false;
	args.test = false;
	args.chunk_size = CHUNK_SIZE;
	args.bench_tests = BENCH_TESTS;

	while ((c = getopt(argc, argv, "01234567b:cdfhkrtvx:")) != EOF) {
		switch (c) {
		case '0':
		case '1':
		case '2':
		case '3':
		case '4':
		case '5':
		case '6':
		case '7':
			args.level = c - '0';
			break;
		case 'b':
			args.benchmark = true;
			args.bench_tests = strtoul(optarg, NULL, 0);
			if (args.bench_tests == 0 || args.bench_tests > 100) {
				printf("Tests must be non-zero and max 100.\n");
				exit(1);
			}
			break;
		case 'c':
			args.console = true;
			break;
		case 'd':
			args.compress = false;
			break;
		case 'f':
			args.clobber = true;
			break;
		case 'k':
			args.remove = false;
			break;
		case 'r':
			args.recurse = true;
			break;
		case 't':
			args.test = true;
			break;
		case 'v':
			args.verbose = true;
			break;
		case 'x':
			args.chunk_size = strtoul(optarg, NULL, 0);
			if (args.chunk_size >= (1 << 22)) {
				printf("Chunk size too large.\n");
				exit(1);
			}
			args.chunk_size <<= 10;
			break;
		case 'h':
		default:
			usage();
			exit(1);
			break;
		}
	}

	pagesize = sysconf(_SC_PAGESIZE);
	if (pagesize <= 0)
		pagesize = 4096;

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

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

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1070, %rsp           # imm = 0x1070
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1054(%rbp)
movl $0x1, -0x3c(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x40(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x400000, -0x34(%rbp)  # imm = 0x400000
movl $0xa, -0x14(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x5d6b(%rip), %rdx      # 0x7150
callq 0x11f0
movl %eax, -0x105c(%rbp)
cmpl $-0x1, %eax
je 0x1523
movl -0x105c(%rbp), %eax
addl $-0x30, %eax
movl %eax, %ecx
movq %rcx, -0x1068(%rbp)
subl $0x48, %eax
ja 0x150f
movq -0x1068(%rbp), %rax
leaq 0x5be2(%rip), %rcx      # 0x7004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x105c(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x38(%rbp)
jmp 0x151e
movl $0x1, -0x20(%rbp)
movq 0x8b8e(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1200
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x1467
cmpl $0x64, -0x14(%rbp)
jbe 0x147f
leaq 0x5cf7(%rip), %rdi      # 0x7165
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1230
jmp 0x151e
movl $0x1, -0x30(%rbp)
jmp 0x151e
movl $0x0, -0x40(%rbp)
jmp 0x151e
movl $0x1, -0x2c(%rbp)
jmp 0x151e
movl $0x0, -0x24(%rbp)
jmp 0x151e
movl $0x1, -0x28(%rbp)
jmp 0x151e
movl $0x1, -0x18(%rbp)
jmp 0x151e
movl $0x1, -0x1c(%rbp)
jmp 0x151e
movq 0x8b08(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1200
movl %eax, -0x34(%rbp)
cmpl $0x400000, -0x34(%rbp)  # imm = 0x400000
jb 0x1502
leaq 0x5c99(%rip), %rdi      # 0x718a
movb $0x0, %al
callq 0x10e0
movl $0x1, %edi
callq 0x1230
movl -0x34(%rbp), %eax
shll $0xa, %eax
movl %eax, -0x34(%rbp)
jmp 0x151e
jmp 0x150f
callq 0x15e0
movl $0x1, %edi
callq 0x1230
jmp 0x13d7
movl $0x1e, %edi
callq 0x11e0
movq %rax, 0x8d14(%rip)      # 0xa248
cmpq $0x0, 0x8d0c(%rip)      # 0xa248
jg 0x1549
movq $0x1000, 0x8cff(%rip) # imm = 0x1000
movq 0x8a80(%rip), %rax      # 0x9fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x1566
callq 0x15e0
movl $0x1, %edi
callq 0x1230
jmp 0x1568
movq 0x8a61(%rip), %rax      # 0x9fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jge 0x15cd
movq -0x10(%rbp), %rax
movq 0x8a4f(%rip), %rcx      # 0x9fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x1048(%rbp)
leaq -0x1050(%rbp), %rdi
callq 0x16b0
movl %eax, -0x1058(%rbp)
cmpl $0x0, -0x1054(%rbp)
jne 0x15b6
movl -0x1058(%rbp), %eax
movl %eax, -0x1054(%rbp)
movq 0x8a13(%rip), %rax      # 0x9fd0
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x8a07(%rip), %rax      # 0x9fd0
movl %ecx, (%rax)
jmp 0x1568
movl -0x1054(%rbp), %eax
addq $0x1070, %rsp           # imm = 0x1070
popq %rbp
retq
nopl (%rax)