LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb_stat.c
// Function: prstat
static void prstat(MDB_stat *ms)
{
#if 0
	printf("  Page size: %u\n", ms->ms_psize);
#endif
	printf("  Tree depth: %u\n", ms->ms_depth);
	printf("  Branch pages: %"Z"u\n", ms->ms_branch_pages);
	printf("  Leaf pages: %"Z"u\n", ms->ms_leaf_pages);
	printf("  Overflow pages: %"Z"u\n", ms->ms_overflow_pages);
	printf("  Entries: %"Z"u\n", ms->ms_entries);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %esi
leaq 0xb5c9(%rip), %rdi      # 0xe289
xorl %eax, %eax
callq 0x2130
movq 0x8(%rbx), %rsi
leaq 0xb5c9(%rip), %rdi      # 0xe29b
xorl %eax, %eax
callq 0x2130
movq 0x10(%rbx), %rsi
leaq 0xb5cc(%rip), %rdi      # 0xe2b0
xorl %eax, %eax
callq 0x2130
movq 0x18(%rbx), %rsi
leaq 0xb5cd(%rip), %rdi      # 0xe2c3
xorl %eax, %eax
callq 0x2130
movq 0x20(%rbx), %rsi
leaq 0xb5d2(%rip), %rdi      # 0xe2da
xorl %eax, %eax
popq %rbx
jmp 0x2130
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_sync
int
mdb_env_sync(MDB_env *env, int force)
{
	int rc = 0;
	if (env->me_flags & MDB_RDONLY)
		return EACCES;
	if (force || !F_ISSET(env->me_flags, MDB_NOSYNC)) {
		if (env->me_flags & MDB_WRITEMAP) {
			int flags = ((env->me_flags & MDB_MAPASYNC) && !force)
				? MS_ASYNC : MS_SYNC;
			if (MDB_MSYNC(env->me_map, env->me_mapsize, flags))
				rc = ErrCode();
#ifdef _WIN32
			else if (flags == MS_SYNC && MDB_FDATASYNC(env->me_fd))
				rc = ErrCode();
#endif
		} else {
#ifdef BROKEN_FDATASYNC
			if (env->me_flags & MDB_FSYNCONLY) {
				if (fsync(env->me_fd))
					rc = ErrCode();
			} else
#endif
			if (MDB_FDATASYNC(env->me_fd))
				rc = ErrCode();
		}
	}
	return rc;
}

// Assembly:
pushq %rbx
movl 0xc(%rdi), %eax
btl $0x11, %eax
jb 0x2ded
testl %esi, %esi
sete %cl
movl %eax, %edx
shrl $0x10, %edx
andl $0x1, %edx
xorl %ebx, %ebx
testb %dl, %cl
jne 0x2e29
btl $0x13, %eax
jb 0x2df2
btl $0x1b, %eax
movl (%rdi), %edi
jb 0x2e19
callq 0x2060
jmp 0x2e1e
pushq $0xd
popq %rbx
jmp 0x2e29
xorl %ecx, %ecx
btl $0x14, %eax
setae %cl
testl %esi, %esi
leal 0x1(%rcx,%rcx,2), %eax
pushq $0x4
popq %rdx
cmovel %eax, %edx
movq 0x38(%rdi), %rax
movq 0x70(%rdi), %rsi
movq %rax, %rdi
callq 0x2100
jmp 0x2e1e
callq 0x22f0
testl %eax, %eax
je 0x2e29
callq 0x2050
movl (%rax), %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_txn_abort
void
mdb_txn_abort(MDB_txn *txn)
{
	if (txn == NULL)
		return;

	if (txn->mt_child)
		mdb_txn_abort(txn->mt_child);

	mdb_txn_end(txn, MDB_END_ABORT|MDB_END_SLOT|MDB_END_FREE);
}

// Assembly:
testq %rdi, %rdi
je 0x37c1
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x37b3
callq 0x379c
movq %rbx, %rdi
movl $0x200022, %esi         # imm = 0x200022
popq %rbx
jmp 0x351c
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursors_close
static void
mdb_cursors_close(MDB_txn *txn, unsigned merge)
{
	MDB_cursor **cursors = txn->mt_cursors, *mc, *next, *bk;
	MDB_xcursor *mx;
	int i;

	for (i = txn->mt_numdbs; --i >= 0; ) {
		for (mc = cursors[i]; mc; mc = next) {
			next = mc->mc_next;
			if ((bk = mc->mc_backup) != NULL) {
				if (merge) {
					/* Commit changes to parent txn */
					mc->mc_next = bk->mc_next;
					mc->mc_backup = bk->mc_backup;
					mc->mc_txn = bk->mc_txn;
					mc->mc_db = bk->mc_db;
					mc->mc_dbflag = bk->mc_dbflag;
					if ((mx = mc->mc_xcursor) != NULL)
						mx->mx_cursor.mc_txn = bk->mc_txn;
				} else {
					/* Abort nested txn */
					*mc = *bk;
					if ((mx = mc->mc_xcursor) != NULL)
						*mx = *(MDB_xcursor *)(bk+1);
				}
				mc = bk;
			}
			/* Only malloced cursors are permanently tracked. */
			free(mc);
		}
		cursors[i] = NULL;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x68(%rdi), %r12
movl 0x78(%rdi), %r13d
testl %r13d, %r13d
jle 0x4442
decq %r13
movq (%r12,%r13,8), %rbp
testq %rbp, %rbp
je 0x4438
movq %rbp, %r15
movq (%rbp), %rbp
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x43fc
testl %ebx, %ebx
je 0x4401
movups (%r14), %xmm0
movups %xmm0, (%r15)
movq 0x18(%r14), %rax
movq %rax, 0x18(%r15)
movq 0x28(%r14), %rcx
movq %rcx, 0x28(%r15)
movq 0x38(%r14), %rcx
movq %rcx, 0x38(%r15)
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0x442b
movq %rax, 0x18(%rcx)
jmp 0x442b
movq %r15, %r14
jmp 0x442b
movl $0x188, %edx            # imm = 0x188
movq %r15, %rdi
movq %r14, %rsi
callq 0x2240
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x442b
leaq 0x188(%r14), %rsi
movl $0x1f0, %edx            # imm = 0x1F0
callq 0x2240
movq %r14, %rdi
callq 0x2030
jmp 0x43b4
andq $0x0, (%r12,%r13,8)
jmp 0x43a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_init
static void
mdb_cursor_init(MDB_cursor *mc, MDB_txn *txn, MDB_dbi dbi, MDB_xcursor *mx)
{
	mc->mc_next = NULL;
	mc->mc_backup = NULL;
	mc->mc_dbi = dbi;
	mc->mc_txn = txn;
	mc->mc_db = &txn->mt_dbs[dbi];
	mc->mc_dbx = &txn->mt_dbxs[dbi];
	mc->mc_dbflag = &txn->mt_dbflags[dbi];
	mc->mc_snum = 0;
	mc->mc_top = 0;
	mc->mc_pg[0] = 0;
	mc->mc_ki[0] = 0;
	mc->mc_flags = 0;
	if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT) {
		mdb_tassert(txn, mx != NULL);
		mc->mc_xcursor = mx;
		mdb_xcursor_init0(mc);
	} else {
		mc->mc_xcursor = NULL;
	}
	if (*mc->mc_dbflag & DB_STALE) {
		mdb_page_search(mc, NULL, MDB_PS_ROOTONLY);
	}
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movl %edx, 0x20(%rdi)
movq %rsi, 0x18(%rdi)
movl %edx, %eax
imulq $0x30, %rax, %r8
movq 0x58(%rsi), %r9
addq %r8, %r9
movq %r9, 0x28(%rdi)
movq 0x50(%rsi), %r9
addq %r8, %r9
movq %r9, 0x30(%rdi)
addq 0x70(%rsi), %rax
movq %rax, 0x38(%rdi)
andw $0x0, 0x148(%rdi)
movups %xmm0, 0x40(%rdi)
movq 0x58(%rsi), %r9
testb $0x4, 0x4(%r9,%r8)
jne 0x44a1
andq $0x0, 0x10(%rdi)
jmp 0x4512
testq %rcx, %rcx
je 0x4522
movq %rcx, 0x10(%rdi)
andq $0x0, 0x10(%rcx)
movq %rsi, 0x18(%rcx)
leaq 0x188(%rcx), %rax
movq %rax, 0x28(%rcx)
leaq 0x1b8(%rcx), %rax
movq %rax, 0x30(%rcx)
movl %edx, 0x20(%rcx)
leaq 0x1e8(%rcx), %rax
movq %rax, 0x38(%rcx)
movabsq $0x400000000, %rax      # imm = 0x400000000
movq %rax, 0x40(%rcx)
movups %xmm0, 0x1b8(%rcx)
movq 0x30(%rdi), %rax
movq 0x18(%rax), %rdx
movq %rdx, 0x1c8(%rcx)
andq $0x0, 0x1d0(%rcx)
movq 0x20(%rax), %rax
movq %rax, 0x1d8(%rcx)
movq 0x38(%rdi), %rax
testb $0x2, (%rax)
jne 0x4518
retq
pushq $0x2
popq %rdx
xorl %esi, %esi
jmp 0x958a
pushq %rax
movq 0x20(%rsi), %rdi
leaq 0xa697(%rip), %rsi      # 0xebc5
leaq 0xa69b(%rip), %rdx      # 0xebd0
movl $0x1caf, %ecx           # imm = 0x1CAF
callq 0xb672
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_get
int
mdb_get(MDB_txn *txn, MDB_dbi dbi,
    MDB_val *key, MDB_val *data)
{
	MDB_cursor	mc;
	MDB_xcursor	mx;
	int exact = 0;
	DKBUF;

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

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

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

	mdb_cursor_init(&mc, txn, dbi, &mx);
	return mdb_cursor_set(&mc, key, data, MDB_SET, &exact);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x380, %rsp            # imm = 0x380
andl $0x0, 0x4(%rsp)
pushq $0x16
popq %rax
testq %rdi, %rdi
je 0x560c
movq %rdx, %r14
testq %rdx, %rdx
je 0x560c
movq %rcx, %rbx
testq %rcx, %rcx
je 0x560c
movl %esi, %edx
movq %rdi, %rsi
cmpl %edx, 0x78(%rdi)
jbe 0x560c
movq 0x70(%rsi), %rcx
movl %edx, %edi
testb $0x10, (%rcx,%rdi)
je 0x560c
movl $0xffff87c2, %eax       # imm = 0xFFFF87C2
testb $0x13, 0x7c(%rsi)
jne 0x560c
leaq 0x8(%rsp), %r15
leaq 0x190(%rsp), %rcx
movq %r15, %rdi
callq 0x4451
pushq $0xf
popq %rcx
leaq 0x4(%rsp), %r8
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5619
addq $0x380, %rsp            # imm = 0x380
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_xcursor_init1
static void
mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node)
{
	MDB_xcursor *mx = mc->mc_xcursor;

	if (node->mn_flags & F_SUBDATA) {
		memcpy(&mx->mx_db, NODEDATA(node), sizeof(MDB_db));
		mx->mx_cursor.mc_pg[0] = 0;
		mx->mx_cursor.mc_snum = 0;
		mx->mx_cursor.mc_top = 0;
		mx->mx_cursor.mc_flags = C_SUB;
	} else {
		MDB_page *fp = NODEDATA(node);
		mx->mx_db.md_pad = 0;
		mx->mx_db.md_flags = 0;
		mx->mx_db.md_depth = 1;
		mx->mx_db.md_branch_pages = 0;
		mx->mx_db.md_leaf_pages = 1;
		mx->mx_db.md_overflow_pages = 0;
		mx->mx_db.md_entries = NUMKEYS(fp);
		COPY_PGNO(mx->mx_db.md_root, fp->mp_pgno);
		mx->mx_cursor.mc_snum = 1;
		mx->mx_cursor.mc_top = 0;
		mx->mx_cursor.mc_flags = C_INITIALIZED|C_SUB;
		mx->mx_cursor.mc_pg[0] = fp;
		mx->mx_cursor.mc_ki[0] = 0;
		if (mc->mc_db->md_flags & MDB_DUPFIXED) {
			mx->mx_db.md_flags = MDB_DUPFIXED;
			mx->mx_db.md_pad = fp->mp_pad;
			if (mc->mc_db->md_flags & MDB_INTEGERDUP)
				mx->mx_db.md_flags |= MDB_INTEGERKEY;
		}
	}
	DPRINTF(("Sub-db -%u root page %"Z"u", mx->mx_cursor.mc_dbi,
		mx->mx_db.md_root));
	mx->mx_dbflag = DB_VALID|DB_USRVALID|DB_DIRTY; /* DB_DIRTY guides mdb_cursor_touch */
#if UINT_MAX < SIZE_MAX
	if (mx->mx_dbx.md_cmp == mdb_cmp_int && mx->mx_db.md_pad == sizeof(size_t))
		mx->mx_dbx.md_cmp = mdb_cmp_clong;
#endif
}

// Assembly:
movq 0x10(%rdi), %rax
testb $0x2, 0x4(%rsi)
jne 0x5f34
movzwl 0x6(%rsi), %ecx
andl $0x0, 0x188(%rax)
addq %rsi, %rcx
addq $0x8, %rcx
andw $0x0, 0x18c(%rax)
movw $0x1, 0x18e(%rax)
andq $0x0, 0x190(%rax)
movq $0x1, 0x198(%rax)
andq $0x0, 0x1a0(%rax)
movzwl 0xc(%rcx), %edx
addl $-0x10, %edx
shrl %edx
movq %rdx, 0x1a8(%rax)
movq (%rcx), %rdx
movq %rdx, 0x1b0(%rax)
movabsq $0x500000001, %rdx      # imm = 0x500000001
movq %rdx, 0x40(%rax)
movq %rcx, 0x48(%rax)
andw $0x0, 0x148(%rax)
movq 0x28(%rdi), %rdx
testb $0x10, 0x4(%rdx)
je 0x5f6f
movw $0x10, 0x18c(%rax)
movzwl 0x8(%rcx), %ecx
movl %ecx, 0x188(%rax)
testb $0x20, 0x4(%rdx)
je 0x5f6f
movw $0x18, 0x18c(%rax)
jmp 0x5f6f
movzwl 0x6(%rsi), %ecx
movups 0x8(%rsi,%rcx), %xmm0
movups 0x18(%rsi,%rcx), %xmm1
movups 0x28(%rsi,%rcx), %xmm2
movups %xmm2, 0x1a8(%rax)
movups %xmm1, 0x198(%rax)
movups %xmm0, 0x188(%rax)
andq $0x0, 0x48(%rax)
movabsq $0x400000000, %rcx      # imm = 0x400000000
movq %rcx, 0x40(%rax)
movb $0x19, 0x1e8(%rax)
leaq -0x31f4(%rip), %rcx     # 0x2d89
cmpq %rcx, 0x1c8(%rax)
je 0x5f87
retq
cmpl $0x8, 0x188(%rax)
jne 0x5f86
leaq -0x31f6(%rip), %rcx     # 0x2da1
movq %rcx, 0x1c8(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_node_read
static int
mdb_node_read(MDB_txn *txn, MDB_node *leaf, MDB_val *data)
{
	MDB_page	*omp;		/* overflow page */
	pgno_t		 pgno;
	int rc;

	if (!F_ISSET(leaf->mn_flags, F_BIGDATA)) {
		data->mv_size = NODEDSZ(leaf);
		data->mv_data = NODEDATA(leaf);
		return MDB_SUCCESS;
	}

	/* Read overflow data.
	 */
	data->mv_size = NODEDSZ(leaf);
	memcpy(&pgno, NODEDATA(leaf), sizeof(pgno));
	if ((rc = mdb_page_get(txn, pgno, &omp, NULL)) != 0) {
		DPRINTF(("read overflow page %"Z"u failed", pgno));
		return rc;
	}
	data->mv_data = METADATA(omp);

	return MDB_SUCCESS;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movzwl 0x4(%rsi), %ecx
movl (%rsi), %eax
movq %rax, (%rdx)
movzwl 0x6(%rsi), %eax
addq %rsi, %rax
addq $0x8, %rax
testb $0x1, %cl
je 0x5fdc
movq (%rax), %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x6fba
testl %eax, %eax
jne 0x5fe2
movq 0x8(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x8(%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_first
static int
mdb_cursor_first(MDB_cursor *mc, MDB_val *key, MDB_val *data)
{
	int		 rc;
	MDB_node	*leaf;

	if (mc->mc_xcursor)
		mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);

	if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) {
		rc = mdb_page_search(mc, NULL, MDB_PS_FIRST);
		if (rc != MDB_SUCCESS)
			return rc;
	}
	mdb_cassert(mc, IS_LEAF(mc->mc_pg[mc->mc_top]));

	leaf = NODEPTR(mc->mc_pg[mc->mc_top], 0);
	mc->mc_flags |= C_INITIALIZED;
	mc->mc_flags &= ~C_EOF;

	mc->mc_ki[mc->mc_top] = 0;

	if (IS_LEAF2(mc->mc_pg[mc->mc_top])) {
		key->mv_size = mc->mc_db->md_pad;
		key->mv_data = LEAF2KEY(mc->mc_pg[mc->mc_top], 0, key->mv_size);
		return MDB_SUCCESS;
	}

	if (data) {
		if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
			mdb_xcursor_init1(mc, leaf);
			rc = mdb_cursor_first(&mc->mc_xcursor->mx_cursor, data, NULL);
			if (rc)
				return rc;
		} else {
			if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
				return rc;
		}
	}
	MDB_GET_KEY(leaf, key);
	return MDB_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x6006
andb $-0x4, 0x44(%rax)
testb $0x1, 0x44(%r12)
je 0x6017
cmpw $0x0, 0x42(%r12)
je 0x6034
pushq $0x4
popq %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x958a
testl %eax, %eax
jne 0x60d1
movzwl 0x42(%r12), %eax
jmp 0x6036
xorl %eax, %eax
movq 0x48(%r12,%rax,8), %r15
testb $0x2, 0xa(%r15)
je 0x60dd
movzwl 0x10(%r15), %ecx
movl 0x44(%r12), %edx
andl $-0x4, %edx
incl %edx
movl %edx, 0x44(%r12)
andw $0x0, 0x148(%r12,%rax,2)
testb $0x20, 0xa(%r15)
jne 0x608c
addq %rcx, %r15
testq %r14, %r14
je 0x60ba
testb $0x4, 0x4(%r15)
jne 0x609c
movq 0x18(%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5f9f
jmp 0x60b6
addq $0x10, %r15
movq 0x28(%r12), %rax
movl (%rax), %eax
movq %rax, (%rbx)
jmp 0x60cb
movq %r12, %rdi
movq %r15, %rsi
callq 0x5e86
movq 0x10(%r12), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5fe8
testl %eax, %eax
jne 0x60d1
testq %rbx, %rbx
je 0x60cf
movzwl 0x6(%r15), %eax
movq %rax, (%rbx)
addq $0x8, %r15
movq %r15, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x18(%r12), %rax
movq 0x20(%rax), %rdi
leaq 0x89bf(%rip), %rsi      # 0xeaac
leaq 0x89d7(%rip), %rdx      # 0xeacb
movl $0x1793, %ecx           # imm = 0x1793
callq 0xb672
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_last
static int
mdb_cursor_last(MDB_cursor *mc, MDB_val *key, MDB_val *data)
{
	int		 rc;
	MDB_node	*leaf;

	if (mc->mc_xcursor)
		mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);

	if (!(mc->mc_flags & C_EOF)) {

		if (!(mc->mc_flags & C_INITIALIZED) || mc->mc_top) {
			rc = mdb_page_search(mc, NULL, MDB_PS_LAST);
			if (rc != MDB_SUCCESS)
				return rc;
		}
		mdb_cassert(mc, IS_LEAF(mc->mc_pg[mc->mc_top]));

	}
	mc->mc_ki[mc->mc_top] = NUMKEYS(mc->mc_pg[mc->mc_top]) - 1;
	mc->mc_flags |= C_INITIALIZED|C_EOF;
	leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);

	if (IS_LEAF2(mc->mc_pg[mc->mc_top])) {
		key->mv_size = mc->mc_db->md_pad;
		key->mv_data = LEAF2KEY(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top], key->mv_size);
		return MDB_SUCCESS;
	}

	if (data) {
		if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
			mdb_xcursor_init1(mc, leaf);
			rc = mdb_cursor_last(&mc->mc_xcursor->mx_cursor, data, NULL);
			if (rc)
				return rc;
		} else {
			if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
				return rc;
		}
	}

	MDB_GET_KEY(leaf, key);
	return MDB_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x6343
andb $-0x4, 0x44(%rax)
movl 0x44(%r15), %edx
testb $0x2, %dl
jne 0x6375
testb $0x1, %dl
je 0x6359
cmpw $0x0, 0x42(%r15)
je 0x637c
pushq $0x8
popq %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x958a
testl %eax, %eax
jne 0x6430
movzwl 0x42(%r15), %eax
jmp 0x637e
movzwl 0x42(%r15), %eax
jmp 0x6391
xorl %eax, %eax
movq 0x48(%r15,%rax,8), %rcx
testb $0x2, 0xa(%rcx)
je 0x643c
movl 0x44(%r15), %edx
movq 0x48(%r15,%rax,8), %rcx
movzwl 0xc(%rcx), %esi
addl $0x1fff0, %esi          # imm = 0x1FFF0
shrl %esi
decl %esi
movw %si, 0x148(%r15,%rax,2)
orl $0x3, %edx
movl %edx, 0x44(%r15)
movzwl %si, %r12d
testb $0x20, 0xa(%rcx)
jne 0x63e5
movzwl 0x10(%rcx,%r12,2), %r12d
addq %rcx, %r12
testq %r14, %r14
je 0x6418
testb $0x4, 0x4(%r12)
jne 0x63fb
movq 0x18(%r15), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x5f9f
jmp 0x6414
addq $0x10, %rcx
movq 0x28(%r15), %rax
movl (%rax), %eax
movq %rax, (%rbx)
imulq %rax, %r12
addq %rcx, %r12
jmp 0x642a
movq %r15, %rdi
movq %r12, %rsi
callq 0x5e86
movq 0x10(%r15), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x6325
testl %eax, %eax
jne 0x6430
testq %rbx, %rbx
je 0x642e
movzwl 0x6(%r12), %eax
movq %rax, (%rbx)
addq $0x8, %r12
movq %r12, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x18(%r15), %rax
movq 0x20(%rax), %rdi
leaq 0x8661(%rip), %rsi      # 0xeaac
leaq 0x86b7(%rip), %rdx      # 0xeb09
movl $0x17c1, %ecx           # imm = 0x17C1
callq 0xb672
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_new
static int
mdb_page_new(MDB_cursor *mc, uint32_t flags, int num, MDB_page **mp)
{
	MDB_page	*np;
	int rc;

	if ((rc = mdb_page_alloc(mc, num, &np)))
		return rc;
	DPRINTF(("allocated new mpage %"Z"u, page size %u",
	    np->mp_pgno, mc->mc_txn->mt_env->me_psize));
	np->mp_flags = flags | P_DIRTY;
	np->mp_lower = (PAGEHDRSZ-PAGEBASE);
	np->mp_upper = mc->mc_txn->mt_env->me_psize - PAGEBASE;

	if (IS_BRANCH(np))
		mc->mc_db->md_branch_pages++;
	else if (IS_LEAF(np))
		mc->mc_db->md_leaf_pages++;
	else if (IS_OVERFLOW(np)) {
		mc->mc_db->md_overflow_pages += num;
		np->mp_pages = num;
	}
	*mp = np;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
movq %rsp, %rdx
movl %ebp, %esi
callq 0x6ac1
testl %eax, %eax
jne 0x68a7
orl $0x10, %r15d
movq (%rsp), %rcx
movw %r15w, 0xa(%rcx)
movw $0x10, 0xc(%rcx)
movq 0x18(%r14), %rdx
movq 0x20(%rdx), %rdx
movzwl 0x10(%rdx), %edx
movw %dx, 0xe(%rcx)
testb $0x1, %r15b
jne 0x6892
movzwl %r15w, %edx
testb $0x2, %dl
jne 0x689c
testb $0x4, %dl
je 0x68a4
movslq %ebp, %rdx
movq 0x28(%r14), %rsi
addq %rdx, 0x18(%rsi)
movl %ebp, 0xc(%rcx)
jmp 0x68a4
movq 0x28(%r14), %rdx
incq 0x8(%rdx)
jmp 0x68a4
movq 0x28(%r14), %rdx
incq 0x10(%rdx)
movq %rcx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_touch
static int
mdb_cursor_touch(MDB_cursor *mc)
{
	int rc = MDB_SUCCESS;

	if (mc->mc_dbi >= CORE_DBS && !(*mc->mc_dbflag & DB_DIRTY)) {
		MDB_cursor mc2;
		MDB_xcursor mcx;
		if (TXN_DBI_CHANGED(mc->mc_txn, mc->mc_dbi))
			return MDB_BAD_DBI;
		mdb_cursor_init(&mc2, mc->mc_txn, MAIN_DBI, &mcx);
		rc = mdb_page_search(&mc2, &mc->mc_dbx->md_name, MDB_PS_MODIFY);
		if (rc)
			 return rc;
		*mc->mc_dbflag |= DB_DIRTY;
	}
	mc->mc_top = 0;
	if (mc->mc_snum) {
		do {
			rc = mdb_page_touch(mc);
		} while (!rc && ++(mc->mc_top) < mc->mc_snum);
		mc->mc_top = mc->mc_snum-1;
	}
	return rc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x380, %rsp            # imm = 0x380
movq %rdi, %rbx
movl 0x20(%rdi), %ecx
cmpq $0x2, %rcx
jb 0x6959
movq 0x38(%rbx), %rax
testb $0x1, (%rax)
jne 0x6959
movq 0x18(%rbx), %rsi
movq 0x20(%rsi), %rax
movq 0x60(%rsi), %rdx
movl (%rdx,%rcx,4), %edx
movq 0x98(%rax), %rdi
movl $0xffff87c4, %eax       # imm = 0xFFFF87C4
cmpl (%rdi,%rcx,4), %edx
jne 0x698e
leaq 0x8(%rsp), %r14
pushq $0x1
popq %rbp
leaq 0x190(%rsp), %rcx
movq %r14, %rdi
movl %ebp, %edx
callq 0x4451
movq 0x30(%rbx), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x958a
testl %eax, %eax
jne 0x698e
movq 0x38(%rbx), %rax
orb $0x1, (%rax)
andw $0x0, 0x42(%rbx)
cmpw $0x0, 0x40(%rbx)
je 0x698c
movq %rbx, %rdi
callq 0x9908
movzwl 0x40(%rbx), %ecx
testl %eax, %eax
jne 0x6984
movzwl 0x42(%rbx), %edx
incl %edx
movw %dx, 0x42(%rbx)
cmpw %cx, %dx
jb 0x6965
decl %ecx
movw %cx, 0x42(%rbx)
jmp 0x698e
xorl %eax, %eax
addq $0x380, %rsp            # imm = 0x380
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_node_del
static void
mdb_node_del(MDB_cursor *mc, int ksize)
{
	MDB_page *mp = mc->mc_pg[mc->mc_top];
	indx_t	indx = mc->mc_ki[mc->mc_top];
	unsigned int	 sz;
	indx_t		 i, j, numkeys, ptr;
	MDB_node	*node;
	char		*base;

	DPRINTF(("delete node %u on %s page %"Z"u", indx,
	    IS_LEAF(mp) ? "leaf" : "branch", mdb_dbg_pgno(mp)));
	numkeys = NUMKEYS(mp);
	mdb_cassert(mc, indx < numkeys);

	if (IS_LEAF2(mp)) {
		int x = numkeys - 1 - indx;
		base = LEAF2KEY(mp, indx, ksize);
		if (x)
			memmove(base, base + ksize, x * ksize);
		mp->mp_lower -= sizeof(indx_t);
		mp->mp_upper += ksize - sizeof(indx_t);
		return;
	}

	node = NODEPTR(mp, indx);
	sz = NODESIZE + node->mn_ksize;
	if (IS_LEAF(mp)) {
		if (F_ISSET(node->mn_flags, F_BIGDATA))
			sz += sizeof(pgno_t);
		else
			sz += NODEDSZ(node);
	}
	sz = EVEN(sz);

	ptr = mp->mp_ptrs[indx];
	for (i = j = 0; i < numkeys; i++) {
		if (i != indx) {
			mp->mp_ptrs[j] = mp->mp_ptrs[i];
			if (mp->mp_ptrs[i] < ptr)
				mp->mp_ptrs[j] += sz;
			j++;
		}
	}

	base = (char *)mp + mp->mp_upper + PAGEBASE;
	memmove(base + sz, base, ptr - mp->mp_upper);

	mp->mp_lower -= sizeof(indx_t);
	mp->mp_upper += sz;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movzwl 0x42(%rdi), %eax
movq 0x48(%rdi,%rax,8), %r14
movzwl 0x148(%rdi,%rax,2), %edx
movzwl 0xc(%r14), %ecx
leal 0x1fff0(%rcx), %eax
shrl %eax
movzwl %ax, %eax
cmpl %edx, %eax
jbe 0x6f9a
movl %esi, %ebx
movzwl 0xa(%r14), %esi
testb $0x20, %sil
jne 0x6ed8
movl %edx, %ecx
movzwl 0x10(%r14,%rcx,2), %edx
movzwl 0x6(%r14,%rdx), %edi
leal 0x8(%rdi), %ebx
testb $0x2, %sil
je 0x6f26
testb $0x1, 0x4(%r14,%rdx)
jne 0x6f21
addl (%r14,%rdx), %ebx
jmp 0x6f26
movl %edx, %esi
notl %esi
addl %esi, %eax
je 0x6f0a
movslq %ebx, %rcx
imulq %rcx, %rdx
leaq (%r14,%rdx), %rsi
leaq (%r14,%rdx), %rdi
addq $0x10, %rdi
addq %rcx, %rsi
addq $0x10, %rsi
imull %ebx, %eax
movslq %eax, %rdx
callq 0x22e0
movzwl 0xc(%r14), %ecx
addl $-0x2, %ecx
movw %cx, 0xc(%r14)
addw 0xe(%r14), %bx
addl $-0x2, %ebx
movw %bx, 0xe(%r14)
jmp 0x6f92
addl $0x10, %edi
movl %edi, %ebx
incl %ebx
andl $-0x2, %ebx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rsi, %rax
je 0x6f5f
cmpq %rsi, %rcx
je 0x6f5a
movzwl 0x10(%r14,%rsi,2), %r8d
movl %ebx, %r9d
cmpw %dx, %r8w
jb 0x6f4b
xorl %r9d, %r9d
addl %r9d, %r8d
movzwl %di, %r9d
movw %r8w, 0x10(%r14,%r9,2)
incl %edi
incq %rsi
jmp 0x6f2f
movzwl 0xe(%r14), %eax
leaq (%r14,%rax), %rsi
movl %ebx, %edi
addq %rsi, %rdi
subq %rax, %rdx
callq 0x22e0
movd 0xc(%r14), %xmm0
movdqa 0x73ad(%rip), %xmm1     # 0xe330
pinsrw $0x1, %ebx, %xmm1
paddw %xmm0, %xmm1
movd %xmm1, 0xc(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x18(%rdi), %rax
movq 0x20(%rax), %rdi
leaq 0x7c00(%rip), %rsi      # 0xeba9
leaq 0x7c08(%rip), %rdx      # 0xebb8
movl $0x1bfc, %ecx           # imm = 0x1BFC
callq 0xb672
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_get
static int
mdb_page_get(MDB_txn *txn, pgno_t pgno, MDB_page **ret, int *lvl)
{
	MDB_env *env = txn->mt_env;
	MDB_page *p = NULL;
	int level;

	if (! (txn->mt_flags & (MDB_TXN_RDONLY|MDB_TXN_WRITEMAP))) {
		MDB_txn *tx2 = txn;
		level = 1;
		do {
			MDB_ID2L dl = tx2->mt_u.dirty_list;
			unsigned x;
			/* Spilled pages were dirtied in this txn and flushed
			 * because the dirty list got full. Bring this page
			 * back in from the map (but don't unspill it here,
			 * leave that unless page_touch happens again).
			 */
			if (tx2->mt_spill_pgs) {
				MDB_ID pn = pgno << 1;
				x = mdb_midl_search(tx2->mt_spill_pgs, pn);
				if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pn) {
					p = (MDB_page *)(env->me_map + env->me_psize * pgno);
					goto done;
				}
			}
			if (dl[0].mid) {
				unsigned x = mdb_mid2l_search(dl, pgno);
				if (x <= dl[0].mid && dl[x].mid == pgno) {
					p = dl[x].mptr;
					goto done;
				}
			}
			level++;
		} while ((tx2 = tx2->mt_parent) != NULL);
	}

	if (pgno < txn->mt_next_pgno) {
		level = 0;
		p = (MDB_page *)(env->me_map + env->me_psize * pgno);
	} else {
		DPRINTF(("page %"Z"u not found", pgno));
		txn->mt_flags |= MDB_TXN_ERROR;
		return MDB_PAGE_NOTFOUND;
	}

done:
	*ret = p;
	if (lvl)
		*lvl = level;
	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq %rax, (%rsp)
testb $0xa, 0x7e(%rdi)
jne 0x704b
leaq (%r15,%r15), %r13
pushq $0x1
popq %r14
movq %rbx, %r12
movq 0x40(%r12), %rdi
movq 0x48(%r12), %rbp
testq %rdi, %rdi
je 0x701a
movq %r13, %rsi
callq 0xb128
movl %eax, %eax
movq 0x40(%r12), %rcx
cmpq %rax, (%rcx)
jb 0x701a
cmpq %r13, (%rcx,%rax,8)
je 0x7094
cmpq $0x0, (%rbp)
je 0x703f
movq %rbp, %rdi
movq %r15, %rsi
callq 0xb54e
movl %eax, %eax
cmpq %rax, (%rbp)
jb 0x703f
shlq $0x4, %rax
cmpq %r15, (%rbp,%rax)
je 0x70a5
incl %r14d
movq (%r12), %r12
testq %r12, %r12
jne 0x6ff1
cmpq %r15, 0x10(%rbx)
jbe 0x707c
movq (%rsp), %rcx
movl 0x10(%rcx), %eax
imulq %r15, %rax
addq 0x38(%rcx), %rax
xorl %r14d, %r14d
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %eax, %eax
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x7085
movl %r14d, (%rcx)
jmp 0x7085
orb $0x2, 0x7c(%rbx)
movl $0xffff87b3, %eax       # imm = 0xFFFF87B3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rcx
movl 0x10(%rcx), %eax
imulq %r15, %rax
addq 0x38(%rcx), %rax
jmp 0x7063
addq %rax, %rbp
movq 0x8(%rbp), %rax
jmp 0x7063
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_unspill
static int
mdb_page_unspill(MDB_txn *txn, MDB_page *mp, MDB_page **ret)
{
	MDB_env *env = txn->mt_env;
	const MDB_txn *tx2;
	unsigned x;
	pgno_t pgno = mp->mp_pgno, pn = pgno << 1;

	for (tx2 = txn; tx2; tx2=tx2->mt_parent) {
		if (!tx2->mt_spill_pgs)
			continue;
		x = mdb_midl_search(tx2->mt_spill_pgs, pn);
		if (x <= tx2->mt_spill_pgs[0] && tx2->mt_spill_pgs[x] == pn) {
			MDB_page *np;
			int num;
			if (txn->mt_dirty_room == 0)
				return MDB_TXN_FULL;
			if (IS_OVERFLOW(mp))
				num = mp->mp_pages;
			else
				num = 1;
			if (env->me_flags & MDB_WRITEMAP) {
				np = mp;
			} else {
				np = mdb_page_malloc(txn, num);
				if (!np)
					return ENOMEM;
				if (num > 1)
					memcpy(np, mp, num * env->me_psize);
				else
					mdb_page_copy(np, mp, env->me_psize);
			}
			if (tx2 == txn) {
				/* If in current txn, this page is no longer spilled.
				 * If it happens to be the last page, truncate the spill list.
				 * Otherwise mark it as deleted by setting the LSB.
				 */
				if (x == txn->mt_spill_pgs[0])
					txn->mt_spill_pgs[0]--;
				else
					txn->mt_spill_pgs[x] |= 1;
			}	/* otherwise, if belonging to a parent txn, the
				 * page remains spilled until child commits
				 */

			mdb_page_dirty(txn, np);
			np->mp_flags |= P_DIRTY;
			*ret = np;
			break;
		}
	}
	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %r13
movq 0x20(%rdi), %rax
movq %rax, 0x8(%rsp)
movq (%rsi), %r12
addq %r12, %r12
movq %rdi, %r14
xorl %ebp, %ebp
testq %r14, %r14
je 0x71b9
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x7106
movq %r12, %rsi
callq 0xb128
movl %eax, %ebx
movq 0x40(%r14), %rax
cmpq %rbx, (%rax)
jb 0x7106
cmpq %r12, (%rax,%rbx,8)
je 0x710b
movq (%r14), %r14
jmp 0x70db
cmpl $0x0, 0x80(%r13)
je 0x7121
testb $0x4, 0xa(%r15)
jne 0x712b
pushq $0x1
popq %rcx
jmp 0x712f
movl $0xffff87bc, %ebp       # imm = 0xFFFF87BC
jmp 0x71b9
movl 0xc(%r15), %ecx
movq 0x8(%rsp), %rax
testb $0x8, 0xe(%rax)
jne 0x7171
movq %r13, %rdi
movl %ecx, %esi
movl %ecx, 0x4(%rsp)
callq 0x71ca
testq %rax, %rax
je 0x7176
movq %rax, %r12
movq 0x8(%rsp), %rax
movl 0x10(%rax), %edx
movl 0x4(%rsp), %eax
cmpl $0x2, %eax
jl 0x717b
imull %eax, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2240
jmp 0x7186
movq %r15, %r12
jmp 0x7186
pushq $0xc
popq %rbp
jmp 0x71b9
movq %r12, %rdi
movq %r15, %rsi
callq 0x9dfd
cmpq %r13, %r14
jne 0x71a0
movq 0x40(%r13), %rax
cmpq %rbx, (%rax)
jne 0x719c
decq %rbx
movq %rbx, (%rax)
jmp 0x71a0
orb $0x1, (%rax,%rbx,8)
movq %r13, %rdi
movq %r12, %rsi
callq 0xa139
orb $0x10, 0xa(%r12)
movq 0x10(%rsp), %rax
movq %r12, (%rax)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_malloc
static MDB_page *
mdb_page_malloc(MDB_txn *txn, unsigned num)
{
	MDB_env *env = txn->mt_env;
	MDB_page *ret = env->me_dpages;
	size_t psize = env->me_psize, sz = psize, off;
	/* For ! #MDB_NOMEMINIT, psize counts how much to init.
	 * For a single page alloc, we init everything after the page header.
	 * For multi-page, we init the final page; if the caller needed that
	 * many pages they will be filling in at least up to the last page.
	 */
	if (num == 1) {
		if (ret) {
			VGMEMP_ALLOC(env, ret, sz);
			VGMEMP_DEFINED(ret, sizeof(ret->mp_next));
			env->me_dpages = ret->mp_next;
			return ret;
		}
		psize -= off = PAGEHDRSZ;
	} else {
		sz *= num;
		off = sz - psize;
	}
	if ((ret = malloc(sz)) != NULL) {
		VGMEMP_ALLOC(env, ret, sz);
		if (!(env->me_flags & MDB_NOMEMINIT)) {
			memset((char *)ret + off, 0, psize);
			ret->mp_pad = 0;
		}
	} else {
		txn->mt_flags |= MDB_TXN_ERROR;
	}
	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %r12
movl 0x10(%r12), %edi
cmpl $0x1, %esi
jne 0x71fe
movq 0xc0(%r12), %r14
testq %r14, %r14
je 0x7212
movq (%r14), %rax
movq %rax, 0xc0(%r12)
jmp 0x724e
movl %esi, %eax
imulq %rdi, %rax
movq %rax, %r13
subq %rdi, %r13
movq %rdi, %r15
movq %rax, %rdi
jmp 0x721a
leaq -0x10(%rdi), %r15
pushq $0x10
popq %r13
callq 0x2270
testq %rax, %rax
je 0x7247
movq %rax, %r14
testb $0x1, 0xf(%r12)
jne 0x724e
movq %r14, %rdi
addq %r13, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2190
andw $0x0, 0x8(%r14)
jmp 0x724e
orb $0x2, 0x7c(%rbx)
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %al
testq %rdi, %rdi
sete %dl
pushq $0x16
popq %rcx
orb %al, %dl
jne 0x8b92
movl %esi, %ebp
movq %rdi, %r14
cmpl %esi, 0x78(%rdi)
jbe 0x8b92
movq 0x70(%r14), %rax
movl %ebp, %r12d
testb $0x8, (%rax,%r12)
jne 0x8b9d
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x7c(%r14), %edx
movl $0xffff87c2, %eax       # imm = 0xFFFF87C2
testb $0x13, %dl
jne 0x8b94
andl $0x20000, %edx          # imm = 0x20000
orl %ebp, %edx
movl %ecx, %eax
je 0x8b94
movq 0x58(%r14), %rax
imulq $0x30, %r12, %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 0x8c1b
movq %rax, %r15
movq %rax, %rcx
addq $0x188, %rcx            # imm = 0x188
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x4451
movq 0x68(%r14), %rax
testq %rax, %rax
je 0x8c11
movq (%rax,%r12,8), %rcx
movq %rcx, (%r15)
movq %r15, (%rax,%r12,8)
orb $0x40, 0x44(%r15)
movq %r15, (%rbx)
xorl %eax, %eax
jmp 0x8b94
pushq $0xc
popq %rax
jmp 0x8b94
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x16
popq %rax
orb %cl, %dl
jne 0x8c7a
movq %rdi, %r8
movl 0x20(%rsi), %edx
cmpl 0x78(%rdi), %edx
jae 0x8c7a
movq 0x70(%r8), %rcx
testb $0x8, (%rcx,%rdx)
je 0x8c7a
testb $0x40, 0x44(%rsi)
jne 0x8c7a
cmpq $0x0, 0x68(%r8)
jne 0x8c7a
movl $0xffff87c2, %eax       # imm = 0xFFFF87C2
testb $0x13, 0x7c(%r8)
jne 0x8c7a
pushq %rax
movq 0x10(%rsi), %rcx
movq %rsi, %rdi
movq %r8, %rsi
callq 0x4451
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x16
popq %rcx
je 0x8c91
movl %ecx, %eax
retq
movq 0x10(%rdi), %rdx
testq %rdx, %rdx
je 0x8cab
movq 0x18(%rdi), %r8
movl $0xffff87c2, %eax       # imm = 0xFFFF87C2
testb $0x13, 0x7c(%r8)
je 0x8cb1
retq
movl $0xffff87c0, %eax       # imm = 0xFFFF87C0
retq
movl 0x44(%rdi), %r8d
testb $0x1, %r8b
je 0x8c8e
movl $0xffff87b2, %eax       # imm = 0xFFFF87B2
testb $0x2, %r8b
jne 0x8caa
cmpw $0x0, 0x40(%rdi)
je 0x8caa
movzwl 0x42(%rdi), %eax
movq 0x48(%rdi,%rax,8), %r8
movzwl 0x148(%rdi,%rax,2), %eax
movzwl 0x10(%r8,%rax,2), %eax
testb $0x4, 0x4(%r8,%rax)
jne 0x8cf1
pushq $0x1
popq %rax
jmp 0x8d00
testb $0x1, 0x44(%rdx)
movl %ecx, %eax
je 0x8caa
movq 0x1a8(%rdx), %rax
movq %rax, (%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8d12
cmpq $0x0, 0x8(%rdi)
je 0x8d13
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 0x8d45
cmpq %rdi, %rcx
jne 0x8d35
cmpq %rdi, %rcx
jne 0x2030
movq (%rdi), %rcx
movq %rcx, (%rax)
jmp 0x2030
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x16
popq %rax
orb %r8b, %r9b
jne 0x8dac
cmpl %esi, 0x78(%rdi)
jbe 0x8dac
movq 0x70(%rdi), %r9
movl %esi, %r8d
testb $0x10, (%r9,%r8)
je 0x8dac
movl 0x7c(%rdi), %eax
testl $0x20013, %eax          # imm = 0x20013
je 0x8dad
btl $0x11, %eax
movl $0xffff87c2, %ecx       # imm = 0xFFFF87C2
pushq $0xd
popq %rax
cmovael %ecx, %eax
retq
movq 0x58(%rdi), %rax
imulq $0x30, %r8, %r8
movzwl 0x4(%rax,%r8), %eax
xorl %r8d, %r8d
testb $0x4, %al
cmoveq %r8, %rcx
xorl %r8d, %r8d
jmp 0x8dc9
// File: /workspace/github_cpp_makefile_star2_O2/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
andl $0x0, 0xc(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x1b0(%rsp), %rcx
movq %rbx, %rsi
movl %r14d, %edx
callq 0x4451
testq %r12, %r12
je 0x8e1b
movups (%r12), %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
pushq $0x2
popq %rcx
jmp 0x8e23
orl $0x20, %ebp
pushq $0xf
popq %rcx
xorl %edx, %edx
leaq 0x28(%rsp), %r12
leaq 0xc(%rsp), %r8
movq %r12, %rdi
movq %r15, %rsi
callq 0x5619
testl %eax, %eax
jne 0x8e6c
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 0x8427
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_O2/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:
pushq $0x16
popq %rax
testq %rdi, %rdi
je 0x8f16
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %rdx, %r15
testq %rdx, %rdx
je 0x8f08
movq %rcx, %r14
testq %rcx, %rcx
je 0x8f08
movl %esi, %edx
movq %rdi, %rsi
cmpl %edx, 0x78(%rdi)
jbe 0x8f08
movl %r8d, %ebx
testl $0xfff8ffcf, %r8d       # imm = 0xFFF8FFCF
jne 0x8f08
movq 0x70(%rsi), %rcx
movl %edx, %edi
movb (%rcx,%rdi), %cl
andb $0x10, %cl
je 0x8f08
movl 0x7c(%rsi), %eax
testl $0x20013, %eax          # imm = 0x20013
je 0x8ee5
btl $0x11, %eax
movl $0xffff87c2, %ecx       # imm = 0xFFFF87C2
pushq $0xd
popq %rax
cmovael %ecx, %eax
jmp 0x8f08
movq %rsp, %r12
leaq 0x188(%rsp), %rcx
movq %r12, %rdi
callq 0x4451
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x453f
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
imulq $0x30, %rcx, %rcx
movzwl 0x4(%rdx,%rcx), %esi
testb $0x8, %sil
leaq 0x1ed1(%rip), %rdi      # 0xb0ee
leaq 0xba4(%rip), %r8        # 0x9dc8
movq %r8, %r9
cmoveq %rdi, %r9
testb $0x2, %sil
leaq 0x1e65(%rip), %rdx      # 0xb09b
cmovneq %rdx, %r9
movq %r9, 0x10(%rax,%rcx)
testb $0x4, %sil
jne 0x9249
xorl %edx, %edx
jmp 0x9268
testb $0x20, %sil
jne 0x9259
testb $0x40, %sil
cmoveq %rdi, %rdx
jmp 0x9268
testb $0x10, %sil
leaq -0x64db(%rip), %rdx     # 0x2d89
cmoveq %r8, %rdx
movq %rdx, 0x18(%rax,%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x92b4
cmpl %esi, 0x24(%rdi)
jbe 0x92b4
movq 0x88(%rdi), %rdx
movl %esi, %ecx
imulq $0x30, %rcx, %rsi
movq 0x8(%rdx,%rsi), %rax
testq %rax, %rax
je 0x92b4
xorps %xmm0, %xmm0
movups %xmm0, (%rdx,%rsi)
movq 0x90(%rdi), %rdx
andw $0x0, (%rdx,%rcx,2)
movq 0x98(%rdi), %rdx
incl (%rdx,%rcx,4)
movq %rax, %rdi
jmp 0x2030
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x16
popq %r14
orb %al, %cl
jne 0x939a
movl %esi, %ebp
movq %rdi, %rbx
cmpl %esi, 0x78(%rdi)
jbe 0x939a
movq 0x70(%rbx), %rax
movl %ebp, %r12d
testb $0x10, (%rax,%r12)
je 0x939a
testb $0x2, 0x7e(%rbx)
jne 0x9396
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 0x939a
movl %edx, %r15d
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8b5c
movl %eax, %r14d
testl %eax, %eax
jne 0x939a
movq 0x8(%rsp), %rdi
movq 0x28(%rdi), %rax
movzwl 0x4(%rax), %esi
andl $0x4, %esi
callq 0x88e8
movl %eax, %r14d
leaq (,%r12,8), %rax
addq 0x68(%rbx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x93aa
andb $-0x4, 0x44(%rax)
jmp 0x9388
pushq $0xd
popq %r14
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testl %r14d, %r14d
jne 0x9434
testl %r15d, %r15d
sete %al
cmpl $0x2, %ebp
setb %cl
orb %al, %cl
jne 0x93ed
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdx
xorl %r14d, %r14d
pushq $0x1
popq %rsi
pushq $0x2
popq %r8
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x8dc9
testl %eax, %eax
je 0x9420
orb $0x2, 0x7c(%rbx)
movl %eax, %r14d
jmp 0x9434
movq 0x70(%rbx), %rax
orb $0x1, (%rax,%r12)
movq 0x58(%rbx), %rax
imulq $0x30, %r12, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x16(%rax,%rcx)
andw $0x0, 0x26(%rax,%rcx)
movups %xmm0, 0x6(%rax,%rcx)
orq $-0x1, 0x28(%rax,%rcx)
orb $0x4, 0x7c(%rbx)
xorl %r14d, %r14d
jmp 0x9434
movq 0x70(%rbx), %rax
movb $0x2, (%rax,%r12)
movq 0x20(%rbx), %rdi
movl %ebp, %esi
callq 0x926e
movq 0x8(%rsp), %rdi
callq 0x8d06
jmp 0x939a
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
movslq %edx, %r12
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movw $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 0x9543
callq 0x2050
movl (%rax), %eax
cmpl $0x4, %eax
je 0x9501
jmp 0x9558
cmpl $0x5, %ebx
sete %al
cmpw $0x2, (%rsp)
setne %cl
andb %al, %cl
movzbl %cl, %eax
negl %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9570
cmpl $0x1, 0xc(%rsi)
jne 0x9582
movq 0xc0(%rdi), %rax
movq %rax, (%rsi)
movq %rsi, 0xc0(%rdi)
retq
movq %rsi, %rdi
jmp 0x2030