// File: /workspace/github_cpp_makefile_star2_O3/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb_dump.c
// Function: dumpit
static int dumpit(MDB_txn *txn, MDB_dbi dbi, char *name)
{
	MDB_cursor *mc;
	MDB_stat ms;
	MDB_val key, data;
	MDB_envinfo info;
	unsigned int flags;
	int rc, i;

	rc = mdb_dbi_flags(txn, dbi, &flags);
	if (rc) return rc;

	rc = mdb_stat(txn, dbi, &ms);
	if (rc) return rc;

	rc = mdb_env_info(mdb_txn_env(txn), &info);
	if (rc) return rc;

	printf("VERSION=3\n");
	printf("format=%s\n", mode & PRINT ? "print" : "bytevalue");
	if (name)
		printf("database=%s\n", name);
	printf("type=btree\n");
	printf("mapsize=%" Z "u\n", info.me_mapsize);
	if (info.me_mapaddr)
		printf("mapaddr=%p\n", info.me_mapaddr);
	printf("maxreaders=%u\n", info.me_maxreaders);

	if (flags & MDB_DUPSORT)
		printf("duplicates=1\n");

	for (i=0; dbflags[i].bit; i++)
		if (flags & dbflags[i].bit)
			printf("%s=1\n", dbflags[i].name);

	printf("db_pagesize=%d\n", ms.ms_psize);
	printf("HEADER=END\n");

	rc = mdb_cursor_open(txn, dbi, &mc);
	if (rc) return rc;

	while ((rc = mdb_cursor_get(mc, &key, &data, MDB_NEXT) == MDB_SUCCESS)) {
		if (gotsig) {
			rc = EINTR;
			break;
		}
		if (mode & PRINT) {
			text(&key);
			text(&data);
		} else {
			byte(&key);
			byte(&data);
		}
	}
	printf("DATA=END\n");
	if (rc == MDB_NOTFOUND)
		rc = MDB_SUCCESS;

	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
leaq 0x4(%rsp), %rdx
callq 0x9986
testl %eax, %eax
jne 0x2d7a
leaq 0x58(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0xd498
testl %eax, %eax
jne 0x2d7a
movq %r14, %rdi
callq 0x39de
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0xd424
testl %eax, %eax
jne 0x2d7a
leaq 0xc5ba(%rip), %rdi      # 0xf22a
callq 0x20b0
leaq 0xc553(%rip), %rax      # 0xf1cf
leaq 0xc552(%rip), %rsi      # 0xf1d5
cmpb $0x0, 0x1063a(%rip)     # 0x132c4
cmovneq %rax, %rsi
leaq 0xc52f(%rip), %rdi      # 0xf1c4
xorl %eax, %eax
callq 0x2140
testq %r15, %r15
je 0x2cb2
leaq 0xc537(%rip), %rdi      # 0xf1df
movq %r15, %rsi
xorl %eax, %eax
callq 0x2140
leaq 0xc57b(%rip), %rdi      # 0xf234
callq 0x20b0
movq 0x38(%rsp), %rsi
leaq 0xc522(%rip), %rdi      # 0xf1ec
xorl %eax, %eax
callq 0x2140
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x2ce9
leaq 0xc517(%rip), %rdi      # 0xf1f9
xorl %eax, %eax
callq 0x2140
movl 0x50(%rsp), %esi
leaq 0xc511(%rip), %rdi      # 0xf205
xorl %eax, %eax
callq 0x2140
testb $0x4, 0x4(%rsp)
je 0x2d0e
leaq 0xc536(%rip), %rdi      # 0xf23f
callq 0x20b0
movl 0x1053c(%rip), %eax     # 0x13250
testl %eax, %eax
je 0x2d47
leaq 0x10541(%rip), %r12     # 0x13260
leaq 0xc4ee(%rip), %r15      # 0xf214
testl %eax, 0x4(%rsp)
je 0x2d3b
movq -0x8(%r12), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
movl (%r12), %eax
addq $0x10, %r12
testl %eax, %eax
jne 0x2d26
movl 0x58(%rsp), %esi
leaq 0xc4c8(%rip), %rdi      # 0xf21a
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2140
leaq 0xc4ea(%rip), %rdi      # 0xf24c
callq 0x20b0
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x91cb
testl %eax, %eax
je 0x2d8e
movl %eax, %ebp
movl %ebp, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movl $0x8, %ecx
callq 0x5f39
testl %eax, %eax
jne 0x2e09
leaq 0x20(%rsp), %rbx
leaq 0x10(%rsp), %r14
cmpl $0x0, 0x1050c(%rip)     # 0x132c8
jne 0x2e04
cmpb $0x1, 0x104ff(%rip)     # 0x132c4
jne 0x2dd9
movq %rbx, %rdi
callq 0x2e1a
movq %r14, %rdi
callq 0x2e1a
jmp 0x2de9
movq %rbx, %rdi
callq 0x2ea4
movq %r14, %rdi
callq 0x2ea4
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x8, %ecx
callq 0x5f39
testl %eax, %eax
je 0x2db5
jmp 0x2e09
movl $0x4, %ebp
leaq 0xc447(%rip), %rdi      # 0xf257
callq 0x20b0
jmp 0x2d7c