// File: /workspace/github_cpp_makefile_star2_O1/twekkel[P]mzpq/mzpq.cpp
// Function: main
int main(int argc, char **argv) {

	// Initialization
	int c = 0;
	bool conout   = false;
	bool compress = true;
	bool force    = false;
	bool keep     = false;
	bool name     = false;
	std::size_t found;
	std::string method = "4";
	std::string fname;
	std::string fnorg;

	// See how we are called and change defaults accordingly
	std::string filename = argv[0];
	found = filename.find_last_of("\\/");
	if ( std::string::npos != found ) filename.erase(0, found + 1);

	if ( filename.compare("unmzpq") == 0 ) {
		compress = false;
	} else if ( filename.compare("mzpqcat") == 0 ) {
		conout   = true;
		compress = false;
		keep     = true;
	}

	// Parse command line arguments
	while ((c = getopt (argc, argv, "123456789cdfhkm:NV")) != -1)
	switch(c)
	{
	case '1':
		method = "1";
		break;
	case '2':
		method = "2";
		break;
	case '3':
		method = "3";
		break;
	case '4':
		method = "4";
		break;
	case '5':
		method = "47";
		break;
	case '6':
		method = "51";
		break;
	case '7':
		method = "54";
		break;
	case '8':
		method = "57";
		break;
	case '9':
		method = "59";
		break;
	case 'c':
		conout = true;
		break;
	case 'd':
		compress = false;
		break;
	case 'f':
		force = true;
		break;
	case 'h':
		usage();
		break;
	case 'k':
		keep = true;
		break;
	case 'm':
		method = optarg;
		break;
	case 'N':
		name = true;
		break;
	case 'V':
		version();
		break;
	default:
		usage();
	}

	// Loop over the arguments/file names, at least once to cover stdin
	int i = optind;
	do {

		if ( argv[i] != NULL ) fname = argv[i];
		if ( fname.compare("-") == 0) fname.clear();
		fnorg = fname;

		// Try to read from file
		if ( ! fname.empty() && ! fexists(fname) ) {
			fprintf(stderr, "%s does not exists\n", fname.c_str());
			exit(1);
		}

		if ( ! fname.empty() ) {
			stdin = freopen( fname.c_str() , "r", stdin );
		}

		// Compress
		if ( compress && ! conout && ! fname.empty() ) {
			fname += suffix;
			if ( ! force && fexists(fname) ) {
				fprintf(stderr, "%s already exists\n", fname.c_str());
				return 1;
			}
			stdout = freopen(fname.c_str() , "w", stdout);
		}

		// Decompress
		if ( ! compress && ! conout && ! fname.empty() ) {
			found = fname.find(suffix);
			if ( found == std::string::npos ) {
				fprintf(stderr, "unknown suffix: %s\n", fname.c_str());
				exit(1);
			}
			fname = fname.substr( 0, found );
			if ( ! force && fexists(fname) ) {
				fprintf(stderr, "%s already exists\n", fname.c_str());
				return 1;
			}
			stdout = freopen(fname.c_str() , "w", stdout);
		}

		// Do the actual work
		if ( compress ) {
			libzpaq::compress(&in, &out, method.c_str(), name ? fnorg.c_str() : "");
		} else {
			libzpaq::decompress(&in, &out);
		}

		// Remove input file
		if ( ! keep ) remove(fnorg.c_str());

		// Next file
		i++;
	} while ( i < argc );

	// Flush output streams before exiting
	fflush(stdout);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %r13
movl %edi, %ebp
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4a986(%rip), %rsi     # 0x4ef75
leaq 0x4a980(%rip), %rdx     # 0x4ef76
leaq 0x68(%rsp), %rdi
callq 0x4da8
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
xorl %eax, %eax
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq (%r13), %rsi
leaq 0x88(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x4d44
leaq 0x46a1d(%rip), %rsi     # 0x4b05e
leaq 0x88(%rsp), %rdi
movl $0x2, %ecx
movq $-0x1, %rdx
callq 0x4360
cmpq $-0x1, %rax
je 0x4675
incq %rax
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x4050
leaq 0x469e5(%rip), %rsi     # 0x4b061
leaq 0x88(%rsp), %rdi
callq 0x4070
testl %eax, %eax
je 0x46af
leaq 0x469d4(%rip), %rsi     # 0x4b068
leaq 0x88(%rsp), %rdi
callq 0x4070
testl %eax, %eax
setne %al
movl %eax, 0x4(%rsp)
sete %al
jmp 0x46b9
movl $0x0, 0x4(%rsp)
xorl %eax, %eax
movq $0x0, 0x28(%rsp)
leaq 0x469a7(%rip), %r15     # 0x4b070
leaq 0x46934(%rip), %r12     # 0x4b004
leaq 0x68(%rsp), %r14
movb %al, 0x3(%rsp)
movq $0x0, 0x38(%rsp)
movq %r13, 0x40(%rsp)
movl %eax, 0x34(%rsp)
movl %ebp, %edi
movq %r13, %rsi
movq %r15, %rdx
callq 0x4040
cmpl $0x4d, %eax
jg 0x4724
leal -0x31(%rax), %ecx
cmpl $0x8, %ecx
ja 0x4835
movl $0x1, %r8d
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x4af00(%rip), %rcx     # 0x4f61f
jmp 0x47e2
leal -0x63(%rax), %ecx
cmpl $0xa, %ecx
ja 0x47f6
leaq 0x468f1(%rip), %rdx     # 0x4b028
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x52879(%rip), %rax     # 0x56fc0
movq (%rax), %r13
movl %ebp, %ebx
movq %r15, %rbp
movq 0x70(%rsp), %r15
movq %r13, %rdi
callq 0x40b0
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rbp, %r15
movl %ebx, %ebp
movq %r13, %rcx
movq 0x40(%rsp), %r13
movq %rax, %r8
callq 0x4290
jmp 0x46eb
movl $0x2, %r8d
leaq 0x468f8(%rip), %rcx     # 0x4b083
jmp 0x47e2
leaq 0x4d551(%rip), %rcx     # 0x51ce5
jmp 0x47e2
leaq 0x4a7d8(%rip), %rcx     # 0x4ef75
jmp 0x47e2
movl $0x2, %r8d
leaq 0x468e0(%rip), %rcx     # 0x4b08c
jmp 0x47e2
leaq 0x4d514(%rip), %rcx     # 0x51cc9
jmp 0x47e2
movl $0x2, %r8d
leaq 0x468c2(%rip), %rcx     # 0x4b086
jmp 0x47e2
movl $0x2, %r8d
leaq 0x468b6(%rip), %rcx     # 0x4b089
jmp 0x47e2
movl $0x2, %r8d
leaq 0x468ad(%rip), %rcx     # 0x4b08f
movq 0x70(%rsp), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x4290
jmp 0x46eb
cmpl $0x4e, %eax
jne 0x4c88
movb $0x1, %al
movq %rax, 0x38(%rsp)
jmp 0x46eb
movb $0x1, %al
movq %rax, 0x28(%rsp)
jmp 0x46eb
movl $0x0, 0x4(%rsp)
jmp 0x46eb
movb $0x1, 0x3(%rsp)
jmp 0x46eb
movb $0x1, %al
jmp 0x46e7
cmpl $-0x1, %eax
jne 0x4c92
movq 0x5279b(%rip), %rax     # 0x56fe0
movslq (%rax), %r13
leaq 0xf8(%rsp), %r12
movslq %ebp, %rbp
leaq 0x8(%rsp), %r15
movq 0x40(%rsp), %rax
movq (%rax,%r13,8), %r14
testq %r14, %r14
je 0x488c
movq %r12, %rbx
movq 0x10(%rsp), %r12
movq %r14, %rdi
callq 0x40b0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rbx, %r12
movq %r14, %rcx
movq %rax, %r8
callq 0x4290
movq %r15, %rdi
leaq 0x4a892(%rip), %rsi     # 0x4f128
callq 0x4070
testl %eax, %eax
jne 0x48b0
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x40d0
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x48fd
movq %r12, 0xe8(%rsp)
movq 0x8(%rsp), %rsi
leaq (%rsi,%rbx), %rdx
leaq 0xe8(%rsp), %rdi
callq 0x4e38
movq 0xe8(%rsp), %rdi
xorl %esi, %esi
callq 0x42f0
cmpl $-0x1, %eax
sete %r14b
jmp 0x4900
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x4922
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4922
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x4180
testb %r14b, %r14b
jne 0x4ca5
cmpq $0x0, 0x10(%rsp)
je 0x4958
movq 0x8(%rsp), %rdi
movq 0x52691(%rip), %rax     # 0x56fd0
movq (%rax), %rdx
leaq 0x4a7ea(%rip), %rsi     # 0x4f133
callq 0x41a0
movq 0x5267b(%rip), %rcx     # 0x56fd0
movq %rax, (%rcx)
movq 0x10(%rsp), %rax
testb $0x1, 0x4(%rsp)
je 0x499e
testq %rax, %rax
sete %al
orb 0x34(%rsp), %al
testb $0x1, %al
jne 0x4b68
movq 0x53903(%rip), %rsi     # 0x58280
movq 0x53904(%rip), %rdx     # 0x58288
movq %r15, %rdi
callq 0x4080
testb $0x1, 0x28(%rsp)
je 0x4a2c
xorl %ebx, %ebx
jmp 0x4a6b
testq %rax, %rax
sete %al
orb 0x34(%rsp), %al
testb $0x1, %al
jne 0x4b61
movq 0x538c9(%rip), %rsi     # 0x58280
movq 0x538ca(%rip), %rcx     # 0x58288
movq %r15, %rdi
xorl %edx, %edx
callq 0x4300
cmpq $-0x1, %rax
je 0x4caf
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4190
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4220
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x4a1a
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x4180
testb $0x1, 0x28(%rsp)
je 0x4ac9
xorl %ebx, %ebx
jmp 0x4b08
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x4e38
movq 0xc8(%rsp), %rdi
xorl %esi, %esi
callq 0x42f0
cmpl $-0x1, %eax
setne %bl
testb $0x1, 0x28(%rsp)
jne 0x4a97
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x4a97
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x4180
testb %bl, %bl
jne 0x4c68
movq 0x8(%rsp), %rdi
movq 0x524fd(%rip), %rax     # 0x56fa8
movq (%rax), %rdx
leaq 0x4aa8e(%rip), %rsi     # 0x4f543
callq 0x41a0
movq 0x524e7(%rip), %rcx     # 0x56fa8
movq %rax, (%rcx)
jmp 0x4b68
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x4e38
movq 0xa8(%rsp), %rdi
xorl %esi, %esi
callq 0x42f0
cmpl $-0x1, %eax
setne %bl
testb $0x1, 0x28(%rsp)
jne 0x4b34
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x4b34
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4180
testb %bl, %bl
jne 0x4c74
movq 0x8(%rsp), %rdi
movq 0x52460(%rip), %rax     # 0x56fa8
movq (%rax), %rdx
leaq 0x4a9f1(%rip), %rsi     # 0x4f543
callq 0x41a0
movq 0x5244a(%rip), %rcx     # 0x56fa8
movq %rax, (%rcx)
testb $0x1, 0x4(%rsp)
je 0x4b9e
leaq 0x4ae7c(%rip), %rcx     # 0x4f9eb
testb $0x1, 0x38(%rsp)
je 0x4b7b
movq 0x48(%rsp), %rcx
movq 0x68(%rsp), %rdx
leaq 0x52649(%rip), %rdi     # 0x571d0
leaq 0x5264a(%rip), %rsi     # 0x571d8
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xe513
jmp 0x4bb1
leaq 0x5262b(%rip), %rdi     # 0x571d0
leaq 0x5262c(%rip), %rsi     # 0x571d8
callq 0xcd53
testb $0x1, 0x3(%rsp)
jne 0x4bc2
movq 0x48(%rsp), %rdi
callq 0x4340
incq %r13
cmpq %rbp, %r13
jl 0x4858
movq 0x523d3(%rip), %rax     # 0x56fa8
movq (%rax), %rdi
callq 0x41e0
xorl %ebx, %ebx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq 0x78(%rsp), %r14
leaq 0x18(%rsp), %r15
je 0x4c0a
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4180
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x4c26
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4180
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4c3d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4180
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x4c54
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4180
movl %ebx, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
callq 0x43cb
jmp 0x4c7e
leaq 0x8(%rsp), %rdi
callq 0x4380
movl $0x1, %ebx
jmp 0x4bdf
cmpl $0x56, %eax
jne 0x4c92
callq 0x45a9
leaq 0x4645e(%rip), %rdi     # 0x4b0f7
callq 0x4280
xorl %edi, %edi
callq 0x4210
leaq 0x8(%rsp), %rdi
callq 0x43ef
leaq 0x8(%rsp), %rdi
callq 0x43a4
jmp 0x4cc4
movq %rax, %rbx
jmp 0x4cf2
jmp 0x4cc4
jmp 0x4cc4
movq %rax, %rbx
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq 0x78(%rsp), %r14
leaq 0x18(%rsp), %r15
je 0x4cf2
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4180
leaq 0x58(%rsp), %rax
movq 0x48(%rsp), %rdi
cmpq %rax, %rdi
je 0x4d0e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4180
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4d25
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4180
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x4d3c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4180
movq %rbx, %rdi
callq 0x4310