LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_dbis_update
static void
mdb_dbis_update(MDB_txn *txn, int keep)
{
	int i;
	MDB_dbi n = txn->mt_numdbs;
	MDB_env *env = txn->mt_env;
	unsigned char *tdbflags = txn->mt_dbflags;

	for (i = n; --i >= CORE_DBS;) {
		if (tdbflags[i] & DB_NEW) {
			if (keep) {
				env->me_dbflags[i] = txn->mt_dbs[i].md_flags | MDB_VALID;
			} else {
				char *ptr = env->me_dbxs[i].md_name.mv_data;
				if (ptr) {
					env->me_dbxs[i].md_name.mv_data = NULL;
					env->me_dbxs[i].md_name.mv_size = 0;
					env->me_dbflags[i] = 0;
					env->me_dbiseqs[i]++;
					free(ptr);
				}
			}
		}
	}
	if (keep && env->me_numdbs < n)
		env->me_numdbs = n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x78(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
cmpl $0x2, %eax
jl 0xed9d
movq -0x28(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xed98
cmpl $0x0, -0xc(%rbp)
je 0xecfe
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
orl $0x8000, %eax           # imm = 0x8000
movw %ax, %dx
movq -0x20(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x10(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0xed96
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xed94
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x10(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movq -0x20(%rbp), %rax
movq 0x98(%rax), %rax
movslq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rdi
callq 0x2030
jmp 0xed96
jmp 0xed98
jmp 0xec97
cmpl $0x0, -0xc(%rbp)
je 0xedb9
movq -0x20(%rbp), %rax
movl 0x20(%rax), %eax
cmpl -0x14(%rbp), %eax
jae 0xedb9
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20(%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_dlist_free
static void
mdb_dlist_free(MDB_txn *txn)
{
	MDB_env *env = txn->mt_env;
	MDB_ID2L dl = txn->mt_u.dirty_list;
	unsigned i, n = dl[0].mid;

	for (i = 1; i <= n; i++) {
		mdb_dpage_free(env, dl[i].mptr);
	}
	dl[0].mid = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x20(%rbp)
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
ja 0xee23
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0xee40
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xedf5
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x4, %eax
cmpl $0x4, %eax
jne 0xee6a
movq -0x10(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jne 0xee79
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xee90
jmp 0xee82
movq -0x10(%rbp), %rdi
callq 0x2030
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cmp_cint
static int
mdb_cmp_cint(const MDB_val *a, const MDB_val *b)
{
#if BYTE_ORDER == LITTLE_ENDIAN
	unsigned short *u, *c;
	int x;

	u = (unsigned short *) ((char *) a->mv_data + a->mv_size);
	c = (unsigned short *) ((char *) b->mv_data + a->mv_size);
	do {
		x = *--u - *--c;
	} while(!x && u > (unsigned short *)a->mv_data);
	return x;
#else
	unsigned short *u, *c, *end;
	int x;

	end = (unsigned short *) ((char *) a->mv_data + a->mv_size);
	u = (unsigned short *)a->mv_data;
	c = (unsigned short *)b->mv_data;
	do {
		x = *u++ - *c++;
	} while(!x && u < end);
	return x;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $-0x2, %rcx
movq %rcx, -0x18(%rbp)
movzwl -0x2(%rax), %eax
movq -0x20(%rbp), %rcx
movq %rcx, %rdx
addq $-0x2, %rdx
movq %rdx, -0x20(%rbp)
movzwl -0x2(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x24(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x24(%rbp)
movb %al, -0x25(%rbp)
jne 0xfd1a
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
seta %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xfcd2
movl -0x24(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw 0xe(%rax), %ax
movw %ax, -0x16(%rbp)
movq -0x10(%rbp), %rax
movw 0xc(%rax), %ax
movw %ax, -0x18(%rbp)
movzwl -0x16(%rbp), %eax
movzwl -0x18(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
movzwl -0x1a(%rbp), %eax
andl $-0x8, %eax
movw %ax, -0x1a(%rbp)
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xfde6
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x20, %eax
cmpl $0x20, %eax
je 0xfde6
movzwl -0x16(%rbp), %eax
addl $0x0, %eax
andl $-0x8, %eax
movw %ax, -0x16(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzwl -0x18(%rbp), %eax
addl $0x0, %eax
addl $0x7, %eax
andl $-0x8, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x2230
movq -0x8(%rbp), %rdi
movzwl -0x16(%rbp), %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movzwl -0x16(%rbp), %eax
cltq
addq %rax, %rsi
movl -0x14(%rbp), %eax
movzwl -0x16(%rbp), %ecx
subl %ecx, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x2230
jmp 0xfe00
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
subl %ecx, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x2230
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_pop
static void
mdb_cursor_pop(MDB_cursor *mc)
{
	if (mc->mc_snum) {
		DPRINTF(("popping page %"Z"u off db %d cursor %p",
			mc->mc_pg[mc->mc_top]->mp_pgno, DDBI(mc), (void *) mc));

		mc->mc_snum--;
		if (mc->mc_snum)
			mc->mc_top--;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpw $0x0, 0x40(%rax)
je 0x100c0
movq -0x8(%rbp), %rax
movw 0x40(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x40(%rax)
movq -0x8(%rbp), %rax
cmpw $0x0, 0x40(%rax)
je 0x100be
movq -0x8(%rbp), %rax
movw 0x42(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x42(%rax)
jmp 0x100c0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x40(%rax)
je 0x103d2
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rax), %rax
addq $0x80, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x40(%rax), %rax
movl 0x38(%rax), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jl 0x103d0
movq -0x28(%rbp), %rax
movslq -0xc(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl $0x0, %eax
je 0x103ce
movq -0x28(%rbp), %rax
movslq -0xc(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x103cc
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x103ce
jmp 0x1037f
jmp 0x103d2
movq -0x20(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x7c(%rax), %eax
andl $0x80000, %eax          # imm = 0x80000
cmpl $0x0, %eax
je 0x1040e
leaq 0x2ee8(%rip), %rax      # 0x132f0
movq %rax, -0x30(%rbp)
jmp 0x10419
leaq 0x2dcb(%rip), %rax      # 0x131e0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rdi
leaq -0x20(%rbp), %rsi
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x10449
jmp 0x10471
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x75ae(%rip), %rsi      # 0x17a06
leaq 0x76c6(%rip), %rdx      # 0x17b25
leaq 0x6fa9(%rip), %rcx      # 0x1740f
movl $0x829, %r8d            # imm = 0x829
callq 0x133a0
movq -0x8(%rbp), %rax
movl 0x80(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x80(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_xcursor_init0
static void
mdb_xcursor_init0(MDB_cursor *mc)
{
	MDB_xcursor *mx = mc->mc_xcursor;

	mx->mx_cursor.mc_xcursor = NULL;
	mx->mx_cursor.mc_txn = mc->mc_txn;
	mx->mx_cursor.mc_db = &mx->mx_db;
	mx->mx_cursor.mc_dbx = &mx->mx_dbx;
	mx->mx_cursor.mc_dbi = mc->mc_dbi;
	mx->mx_cursor.mc_dbflag = &mx->mx_dbflag;
	mx->mx_cursor.mc_snum = 0;
	mx->mx_cursor.mc_top = 0;
	mx->mx_cursor.mc_flags = C_SUB;
	mx->mx_dbx.md_name.mv_size = 0;
	mx->mx_dbx.md_name.mv_data = NULL;
	mx->mx_dbx.md_cmp = mc->mc_dbx->md_dcmp;
	mx->mx_dbx.md_dcmp = NULL;
	mx->mx_dbx.md_rel = mc->mc_dbx->md_rel;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rcx
addq $0x188, %rcx            # imm = 0x188
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rcx
addq $0x1b8, %rcx            # imm = 0x1B8
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rcx
addq $0x1e8, %rcx            # imm = 0x1E8
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x42(%rax)
movq -0x10(%rbp), %rax
movl $0x4, 0x44(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1b8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1c0(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1c8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1d0(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1d8(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movw 0x40(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x40(%rax)
movq -0x8(%rbp), %rax
movw 0x42(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x42(%rax)
movq -0x8(%rbp), %rax
movl 0x44(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x44(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x40(%rcx), %ecx
cmpl %ecx, %eax
jae 0x1114f
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movq 0x48(%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movq %rdx, 0x48(%rax,%rcx,8)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movw 0x148(%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movw %dx, 0x148(%rax,%rcx,2)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x110ff
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movq 0x48(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x18(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rax
movzwl (%rax), %eax
movl %eax, %esi
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %eax
shlq $0x10, %rax
orq %rax, %rsi
movq -0x20(%rbp), %rax
movzwl 0x4(%rax), %eax
shlq $0x20, %rax
orq %rax, %rsi
leaq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0xa740
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x12223
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1226b
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movw $0x0, 0x148(%rax,%rcx,2)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9b50
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
je 0x12256
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1226b
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x4, %edx
callq 0xf9e0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_page_loose
static int
mdb_page_loose(MDB_cursor *mc, MDB_page *mp)
{
	int loose = 0;
	pgno_t pgno = mp->mp_pgno;
	MDB_txn *txn = mc->mc_txn;

	if ((mp->mp_flags & P_DIRTY) && mc->mc_dbi != FREE_DBI) {
		if (txn->mt_parent) {
			MDB_ID2 *dl = txn->mt_u.dirty_list;
			/* If txn has a parent, make sure the page is in our
			 * dirty list.
			 */
			if (dl[0].mid) {
				unsigned x = mdb_mid2l_search(dl, pgno);
				if (x <= dl[0].mid && dl[x].mid == pgno) {
					if (mp != dl[x].mptr) { /* bad cursor? */
						mc->mc_flags &= ~(C_INITIALIZED|C_EOF);
						txn->mt_flags |= MDB_TXN_ERROR;
						return MDB_CORRUPTED;
					}
					/* ok, it's ours */
					loose = 1;
				}
			}
		} else {
			/* no parent txn, so it's just ours */
			loose = 1;
		}
	}
	if (loose) {
		DPRINTF(("loosen db %d page %"Z"u", DDBI(mc),
			mp->mp_pgno));
		NEXT_LOOSE_PAGE(mp) = txn->mt_loose_pgs;
		txn->mt_loose_pgs = mp;
		txn->mt_loose_count++;
		mp->mp_flags |= P_LOOSE;
	} else {
		int rc = mdb_midl_append(&txn->mt_free_pgs, pgno);
		if (rc)
			return rc;
	}

	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x12379
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x12379
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x12370
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, (%rax)
je 0x1236e
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x130f0
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
ja 0x1236c
movq -0x38(%rbp), %rax
movl -0x3c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq -0x28(%rbp), %rax
jne 0x1236c
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movl -0x3c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
je 0x12365
movq -0x10(%rbp), %rax
movl 0x44(%rax), %ecx
andl $-0x4, %ecx
movl %ecx, 0x44(%rax)
movq -0x30(%rbp), %rax
movl 0x7c(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x7c(%rax)
movl $0xffff87b4, -0x4(%rbp) # imm = 0xFFFF87B4
jmp 0x123e7
movl $0x1, -0x1c(%rbp)
jmp 0x1236e
jmp 0x12377
movl $0x1, -0x1c(%rbp)
jmp 0x12379
cmpl $0x0, -0x1c(%rbp)
je 0x123bc
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movq -0x18(%rbp), %rax
movzwl 0xa(%rax), %ecx
orl $0x4000, %ecx           # imm = 0x4000
movw %cx, 0xa(%rax)
jmp 0x123e0
movq -0x30(%rbp), %rdi
addq $0x28, %rdi
movq -0x28(%rbp), %rsi
callq 0x12860
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x123de
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x123e7
jmp 0x123e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_branch_size
static size_t
mdb_branch_size(MDB_env *env, MDB_val *key)
{
	size_t		 sz;

	sz = INDXSIZE(key);
	if (sz > env->me_nodemax) {
		/* put on overflow page */
		/* not implemented */
		/* sz -= key->size - sizeof(pgno_t); */
	}

	return sz + sizeof(indx_t);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1240b
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x12416
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0xdc(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x12437
jmp 0x12437
movq -0x18(%rbp), %rax
addq $0x2, %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jle 0x124bb
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x1, -0x38(%rbp)
jmp 0x124bd
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x12502
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x20(%rbp)
movzbl -0x1(%rax), %eax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $-0x1, %rdx
movq %rdx, -0x28(%rbp)
movzbl -0x1(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x12500
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x12525
jmp 0x124bd
cmpq $0x0, -0x38(%rbp)
jge 0x12516
movq $-0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x1251e
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jle 0x12575
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x24(%rbp)
movq $0x1, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl -0x24(%rbp), %eax
movl %eax, %edx
callq 0x21d0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x125a2
movslq -0x14(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x125c6
cmpq $0x0, -0x20(%rbp)
jge 0x125b6
movq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x125be
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_midl_search
unsigned mdb_midl_search( MDB_IDL 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 = ids[0];

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

		if( val < 0 ) {
			n = pivot;

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

		} else {
			return cursor;
		}
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x1, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x28(%rbp)
xorl %eax, %eax
cmpl -0x28(%rbp), %eax
jae 0x1268e
movl -0x28(%rbp), %eax
shrl %eax
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
addl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movq (%rax,%rcx,8), %rax
cmpq -0x18(%rbp), %rax
jae 0x12635
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x30(%rbp)
jmp 0x1264f
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movq (%rax,%rcx,8), %rax
cmpq -0x18(%rbp), %rax
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x12663
movl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x12689
cmpl $0x0, -0x24(%rbp)
jle 0x1267f
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
jmp 0x12687
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x126a3
jmp 0x12689
jmp 0x125fb
cmpl $0x0, -0x24(%rbp)
jle 0x1269d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x2260
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x126f9
movslq -0x4(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x10(%rbp)
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $-0x8, %rcx
movq %rcx, -0x10(%rbp)
cmpq $0x1ffff, -0x8(%rax)    # imm = 0x1FFFF
jbe 0x127a9
movq -0x10(%rbp), %rdi
movl $0x100000, %esi         # imm = 0x100000
callq 0x2270
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x127a9
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq $0x1ffff, (%rax)        # imm = 0x1FFFF
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movl -0x14(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpq -0x8(%rcx), %rax
jbe 0x1284f
movl -0x14(%rbp), %eax
movl -0x14(%rbp), %ecx
shrl $0x2, %ecx
addl %ecx, %eax
addl $0x102, %eax            # imm = 0x102
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rdi
addq $-0x8, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x2270
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x12828
movl $0xc, -0x4(%rbp)
jmp 0x12856
movl -0x14(%rbp), %eax
subl $0x2, %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x20(%rbp)
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq -0x8(%rcx), %rax
jb 0x128b3
movq -0x10(%rbp), %rdi
movl $0x1ffff, %esi          # imm = 0x1FFFF
callq 0x128f0
cmpl $0x0, %eax
je 0x128a8
movl $0xc, -0x4(%rbp)
jmp 0x128db
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movslq -0x14(%rbp), %rax
addq %rax, %rsi
addq $0x2, %rsi
shlq $0x3, %rsi
callq 0x2270
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x12941
movl $0xc, -0x4(%rbp)
jmp 0x1296c
movslq -0x14(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, -0x20(%rbp)
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
addq (%rcx), %rax
movq -0x20(%rbp), %rcx
cmpq -0x8(%rcx), %rax
jb 0x129de
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %esi
callq 0x128f0
cmpl $0x0, %eax
je 0x129d3
movl $0xc, -0x4(%rbp)
jmp 0x12a24
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rax
addq $0x1, %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
shlq $0x3, %rdx
callq 0x2230
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl -0x1c(%rbp), %ecx
addq %rcx, %rax
movq -0x28(%rbp), %rcx
cmpq -0x8(%rcx), %rax
jbe 0x12a98
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
orl $0x1ffff, %esi          # imm = 0x1FFFF
callq 0x128f0
cmpl $0x0, %eax
je 0x12a8d
movl $0xc, -0x4(%rbp)
jmp 0x12aec
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rcx
movl -0x1c(%rbp), %eax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
shlq $0x3, %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x12ae5
movq -0x18(%rbp), %rdx
movq %rdx, %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $-0x1, %esi
movl %esi, -0x1c(%rbp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x12ab9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq $-0x1, (%rax)
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x12bd6
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $-0x1, %rdx
movq %rdx, -0x28(%rbp)
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x12bb6
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, %rsi
addq $-0x1, %rsi
movq %rsi, -0x38(%rbp)
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, %rdx
addq $-0x1, %rdx
movq %rdx, -0x30(%rbp)
movq -0x8(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
jmp 0x12b73
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, %rsi
addq $-0x1, %rsi
movq %rsi, -0x38(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x12b51
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x1, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x28(%rbp)
xorl %eax, %eax
cmpl -0x28(%rbp), %eax
jae 0x131ba
movl -0x28(%rbp), %eax
shrl %eax
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
addl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x20(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x1315b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x30(%rbp)
jmp 0x1317b
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x20(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
seta %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x1318f
movl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x131b5
cmpl $0x0, -0x24(%rbp)
jle 0x131ab
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movl -0x28(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
jmp 0x131b3
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x131cf
jmp 0x131b5
jmp 0x1311b
cmpl $0x0, -0x24(%rbp)
jle 0x131c9
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x130f0
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jae 0x13215
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x132e1
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
ja 0x13247
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x13247
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x132e1
movq -0x10(%rbp), %rax
cmpq $0x1ffff, (%rax)        # imm = 0x1FFFF
jb 0x13260
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x132e1
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jbe 0x132ba
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movl -0x20(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x13278
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/midl.c
// Function: mdb_mid2l_append
int mdb_mid2l_append( MDB_ID2L ids, MDB_ID2 *id )
{
	/* Too big? */
	if (ids[0].mid >= MDB_IDL_UM_MAX) {
		return -2;
	}
	ids[0].mid++;
	ids[ids[0].mid] = *id;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1ffff, (%rax)        # imm = 0x1FFFF
jb 0x13312
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x1334b
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: 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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x13371
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
cmpq $0x0, -0x10(%rbp)
je 0x13382
movq -0x10(%rbp), %rax
movl $0x9, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0x13393
movq -0x18(%rbp), %rax
movl $0x10, (%rax)
leaq 0x3ceb(%rip), %rax      # 0x17085
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
leaq -0x1c0(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %r8
movq -0x18(%rbp), %r9
leaq 0x4557(%rip), %rsi      # 0x17933
movb $0x0, %al
callq 0x2360
movq -0x8(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x13409
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rax
movq -0x8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq *%rax
movq 0x7be8(%rip), %rax      # 0x1aff8
movq (%rax), %rdi
leaq -0x1c0(%rbp), %rdx
leaq 0x3ca3(%rip), %rsi      # 0x170c4
movb $0x0, %al
callq 0x2210
callq 0x2040
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x1, %edi
movl $0xf8, %esi
callq 0x21f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1345f
movl $0xc, -0x4(%rbp)
jmp 0x134d3
movq -0x18(%rbp), %rax
movl $0x7e, 0x18(%rax)
movq -0x18(%rbp), %rax
movl $0x2, 0x20(%rax)
movq -0x18(%rbp), %rax
movl $0x2, 0x24(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
callq 0x20d0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x28(%rax)
movl $0x1e, %edi
callq 0x2310
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x135d1
movq -0x10(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x13516
movl $0x16, -0x4(%rbp)
jmp 0x13610
movq -0x10(%rbp), %rdi
callq 0x7850
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x13536
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x13563
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x2280
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x135a1
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x135a9
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x135a9
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x13620
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x135cf
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x13610
jmp 0x135d1
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x13609
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x80(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_set_maxdbs
int ESECT
mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs)
{
	if (env->me_map)
		return EINVAL;
	env->me_maxdbs = dbs + CORE_DBS;
	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x1378f
movl $0x16, -0x4(%rbp)
jmp 0x137a3
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_set_maxreaders
int ESECT
mdb_env_set_maxreaders(MDB_env *env, unsigned int readers)
{
	if (env->me_map || readers < 1)
		return EINVAL;
	env->me_maxreaders = readers;
	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x137cc
cmpl $0x1, -0x14(%rbp)
jae 0x137d5
movl $0x16, -0x4(%rbp)
jmp 0x137e6
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_env_get_maxreaders
int ESECT
mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers)
{
	if (!env || !readers)
		return EINVAL;
	*readers = env->me_maxreaders;
	return MDB_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1380a
cmpq $0x0, -0x18(%rbp)
jne 0x13813
movl $0x16, -0x4(%rbp)
jmp 0x13827
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)