// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb_copy.c
// Function: main
int main(int argc,char * argv[])
{
	int rc;
	MDB_env *env;
	const char *progname = argv[0], *act;
	unsigned flags = MDB_RDONLY;
	unsigned cpflags = 0;

	for (; argc > 1 && argv[1][0] == '-'; argc--, argv++) {
		if (argv[1][1] == 'n' && argv[1][2] == '\0')
			flags |= MDB_NOSUBDIR;
		else if (argv[1][1] == 'c' && argv[1][2] == '\0')
			cpflags |= MDB_CP_COMPACT;
		else if (argv[1][1] == 'V' && argv[1][2] == '\0') {
			printf("%s\n", MDB_VERSION_STRING);
			exit(0);
		} else
			argc = 0;
	}

	if (argc<2 || argc>3) {
		fprintf(stderr, "usage: %s [-V] [-c] [-n] srcpath [dstpath]\n", progname);
		exit(EXIT_FAILURE);
	}

#ifdef SIGPIPE
	signal(SIGPIPE, sighandle);
#endif
#ifdef SIGHUP
	signal(SIGHUP, sighandle);
#endif
	signal(SIGINT, sighandle);
	signal(SIGTERM, sighandle);

	act = "opening environment";
	rc = mdb_env_create(&env);
	if (rc == MDB_SUCCESS) {
		rc = mdb_env_open(env, argv[1], flags, 0600);
	}
	if (rc == MDB_SUCCESS) {
		act = "copying";
		if (argc == 2)
			rc = mdb_env_copyfd2(env, MDB_STDOUT, cpflags);
		else
			rc = mdb_env_copy2(env, argv[2], cpflags);
	}
	if (rc)
		fprintf(stderr, "%s: %s failed, error %d (%s)\n",
			progname, act, rc, mdb_strerror(rc));
	mdb_env_close(env);

	return rc ? EXIT_FAILURE : EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %r12d
movq (%rsi), %rbx
cmpl $0x2, %edi
jl 0x25c1
movl $0x20000, %r15d         # imm = 0x20000
xorl %ebp, %ebp
movq 0x8(%r14), %rcx
cmpb $0x2d, (%rcx)
jne 0x25c9
movzbl 0x1(%rcx), %edx
xorl %eax, %eax
cmpl $0x56, %edx
je 0x2596
cmpl $0x63, %edx
je 0x258b
cmpl $0x6e, %edx
jne 0x25b2
cmpb $0x0, 0x2(%rcx)
je 0x25a8
cmpl $0x56, %edx
je 0x2596
cmpl $0x63, %edx
jne 0x25b2
cmpb $0x0, 0x2(%rcx)
je 0x25a1
cmpl $0x56, %edx
jne 0x25b2
cmpb $0x0, 0x2(%rcx)
jne 0x25b2
jmp 0x26cc
movl $0x1, %ebp
jmp 0x25af
orl $0x4000, %r15d          # imm = 0x4000
movl %r12d, %eax
addq $0x8, %r14
leal -0x1(%rax), %r12d
cmpl $0x2, %eax
jg 0x255d
jmp 0x25c9
xorl %ebp, %ebp
movl $0x20000, %r15d         # imm = 0x20000
leal -0x4(%r12), %eax
cmpl $-0x3, %eax
jbe 0x26df
leaq 0x109(%rip), %r13       # 0x26e7
movl $0xd, %edi
movq %r13, %rsi
callq 0x21f0
movl $0x1, %edi
movq %r13, %rsi
callq 0x21f0
movl $0x2, %edi
movq %r13, %rsi
callq 0x21f0
movl $0xf, %edi
movq %r13, %rsi
callq 0x21f0
movq %rsp, %rdi
callq 0xbbcb
movl %eax, %r13d
testl %eax, %eax
jne 0x2639
movq (%rsp), %rdi
movq 0x8(%r14), %rsi
movl %r15d, %edx
movl $0x180, %ecx            # imm = 0x180
callq 0xbde5
movl %eax, %r13d
testl %r13d, %r13d
je 0x2647
leaq 0xba0a(%rip), %r14      # 0xe04f
jmp 0x2674
movq (%rsp), %rdi
cmpl $0x2, %r12d
jne 0x265f
movl $0x1, %esi
movl %ebp, %edx
callq 0xc92c
jmp 0x266a
movq 0x10(%r14), %rsi
movl %ebp, %edx
callq 0xce44
movl %eax, %r13d
leaq 0xb9ef(%rip), %r14      # 0xe063
testl %r13d, %r13d
jne 0x269b
xorl %ebx, %ebx
testl %r13d, %r13d
setne %bl
movq (%rsp), %rdi
callq 0xc8f4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf956(%rip), %rax      # 0x11ff8
movq (%rax), %r15
movl %r13d, %edi
callq 0x26e8
leaq 0xb9b7(%rip), %rsi      # 0xe06b
movq %r15, %rdi
movq %rbx, %rdx
movq %r14, %rcx
movl %r13d, %r8d
movq %rax, %r9
xorl %eax, %eax
callq 0x2210
jmp 0x2679
leaq 0xb931(%rip), %rdi      # 0xe004
callq 0x20a0
xorl %edi, %edi
callq 0x2360
movq %rbx, %rdi
callq 0x2420