// File: /workspace/github_c_makefile_star2_O1/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 $0x128, %rsp            # imm = 0x128
movq %rsi, %r12
movl %edi, %r13d
movq $0x0, 0x90(%rsp)
movq (%rsi), %rdi
callq 0x4c53
leaq 0x622a(%rip), %rcx      # 0xa118
movq %rax, (%rcx)
leaq 0x3155(%rip), %rsi      # 0x704d
movq %rax, %rdi
callq 0x1120
testl %eax, %eax
sete (%rsp)
movl $0x6, %r15d
movl $0x80000, 0x8(%rsp)     # imm = 0x80000
leaq 0x3116(%rip), %rax      # 0x7031
movq %rax, 0x10(%rsp)
movl $0x0, 0x24(%rsp)
leaq 0x3108(%rip), %rbp      # 0x7037
leaq 0x30ce(%rip), %r14      # 0x7004
movl $0x0, 0x4(%rsp)
xorl %edx, %edx
movl %edx, %ebx
movl %r13d, %edi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x5130
cmpl $0x52, %eax
jg 0x3f6b
leal -0x31(%rax), %ecx
cmpl $0x9, %ecx
jae 0x3fe9
addl $-0x30, %eax
movl %eax, %r15d
movl %ebx, %edx
jmp 0x3f40
cmpl $0x62, %eax
jle 0x3f8b
leal -0x63(%rax), %ecx
cmpl $0x8, %ecx
ja 0x3fa7
movb $0x1, %dl
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
movb $0x1, (%rsp)
movl %ebx, %edx
jmp 0x3f40
cmpl $0x53, %eax
jne 0x4014
leaq 0x619d(%rip), %rax      # 0xa138
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movl %ebx, %edx
jmp 0x3f40
cmpl $0x73, %eax
jne 0x4752
leaq 0x6181(%rip), %rax      # 0xa138
movq (%rax), %rdi
callq 0x5045
movl %ebx, %edx
movl %eax, 0x8(%rsp)
testl %eax, %eax
jne 0x3f40
jmp 0x400a
movb $0x1, %al
movl %eax, 0x4(%rsp)
movl %ebx, %edx
jmp 0x3f40
movb $0x1, %al
movl %eax, 0x24(%rsp)
movl %ebx, %edx
jmp 0x3f40
cmpl $0x4c, %eax
jne 0x4059
leaq 0x6143(%rip), %rax      # 0xa138
movq (%rax), %rdi
callq 0x5090
movl %eax, %r15d
movl %ebx, %edx
testl %eax, %eax
jg 0x3f40
movl $0x1, %ebx
jmp 0x473e
cmpl $0x56, %eax
jne 0x4752
leaq 0x355c(%rip), %rdi      # 0x7580
callq 0x1070
xorl %ebx, %ebx
jmp 0x473e
movq 0x5fa1(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
leaq 0x60d7(%rip), %rax      # 0xa118
movq (%rax), %rdx
leaq 0x300a(%rip), %rsi      # 0x7055
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1140
jmp 0x473e
cmpl $-0x1, %eax
jne 0x4752
leaq 0x609f(%rip), %rax      # 0xa108
movslq (%rax), %rax
subl %eax, %r13d
je 0x40ab
leaq (%r12,%rax,8), %rbp
testl %r13d, %r13d
movq 0x10(%rsp), %rsi
jle 0x40be
movl %r13d, %eax
xorl %ecx, %ecx
movb (%rsp), %dil
movq (%rbp,%rcx,8), %rdx
cmpb $0x2d, (%rdx)
jne 0x40a1
cmpb $0x0, 0x1(%rdx)
jne 0x40a1
movq $0x0, (%rbp,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x4088
jmp 0x40c2
movl $0x1, %r13d
leaq 0x90(%rsp), %rbp
movq 0x10(%rsp), %rsi
movb (%rsp), %dil
movq %rsi, 0x10(%rsp)
testb $0x1, %dil
movq %rbp, 0x68(%rsp)
je 0x4415
callq 0x510a
movq %rax, %r15
testq %rax, %rax
je 0x470d
movq %r15, 0x38(%rsp)
movl $0x0, %r12d
testl %r13d, %r13d
movq 0x10(%rsp), %r14
jle 0x46eb
movl %r13d, %eax
movq %rax, 0x18(%rsp)
movzbl 0x4(%rsp), %eax
andl $0x1, %eax
movl %eax, 0x60(%rsp)
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rbp,%r15,8), %r13
testq %r13, %r13
sete %al
orb %bl, %al
testb $0x1, %al
je 0x4136
movq $0x0, 0x8(%rsp)
jmp 0x41ab
movq %r13, %rdi
movq %r14, %rsi
callq 0x475c
movq %r14, %rdx
movq %rax, %r14
testq %rax, %rax
je 0x418c
movq %r14, %rbp
subq %r13, %rbp
leaq 0x1(%rbp), %rdi
callq 0x4bea
movl %r12d, (%rsp)
movq %r13, %r12
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1150
movq %r13, 0x8(%rsp)
movb $0x0, (%r13,%rbp)
movq %r12, %r13
movl (%rsp), %r12d
movq 0x68(%rsp), %rbp
jmp 0x41a6
leaq 0x3144(%rip), %rdi      # 0x72d7
movq %r13, %rsi
xorl %eax, %eax
callq 0x4b60
movq $0x0, 0x8(%rsp)
testq %r14, %r14
je 0x421b
movq %r13, %rdi
leaq 0x40(%rsp), %rsi
callq 0x4c71
movl %eax, %r14d
testl %eax, %eax
jne 0x42c7
testb $0x1, 0x4(%rsp)
jne 0x41ea
movl 0x40(%rsp), %edi
callq 0x1080
testl %eax, %eax
je 0x41ea
leaq 0x312b(%rip), %rdi      # 0x7309
xorl %eax, %eax
callq 0x4b60
jmp 0x4275
cmpq $0x0, 0x8(%rsp)
sete %al
orb 0x4(%rsp), %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
leaq 0x98(%rsp), %rsi
callq 0x479a
testl %eax, %eax
je 0x4226
movl %eax, %r14d
jmp 0x427b
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
jmp 0x42d1
movl $0x10, %edx
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4e29
movq %rax, %r14
testl %r14d, %r14d
js 0x427b
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpl $0x10, %r14d
jne 0x4262
movabsq $0x4b43415058, %rax     # imm = 0x4B43415058
cmpq %rax, 0x28(%rsp)
je 0x42ef
movq 0x48(%rsp), %rsi
leaq 0x30f2(%rip), %rdi      # 0x7360
xorl %eax, %eax
callq 0x4b60
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %r13, %r13
setne %bpl
leaq 0x40(%rsp), %rdi
callq 0x4fed
testl %r14d, %r14d
sete %al
cmpq $0x0, 0x8(%rsp)
setne %cl
andb %bpl, %cl
andb %al, %cl
movl %ecx, %eax
notb %al
orb 0x24(%rsp), %al
testb %cl, %cl
movl $0x0, %ecx
cmovnel %ecx, %r14d
testb $0x1, %al
movq 0x68(%rsp), %rbp
jne 0x42c7
movq %r13, %rdi
callq 0x1060
xorl %r14d, %r14d
movq 0x8(%rsp), %rdi
callq 0x1040
negl %r14d
orl %r14d, %r12d
incq %r15
cmpq %r15, 0x18(%rsp)
movq 0x10(%rsp), %r14
jne 0x411a
jmp 0x46eb
movzbl 0x36(%rsp), %edx
cmpl $0x1, %edx
jne 0x4312
movzwl 0x34(%rsp), %edx
cmpq $0xf, %rdx
ja 0x432a
movq 0x48(%rsp), %rsi
leaq 0x3085(%rip), %rdi      # 0x7395
jmp 0x431e
movq 0x48(%rsp), %rsi
leaq 0x305a(%rip), %rdi      # 0x7378
xorl %eax, %eax
callq 0x4b60
jmp 0x4275
movl 0x30(%rsp), %eax
leal -0x4000001(%rax), %ecx
cmpl $0xfc0003fe, %ecx       # imm = 0xFC0003FE
ja 0x434c
movq 0x48(%rsp), %rsi
leaq 0x306c(%rip), %rdi      # 0x73b4
movl %eax, %edx
jmp 0x431e
addq $-0x10, %rdx
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq %rdx, %rsi
callq 0x4ebf
testl %eax, %eax
jne 0x4216
movq 0x8(%rsp), %rdi
movl 0x60(%rsp), %esi
leaq 0x78(%rsp), %rdx
callq 0x4d29
testl %eax, %eax
jne 0x4216
movl 0x30(%rsp), %ecx
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
leaq 0x78(%rsp), %r14
movq %r14, %rdx
callq 0x4836
movl %eax, %ebp
testl %eax, %eax
jne 0x43e0
movl %r12d, (%rsp)
xorl %ebp, %ebp
movq %r13, %r12
testq %r13, %r13
je 0x43d4
cmpq $0x0, 0x8(%rsp)
je 0x43d4
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movq 0x8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x49c1
jmp 0x43d9
leaq 0x78(%rsp), %r14
movq %r12, %r13
movl (%rsp), %r12d
movq %r14, %rdi
callq 0x4fed
movl %eax, %r14d
testl %ebp, %ebp
cmovnel %ebp, %r14d
cmpq $0x0, 0x8(%rsp)
je 0x427b
testl %r14d, %r14d
je 0x427b
movq 0x8(%rsp), %rdi
callq 0x1060
jmp 0x427b
movl 0x8(%rsp), %edi
movl %r15d, %esi
callq 0x50d7
movq %rax, 0x58(%rsp)
testq %rax, %rax
je 0x471c
movl $0x0, %r12d
testl %r13d, %r13d
jle 0x46fc
movl %r13d, %eax
movq %rax, 0x38(%rsp)
movzbl 0x4(%rsp), %eax
andl $0x1, %eax
movl %eax, 0x74(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
movq (%rbp,%r13,8), %rcx
testq %rcx, %rcx
sete %al
orb %bl, %al
testb $0x1, %al
movl %r12d, (%rsp)
je 0x4475
xorl %r14d, %r14d
jmp 0x4525
testb $0x1, 0x4(%rsp)
movq %rcx, 0x18(%rsp)
jne 0x44b5
movq %rcx, %rdi
movq 0x10(%rsp), %rsi
callq 0x475c
movq 0x18(%rsp), %rcx
testq %rax, %rax
je 0x44b5
xorl %r14d, %r14d
leaq 0x3062(%rip), %rdi      # 0x7504
movq %rcx, %rsi
movq 0x10(%rsp), %rdx
xorl %eax, %eax
callq 0x4b60
xorl %eax, %eax
jmp 0x4513
movq %rcx, %rdi
movq %rcx, %r12
callq 0x10a0
movq %rax, %rbp
movq 0x10(%rsp), %rdi
callq 0x10a0
leaq (%rax,%rbp), %rdi
addq $0x2, %rdi
incq %rax
movq %rax, 0x60(%rsp)
callq 0x4bea
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movl (%rsp), %r12d
movq %rbp, %rdx
callq 0x1150
leaq (%r14,%rbp), %rdi
incq %rdi
movb $0x2e, -0x1(%rdi)
movq 0x10(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq 0x1150
movb $0x1, %al
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
testb %al, %al
movq 0x18(%rsp), %rcx
je 0x469a
movq %rcx, %rdi
movq %rcx, %r12
leaq 0x40(%rsp), %rsi
callq 0x4c71
movl %eax, %ebp
testl %eax, %eax
jne 0x468e
movq %r12, 0x18(%rsp)
testq %r14, %r14
sete %al
orb 0x4(%rsp), %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x40(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x479a
testl %eax, %eax
je 0x4574
movl %eax, %ebp
movq %r14, %r12
jmp 0x4645
movq %r14, %r12
movq %r14, %rdi
movl 0x74(%rsp), %esi
leaq 0x78(%rsp), %r14
movq %r14, %rdx
callq 0x4d29
testl %eax, %eax
je 0x4596
movl %eax, %ebp
jmp 0x4645
testb $0x1, 0x4(%rsp)
jne 0x45c3
movl 0x78(%rsp), %edi
callq 0x1080
testl %eax, %eax
je 0x45c3
movq %r14, %rbp
leaq 0x2f77(%rip), %rdi      # 0x752b
xorl %eax, %eax
callq 0x4b60
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x4623
movabsq $0x4b43415058, %rax     # imm = 0x4B43415058
movq %rax, 0x28(%rsp)
movl 0x8(%rsp), %ebp
movl %ebp, 0x30(%rsp)
movw $0x10, 0x34(%rsp)
movb $0x1, 0x36(%rsp)
movb %r15b, 0x37(%rsp)
movl $0x10, %edx
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4f74
testl %eax, %eax
jne 0x461d
movq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x4a5b
testl %eax, %eax
je 0x46b4
movq %r14, %rbp
movl %eax, %r14d
movq %rbp, %rdi
callq 0x4fed
movl %eax, %ebp
testl %r14d, %r14d
cmovnel %r14d, %ebp
testq %r12, %r12
je 0x4645
testl %ebp, %ebp
je 0x4645
movq %r12, %rdi
callq 0x1060
cmpq $0x0, 0x18(%rsp)
setne %r14b
leaq 0x40(%rsp), %rdi
callq 0x4fed
testl %ebp, %ebp
sete %al
testq %r12, %r12
setne %cl
andb %r14b, %cl
movq %r12, %r14
andb %al, %cl
movl %ecx, %eax
notb %al
orb 0x24(%rsp), %al
testb %cl, %cl
movl $0x0, %ecx
cmovnel %ecx, %ebp
testb $0x1, %al
jne 0x468e
movq 0x18(%rsp), %rdi
callq 0x1060
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x1040
movl (%rsp), %r12d
negl %ebp
orl %ebp, %r12d
incq %r13
cmpq %r13, 0x38(%rsp)
movq 0x68(%rsp), %rbp
jne 0x4458
jmp 0x46fc
movq %r14, %rbp
cmpq $0x0, 0x18(%rsp)
je 0x46e3
xorl %r14d, %r14d
testq %r12, %r12
je 0x4623
movq %r12, %rsi
movq %rbp, %rdi
leaq 0x98(%rsp), %rdx
callq 0x49c1
jmp 0x4623
xorl %r14d, %r14d
jmp 0x4623
movq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x67f6
xorl %ebx, %ebx
jmp 0x4715
movq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x53cc
xorl %ebx, %ebx
jmp 0x4729
movl $0x1, %ebx
xorl %r12d, %r12d
testq %r15, %r15
jne 0x472e
jmp 0x473e
movl $0x1, %ebx
xorl %r12d, %r12d
movq 0x58(%rsp), %r14
testq %r14, %r14
je 0x473e
testl $0xfffffffd, %r12d      # imm = 0xFFFFFFFD
movl $0x1, %ebx
cmovel %r12d, %ebx
movl %ebx, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1200
jmp 0x400a