// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]xpack/programs/xpack.c
// Function: main
int
tmain(int argc, tchar *argv[])
{
	struct options options;
	tchar *default_file_list[] = { NULL };
	int opt_char;
	int i;
	int ret;

	program_invocation_name = get_filename(argv[0]);

	options.to_stdout = false;
	options.decompress = is_xunpack();
	options.force = false;
	options.keep = false;
	options.compression_level = 6;
	options.chunk_size = 524288;
	options.suffix = T("xpack");

	while ((opt_char = tgetopt(argc, argv, optstring)) != -1) {
		switch (opt_char) {
		case '1':
		case '2':
		case '3':
		case '4':
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
			options.compression_level = opt_char - '0';
			break;
		case 'c':
			options.to_stdout = true;
			break;
		case 'd':
			options.decompress = true;
			break;
		case 'f':
			options.force = true;
			break;
		case 'h':
			show_usage(stdout);
			return 0;
		case 'k':
			options.keep = true;
			break;
		case 'L':
			options.compression_level =
				parse_compression_level(toptarg);
			if (options.compression_level <= 0)
				return 1;
			break;
		case 's':
			options.chunk_size = parse_chunk_size(toptarg);
			if (options.chunk_size == 0)
				return 1;
			break;
		case 'S':
			options.suffix = toptarg;
			break;
		case 'V':
			show_version();
			return 0;
		default:
			show_usage(stderr);
			return 1;
		}
	}

	argv += toptind;
	argc -= toptind;

	if (argc == 0) {
		argv = default_file_list;
		argc = ARRAY_LEN(default_file_list);
	} else {
		for (i = 0; i < argc; i++)
			if (argv[i][0] == '-' && argv[i][1] == '\0')
				argv[i] = NULL;
	}

	ret = 0;
	if (options.decompress) {
		struct xpack_decompressor *d;

		d = alloc_decompressor();
		if (d == NULL)
			return 1;

		for (i = 0; i < argc; i++)
			ret |= -decompress_file(d, argv[i], &options);

		xpack_free_decompressor(d);
	} else {
		struct xpack_compressor *c;

		c = alloc_compressor(options.chunk_size,
				     options.compression_level);
		if (c == NULL)
			return 1;

		for (i = 0; i < argc; i++)
			ret |= -compress_file(c, argv[i], &options);

		xpack_free_compressor(c);
	}

	/*
	 * If ret=0, there were no warnings or errors.  Exit with status 0.
	 * If ret=2, there was at least one warning.  Exit with status 2.
	 * Else, there was at least one error.  Exit with status 1.
	 */
	if (ret != 0 && ret != 2)
		ret = 1;

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, %r13
movl %edi, %ebx
andq $0x0, 0xc0(%rsp)
movq (%rsi), %rdi
callq 0x20c3
leaq 0x8dfe(%rip), %rcx      # 0xa118
movq %rax, (%rcx)
leaq 0x5d29(%rip), %rsi      # 0x704d
movq %rax, %rdi
callq 0x1120
testl %eax, %eax
sete 0x10(%rsp)
pushq $0x6
popq %r12
movl $0x80000, %eax          # imm = 0x80000
movq %rax, 0x18(%rsp)
leaq 0x5ce9(%rip), %rax      # 0x7031
movq %rax, 0x68(%rsp)
movl $0x0, 0x34(%rsp)
leaq 0x5cdb(%rip), %r14      # 0x7037
leaq 0x5ca1(%rip), %r15      # 0x7004
movl $0x0, 0x14(%rsp)
xorl %edx, %edx
movl %edx, %ebp
movl %ebx, %edi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2584
leal -0x31(%rax), %ecx
cmpl $0x9, %ecx
jae 0x138e
addl $-0x30, %eax
movl %eax, %r12d
movl %ebp, %edx
jmp 0x136d
leal -0x63(%rax), %ecx
cmpl $0x8, %ecx
ja 0x13aa
movb $0x1, %dl
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movb $0x1, 0x10(%rsp)
movl %ebp, %edx
jmp 0x136d
cmpl $0x4c, %eax
je 0x13e9
cmpl $0x53, %eax
je 0x1407
cmpl $0x73, %eax
jne 0x141d
leaq 0x8d78(%rip), %rax      # 0xa138
movq (%rax), %rdi
callq 0x249e
movl %ebp, %edx
movq %rax, 0x18(%rsp)
testl %eax, %eax
jne 0x136d
jmp 0x1444
movb $0x1, %al
movl %eax, 0x34(%rsp)
movl %ebp, %edx
jmp 0x136d
movb $0x1, %al
movl %eax, 0x14(%rsp)
movl %ebp, %edx
jmp 0x136d
leaq 0x8d48(%rip), %rax      # 0xa138
movq (%rax), %rdi
callq 0x24e9
movl %eax, %r12d
movl %ebp, %edx
testl %eax, %eax
jg 0x136d
jmp 0x1444
leaq 0x8d2a(%rip), %rax      # 0xa138
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movl %ebp, %edx
jmp 0x136d
cmpl $-0x1, %eax
je 0x1462
cmpl $0x56, %eax
jne 0x1435
leaq 0x6152(%rip), %rdi      # 0x7580
callq 0x1070
jmp 0x145b
movq 0x8bbc(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
callq 0x1d30
pushq $0x1
popq %rax
jmp 0x1d1e
movq 0x8b85(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x1d30
xorl %eax, %eax
jmp 0x1d1e
leaq 0x8c9f(%rip), %rax      # 0xa108
movslq (%rax), %rax
subl %eax, %ebx
je 0x14c3
leaq (,%rax,8), %rax
addq %r13, %rax
movq %rax, 0x60(%rsp)
xorl %eax, %eax
testl %ebx, %ebx
movl $0x0, %ecx
cmovgl %ebx, %ecx
movq 0x68(%rsp), %r15
movq 0x18(%rsp), %r14
movb 0x10(%rsp), %sil
cmpq %rax, %rcx
je 0x14e2
movq 0x60(%rsp), %rdx
movq (%rdx,%rax,8), %rdx
cmpb $0x2d, (%rdx)
jne 0x14be
cmpb $0x0, 0x1(%rdx)
jne 0x14be
movq 0x60(%rsp), %rdx
andq $0x0, (%rdx,%rax,8)
incq %rax
jmp 0x149b
pushq $0x1
popq %rbx
leaq 0xc0(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %r15
movq 0x18(%rsp), %r14
movb 0x10(%rsp), %sil
movzbl 0x14(%rsp), %eax
movl %eax, 0x30(%rsp)
testb $0x1, %sil
je 0x1916
callq 0x2561
testq %rax, %rax
je 0x1444
movq %rax, 0x70(%rsp)
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
andl $0x1, 0x30(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
cmpq %rbx, %r12
je 0x1cf7
movl %r14d, 0x10(%rsp)
movq 0x60(%rsp), %rax
movq (%rax,%r12,8), %r13
testq %r13, %r13
sete %al
orb %bpl, %al
testb $0x1, %al
je 0x1549
movq $0x0, 0x18(%rsp)
jmp 0x1597
movq %r13, %rdi
movq %r15, %rsi
callq 0x1d48
testq %rax, %rax
je 0x16bd
movq %rax, %r14
subq %r13, %r14
leaq 0x1(%r14), %rdi
callq 0x205c
movq %r12, 0x8(%rsp)
movq %r15, %r12
movq %rax, %r15
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x1150
movq %r15, 0x18(%rsp)
movb $0x0, (%r15,%r14)
movq %r12, %r15
movq 0x8(%rsp), %r12
movq %r13, %rdi
leaq 0x48(%rsp), %rsi
callq 0x20df
movl %eax, %r14d
testl %eax, %eax
jne 0x169e
testb $0x1, 0x14(%rsp)
jne 0x15d3
movl 0x48(%rsp), %edi
callq 0x1080
testl %eax, %eax
je 0x15d3
leaq 0x5d3f(%rip), %rdi      # 0x7309
xorl %eax, %eax
callq 0x1eb8
jmp 0x164c
cmpq $0x0, 0x18(%rsp)
sete %al
orb 0x14(%rsp), %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x1d84
testl %eax, %eax
jne 0x164f
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x22df
movq %rax, %r14
testl %r14d, %r14d
js 0x1652
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpl $0x10, %r14d
jne 0x1639
movabsq $0x4b43415058, %rax     # imm = 0x4B43415058
cmpq %rax, 0x38(%rsp)
je 0x16d9
movq 0x50(%rsp), %rsi
leaq 0x5d1b(%rip), %rdi      # 0x7360
xorl %eax, %eax
callq 0x1eb8
pushq $-0x1
popq %rax
movl %eax, %r14d
testq %r13, %r13
setne %r15b
leaq 0x48(%rsp), %rdi
callq 0x244e
testl %r14d, %r14d
sete %al
cmpq $0x0, 0x18(%rsp)
setne %cl
andb %r15b, %cl
andb %al, %cl
movl %ecx, %eax
notb %al
orb 0x34(%rsp), %al
testb %cl, %cl
movl $0x0, %ecx
cmovnel %ecx, %r14d
testb $0x1, %al
movq 0x68(%rsp), %r15
jne 0x169e
movq %r13, %rdi
callq 0x1060
xorl %r14d, %r14d
movq 0x18(%rsp), %rdi
callq 0x1040
negl %r14d
movl 0x10(%rsp), %eax
orl %r14d, %eax
movl %eax, %r14d
incq %r12
jmp 0x151a
leaq 0x5c13(%rip), %rdi      # 0x72d7
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1eb8
pushq $-0x2
popq %rax
movl %eax, %r14d
jmp 0x16a8
movzbl 0x46(%rsp), %edx
cmpl $0x1, %edx
jne 0x16fc
movzwl 0x44(%rsp), %edx
cmpq $0xf, %rdx
ja 0x1714
movq 0x50(%rsp), %rsi
leaq 0x5c9b(%rip), %rdi      # 0x7395
jmp 0x1708
movq 0x50(%rsp), %rsi
leaq 0x5c70(%rip), %rdi      # 0x7378
xorl %eax, %eax
callq 0x1eb8
jmp 0x164c
movl 0x40(%rsp), %eax
leal -0x4000001(%rax), %ecx
cmpl $0xfc0003fe, %ecx       # imm = 0xFC0003FE
ja 0x1736
movq 0x50(%rsp), %rsi
leaq 0x5c82(%rip), %rdi      # 0x73b4
movl %eax, %edx
jmp 0x1708
addq $-0x10, %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, %rsi
callq 0x234c
testl %eax, %eax
jne 0x164f
movq 0x18(%rsp), %rdi
movl 0x30(%rsp), %esi
leaq 0x78(%rsp), %rdx
callq 0x21a6
testl %eax, %eax
jne 0x164f
movl 0x40(%rsp), %r15d
movq %r15, %rdi
callq 0x205c
movq %rax, %r14
movq %r15, 0x28(%rsp)
leal -0x1(%r15), %edi
callq 0x205c
movq %r14, 0x8(%rsp)
testq %r14, %r14
sete %dl
movq %rax, 0x20(%rsp)
testq %rax, %rax
sete %cl
orb %dl, %cl
pushq $-0x1
popq %r15
jne 0x18a1
leaq 0x48(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x22df
cmpq $0x8, %rax
jne 0x1872
movl 0xac(%rsp), %ecx
testq %rcx, %rcx
je 0x1864
cmpl 0x28(%rsp), %ecx
ja 0x1864
movl 0xa8(%rsp), %r14d
leal -0x1(%r14), %eax
cmpl %ecx, %eax
jae 0x1864
movq 0x8(%rsp), %rsi
movq %rcx, %r15
cmpl %ecx, %r14d
je 0x1805
movq 0x20(%rsp), %rsi
leaq 0x48(%rsp), %rdi
movq %r14, %rdx
callq 0x22df
testq %rax, %rax
js 0x1885
cmpq %r14, %rax
jne 0x1877
movq %r15, %rdx
cmpl %edx, %r14d
je 0x1848
movq 0x70(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
movq %r15, %r8
xorl %r9d, %r9d
callq 0x5098
movq %r15, %rdx
testl %eax, %eax
jne 0x188a
leaq 0x78(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x23e9
testl %eax, %eax
je 0x17aa
movl %eax, %r15d
jmp 0x18a1
movq 0x50(%rsp), %rsi
leaq 0x5bf2(%rip), %rdi      # 0x7462
jmp 0x1896
testq %rax, %rax
jle 0x1885
movq 0x50(%rsp), %rsi
leaq 0x5bf0(%rip), %rdi      # 0x7473
jmp 0x1896
movq %rax, %r15
jmp 0x18a1
movq 0x50(%rsp), %rsi
leaq 0x5bf8(%rip), %rdi      # 0x748e
xorl %eax, %eax
callq 0x1eb8
pushq $-0x1
popq %r15
movq 0x20(%rsp), %rdi
callq 0x1040
movq 0x8(%rsp), %rdi
callq 0x1040
testq %r13, %r13
je 0x18de
cmpq $0x0, 0x18(%rsp)
je 0x18de
testl %r15d, %r15d
jne 0x18de
leaq 0x78(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x1e1b
leaq 0x78(%rsp), %rdi
callq 0x244e
movl %eax, %r14d
testl %r15d, %r15d
cmovnel %r15d, %r14d
cmpq $0x0, 0x18(%rsp)
je 0x1652
testl %r14d, %r14d
je 0x1652
movq 0x18(%rsp), %rdi
callq 0x1060
jmp 0x1652
movl %r14d, %edi
movl %r12d, %esi
callq 0x2530
movq %rax, 0xa0(%rsp)
testq %rax, %rax
je 0x1444
movl %r14d, %eax
movq %rax, 0x98(%rsp)
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leal -0x1(%r14), %eax
movq %rax, 0xb0(%rsp)
andl $0x1, 0x30(%rsp)
xorl %eax, %eax
xorl %r14d, %r14d
cmpq %rbx, %rax
je 0x1d03
movq %rax, 0x70(%rsp)
movq 0x60(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
testq %rsi, %rsi
sete %al
orb %bpl, %al
testb $0x1, %al
movl %r14d, 0x10(%rsp)
je 0x1994
movq %r15, %r13
movq $0x0, 0x8(%rsp)
jmp 0x1a30
testb $0x1, 0x14(%rsp)
jne 0x19cb
movq %rsi, %rdi
movq %rsi, %r14
movq %r15, %rsi
callq 0x1d48
movq %r14, %rsi
testq %rax, %rax
je 0x19cb
leaq 0x5b4c(%rip), %rdi      # 0x7504
movq %r15, %rdx
xorl %eax, %eax
callq 0x1eb8
pushq $-0x2
popq %r14
jmp 0x1af6
movq %rsi, 0x20(%rsp)
movq %rsi, %rdi
callq 0x10a0
movq %rax, %r14
movq %r15, %rdi
callq 0x10a0
leaq (%rax,%r14), %rdi
addq $0x2, %rdi
incq %rax
movq %rax, 0x28(%rsp)
callq 0x205c
movq %rax, %r13
movq %rax, %rdi
movq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x1150
movq %r13, 0x8(%rsp)
leaq (%r14,%r13), %rdi
incq %rdi
movb $0x2e, -0x1(%rdi)
movq %r15, %r13
movq %r15, %rsi
movq 0x28(%rsp), %rdx
callq 0x1150
movq 0x20(%rsp), %rsi
movq %rsi, %rdi
movq %rsi, %r15
leaq 0x48(%rsp), %rsi
callq 0x20df
movl %eax, %r14d
testl %eax, %eax
jne 0x1ae9
movq %r15, 0x20(%rsp)
movq 0x8(%rsp), %r13
testq %r13, %r13
sete %al
orb 0x14(%rsp), %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x48(%rsp), %r15
movq %r15, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x1d84
testl %eax, %eax
jne 0x1a95
movq 0x8(%rsp), %rdi
movl 0x30(%rsp), %esi
leaq 0x78(%rsp), %rdx
callq 0x21a6
testl %eax, %eax
je 0x1b10
movl %eax, %r14d
cmpq $0x0, 0x20(%rsp)
setne %r15b
leaq 0x48(%rsp), %rdi
callq 0x244e
testl %r14d, %r14d
sete %al
cmpq $0x0, 0x8(%rsp)
setne %cl
andb %r15b, %cl
andb %al, %cl
movl %ecx, %eax
notb %al
orb 0x34(%rsp), %al
testb %cl, %cl
movl $0x0, %ecx
cmovnel %ecx, %r14d
testb $0x1, %al
movq 0x68(%rsp), %r13
jne 0x1ae9
movq 0x20(%rsp), %rdi
callq 0x1060
xorl %r14d, %r14d
movq 0x8(%rsp), %rdi
callq 0x1040
movq %r13, %r15
negl %r14d
movl 0x10(%rsp), %eax
orl %r14d, %eax
movl %eax, %r14d
movq 0x70(%rsp), %rax
incq %rax
jmp 0x195a
testb $0x1, 0x14(%rsp)
jne 0x1b3f
movl 0x78(%rsp), %edi
callq 0x1080
testl %eax, %eax
je 0x1b3f
leaq 0x5a00(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x1eb8
pushq $-0x1
popq %rax
leaq 0x78(%rsp), %r14
jmp 0x1cbe
movabsq $0x4b43415058, %rax     # imm = 0x4B43415058
movq %rax, 0x38(%rsp)
movq 0x18(%rsp), %rax
movl %eax, 0x40(%rsp)
movw $0x10, 0x44(%rsp)
movb $0x1, 0x46(%rsp)
movb %r12b, 0x47(%rsp)
leaq 0x78(%rsp), %r14
movq %r14, %rdi
leaq 0x38(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x23e9
testl %eax, %eax
jne 0x1cbe
movq 0x98(%rsp), %rdi
callq 0x205c
movq %rax, %r13
movq 0xb0(%rsp), %rdi
callq 0x205c
movq %rax, %rdi
movq %r13, 0x90(%rsp)
testq %r13, %r13
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
pushq $-0x1
popq %rax
jne 0x1c79
movq %rdi, 0x28(%rsp)
movq 0x90(%rsp), %r13
movq %r15, %rdi
movq %r13, %rsi
movq 0x98(%rsp), %rdx
callq 0x22df
testq %rax, %rax
jle 0x1c74
movl %eax, %edx
movl %eax, %r8d
decl %r8d
movq 0xa0(%rsp), %rdi
movq %r13, %rsi
movq 0x28(%rsp), %rcx
movq %rax, 0xb8(%rsp)
callq 0x3dc5
movq %r14, %rdi
movq %rax, %r14
testl %r14d, %r14d
movl %r14d, %r15d
movq 0xb8(%rsp), %rax
cmovel %eax, %r15d
movl %r15d, 0x38(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x38(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x23e9
testl %eax, %eax
jne 0x1c6f
testl %r14d, %r14d
movq 0x28(%rsp), %rsi
cmoveq %r13, %rsi
movl %r15d, %edx
leaq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0x23e9
testl %eax, %eax
leaq 0x48(%rsp), %r15
je 0x1bd1
jmp 0x1c74
leaq 0x78(%rsp), %r14
movq 0x28(%rsp), %rdi
movq %rax, %r15
callq 0x1040
movq 0x90(%rsp), %rdi
callq 0x1040
movq %r15, %rax
testl %eax, %eax
jne 0x1cbe
xorl %eax, %eax
cmpq $0x0, 0x20(%rsp)
je 0x1cbe
cmpq $0x0, 0x8(%rsp)
je 0x1cbe
movq %r14, %rdi
movq 0x8(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x1e1b
xorl %eax, %eax
movq %r14, %rdi
movq %rax, %r15
callq 0x244e
movl %eax, %r14d
testl %r15d, %r15d
cmovnel %r15d, %r14d
cmpq $0x0, 0x8(%rsp)
je 0x1a98
testl %r14d, %r14d
je 0x1a98
movq 0x8(%rsp), %rdi
callq 0x1060
jmp 0x1a98
movq 0x70(%rsp), %rdi
callq 0x626f
jmp 0x1d10
movq 0xa0(%rsp), %rdi
callq 0x3de8
testl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
pushq $0x1
popq %rax
cmovel %r14d, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq