// File: /workspace/github_cpp_makefile_star2_O2/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 0x9309
testl %eax, %eax
jne 0x2c19
leaq 0x58(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0xcb85
testl %eax, %eax
jne 0x2c19
movq %r14, %rdi
callq 0x37c2
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xcb12
testl %eax, %eax
jne 0x2c19
leaq 0xb711(%rip), %rdi      # 0xe22a
callq 0x20b0
leaq 0xb6aa(%rip), %rax      # 0xe1cf
leaq 0xb6a9(%rip), %rsi      # 0xe1d5
cmpb $0x0, 0x10791(%rip)     # 0x132c4
cmovneq %rax, %rsi
leaq 0xb686(%rip), %rdi      # 0xe1c4
xorl %eax, %eax
callq 0x2140
testq %r15, %r15
je 0x2b5b
leaq 0xb68e(%rip), %rdi      # 0xe1df
movq %r15, %rsi
xorl %eax, %eax
callq 0x2140
leaq 0xb6d2(%rip), %rdi      # 0xe234
callq 0x20b0
movq 0x18(%rsp), %rsi
leaq 0xb679(%rip), %rdi      # 0xe1ec
xorl %eax, %eax
callq 0x2140
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x2b92
leaq 0xb66e(%rip), %rdi      # 0xe1f9
xorl %eax, %eax
callq 0x2140
movl 0x30(%rsp), %esi
leaq 0xb668(%rip), %rdi      # 0xe205
xorl %eax, %eax
callq 0x2140
testb $0x4, 0x4(%rsp)
je 0x2bb7
leaq 0xb68d(%rip), %rdi      # 0xe23f
callq 0x20b0
leaq 0x1069a(%rip), %r12     # 0x13258
leaq 0xb64f(%rip), %r15      # 0xe214
movl -0x8(%r12), %eax
testl %eax, %eax
je 0x2be8
testl %eax, 0x4(%rsp)
je 0x2be2
movq (%r12), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
addq $0x10, %r12
jmp 0x2bc5
movl 0x58(%rsp), %esi
leaq 0xb627(%rip), %rdi      # 0xe21a
xorl %eax, %eax
callq 0x2140
leaq 0xb64b(%rip), %rdi      # 0xe24c
callq 0x20b0
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x8bb0
testl %eax, %eax
je 0x2c2d
movl %eax, %ebp
movl %ebp, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x48(%rsp), %rbx
leaq 0x38(%rsp), %r14
pushq $0x8
popq %r15
pushq $0x4
popq %rbp
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %r15d, %ecx
callq 0x5b7b
testl %eax, %eax
jne 0x2c8b
cmpl $0x0, 0x1066c(%rip)     # 0x132c8
jne 0x2c8d
cmpb $0x1, 0x1065f(%rip)     # 0x132c4
jne 0x2c79
movq %rbx, %rdi
callq 0x2c9b
movq %r14, %rdi
callq 0x2c9b
jmp 0x2c3e
movq %rbx, %rdi
callq 0x2cf9
movq %r14, %rdi
callq 0x2cf9
jmp 0x2c3e
xorl %ebp, %ebp
leaq 0xb5c3(%rip), %rdi      # 0xe257
callq 0x20b0
jmp 0x2c1b