// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1118, %rsp           # imm = 0x1118
movq %rsi, %rbx
movl %edi, %ebp
movl $0x1, 0x10ec(%rsp)
movl $0x400000, %r15d        # imm = 0x400000
pushq $0x1
popq %rcx
movq $0x0, 0x28(%rsp)
pushq $0xa
popq %rax
movq %rax, 0x20(%rsp)
pushq $-0x1
popq %r13
leaq 0x3cee(%rip), %r12      # 0x5090
xorl %eax, %eax
movl %ecx, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movl %eax, %r14d
movl %ebp, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x11f0
leal -0x30(%rax), %ecx
cmpl $0x8, %ecx
jb 0x142f
leal -0x62(%rax), %ecx
cmpl $0x9, %ecx
ja 0x1437
leaq 0x3c11(%rip), %rax      # 0x5004
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
pushq $0x1
popq %rax
jmpq *%rcx
movq 0x6bd2(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1200
movq %rax, 0x20(%rsp)
leal -0x65(%rax), %ecx
pushq $0x1
popq %rax
movq %rax, 0x28(%rsp)
movl %r14d, %eax
cmpl $-0x65, %ecx
ja 0x13cc
jmp 0x18aa
movl %ecx, %r13d
movl %r14d, %eax
jmp 0x13cc
leal -0x72(%rax), %ecx
cmpl $0x6, %ecx
ja 0x14de
leaq 0x3be2(%rip), %rdx      # 0x502c
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl %r14d, %eax
pushq $0x1
popq %rcx
movl %ecx, 0xc(%rsp)
jmp 0x13cc
movl $0x0, 0x18(%rsp)
movl %r14d, %eax
jmp 0x13cc
movl %r14d, %eax
pushq $0x1
popq %rcx
movl %ecx, 0x10(%rsp)
jmp 0x13cc
movl $0x0, 0x14(%rsp)
movl %r14d, %eax
jmp 0x13cc
movq 0x6b40(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1200
movq %rax, %r15
cmpl $0x400000, %r15d        # imm = 0x400000
jae 0x18a1
shll $0xa, %r15d
movl %r14d, %eax
jmp 0x13cc
movl %r14d, %eax
pushq $0x1
popq %rcx
movl %ecx, 0x4(%rsp)
jmp 0x13cc
movl %r14d, %eax
pushq $0x1
popq %rcx
movl %ecx, 0x8(%rsp)
jmp 0x13cc
cmpl $-0x1, %eax
jne 0x189a
movl %r15d, 0x10f4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0x110c(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x1110(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x1100(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x1104(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x10fc(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x10e8(%rsp)
movl %r14d, 0x10f8(%rsp)
movq 0x28(%rsp), %rax
movl %eax, 0x1108(%rsp)
movq 0x20(%rsp), %rax
movl %eax, 0x1114(%rsp)
movl %r13d, 0x10f0(%rsp)
pushq $0x1e
popq %rdi
callq 0x11e0
testq %rax, %rax
movl $0x1000, %ecx           # imm = 0x1000
cmovgq %rax, %rcx
movq %rcx, 0x6cd4(%rip)      # 0x8248
movq 0x6a55(%rip), %r13      # 0x7fd0
movl (%r13), %ecx
cmpl %ebp, %ecx
je 0x189a
pushq $0x1
popq %r15
leaq 0x48(%rsp), %r12
xorl %eax, %eax
cmpl %ebp, %ecx
jge 0x1888
movl %eax, 0x20(%rsp)
movslq %ecx, %rax
movq (%rbx,%rax,8), %rdi
movq %rdi, 0xe0(%rsp)
cmpb $0x2d, (%rdi)
jne 0x15bc
cmpb $0x0, 0x1(%rdi)
je 0x16ff
movq %r12, %rsi
callq 0x11a0
testl %eax, %eax
js 0x1781
movl 0x60(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
movl %eax, %ecx
negw %cx
jo 0x16d5
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x17c5
cmpl $0x0, 0x1100(%rsp)
je 0x17ec
movq 0xe0(%rsp), %rax
movq %rax, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
leaq 0x30(%rsp), %rdi
pushq $0x14
popq %rsi
xorl %edx, %edx
callq 0x1180
testq %rax, %rax
je 0x1810
movq %rax, %r15
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x1100
testq %rax, %rax
je 0x16ec
movq %rax, %r12
movzwl 0x62(%rax), %eax
addl $-0x4, %eax
cmpl $0x6, %eax
ja 0x162c
leaq 0x39f5(%rip), %rcx      # 0x5048
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x30(%r12), %rax
movq %rax, 0xe0(%rsp)
movq 0x68(%r12), %rax
movq %rax, 0xd8(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x1968
movl %eax, %r13d
testl %r14d, %r14d
cmovel %r13d, %r14d
movq 0x693c(%rip), %r13      # 0x7fd0
jmp 0x162c
callq 0x1050
movl (%rax), %r13d
movq 0x6953(%rip), %rax      # 0x7ff8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%r12), %r12
movl %r13d, %edi
callq 0x1250
movq 0x18(%rsp), %rdi
leaq 0x3c5b(%rip), %rsi      # 0x5321
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1190
jmp 0x1686
movq %r12, 0xd8(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x1968
jmp 0x1765
movq %r15, %rdi
callq 0x10e0
pushq $0x1
popq %r15
leaq 0x48(%rsp), %r12
jmp 0x1768
xorl %edi, %edi
callq 0x1090
testl %eax, %eax
jne 0x184e
leaq 0x39fd(%rip), %rax      # 0x5112
movq %rax, 0xe0(%rsp)
cmpl $0x0, 0x1110(%rsp)
pushq $-0x1
popq %rsi
jne 0x1756
movl %r15d, %edi
callq 0x1090
testl %eax, %eax
jne 0x1863
leaq 0xe8(%rsp), %rax
movabsq $0x2974756f64747328, %rcx # imm = 0x2974756F64747328
movq %rcx, (%rax)
movb $0x0, 0x8(%rax)
movl %r15d, %esi
xorl %edi, %edi
leaq 0xd8(%rsp), %rdx
callq 0x2155
movl %eax, %r14d
movl 0x20(%rsp), %eax
testl %eax, %eax
cmovel %r14d, %eax
movl (%r13), %ecx
incl %ecx
movl %ecx, (%r13)
jmp 0x1592
callq 0x1050
movl (%rax), %r14d
movq 0x6868(%rip), %rax      # 0x7ff8
movq (%rax), %r15
movq 0xe0(%rsp), %r12
movl %r14d, %edi
callq 0x1250
movq %r15, %rdi
pushq $0x1
popq %r15
leaq 0x38f4(%rip), %rsi      # 0x50a5
movq %r12, %rdx
leaq 0x48(%rsp), %r12
movq %rax, %rcx
xorl %eax, %eax
callq 0x1190
jmp 0x1768
movq 0x682c(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movq 0xe0(%rsp), %rdx
leaq 0x38fa(%rip), %rsi      # 0x50d8
xorl %eax, %eax
callq 0x1190
pushq $0x16
jmp 0x1881
movq 0x6805(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movq 0xe0(%rsp), %rdx
leaq 0x38ba(%rip), %rsi      # 0x50bf
xorl %eax, %eax
callq 0x1190
pushq $0x15
jmp 0x1881
callq 0x1050
movl (%rax), %r14d
movq 0x67d9(%rip), %rax      # 0x7ff8
movq (%rax), %r15
movq 0xe0(%rsp), %r12
movl %r14d, %edi
callq 0x1250
movq %r15, %rdi
leaq 0x3aca(%rip), %rsi      # 0x5306
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1190
jmp 0x16f4
movq 0x67a3(%rip), %rax      # 0x7ff8
movq (%rax), %rcx
leaq 0x3896(%rip), %rdi      # 0x50f5
pushq $0x1c
jmp 0x1876
movq 0x678e(%rip), %rax      # 0x7ff8
movq (%rax), %rcx
leaq 0x38a6(%rip), %rdi      # 0x511a
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x1230
pushq $0x5
popq %r14
jmp 0x1768
addq $0x1118, %rsp           # imm = 0x1118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x18be
jmp 0x18b6
leaq 0x3cd1(%rip), %rdi      # 0x5579
jmp 0x18b1
leaq 0x3cde(%rip), %rdi      # 0x558f
callq 0x1080
pushq $0x1
popq %rdi
callq 0x1220