// File: /workspace/github_c_makefile_star2_O3/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, %r12
movl %edi, %r15d
movq $0x0, 0xc0(%rsp)
movq (%rsi), %rdi
callq 0x4c77
leaq 0x617a(%rip), %rcx      # 0xa118
movq %rax, (%rcx)
leaq 0x30a5(%rip), %rsi      # 0x704d
movq %rax, %rdi
callq 0x1120
testl %eax, %eax
sete 0x10(%rsp)
movl $0x6, %ebp
movl $0x80000, %eax          # imm = 0x80000
movq %rax, 0x30(%rsp)
leaq 0x3064(%rip), %rax      # 0x7031
movq %rax, 0x20(%rsp)
movl $0x0, 0x3c(%rsp)
leaq 0x3056(%rip), %r13      # 0x7037
leaq 0x301c(%rip), %r14      # 0x7004
movl $0x0, 0xc(%rsp)
xorl %edx, %edx
movl %edx, %ebx
movl %r15d, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0x5124
cmpl $0x52, %eax
jg 0x401c
leal -0x31(%rax), %ecx
cmpl $0x9, %ecx
jae 0x409c
addl $-0x30, %eax
movl %eax, %ebp
movl %ebx, %edx
jmp 0x3ff2
cmpl $0x62, %eax
jle 0x403d
leal -0x63(%rax), %ecx
cmpl $0x8, %ecx
ja 0x4059
movb $0x1, %dl
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
movb $0x1, 0x10(%rsp)
movl %ebx, %edx
jmp 0x3ff2
cmpl $0x53, %eax
jne 0x40c6
leaq 0x60eb(%rip), %rax      # 0xa138
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movl %ebx, %edx
jmp 0x3ff2
cmpl $0x73, %eax
jne 0x48c8
leaq 0x60cf(%rip), %rax      # 0xa138
movq (%rax), %rdi
callq 0x503b
movl %ebx, %edx
movq %rax, 0x30(%rsp)
testl %eax, %eax
jne 0x3ff2
jmp 0x40bc
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl %ebx, %edx
jmp 0x3ff2
movb $0x1, %al
movl %eax, 0x3c(%rsp)
movl %ebx, %edx
jmp 0x3ff2
cmpl $0x4c, %eax
jne 0x410b
leaq 0x6090(%rip), %rax      # 0xa138
movq (%rax), %rdi
callq 0x5086
movl %eax, %ebp
movl %ebx, %edx
testl %eax, %eax
jg 0x3ff2
movl $0x1, %ebx
jmp 0x48b4
cmpl $0x56, %eax
jne 0x48c8
leaq 0x34aa(%rip), %rdi      # 0x7580
callq 0x1070
xorl %ebx, %ebx
jmp 0x48b4
movq 0x5eef(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
leaq 0x6025(%rip), %rax      # 0xa118
movq (%rax), %rdx
leaq 0x2f58(%rip), %rsi      # 0x7055
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1140
jmp 0x48b4
cmpl $-0x1, %eax
jne 0x48c8
leaq 0x5fed(%rip), %rax      # 0xa108
movslq (%rax), %rax
subl %eax, %r15d
je 0x415e
leaq (%r12,%rax,8), %r13
testl %r15d, %r15d
movq 0x20(%rsp), %rsi
jle 0x4171
movl %r15d, %eax
xorl %ecx, %ecx
movb 0x10(%rsp), %dil
movq (%r13,%rcx,8), %rdx
cmpb $0x2d, (%rdx)
jne 0x4154
cmpb $0x0, 0x1(%rdx)
jne 0x4154
movq $0x0, (%r13,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x413b
jmp 0x4176
movl $0x1, %r15d
leaq 0xc0(%rsp), %r13
movq 0x20(%rsp), %rsi
movb 0x10(%rsp), %dil
movq %rsi, 0x20(%rsp)
testb $0x1, %dil
movq %r13, 0x98(%rsp)
je 0x4479
callq 0x5100
testq %rax, %rax
je 0x40bc
movq %rax, 0x30(%rsp)
testl %r15d, %r15d
jle 0x487b
movl %r15d, %eax
movq %rax, 0x10(%rsp)
movzbl 0xc(%rsp), %eax
andl $0x1, %eax
movl %eax, 0x78(%rsp)
xorl %r15d, %r15d
movl $0x0, 0x18(%rsp)
movq (%r13,%r15,8), %r14
testq %r14, %r14
sete %al
orb %bl, %al
testb $0x1, %al
je 0x41dd
xorl %ebp, %ebp
jmp 0x421d
movq %r14, %rdi
movq 0x20(%rsp), %rbp
movq %rbp, %rsi
callq 0x48d2
testq %rax, %rax
je 0x428d
movq %rax, %r12
subq %r14, %r12
leaq 0x1(%r12), %rdi
callq 0x4c0e
movq %rax, %rbp
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1150
movb $0x0, (%rbp,%r12)
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x4c95
movl %eax, %r12d
testl %eax, %eax
jne 0x4345
movq %r14, %r13
testb $0x1, 0xc(%rsp)
jne 0x425f
movl 0x58(%rsp), %edi
callq 0x1080
testl %eax, %eax
je 0x425f
leaq 0x30b6(%rip), %rdi      # 0x7309
xorl %eax, %eax
callq 0x4b84
jmp 0x42fb
testq %rbp, %rbp
sete %al
orb 0xc(%rsp), %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x4910
testl %eax, %eax
je 0x42ac
movl %eax, %r12d
jmp 0x4301
leaq 0x3043(%rip), %rdi      # 0x72d7
movq %r14, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x4b84
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
jmp 0x4355
movl $0x10, %edx
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq 0x4e4a
movq %rax, %r12
testl %r12d, %r12d
js 0x4301
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
cmpl $0x10, %r12d
jne 0x42e8
movabsq $0x4b43415058, %rax     # imm = 0x4B43415058
cmpq %rax, 0x40(%rsp)
je 0x4370
movq 0x60(%rsp), %rsi
leaq 0x306c(%rip), %rdi      # 0x7360
xorl %eax, %eax
callq 0x4b84
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testq %r13, %r13
setne %r14b
leaq 0x58(%rsp), %rdi
callq 0x4fe3
testl %r12d, %r12d
sete %al
testq %rbp, %rbp
setne %cl
andb %r14b, %cl
andb %al, %cl
movl %ecx, %eax
notb %al
orb 0x3c(%rsp), %al
testb %cl, %cl
movl $0x0, %ecx
cmovnel %ecx, %r12d
testb $0x1, %al
jne 0x4345
movq %r13, %rdi
callq 0x1060
xorl %r12d, %r12d
movq %rbp, %rdi
callq 0x1040
movq 0x98(%rsp), %r13
negl %r12d
orl %r12d, 0x18(%rsp)
incq %r15
cmpq %r15, 0x10(%rsp)
jne 0x41c8
jmp 0x4883
movzbl 0x4e(%rsp), %edx
cmpl $0x1, %edx
jne 0x4393
movzwl 0x4c(%rsp), %edx
cmpq $0xf, %rdx
ja 0x43ab
movq 0x60(%rsp), %rsi
leaq 0x3004(%rip), %rdi      # 0x7395
jmp 0x439f
movq 0x60(%rsp), %rsi
leaq 0x2fd9(%rip), %rdi      # 0x7378
xorl %eax, %eax
callq 0x4b84
jmp 0x42fb
movl 0x48(%rsp), %eax
leal -0x4000001(%rax), %ecx
cmpl $0xfc0003fe, %ecx       # imm = 0xFC0003FE
ja 0x43cd
movq 0x60(%rsp), %rsi
leaq 0x2feb(%rip), %rdi      # 0x73b4
movl %eax, %edx
jmp 0x439f
addq $-0x10, %rdx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %rdx, %rsi
callq 0x4ebe
testl %eax, %eax
jne 0x4288
movq %rbp, %rdi
movl 0x78(%rsp), %esi
leaq 0xa0(%rsp), %rdx
callq 0x4d4a
testl %eax, %eax
jne 0x4288
movl 0x48(%rsp), %ecx
movq 0x30(%rsp), %rdi
movq %r14, %rsi
leaq 0xa0(%rsp), %r14
movq %r14, %rdx
callq 0x49ac
testl %eax, %eax
je 0x4432
movl %eax, %r12d
movq %r14, %rdi
callq 0x4fe3
jmp 0x445a
testq %r13, %r13
je 0x444f
testq %rbp, %rbp
je 0x444f
movq %r14, %rdi
movq %rbp, %rsi
leaq 0xc8(%rsp), %rdx
callq 0x4ae9
movq %r14, %rdi
callq 0x4fe3
movl %eax, %r12d
testq %rbp, %rbp
je 0x4301
testl %r12d, %r12d
je 0x4301
movq %rbp, %rdi
callq 0x1060
jmp 0x4301
movq 0x30(%rsp), %rdi
movl %ebp, %esi
callq 0x50cd
movq %rax, 0x90(%rsp)
testq %rax, %rax
je 0x40bc
testl %r15d, %r15d
jle 0x4894
movq 0x30(%rsp), %rax
movl %eax, %ecx
movq %rcx, 0x88(%rsp)
decl %eax
movq %rax, 0xb8(%rsp)
movl %r15d, %eax
movq %rax, 0x78(%rsp)
movzbl 0xc(%rsp), %eax
andl $0x1, %eax
movl %eax, 0x84(%rsp)
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%r13,%r12,8), %r14
testq %r14, %r14
sete %al
orb %bl, %al
testb $0x1, %al
je 0x44f4
movq $0x0, 0x10(%rsp)
jmp 0x459d
testb $0x1, 0xc(%rsp)
jne 0x452e
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0x48d2
testq %rax, %rax
je 0x452e
leaq 0x2ff0(%rip), %rdi      # 0x7504
movq %r14, %rsi
movq 0x20(%rsp), %rdx
xorl %eax, %eax
callq 0x4b84
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
jmp 0x4662
movq %r14, %rdi
callq 0x10a0
movq %rax, %r13
movq %r12, 0x28(%rsp)
movq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x10a0
leaq (%rax,%r13), %rdi
addq $0x2, %rdi
movl %r15d, 0x18(%rsp)
incq %rax
movq %rax, 0x70(%rsp)
callq 0x4c0e
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1150
movq %r15, 0x10(%rsp)
leaq (%r15,%r13), %rdi
incq %rdi
movb $0x2e, -0x1(%rdi)
movq %r12, %rsi
movq 0x28(%rsp), %r12
movq 0x70(%rsp), %rdx
movl 0x18(%rsp), %r15d
callq 0x1150
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x4c95
movl %eax, %r13d
testl %eax, %eax
movq 0x10(%rsp), %rsi
jne 0x465a
testq %rsi, %rsi
sete %al
orb 0xc(%rsp), %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x58(%rsp), %rdi
movq %rsi, 0x10(%rsp)
leaq 0xc8(%rsp), %rsi
callq 0x4910
testl %eax, %eax
movq %r14, 0x50(%rsp)
jne 0x4607
movq 0x10(%rsp), %rdi
movl 0x84(%rsp), %esi
leaq 0xa0(%rsp), %rdx
callq 0x4d4a
testl %eax, %eax
je 0x4683
movl %eax, %r13d
testq %r14, %r14
setne %r14b
leaq 0x58(%rsp), %rdi
callq 0x4fe3
testl %r13d, %r13d
sete %al
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
setne %cl
andb %r14b, %cl
movq 0x50(%rsp), %rdi
andb %al, %cl
movl %ecx, %eax
notb %al
orb 0x3c(%rsp), %al
testb %cl, %cl
movl $0x0, %ecx
cmovnel %ecx, %r13d
testb $0x1, %al
jne 0x465a
callq 0x1060
movq 0x10(%rsp), %rsi
xorl %r13d, %r13d
movq %rsi, %rdi
callq 0x1040
negl %r13d
orl %r13d, %r15d
incq %r12
cmpq 0x78(%rsp), %r12
movq 0x98(%rsp), %r13
jne 0x44d5
jmp 0x4897
testb $0x1, 0xc(%rsp)
jne 0x46b3
movl 0xa0(%rsp), %edi
callq 0x1080
testl %eax, %eax
je 0x46b3
leaq 0x2e8a(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x4b84
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x4811
movabsq $0x4b43415058, %rax     # imm = 0x4B43415058
movq %rax, 0x40(%rsp)
movq 0x30(%rsp), %rax
movl %eax, 0x48(%rsp)
movw $0x10, 0x4c(%rsp)
movb $0x1, 0x4e(%rsp)
movb %bpl, 0x4f(%rsp)
movl $0x10, %edx
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x4f7b
movl %eax, %r13d
testl %eax, %eax
jne 0x4811
movq 0x88(%rsp), %rdi
callq 0x4c0e
movq %rax, %r13
movq 0xb8(%rsp), %rdi
callq 0x4c0e
movq %r13, %rdx
movq %rax, %rdi
testq %r13, %r13
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %rdx, 0x18(%rsp)
jne 0x47fd
movq %rdi, 0x28(%rsp)
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
movq 0x88(%rsp), %rdx
callq 0x4e4a
movq %rax, %r13
testq %rax, %rax
jle 0x47f8
movl %r13d, %edx
movl %r13d, %r8d
decl %r8d
movq 0x90(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x28(%rsp), %rcx
callq 0x2a94
testl %eax, %eax
movq %rax, 0x70(%rsp)
movl %eax, %r14d
cmovel %r13d, %r14d
movl %r14d, 0x40(%rsp)
movl %r13d, 0x44(%rsp)
movl $0x8, %edx
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x4f7b
testl %eax, %eax
jne 0x47f0
cmpl $0x0, 0x70(%rsp)
movq 0x28(%rsp), %rsi
cmoveq 0x18(%rsp), %rsi
movl %r14d, %edx
leaq 0xa0(%rsp), %rdi
callq 0x4f7b
testl %eax, %eax
movq 0x50(%rsp), %r14
movq 0x18(%rsp), %rdx
je 0x4745
movl %eax, %r13d
jmp 0x47f8
movl %eax, %r13d
movq 0x50(%rsp), %r14
movq 0x28(%rsp), %rdi
callq 0x1040
movq 0x18(%rsp), %rdi
callq 0x1040
testl %r13d, %r13d
je 0x483f
leaq 0xa0(%rsp), %rdi
callq 0x4fe3
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x460a
testl %r13d, %r13d
je 0x460a
callq 0x1060
jmp 0x460a
testq %r14, %r14
leaq 0xa0(%rsp), %r14
je 0x4869
cmpq $0x0, 0x10(%rsp)
je 0x4869
movq %r14, %rdi
movq 0x10(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x4ae9
movq %r14, %rdi
callq 0x4fe3
movl %eax, %r13d
movq 0x50(%rsp), %r14
jmp 0x481e
movl $0x0, 0x18(%rsp)
movq 0x30(%rsp), %rdi
callq 0x68be
movl 0x18(%rsp), %r15d
jmp 0x48a4
xorl %r15d, %r15d
movq 0x90(%rsp), %rdi
callq 0x5483
testl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
movl $0x1, %ebx
cmovel %r15d, %ebx
movl %ebx, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1200
jmp 0x40bc