// File: /workspace/github_cpp_makefile_star2_O1/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 0x9d55
testl %eax, %eax
jne 0x2d76
leaq 0x58(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0xd901
testl %eax, %eax
jne 0x2d76
movq %r14, %rdi
callq 0x3a45
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0xd88d
testl %eax, %eax
jne 0x2d76
leaq 0xc5bc(%rip), %rdi      # 0xf22a
callq 0x20b0
leaq 0xc555(%rip), %rax      # 0xf1cf
leaq 0xc554(%rip), %rsi      # 0xf1d5
cmpb $0x0, 0x1063c(%rip)     # 0x132c4
cmovneq %rax, %rsi
leaq 0xc531(%rip), %rdi      # 0xf1c4
xorl %eax, %eax
callq 0x2140
testq %r15, %r15
je 0x2cb0
leaq 0xc539(%rip), %rdi      # 0xf1df
movq %r15, %rsi
xorl %eax, %eax
callq 0x2140
leaq 0xc57d(%rip), %rdi      # 0xf234
callq 0x20b0
movq 0x38(%rsp), %rsi
leaq 0xc524(%rip), %rdi      # 0xf1ec
xorl %eax, %eax
callq 0x2140
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x2ce7
leaq 0xc519(%rip), %rdi      # 0xf1f9
xorl %eax, %eax
callq 0x2140
movl 0x50(%rsp), %esi
leaq 0xc513(%rip), %rdi      # 0xf205
xorl %eax, %eax
callq 0x2140
testb $0x4, 0x4(%rsp)
je 0x2d0c
leaq 0xc538(%rip), %rdi      # 0xf23f
callq 0x20b0
movl 0x1053e(%rip), %eax     # 0x13250
testl %eax, %eax
je 0x2d45
leaq 0x10543(%rip), %r12     # 0x13260
leaq 0xc4f0(%rip), %r15      # 0xf214
testl %eax, 0x4(%rsp)
je 0x2d39
movq -0x8(%r12), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
movl (%r12), %eax
addq $0x10, %r12
testl %eax, %eax
jne 0x2d24
movl 0x58(%rsp), %esi
leaq 0xc4ca(%rip), %rdi      # 0xf21a
xorl %eax, %eax
callq 0x2140
leaq 0xc4ee(%rip), %rdi      # 0xf24c
callq 0x20b0
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x9588
testl %eax, %eax
je 0x2d8a
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 0x622c
testl %eax, %eax
sete %al
jne 0x2e04
leaq 0x20(%rsp), %rbx
leaq 0x10(%rsp), %r14
cmpl $0x0, 0x1050d(%rip)     # 0x132c8
jne 0x2e18
cmpb $0x1, 0x10500(%rip)     # 0x132c4
jne 0x2dd8
movq %rbx, %rdi
callq 0x2e1f
movq %r14, %rdi
callq 0x2e1f
jmp 0x2de8
movq %rbx, %rdi
callq 0x2ea9
movq %r14, %rdi
callq 0x2ea9
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x8, %ecx
callq 0x622c
testl %eax, %eax
sete %al
je 0x2db4
movzbl %al, %ebp
leaq 0xc449(%rip), %rdi      # 0xf257
callq 0x20b0
jmp 0x2d78
movl $0x4, %ebp
jmp 0x2e07