LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_open
int
mdb_cursor_open(MDB_txn *txn, MDB_dbi dbi, MDB_cursor **ret)
{
	MDB_cursor	*mc;
	size_t size = sizeof(MDB_cursor);

	if (!ret || !TXN_DBI_EXIST(txn, dbi, DB_VALID))
		return EINVAL;

	if (txn->mt_flags & MDB_TXN_BLOCKED)
		return MDB_BAD_TXN;

	if (dbi == FREE_DBI && !F_ISSET(txn->mt_flags, MDB_TXN_RDONLY))
		return EINVAL;

	if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT)
		size += sizeof(MDB_xcursor);

	if ((mc = malloc(size)) != NULL) {
		mdb_cursor_init(mc, txn, dbi, (MDB_xcursor *)(mc + 1));
		if (txn->mt_cursors) {
			mc->mc_next = txn->mt_cursors[dbi];
			txn->mt_cursors[dbi] = mc;
			mc->mc_flags |= C_UNTRACK;
		}
	} else {
		return ENOMEM;
	}

	*ret = mc;

	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
testq %rdx, %rdx
sete %cl
testq %rdi, %rdi
sete %dl
movl $0x16, %eax
orb %cl, %dl
jne 0x9672
movl %esi, %ebp
movq %rdi, %r14
cmpl %esi, 0x78(%rdi)
jbe 0x9672
movq 0x70(%r14), %rcx
movl %ebp, %r12d
testb $0x8, (%rcx,%r12)
je 0x9672
movl 0x7c(%r14), %ecx
movl $0xffff87c2, %eax       # imm = 0xFFFF87C2
testb $0x13, %cl
je 0x967b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
andl $0x20000, %ecx          # imm = 0x20000
orl %ebp, %ecx
movl $0x16, %eax
je 0x9672
movq 0x58(%r14), %rax
leaq (%r12,%r12,2), %rcx
shlq $0x4, %rcx
movzwl 0x4(%rax,%rcx), %eax
testb $0x4, %al
movl $0x188, %eax            # imm = 0x188
movl $0x378, %edi            # imm = 0x378
cmoveq %rax, %rdi
callq 0x2270
testq %rax, %rax
je 0x96ef
movq %rax, %r15
movq %rax, %rcx
addq $0x188, %rcx            # imm = 0x188
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x4177
movq 0x68(%r14), %rax
testq %rax, %rax
je 0x96e8
movq (%rax,%r12,8), %rcx
movq %rcx, (%r15)
movq %r15, (%rax,%r12,8)
orb $0x40, 0x44(%r15)
movq %r15, (%rbx)
xorl %eax, %eax
jmp 0x9672
movl $0xc, %eax
jmp 0x9672
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_renew
int
mdb_cursor_renew(MDB_txn *txn, MDB_cursor *mc)
{
	if (!mc || !TXN_DBI_EXIST(txn, mc->mc_dbi, DB_VALID))
		return EINVAL;

	if ((mc->mc_flags & C_UNTRACK) || txn->mt_cursors)
		return EINVAL;

	if (txn->mt_flags & MDB_TXN_BLOCKED)
		return MDB_BAD_TXN;

	mdb_cursor_init(mc, txn, mc->mc_dbi, mc->mc_xcursor);
	return MDB_SUCCESS;
}

// Assembly:
testq %rsi, %rsi
sete %cl
testq %rdi, %rdi
sete %dl
movl $0x16, %eax
orb %cl, %dl
jne 0x9752
movq %rdi, %r8
movl 0x20(%rsi), %edx
cmpl 0x78(%rdi), %edx
jae 0x9752
movq 0x70(%r8), %rcx
testb $0x8, (%rcx,%rdx)
je 0x9752
testb $0x40, 0x44(%rsi)
jne 0x9752
cmpq $0x0, 0x68(%r8)
jne 0x9752
movl $0xffff87c2, %eax       # imm = 0xFFFF87C2
testb $0x13, 0x7c(%r8)
jne 0x9752
pushq %rax
movq 0x10(%rsi), %rcx
movq %rsi, %rdi
movq %r8, %rsi
callq 0x4177
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_count
int
mdb_cursor_count(MDB_cursor *mc, size_t *countp)
{
	MDB_node	*leaf;

	if (mc == NULL || countp == NULL)
		return EINVAL;

	if (mc->mc_xcursor == NULL)
		return MDB_INCOMPATIBLE;

	if (mc->mc_txn->mt_flags & MDB_TXN_BLOCKED)
		return MDB_BAD_TXN;

	if (!(mc->mc_flags & C_INITIALIZED))
		return EINVAL;

	if (!mc->mc_snum || (mc->mc_flags & C_EOF))
		return MDB_NOTFOUND;

	leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
	if (!F_ISSET(leaf->mn_flags, F_DUPDATA)) {
		*countp = 1;
	} else {
		if (!(mc->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED))
			return EINVAL;

		*countp = mc->mc_xcursor->mx_db.md_entries;
	}
	return MDB_SUCCESS;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x9769
movl $0x16, %eax
retq
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x9782
movq 0x18(%rdi), %rdx
movl $0xffff87c2, %eax       # imm = 0xFFFF87C2
testb $0x13, 0x7c(%rdx)
je 0x9788
retq
movl $0xffff87c0, %eax       # imm = 0xFFFF87C0
retq
movl 0x44(%rdi), %edx
testb $0x1, %dl
je 0x9763
movl $0xffff87b2, %eax       # imm = 0xFFFF87B2
testb $0x2, %dl
jne 0x9781
cmpw $0x0, 0x40(%rdi)
je 0x9781
movzwl 0x42(%rdi), %eax
movq 0x48(%rdi,%rax,8), %rdx
movzwl 0x148(%rdi,%rax,2), %eax
movzwl 0x10(%rdx,%rax,2), %edi
movl $0x1, %eax
testb $0x4, 0x4(%rdx,%rdi)
je 0x97d5
testb $0x1, 0x44(%rcx)
movl $0x16, %eax
je 0x9781
movq 0x1a8(%rcx), %rax
movq %rax, (%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_close
void
mdb_cursor_close(MDB_cursor *mc)
{
	if (mc && !mc->mc_backup) {
		/* remove from txn, if tracked */
		if ((mc->mc_flags & C_UNTRACK) && mc->mc_txn->mt_cursors) {
			MDB_cursor **prev = &mc->mc_txn->mt_cursors[mc->mc_dbi];
			while (*prev && *prev != mc) prev = &(*prev)->mc_next;
			if (*prev == mc)
				*prev = mc->mc_next;
		}
		free(mc);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x97e7
cmpq $0x0, 0x8(%rdi)
je 0x97e8
retq
testb $0x40, 0x44(%rdi)
je 0x2030
movq 0x18(%rdi), %rax
movq 0x68(%rax), %rax
testq %rax, %rax
je 0x2030
movl 0x20(%rdi), %ecx
leaq (%rax,%rcx,8), %rcx
movq %rcx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x981a
cmpq %rdi, %rcx
jne 0x980a
cmpq %rdi, %rcx
jne 0x2030
movq (%rdi), %rcx
movq %rcx, (%rax)
jmp 0x2030
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_del
int
mdb_del(MDB_txn *txn, MDB_dbi dbi,
    MDB_val *key, MDB_val *data)
{
	if (!key || !TXN_DBI_EXIST(txn, dbi, DB_USRVALID))
		return EINVAL;

	if (txn->mt_flags & (MDB_TXN_RDONLY|MDB_TXN_BLOCKED))
		return (txn->mt_flags & MDB_TXN_RDONLY) ? EACCES : MDB_BAD_TXN;

	if (!F_ISSET(txn->mt_dbs[dbi].md_flags, MDB_DUPSORT)) {
		/* must ignore any data */
		data = NULL;
	}

	return mdb_del0(txn, dbi, key, data, 0);
}

// Assembly:
testq %rdx, %rdx
sete %r8b
testq %rdi, %rdi
sete %r9b
movl $0x16, %eax
orb %r8b, %r9b
jne 0x9885
cmpl %esi, 0x78(%rdi)
jbe 0x9885
movq 0x70(%rdi), %r9
movl %esi, %r8d
testb $0x10, (%r9,%r8)
je 0x9885
movl 0x7c(%rdi), %eax
testl $0x20013, %eax          # imm = 0x20013
je 0x9886
btl $0x11, %eax
movl $0xffff87c2, %ecx       # imm = 0xFFFF87C2
movl $0xd, %eax
cmovael %ecx, %eax
retq
movq 0x58(%rdi), %rax
leaq (%r8,%r8,2), %r8
shlq $0x4, %r8
movzwl 0x4(%rax,%r8), %eax
xorl %r8d, %r8d
testb $0x4, %al
cmoveq %r8, %rcx
xorl %r8d, %r8d
jmp 0x98a6
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_del0
static int
mdb_del0(MDB_txn *txn, MDB_dbi dbi,
	MDB_val *key, MDB_val *data, unsigned flags)
{
	MDB_cursor mc;
	MDB_xcursor mx;
	MDB_cursor_op op;
	MDB_val rdata, *xdata;
	int		 rc, exact = 0;
	DKBUF;

	DPRINTF(("====> delete db %u key [%s]", dbi, DKEY(key)));

	mdb_cursor_init(&mc, txn, dbi, &mx);

	if (data) {
		op = MDB_GET_BOTH;
		rdata = *data;
		xdata = &rdata;
	} else {
		op = MDB_SET;
		xdata = NULL;
		flags |= MDB_NODUPDATA;
	}
	rc = mdb_cursor_set(&mc, key, xdata, op, &exact);
	if (rc == 0) {
		/* let mdb_page_split know about this cursor if needed:
		 * delete will trigger a rebalance; if it needs to move
		 * a node from one page to another, it will have to
		 * update the parent's separator key(s). If the new sepkey
		 * is larger than the current one, the parent page may
		 * run out of space, triggering a split. We need this
		 * cursor to be consistent until the end of the rebalance.
		 */
		mc.mc_flags |= C_UNTRACK;
		mc.mc_next = txn->mt_cursors[dbi];
		txn->mt_cursors[dbi] = &mc;
		rc = mdb_cursor_del(&mc, flags);
		txn->mt_cursors[dbi] = mc.mc_next;
	}
	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3a0, %rsp            # imm = 0x3A0
movl %r8d, %ebp
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %rbx
movl $0x0, 0xc(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x1b0(%rsp), %rcx
movq %rbx, %rsi
movl %r14d, %edx
callq 0x4177
testq %r12, %r12
je 0x98fd
movups (%r12), %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movl $0x2, %ecx
jmp 0x9907
orl $0x20, %ebp
movl $0xf, %ecx
xorl %edx, %edx
leaq 0x28(%rsp), %r12
leaq 0xc(%rsp), %r8
movq %r12, %rdi
movq %r15, %rsi
callq 0x5cd7
testl %eax, %eax
jne 0x9950
orb $0x40, 0x6c(%rsp)
movq 0x68(%rbx), %rax
movl %r14d, %r14d
movq (%rax,%r14,8), %rcx
movq %rcx, 0x28(%rsp)
movq %r12, (%rax,%r14,8)
movq %r12, %rdi
movl %ebp, %esi
callq 0x8e3e
movq 0x28(%rsp), %rcx
movq 0x68(%rbx), %rdx
movq %rcx, (%rdx,%r14,8)
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_put
int
mdb_put(MDB_txn *txn, MDB_dbi dbi,
    MDB_val *key, MDB_val *data, unsigned int flags)
{
	MDB_cursor mc;
	MDB_xcursor mx;

	if (!key || !data || !TXN_DBI_EXIST(txn, dbi, DB_USRVALID))
		return EINVAL;

	if (flags & ~(MDB_NOOVERWRITE|MDB_NODUPDATA|MDB_RESERVE|MDB_APPEND|MDB_APPENDDUP))
		return EINVAL;

	if (txn->mt_flags & (MDB_TXN_RDONLY|MDB_TXN_BLOCKED))
		return (txn->mt_flags & MDB_TXN_RDONLY) ? EACCES : MDB_BAD_TXN;

	mdb_cursor_init(&mc, txn, dbi, &mx);
	return mdb_cursor_put(&mc, key, data, flags);
}

// Assembly:
movl $0x16, %eax
testq %rdi, %rdi
je 0x99fe
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %rdx, %r15
testq %rdx, %rdx
je 0x99f0
movq %rcx, %r14
testq %rcx, %rcx
je 0x99f0
movl %esi, %edx
movq %rdi, %rsi
cmpl %edx, 0x78(%rdi)
jbe 0x99f0
movl %r8d, %ebx
testl $0xfff8ffcf, %r8d       # imm = 0xFFF8FFCF
jne 0x99f0
movq 0x70(%rsi), %rcx
movl %edx, %edi
movb (%rcx,%rdi), %cl
andb $0x10, %cl
je 0x99f0
movl 0x7c(%rsi), %eax
testl $0x20013, %eax          # imm = 0x20013
je 0x99cd
btl $0x11, %eax
movl $0xffff87c2, %ecx       # imm = 0xFFFF87C2
movl $0xd, %eax
cmovael %ecx, %eax
jmp 0x99f0
movq %rsp, %r12
leaq 0x188(%rsp), %rcx
movq %r12, %rdi
callq 0x4177
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x427c
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_default_cmp
static void
mdb_default_cmp(MDB_txn *txn, MDB_dbi dbi)
{
	uint16_t f = txn->mt_dbs[dbi].md_flags;

	txn->mt_dbxs[dbi].md_cmp =
		(f & MDB_REVERSEKEY) ? mdb_cmp_memnr :
		(f & MDB_INTEGERKEY) ? mdb_cmp_cint  : mdb_cmp_memn;

	txn->mt_dbxs[dbi].md_dcmp =
		!(f & MDB_DUPSORT) ? 0 :
		((f & MDB_INTEGERDUP)
		 ? ((f & MDB_DUPFIXED)   ? mdb_cmp_int   : mdb_cmp_cint)
		 : ((f & MDB_REVERSEDUP) ? mdb_cmp_memnr : mdb_cmp_memn));
}

// Assembly:
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rdx
movl %esi, %ecx
movq %rcx, %rsi
shlq $0x4, %rsi
leaq (%rsi,%rsi,2), %r9
movzwl 0x4(%rdx,%r9), %esi
testb $0x8, %sil
leaq 0x2119(%rip), %rdi      # 0xbe6d
leaq 0xcb9(%rip), %r8        # 0xaa14
movq %r8, %r10
cmoveq %rdi, %r10
testb $0x2, %sil
leaq 0x20a7(%rip), %rdx      # 0xbe14
cmovneq %rdx, %r10
movq %r10, 0x10(%rax,%r9)
testb $0x4, %sil
jne 0x9d80
xorl %edx, %edx
jmp 0x9d9f
testb $0x20, %sil
jne 0x9d90
testb $0x40, %sil
cmoveq %rdi, %rdx
jmp 0x9d9f
testb $0x10, %sil
leaq -0x6d62(%rip), %rdx     # 0x3039
cmoveq %r8, %rdx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq %rdx, 0x18(%rax,%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_dbi_close
void mdb_dbi_close(MDB_env *env, MDB_dbi dbi)
{
	char *ptr;
	if (dbi < CORE_DBS || dbi >= env->me_maxdbs)
		return;
	ptr = env->me_dbxs[dbi].md_name.mv_data;
	/* If there was no name, this was already closed */
	if (ptr) {
		env->me_dbxs[dbi].md_name.mv_data = NULL;
		env->me_dbxs[dbi].md_name.mv_size = 0;
		env->me_dbflags[dbi] = 0;
		env->me_dbiseqs[dbi]++;
		free(ptr);
	}
}

// Assembly:
cmpl $0x2, %esi
jb 0x9df8
cmpl %esi, 0x24(%rdi)
jbe 0x9df8
movq 0x88(%rdi), %rdx
movl %esi, %ecx
leaq (%rcx,%rcx,2), %rsi
shlq $0x4, %rsi
movq 0x8(%rdx,%rsi), %rax
testq %rax, %rax
je 0x9df8
xorps %xmm0, %xmm0
movups %xmm0, (%rdx,%rsi)
movq 0x90(%rdi), %rdx
movw $0x0, (%rdx,%rcx,2)
movq 0x98(%rdi), %rdx
incl (%rdx,%rcx,4)
movq %rax, %rdi
jmp 0x2030
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_drop
int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del)
{
	MDB_cursor *mc, *m2;
	int rc;

	if ((unsigned)del > 1 || !TXN_DBI_EXIST(txn, dbi, DB_USRVALID))
		return EINVAL;

	if (F_ISSET(txn->mt_flags, MDB_TXN_RDONLY))
		return EACCES;

	if (TXN_DBI_CHANGED(txn, dbi))
		return MDB_BAD_DBI;

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

	rc = mdb_drop0(mc, mc->mc_db->md_flags & MDB_DUPSORT);
	/* Invalidate the dropped DB's cursors */
	for (m2 = txn->mt_cursors[dbi]; m2; m2 = m2->mc_next)
		m2->mc_flags &= ~(C_INITIALIZED|C_EOF);
	if (rc)
		goto leave;

	/* Can't delete the main DB */
	if (del && dbi >= CORE_DBS) {
		rc = mdb_del0(txn, MAIN_DBI, &mc->mc_dbx->md_name, NULL, F_SUBDATA);
		if (!rc) {
			txn->mt_dbflags[dbi] = DB_STALE;
			mdb_dbi_close(txn->mt_env, dbi);
		} else {
			txn->mt_flags |= MDB_TXN_ERROR;
		}
	} else {
		/* reset the DB record, mark it dirty */
		txn->mt_dbflags[dbi] |= DB_DIRTY;
		txn->mt_dbs[dbi].md_depth = 0;
		txn->mt_dbs[dbi].md_branch_pages = 0;
		txn->mt_dbs[dbi].md_leaf_pages = 0;
		txn->mt_dbs[dbi].md_overflow_pages = 0;
		txn->mt_dbs[dbi].md_entries = 0;
		txn->mt_dbs[dbi].md_root = P_INVALID;

		txn->mt_flags |= MDB_TXN_DIRTY;
	}
leave:
	mdb_cursor_close(mc);
	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0x2, %edx
setae %al
testq %rdi, %rdi
sete %cl
movl $0x16, %r14d
orb %al, %cl
jne 0x9f94
movl %esi, %ebp
movq %rdi, %rbx
cmpl %esi, 0x78(%rdi)
jbe 0x9f94
movq 0x70(%rbx), %rax
movl %ebp, %r12d
testb $0x10, (%rax,%r12)
je 0x9f94
movl $0xd, %r14d
testb $0x2, 0x7e(%rbx)
jne 0x9f94
movq 0x20(%rbx), %rax
movq 0x60(%rbx), %rcx
movl (%rcx,%r12,4), %ecx
movq 0x98(%rax), %rax
movl $0xffff87c4, %r14d      # imm = 0xFFFF87C4
cmpl (%rax,%r12,4), %ecx
jne 0x9f94
movl %edx, %r15d
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x962c
movl %eax, %r14d
testl %eax, %eax
jne 0x9f94
movq 0x8(%rsp), %rdi
movq 0x28(%rdi), %rax
movzwl 0x4(%rax), %esi
andl $0x4, %esi
callq 0x91ac
movl %eax, %r14d
movq 0x68(%rbx), %rax
movq (%rax,%r12,8), %rax
testq %rax, %rax
je 0x9ef4
andb $-0x4, 0x44(%rax)
movq (%rax), %rax
jmp 0x9ee6
testl %r14d, %r14d
jne 0x9f8a
testl %r15d, %r15d
sete %al
cmpl $0x2, %ebp
setb %cl
orb %al, %cl
jne 0x9f3b
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdx
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0x98a6
testl %eax, %eax
je 0x9f76
orb $0x2, 0x7c(%rbx)
movl %eax, %r14d
jmp 0x9f8a
movq 0x70(%rbx), %rax
orb $0x1, (%rax,%r12)
movq 0x58(%rbx), %rax
leaq (%r12,%r12,2), %rcx
shlq $0x4, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x16(%rax,%rcx)
movups %xmm0, 0x6(%rax,%rcx)
movw $0x0, 0x26(%rax,%rcx)
movq $-0x1, 0x28(%rax,%rcx)
orb $0x4, 0x7c(%rbx)
xorl %r14d, %r14d
jmp 0x9f8a
movq 0x70(%rbx), %rax
movb $0x2, (%rax,%r12)
movq 0x20(%rbx), %rdi
movl %ebp, %esi
callq 0x9dad
movq 0x8(%rsp), %rdi
callq 0x97db
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_reader_pid
static int
mdb_reader_pid(MDB_env *env, enum Pidlock_op op, MDB_PID_T pid)
{
#if !(MDB_PIDLOCK)		/* Currently the same as defined(_WIN32) */
	int ret = 0;
	HANDLE h;
	if (op == Pidcheck) {
		h = OpenProcess(env->me_pidquery, FALSE, pid);
		/* No documented "no such process" code, but other program use this: */
		if (!h)
			return ErrCode() != ERROR_INVALID_PARAMETER;
		/* A process exists until all handles to it close. Has it exited? */
		ret = WaitForSingleObject(h, 0) != 0;
		CloseHandle(h);
	}
	return ret;
#else
	for (;;) {
		int rc;
		struct flock lock_info;
		memset(&lock_info, 0, sizeof(lock_info));
		lock_info.l_type = F_WRLCK;
		lock_info.l_whence = SEEK_SET;
		lock_info.l_start = pid;
		lock_info.l_len = 1;
		if ((rc = fcntl(env->me_lfd, op, &lock_info)) == 0) {
			if (op == F_GETLK && lock_info.l_type != F_UNLCK)
				rc = -1;
		} else if ((rc = ErrCode()) == EINTR) {
			continue;
		}
		return rc;
	}
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
movq %rdi, %r14
movslq %edx, %r12
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movl $0x1, (%rsp)
movq %r12, 0x8(%rsp)
movq $0x1, 0x10(%rsp)
movl 0x4(%r14), %edi
movl %ebx, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x20c0
testl %eax, %eax
je 0xa0c2
callq 0x2050
movl (%rax), %ecx
cmpl $0x4, %ecx
sete %al
cmovnel %ecx, %ebp
jmp 0xa0d9
cmpl $0x5, %ebx
sete %al
cmpw $0x2, (%rsp)
setne %cl
andb %al, %cl
movzbl %cl, %ebp
negl %ebp
xorl %eax, %eax
testb %al, %al
jne 0xa07b
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_dpage_free
static void
mdb_dpage_free(MDB_env *env, MDB_page *dp)
{
	if (!IS_OVERFLOW(dp) || dp->mp_pages == 1) {
		mdb_page_free(env, dp);
	} else {
		/* large pages just get freed directly */
		VGMEMP_FREE(env, dp);
		free(dp);
	}
}

// Assembly:
testb $0x4, 0xa(%rsi)
je 0xa0f8
cmpl $0x1, 0xc(%rsi)
jne 0xa10a
movq 0xc0(%rdi), %rax
movq %rax, (%rsi)
movq %rsi, 0xc0(%rdi)
retq
movq %rsi, %rdi
jmp 0x2030
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_copy
static void
mdb_page_copy(MDB_page *dst, MDB_page *src, unsigned int psize)
{
	enum { Align = sizeof(pgno_t) };
	indx_t upper = src->mp_upper, lower = src->mp_lower, unused = upper-lower;

	/* If page isn't full, just copy the used portion. Adjust
	 * alignment so memcpy may copy words instead of bytes.
	 */
	if ((unused &= -Align) && !IS_LEAF2(src)) {
		upper = (upper + PAGEBASE) & -Align;
		memcpy(dst, src, (lower + PAGEBASE + (Align-1)) & -Align);
		memcpy((pgno_t *)((char *)dst+upper), (pgno_t *)((char *)src+upper),
			psize - upper);
	} else {
		memcpy(dst, src, psize - unused);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movzwl 0xe(%rsi), %r12d
movzwl 0xc(%rsi), %edx
movl %r12d, %eax
subl %edx, %eax
andl $0xfff8, %eax           # imm = 0xFFF8
je 0xaa95
testb $0x20, 0xa(%r14)
jne 0xaa95
andl $-0x8, %r12d
addl $0x7, %edx
andl $-0x8, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2240
addq %r12, %r15
addq %r12, %r14
subl %r12d, %ebx
jmp 0xaa97
subl %eax, %ebx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2240
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_sibling
static int
mdb_cursor_sibling(MDB_cursor *mc, int move_right)
{
	int		 rc;
	MDB_node	*indx;
	MDB_page	*mp;

	if (mc->mc_snum < 2) {
		return MDB_NOTFOUND;		/* root has no siblings */
	}

	mdb_cursor_pop(mc);
	DPRINTF(("parent page is page %"Z"u, index %u",
		mc->mc_pg[mc->mc_top]->mp_pgno, mc->mc_ki[mc->mc_top]));

	if (move_right ? (mc->mc_ki[mc->mc_top] + 1u >= NUMKEYS(mc->mc_pg[mc->mc_top]))
		       : (mc->mc_ki[mc->mc_top] == 0)) {
		DPRINTF(("no more keys left, moving to %s sibling",
		    move_right ? "right" : "left"));
		if ((rc = mdb_cursor_sibling(mc, move_right)) != MDB_SUCCESS) {
			/* undo cursor_pop before returning */
			mc->mc_top++;
			mc->mc_snum++;
			return rc;
		}
	} else {
		if (move_right)
			mc->mc_ki[mc->mc_top]++;
		else
			mc->mc_ki[mc->mc_top]--;
		DPRINTF(("just moving to %s index key %u",
		    move_right ? "right" : "left", mc->mc_ki[mc->mc_top]));
	}
	mdb_cassert(mc, IS_BRANCH(mc->mc_pg[mc->mc_top]));

	indx = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
	if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(indx), &mp, NULL)) != 0) {
		/* mc will be inconsistent if caller does mc_snum++ as above */
		mc->mc_flags &= ~(C_INITIALIZED|C_EOF);
		return rc;
	}

	mdb_cursor_push(mc, mp);
	if (!move_right)
		mc->mc_ki[mc->mc_top] = NUMKEYS(mp)-1;

	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movzwl 0x40(%rdi), %ecx
movl $0xffff87b2, %eax       # imm = 0xFFFF87B2
cmpw $0x2, %cx
jb 0xabd9
movl %esi, %ebp
movq %rdi, %rbx
decw %cx
movw %cx, 0x40(%rdi)
je 0xaae0
decw 0x42(%rbx)
movzwl 0x42(%rbx), %ecx
movzwl 0x148(%rbx,%rcx,2), %eax
testl %ebp, %ebp
je 0xab23
incl %eax
movq 0x48(%rbx,%rcx,8), %rcx
movzwl 0xc(%rcx), %edx
addl $-0x10, %edx
shrl %edx
movw $0x1, %cx
cmpl %edx, %eax
jb 0xab2b
movq %rbx, %rdi
movl %ebp, %esi
callq 0xaab8
testl %eax, %eax
je 0xab37
incw 0x42(%rbx)
incw 0x40(%rbx)
jmp 0xabd9
movw $0xffff, %cx            # imm = 0xFFFF
testl %eax, %eax
je 0xab08
movzwl 0x42(%rbx), %eax
addw %cx, 0x148(%rbx,%rax,2)
movzwl 0x42(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rax
testb $0x1, 0xa(%rax)
je 0xabe0
movzwl 0x42(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rcx
movzwl 0x148(%rbx,%rax,2), %eax
movzwl 0x10(%rcx,%rax,2), %eax
movq 0x18(%rbx), %rdi
movl (%rcx,%rax), %edx
movzwl 0x4(%rcx,%rax), %esi
shlq $0x20, %rsi
orq %rdx, %rsi
movq %rsp, %rdx
xorl %ecx, %ecx
callq 0x789a
testl %eax, %eax
je 0xab87
andb $-0x4, 0x44(%rbx)
jmp 0xabd9
movq (%rsp), %rcx
movzwl 0x40(%rbx), %eax
cmpq $0x20, %rax
jb 0xab9f
movq 0x18(%rbx), %rax
orl $0x2, 0x7c(%rax)
jmp 0xabb9
leal 0x1(%rax), %edx
movw %dx, 0x40(%rbx)
movw %ax, 0x42(%rbx)
movq %rcx, 0x48(%rbx,%rax,8)
movw $0x0, 0x148(%rbx,%rax,2)
xorl %eax, %eax
testl %ebp, %ebp
jne 0xabd9
movzwl 0xc(%rcx), %ecx
addl $0x1fff0, %ecx          # imm = 0x1FFF0
shrl %ecx
decl %ecx
movzwl 0x42(%rbx), %edx
movw %cx, 0x148(%rbx,%rdx,2)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rdi
leaq 0x4e69(%rip), %rsi      # 0xfa58
leaq 0x4e83(%rip), %rdx      # 0xfa79
movl $0x1610, %ecx           # imm = 0x1610
callq 0xc43e
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_find_oldest
static txnid_t
mdb_find_oldest(MDB_txn *txn)
{
	int i;
	txnid_t mr, oldest = txn->mt_txnid - 1;
	if (txn->mt_env->me_txns) {
		MDB_reader *r = txn->mt_env->me_txns->mti_readers;
		for (i = txn->mt_env->me_txns->mti_numreaders; --i >= 0; ) {
			if (r[i].mr_pid) {
				mr = r[i].mr_txnid;
				if (oldest > mr)
					oldest = mr;
			}
		}
	}
	return oldest;
}

// Assembly:
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
decq %rax
movq 0x40(%rcx), %rdx
testq %rdx, %rdx
je 0xadd7
movslq 0x38(%rdx), %rsi
testq %rsi, %rsi
jle 0xadd7
leaq 0x1(%rsi), %rcx
shlq $0x6, %rsi
addq %rsi, %rdx
addq $0x48, %rdx
cmpl $0x0, (%rdx)
je 0xadca
movq -0x8(%rdx), %rsi
cmpq %rsi, %rax
cmovaeq %rsi, %rax
decq %rcx
addq $-0x40, %rdx
cmpq $0x1, %rcx
jg 0xadba
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_dirty
static void
mdb_page_dirty(MDB_txn *txn, MDB_page *mp)
{
	MDB_ID2 mid;
	int rc, (*insert)(MDB_ID2L, MDB_ID2 *);

	if (txn->mt_flags & MDB_TXN_WRITEMAP) {
		insert = mdb_mid2l_append;
	} else {
		insert = mdb_mid2l_insert;
	}
	mid.mid = mp->mp_pgno;
	mid.mptr = mp;
	rc = insert(txn->mt_u.dirty_list, &mid);
	mdb_tassert(txn, rc == 0);
	txn->mt_dirty_room--;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
btl $0x13, 0x7c(%rdi)
jb 0xadf0
leaq 0x157c(%rip), %rcx      # 0xc36a
jmp 0xadf7
leaq 0x15f9(%rip), %rcx      # 0xc3f0
movq (%rsi), %rdx
movq %rsp, %rax
movq %rdx, (%rax)
movq %rsi, 0x8(%rax)
movq 0x48(%rbx), %rdi
movq %rax, %rsi
callq *%rcx
testl %eax, %eax
jne 0xae1d
decl 0x80(%rbx)
addq $0x10, %rsp
popq %rbx
retq
movq 0x20(%rbx), %rdi
leaq 0x4bc2(%rip), %rsi      # 0xf9ea
leaq 0x4cda(%rip), %rdx      # 0xfb09
movl $0x829, %ecx            # imm = 0x829
callq 0xc43e
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_copy
static void
mdb_cursor_copy(const MDB_cursor *csrc, MDB_cursor *cdst)
{
	unsigned int i;

	cdst->mc_txn = csrc->mc_txn;
	cdst->mc_dbi = csrc->mc_dbi;
	cdst->mc_db  = csrc->mc_db;
	cdst->mc_dbx = csrc->mc_dbx;
	cdst->mc_snum = csrc->mc_snum;
	cdst->mc_top = csrc->mc_top;
	cdst->mc_flags = csrc->mc_flags;

	for (i=0; i<csrc->mc_snum; i++) {
		cdst->mc_pg[i] = csrc->mc_pg[i];
		cdst->mc_ki[i] = csrc->mc_ki[i];
	}
}

// Assembly:
movq 0x18(%rdi), %rax
movq %rax, 0x18(%rsi)
movl 0x20(%rdi), %eax
movl %eax, 0x20(%rsi)
movq 0x28(%rdi), %rax
movq %rax, 0x28(%rsi)
movq 0x30(%rdi), %rax
movq %rax, 0x30(%rsi)
movzwl 0x40(%rdi), %eax
movw %ax, 0x40(%rsi)
movzwl 0x42(%rdi), %eax
movw %ax, 0x42(%rsi)
movl 0x44(%rdi), %eax
movl %eax, 0x44(%rsi)
cmpw $0x0, 0x40(%rdi)
je 0xb91a
xorl %eax, %eax
movq 0x48(%rdi,%rax,8), %rcx
movq %rcx, 0x48(%rsi,%rax,8)
movzwl 0x148(%rdi,%rax,2), %ecx
movw %cx, 0x148(%rsi,%rax,2)
incq %rax
movzwl 0x40(%rdi), %ecx
cmpq %rcx, %rax
jb 0xb8f4
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_search_lowest
static int
mdb_page_search_lowest(MDB_cursor *mc)
{
	MDB_page	*mp = mc->mc_pg[mc->mc_top];
	MDB_node	*node = NODEPTR(mp, 0);
	int rc;

	if ((rc = mdb_page_get(mc->mc_txn, NODEPGNO(node), &mp, NULL)) != 0)
		return rc;

	mc->mc_ki[mc->mc_top] = 0;
	if ((rc = mdb_cursor_push(mc, mp)))
		return rc;
	return mdb_page_search_root(mc, NULL, MDB_PS_FIRST);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movzwl 0x42(%rdi), %eax
movq 0x48(%rdi,%rax,8), %rax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movzwl 0x10(%rax), %ecx
movq 0x18(%rdi), %rdi
movl (%rax,%rcx), %r8d
movzwl 0x4(%rax,%rcx), %esi
shlq $0x20, %rsi
orq %r8, %rsi
xorl %ecx, %ecx
callq 0x789a
testl %eax, %eax
jne 0xbe0e
movzwl 0x42(%rbx), %eax
movw $0x0, 0x148(%rbx,%rax,2)
movzwl 0x40(%rbx), %ecx
cmpq $0x20, %rcx
jae 0xbde7
movq 0x8(%rsp), %rax
leal 0x1(%rcx), %edx
movw %dx, 0x40(%rbx)
movw %cx, 0x42(%rbx)
movq %rax, 0x48(%rbx,%rcx,8)
movw $0x0, 0x148(%rbx,%rcx,2)
xorl %eax, %eax
jmp 0xbdf4
movq 0x18(%rbx), %rax
orl $0x2, 0x7c(%rax)
movl $0xffff87bd, %eax       # imm = 0xFFFF87BD
cmpw $0x1f, %cx
ja 0xbe0e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x4, %edx
addq $0x10, %rsp
popq %rbx
jmp 0xa809
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cmp_memnr
static int
mdb_cmp_memnr(const MDB_val *a, const MDB_val *b)
{
	const unsigned char	*p1, *p2, *p1_lim;
	ssize_t len_diff;
	int diff;

	p1_lim = (const unsigned char *)a->mv_data;
	p1 = (const unsigned char *)a->mv_data + a->mv_size;
	p2 = (const unsigned char *)b->mv_data + b->mv_size;

	len_diff = (ssize_t) a->mv_size - (ssize_t) b->mv_size;
	if (len_diff > 0) {
		p1_lim += len_diff;
		len_diff = 1;
	}

	while (p1 > p1_lim) {
		diff = *--p1 - *--p2;
		if (diff)
			return diff;
	}
	return len_diff<0 ? -1 : len_diff;
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rdi
leaq (%rdi,%rax), %rcx
movq (%rsi), %r8
movq 0x8(%rsi), %r9
subq %r8, %rax
xorl %edx, %edx
testq %rax, %rax
cmovgq %rax, %rdx
movl $0x1, %esi
cmovleq %rax, %rsi
addq %rdi, %rdx
leaq (%r8,%r9), %rdi
decq %rdi
cmpq %rdx, %rcx
jbe 0xbe5e
movzbl -0x1(%rcx), %eax
decq %rcx
movzbl (%rdi), %r8d
decq %rdi
subl %r8d, %eax
je 0xbe45
retq
testq %rsi, %rsi
movq $-0x1, %rax
cmovnsq %rsi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cmp_memn
static int
mdb_cmp_memn(const MDB_val *a, const MDB_val *b)
{
	int diff;
	ssize_t len_diff;
	unsigned int len;

	len = a->mv_size;
	len_diff = (ssize_t) a->mv_size - (ssize_t) b->mv_size;
	if (len_diff > 0) {
		len = b->mv_size;
		len_diff = 1;
	}

	diff = memcmp(a->mv_data, b->mv_data, len);
	return diff ? diff : len_diff<0 ? -1 : len_diff;
}

// Assembly:
pushq %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rdi
movq (%rsi), %rcx
movq 0x8(%rsi), %rsi
movq %rax, %rdx
subq %rcx, %rdx
testq %rdx, %rdx
movq $-0x1, %r8
cmovnsq %rdx, %r8
cmovgq %rcx, %rax
movl $0x1, %ebx
cmovlel %r8d, %ebx
movl %eax, %edx
callq 0x21e0
testl %eax, %eax
cmovel %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_alloc
MDB_IDL mdb_midl_alloc(int num)
{
	MDB_IDL ids = malloc((num+2) * sizeof(MDB_ID));
	if (ids) {
		*ids++ = num;
		*ids = 0;
	}
	return ids;
}

// Assembly:
pushq %rbx
movslq %edi, %rbx
leaq 0x10(,%rbx,8), %rdi
callq 0x2270
testq %rax, %rax
je 0xbf29
movq %rax, %rcx
addq $0x8, %rax
movq %rbx, (%rcx)
movq $0x0, 0x8(%rcx)
jmp 0xbf2b
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_shrink
void mdb_midl_shrink( MDB_IDL *idp )
{
	MDB_IDL ids = *idp;
	if (*(--ids) > MDB_IDL_UM_MAX &&
		(ids = realloc(ids, (MDB_IDL_UM_MAX+1) * sizeof(MDB_ID))))
	{
		*ids++ = MDB_IDL_UM_MAX;
		*idp = ids;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
cmpq $0x20000, -0x8(%rdi)    # imm = 0x20000
jb 0xbf71
addq $-0x8, %rdi
movl $0x100000, %esi         # imm = 0x100000
callq 0x2280
testq %rax, %rax
je 0xbf71
movq %rax, %rcx
addq $0x8, %rcx
movq $0x1ffff, (%rax)        # imm = 0x1FFFF
movq %rcx, (%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_need
int mdb_midl_need( MDB_IDL *idp, unsigned num )
{
	MDB_IDL ids = *idp;
	num += ids[0];
	if (num > ids[-1]) {
		num = (num + num/4 + (256 + 2)) & -256;
		if (!(ids = realloc(ids-1, num * sizeof(MDB_ID))))
			return ENOMEM;
		*ids++ = num - 2;
		*idp = ids;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
addl (%rdi), %esi
xorl %ebx, %ebx
cmpq %rsi, -0x8(%rdi)
jae 0xbfcd
addq $-0x8, %rdi
movl %esi, %eax
shrl $0x2, %eax
leal (%rsi,%rax), %r15d
addl $0x102, %r15d           # imm = 0x102
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
leaq (,%r15,8), %rsi
callq 0x2280
testq %rax, %rax
je 0xbfc8
addl $-0x2, %r15d
movq %rax, %rcx
addq $0x8, %rcx
movq %r15, (%rax)
movq %rcx, (%r14)
jmp 0xbfcd
movl $0xc, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_append
int mdb_midl_append( MDB_IDL *idp, MDB_ID id )
{
	MDB_IDL ids = *idp;
	/* Too big? */
	if (ids[0] >= ids[-1]) {
		if (mdb_midl_grow(idp, MDB_IDL_UM_MAX))
			return ENOMEM;
		ids = *idp;
	}
	ids[0]++;
	ids[ids[0]] = id;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %rax
movq (%rax), %rcx
cmpq -0x8(%rax), %rcx
jb 0xc003
movq %rdi, %r14
movl $0x1ffff, %esi          # imm = 0x1FFFF
callq 0xc01c
movl %eax, %ecx
movl $0xc, %eax
testl %ecx, %ecx
jne 0xc014
movq (%r14), %rax
movq (%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rax)
movq %rbx, 0x8(%rax,%rcx,8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_grow
static int mdb_midl_grow( MDB_IDL *idp, int num )
{
	MDB_IDL idn = *idp-1;
	/* grow it */
	idn = realloc(idn, (*idn + num + 2) * sizeof(MDB_ID));
	if (!idn)
		return ENOMEM;
	*idn++ += num;
	*idp = idn;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movslq %esi, %r14
movq -0x8(%rdi), %rax
addq %r14, %rax
addq $-0x8, %rdi
leaq 0x10(,%rax,8), %rsi
callq 0x2280
testq %rax, %rax
je 0xc054
addq %r14, (%rax)
addq $0x8, %rax
movq %rax, (%rbx)
xorl %eax, %eax
jmp 0xc059
movl $0xc, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_append_list
int mdb_midl_append_list( MDB_IDL *idp, MDB_IDL app )
{
	MDB_IDL ids = *idp;
	/* Too big? */
	if (ids[0] + app[0] >= ids[-1]) {
		if (mdb_midl_grow(idp, app[0]))
			return ENOMEM;
		ids = *idp;
	}
	memcpy(&ids[ids[0]+1], &app[1], app[0] * sizeof(MDB_ID));
	ids[0] += app[0];
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %r15
movq (%rsi), %rsi
movq (%r15), %rax
addq %rsi, %rax
cmpq -0x8(%r15), %rax
jb 0xc091
movq %rdi, %r14
callq 0xc01c
movl %eax, %ecx
movl $0xc, %eax
testl %ecx, %ecx
jne 0xc0b4
movq (%r14), %r15
movq (%r15), %rax
leaq (%r15,%rax,8), %rdi
addq $0x8, %rdi
leaq 0x8(%rbx), %rsi
movq (%rbx), %rdx
shlq $0x3, %rdx
callq 0x2240
movq (%rbx), %rax
addq %rax, (%r15)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_append_range
int mdb_midl_append_range( MDB_IDL *idp, MDB_ID id, unsigned n )
{
	MDB_ID *ids = *idp, len = ids[0];
	/* Too big? */
	if (len + n > ids[-1]) {
		if (mdb_midl_grow(idp, n | MDB_IDL_UM_MAX))
			return ENOMEM;
		ids = *idp;
	}
	ids[0] = len + n;
	ids += len;
	while (n)
		ids[n--] = id++;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq (%rdi), %rcx
movq (%rcx), %r12
movl %edx, %r15d
leaq (%r12,%r15), %r13
cmpq -0x8(%rcx), %r13
jbe 0xc0fb
movq %rdi, %r14
movl %ebp, %esi
orl $0x1ffff, %esi          # imm = 0x1FFFF
callq 0xc01c
movl %eax, %ecx
movl $0xc, %eax
testl %ecx, %ecx
jne 0xc121
movq (%r14), %rcx
movq %r13, (%rcx)
xorl %eax, %eax
testl %ebp, %ebp
je 0xc121
leaq (%rcx,%r12,8), %rcx
decq %r15
movq %r15, %rdx
movq %rbx, 0x8(%rcx,%r15,8)
incq %rbx
decq %rdx
testl %r15d, %r15d
movq %rdx, %r15
jne 0xc10e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_xmerge
void mdb_midl_xmerge( MDB_IDL idl, MDB_IDL merge )
{
	MDB_ID old_id, merge_id, i = merge[0], j = idl[0], k = i+j, total = k;
	idl[0] = (MDB_ID)-1;		/* delimiter for idl scan below */
	old_id = idl[j];
	while (i) {
		merge_id = merge[i--];
		for (; old_id < merge_id; old_id = idl[--j])
			idl[k--] = old_id;
		idl[k--] = merge_id;
	}
	idl[0] = total;
}

// Assembly:
movq (%rsi), %rax
movq (%rdi), %rdx
leaq (%rdx,%rax), %rcx
movq $-0x1, (%rdi)
testq %rax, %rax
je 0xc176
movq (%rdi,%rdx,8), %r9
movq %rcx, %r8
movq (%rsi,%rax,8), %r10
cmpq %r10, %r9
jae 0xc167
movq %r9, (%rdi,%r8,8)
decq %r8
movq -0x8(%rdi,%rdx,8), %r9
decq %rdx
jmp 0xc151
decq %rax
movq %r10, (%rdi,%r8,8)
decq %r8
testq %rax, %rax
jne 0xc14d
movq %rcx, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_mid2l_search
unsigned mdb_mid2l_search( MDB_ID2L ids, MDB_ID id )
{
	/*
	 * binary search of id in ids
	 * if found, returns position of id
	 * if not found, returns first position greater than id
	 */
	unsigned base = 0;
	unsigned cursor = 1;
	int val = 0;
	unsigned n = (unsigned)ids[0].mid;

	while( 0 < n ) {
		unsigned pivot = n >> 1;
		cursor = base + pivot + 1;
		val = CMP( id, ids[cursor].mid );

		if( val < 0 ) {
			n = pivot;

		} else if ( val > 0 ) {
			base = cursor;
			n -= pivot + 1;

		} else {
			return cursor;
		}
	}

	if( val > 0 ) {
		++cursor;
	}
	return cursor;
}

// Assembly:
movl (%rdi), %ecx
testl %ecx, %ecx
je 0xc364
xorl %edx, %edx
movl %ecx, %r11d
shrl %r11d
leal (%rdx,%r11), %r8d
incl %r8d
movq %r8, %r9
shlq $0x4, %r9
movq (%rdi,%r9), %r9
movb $0x1, %r10b
cmpq %rsi, %r9
jbe 0xc33d
movl %r11d, %ecx
jmp 0xc350
jae 0xc34a
notl %r11d
addl %r11d, %ecx
movl %r8d, %edx
jmp 0xc350
xorl %r10d, %r10d
movl %r8d, %eax
testb %r10b, %r10b
je 0xc363
testl %ecx, %ecx
jne 0xc318
cmpq %rsi, %r9
adcl $0x0, %r8d
movl %r8d, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_mid2l_insert
int mdb_mid2l_insert( MDB_ID2L ids, MDB_ID2 *id )
{
	unsigned x, i;

	x = mdb_mid2l_search( ids, id->mid );

	if( x < 1 ) {
		/* internal error */
		return -2;
	}

	if ( x <= ids[0].mid && ids[x].mid == id->mid ) {
		/* duplicate */
		return -1;
	}

	if ( ids[0].mid >= MDB_IDL_UM_MAX ) {
		/* too big */
		return -2;

	} else {
		/* insert id */
		ids[0].mid++;
		for (i=(unsigned)ids[0].mid; i>x; i--)
			ids[i] = ids[i-1];
		ids[x] = *id;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %r15
movq %r15, %rsi
callq 0xc310
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
testl %eax, %eax
je 0xc3e8
movl %eax, %edx
movq (%rbx), %rsi
cmpq %rdx, %rsi
jb 0xc3a5
movq %rdx, %rdi
shlq $0x4, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %r15, (%rbx,%rdi)
je 0xc3e8
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmpq $0x1fffe, %rsi          # imm = 0x1FFFE
ja 0xc3e8
leaq 0x1(%rsi), %rcx
movq %rcx, (%rbx)
cmpl %ecx, %eax
jae 0xc3da
shlq $0x4, %rsi
addq %rbx, %rsi
addq $0x10, %rsi
movups -0x10(%rsi), %xmm0
movups %xmm0, (%rsi)
addq $-0x10, %rsi
decl %ecx
cmpl %ecx, %eax
jb 0xc3c9
shlq $0x4, %rdx
movups (%r14), %xmm0
movups %xmm0, (%rbx,%rdx)
xorl %ecx, %ecx
movl %ecx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_version
char * ESECT
mdb_version(int *major, int *minor, int *patch)
{
	if (major) *major = MDB_VERSION_MAJOR;
	if (minor) *minor = MDB_VERSION_MINOR;
	if (patch) *patch = MDB_VERSION_PATCH;
	return MDB_VERSION_STRING;
}

// Assembly:
testq %rdi, %rdi
je 0xc420
movl $0x0, (%rdi)
testq %rsi, %rsi
je 0xc42b
movl $0x9, (%rsi)
testq %rdx, %rdx
je 0xc436
movl $0x10, (%rdx)
leaq 0x2bd0(%rip), %rax      # 0xf00d
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_assert_fail
static void ESECT
mdb_assert_fail(MDB_env *env, const char *expr_txt,
	const char *func, const char *file, int line)
{
	char buf[400];
	sprintf(buf, "%.100s:%d: Assertion '%.200s' failed in %.40s()",
		file, line, expr_txt, func);
	if (env->me_assert_func)
		env->me_assert_func(env, buf);
	fprintf(stderr, "%s\n", buf);
	abort();
}

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdx, %r9
movq %rsi, %r8
movq %rdi, %rbx
leaq 0x34c1(%rip), %rsi      # 0xf917
leaq 0x2f96(%rip), %rdx      # 0xf3f3
movq %rsp, %rdi
xorl %eax, %eax
callq 0x2370
movq 0xf0(%rbx), %rax
testq %rax, %rax
je 0xc47b
movq %rsp, %rsi
movq %rbx, %rdi
callq *%rax
movq 0x6b76(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x2bc0(%rip), %rsi      # 0xf04c
movq %rsp, %rdx
xorl %eax, %eax
callq 0x2220
callq 0x2040
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_create
int ESECT
mdb_env_create(MDB_env **env)
{
	MDB_env *e;

	e = calloc(1, sizeof(MDB_env));
	if (!e)
		return ENOMEM;

	e->me_maxreaders = DEFAULT_READERS;
	e->me_maxdbs = e->me_numdbs = CORE_DBS;
	e->me_fd = INVALID_HANDLE_VALUE;
	e->me_lfd = INVALID_HANDLE_VALUE;
	e->me_mfd = INVALID_HANDLE_VALUE;
#ifdef MDB_USE_POSIX_SEM
	e->me_rmutex = SEM_FAILED;
	e->me_wmutex = SEM_FAILED;
#elif defined MDB_USE_SYSV_SEM
	e->me_rmutex->semid = -1;
	e->me_wmutex->semid = -1;
#endif
	e->me_pid = getpid();
	GET_PAGESIZE(e->me_os_psize);
	VGMEMP_CREATE(e,0,0);
	*env = e;
	return MDB_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %edi
movl $0xf8, %esi
callq 0x2200
testq %rax, %rax
je 0xc4fb
movq %rax, %r14
movl $0x7e, 0x18(%rax)
movabsq $0x200000002, %rax      # imm = 0x200000002
movq %rax, 0x20(%r14)
movq $-0x1, (%r14)
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
callq 0x20e0
movl %eax, 0x28(%r14)
movl $0x1e, %edi
callq 0x2320
movl %eax, 0x14(%r14)
movq %r14, (%rbx)
xorl %eax, %eax
jmp 0xc500
movl $0xc, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_set_mapsize
int ESECT
mdb_env_set_mapsize(MDB_env *env, size_t size)
{
	/* If env is already open, caller is responsible for making
	 * sure there are no active txns.
	 */
	if (env->me_map) {
		int rc;
		MDB_meta *meta;
		void *old;
		if (env->me_txn)
			return EINVAL;
		meta = mdb_env_pick_meta(env);
		if (!size)
			size = meta->mm_mapsize;
		{
			/* Silently round up to minimum if the size is too small */
			size_t minsize = (meta->mm_last_pg + 1) * env->me_psize;
			if (size < minsize)
				size = minsize;
		}
		munmap(env->me_map, env->me_mapsize);
		env->me_mapsize = size;
		old = (env->me_flags & MDB_FIXEDMAP) ? env->me_map : NULL;
		rc = mdb_env_map(env, old);
		if (rc)
			return rc;
	}
	env->me_mapsize = size;
	if (env->me_psize)
		env->me_maxpg = env->me_mapsize / env->me_psize;
	return MDB_SUCCESS;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0xc59f
cmpq $0x0, 0x60(%rbx)
je 0xc52f
movl $0x16, %ecx
xorl %eax, %eax
jmp 0xc59b
movq 0x48(%rbx), %rax
movq 0x80(%rax), %rax
movq 0x50(%rbx), %rcx
xorl %edx, %edx
cmpq 0x80(%rcx), %rax
setb %dl
movq 0x48(%rbx,%rdx,8), %rax
testq %r14, %r14
jne 0xc558
movq 0x10(%rax), %r14
movq %r14, %rcx
movq 0x78(%rax), %rax
incq %rax
movl 0x10(%rbx), %r14d
imulq %rax, %r14
cmpq %r14, %rcx
cmovaq %rcx, %r14
movq 0x70(%rbx), %rsi
callq 0x2290
movq %r14, 0x70(%rbx)
testb $0x1, 0xc(%rbx)
jne 0xc588
xorl %esi, %esi
jmp 0xc58c
movq 0x38(%rbx), %rsi
movq %rbx, %rdi
callq 0xc5c6
movl %eax, %ecx
testl %eax, %eax
sete %al
testb %al, %al
je 0xc5bc
movq %r14, 0x70(%rbx)
movl 0x10(%rbx), %esi
xorl %ecx, %ecx
testq %rsi, %rsi
je 0xc5bc
movq %r14, %rax
xorl %edx, %edx
divq %rsi
movq %rax, 0x80(%rbx)
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_share_locks
static int ESECT
mdb_env_share_locks(MDB_env *env, int *excl)
{
	int rc = 0;
	MDB_meta *meta = mdb_env_pick_meta(env);

	env->me_txns->mti_txnid = meta->mm_txnid;

#ifdef _WIN32
	{
		OVERLAPPED ov;
		/* First acquire a shared lock. The Unlock will
		 * then release the existing exclusive lock.
		 */
		memset(&ov, 0, sizeof(ov));
		if (!LockFileEx(env->me_lfd, 0, 0, 1, 0, &ov)) {
			rc = ErrCode();
		} else {
			UnlockFile(env->me_lfd, 0, 0, 1, 0);
			*excl = 0;
		}
	}
#else
	{
		struct flock lock_info;
		/* The shared lock replaces the existing lock */
		memset((void *)&lock_info, 0, sizeof(lock_info));
		lock_info.l_type = F_RDLCK;
		lock_info.l_whence = SEEK_SET;
		lock_info.l_start = 0;
		lock_info.l_len = 1;
		while ((rc = fcntl(env->me_lfd, F_SETLK, &lock_info)) &&
				(rc = ErrCode()) == EINTR) ;
		*excl = rc ? -1 : 0;	/* error may mean we lost the lock */
	}
#endif

	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x48(%rdi), %rax
movq 0x80(%rax), %rax
movq 0x50(%rdi), %rcx
xorl %edx, %edx
cmpq 0x80(%rcx), %rax
setb %dl
movq 0x48(%rdi,%rdx,8), %rax
movq 0x80(%rax), %rax
movq 0x40(%rdi), %rcx
movq %rax, 0x30(%rcx)
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq $0x1, 0x10(%r15)
xorl %ebp, %ebp
movl 0x4(%r14), %edi
movl $0x6, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x20c0
testl %eax, %eax
je 0xd058
callq 0x2050
movl (%rax), %eax
cmpl $0x4, %eax
je 0xd033
jmp 0xd05a
xorl %eax, %eax
movl %eax, %ecx
negl %ecx
sbbl %ebp, %ebp
movl %ebp, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_close
void ESECT
mdb_env_close(MDB_env *env)
{
	MDB_page *dp;

	if (env == NULL)
		return;

	VGMEMP_DESTROY(env);
	while ((dp = env->me_dpages) != NULL) {
		VGMEMP_DEFINED(&dp->mp_next, sizeof(dp->mp_next));
		env->me_dpages = dp->mp_next;
		free(dp);
	}

	mdb_env_close0(env, 0);
	free(env);
}

// Assembly:
testq %rdi, %rdi
je 0xd1fb
pushq %rbx
movq %rdi, %rbx
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0xd1ea
movq (%rdi), %rax
movq %rax, 0xc0(%rbx)
callq 0x2030
jmp 0xd1cd
movq %rbx, %rdi
callq 0xd06d
movq %rbx, %rdi
popq %rbx
jmp 0x2030
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_copy2
int ESECT
mdb_env_copy2(MDB_env *env, const char *path, unsigned int flags)
{
	int rc, len;
	char *lpath;
	HANDLE newfd = INVALID_HANDLE_VALUE;

	if (env->me_flags & MDB_NOSUBDIR) {
		lpath = (char *)path;
	} else {
		len = strlen(path);
		len += sizeof(DATANAME);
		lpath = malloc(len);
		if (!lpath)
			return ENOMEM;
		sprintf(lpath, "%s" DATANAME, path);
	}

	/* The destination path must exist, but the destination file must not.
	 * We don't want the OS to cache the writes, since the source data is
	 * already in the OS cache.
	 */
#ifdef _WIN32
	newfd = CreateFileA(lpath, GENERIC_WRITE, 0, NULL, CREATE_NEW,
				FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH, NULL);
#else
	newfd = open(lpath, O_WRONLY|O_CREAT|O_EXCL, 0666);
#endif
	if (newfd == INVALID_HANDLE_VALUE) {
		rc = ErrCode();
		goto leave;
	}

	if (env->me_psize >= env->me_os_psize) {
#ifdef O_DIRECT
	/* Set O_DIRECT if the file system supports it */
	if ((rc = fcntl(newfd, F_GETFL)) != -1)
		(void) fcntl(newfd, F_SETFL, rc | O_DIRECT);
#endif
#ifdef F_NOCACHE	/* __APPLE__ */
	rc = fcntl(newfd, F_NOCACHE, 1);
	if (rc) {
		rc = ErrCode();
		goto leave;
	}
#endif
	}

	rc = mdb_env_copyfd2(env, newfd, flags);

leave:
	if (!(env->me_flags & MDB_NOSUBDIR))
		free(lpath);
	if (newfd != INVALID_HANDLE_VALUE)
		if (close(newfd) < 0 && rc == MDB_SUCCESS)
			rc = ErrCode();

	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
testb $0x40, 0xd(%rdi)
jne 0xd75f
movq %rbx, %rdi
callq 0x2110
addl $0xa, %eax
movslq %eax, %rdi
callq 0x2270
testq %rax, %rax
je 0xd7fe
movq %rax, %r15
leaq 0x1cbe(%rip), %rsi      # 0xf40d
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2370
movq %r15, %rbx
movq %rbx, %rdi
movl $0xc1, %esi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x2310
movl %eax, %r15d
cmpl $-0x1, %eax
je 0xd7c0
movl 0x10(%r14), %eax
cmpl 0x14(%r14), %eax
jb 0xd7af
movl %r15d, %edi
movl $0x3, %esi
xorl %eax, %eax
callq 0x20c0
cmpl $-0x1, %eax
je 0xd7af
orl $0x4000, %eax           # imm = 0x4000
movl %r15d, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x20c0
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xd1fc
movl %eax, %ebp
jmp 0xd7c7
callq 0x2050
movl (%rax), %ebp
testb $0x40, 0xd(%r14)
jne 0xd7d6
movq %rbx, %rdi
callq 0x2030
cmpl $-0x1, %r15d
je 0xd803
movl %r15d, %edi
callq 0x21a0
testl %eax, %eax
sets %al
testl %ebp, %ebp
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd803
callq 0x2050
movl (%rax), %ebp
jmp 0xd803
movl $0xc, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_set_flags
int ESECT
mdb_env_set_flags(MDB_env *env, unsigned int flag, int onoff)
{
	if (flag & ~CHANGEABLE)
		return EINVAL;
	if (onoff)
		env->me_flags |= flag;
	else
		env->me_flags &= ~flag;
	return MDB_SUCCESS;
}

// Assembly:
movl $0x16, %eax
testl $0xfeeaffff, %esi       # imm = 0xFEEAFFFF
je 0xd825
retq
testl %edx, %edx
je 0xd82e
orl %esi, 0xc(%rdi)
jmp 0xd833
notl %esi
andl %esi, 0xc(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_stat
int ESECT
mdb_env_stat(MDB_env *env, MDB_stat *arg)
{
	MDB_meta *meta;

	if (env == NULL || arg == NULL)
		return EINVAL;

	meta = mdb_env_pick_meta(env);

	return mdb_stat0(env, &meta->mm_dbs[MAIN_DBI], arg);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0x16, %eax
jne 0xd930
movq 0x48(%rdi), %rax
movq 0x80(%rax), %rax
movq 0x50(%rdi), %rcx
xorl %edx, %edx
cmpq 0x80(%rcx), %rax
setb %dl
movq 0x48(%rdi,%rdx,8), %rax
movl 0x10(%rdi), %ecx
movl %ecx, (%rsi)
movzwl 0x4e(%rax), %ecx
movl %ecx, 0x4(%rsi)
movq 0x50(%rax), %rcx
movq %rcx, 0x8(%rsi)
movq 0x58(%rax), %rcx
movq %rcx, 0x10(%rsi)
movq 0x60(%rax), %rcx
movq %rcx, 0x18(%rsi)
movq 0x68(%rax), %rax
movq %rax, 0x20(%rsi)
xorl %eax, %eax
retq