// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_cursor_set
static int
mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data,
    MDB_cursor_op op, int *exactp)
{
	int		 rc;
	MDB_page	*mp;
	MDB_node	*leaf = NULL;
	DKBUF;

	if (key->mv_size == 0)
		return MDB_BAD_VALSIZE;

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

	/* See if we're already on the right page */
	if (mc->mc_flags & C_INITIALIZED) {
		MDB_val nodekey;

		mp = mc->mc_pg[mc->mc_top];
		if (!NUMKEYS(mp)) {
			mc->mc_ki[mc->mc_top] = 0;
			return MDB_NOTFOUND;
		}
		if (mp->mp_flags & P_LEAF2) {
			nodekey.mv_size = mc->mc_db->md_pad;
			nodekey.mv_data = LEAF2KEY(mp, 0, nodekey.mv_size);
		} else {
			leaf = NODEPTR(mp, 0);
			MDB_GET_KEY2(leaf, nodekey);
		}
		rc = mc->mc_dbx->md_cmp(key, &nodekey);
		if (rc == 0) {
			/* Probably happens rarely, but first node on the page
			 * was the one we wanted.
			 */
			mc->mc_ki[mc->mc_top] = 0;
			if (exactp)
				*exactp = 1;
			goto set1;
		}
		if (rc > 0) {
			unsigned int i;
			unsigned int nkeys = NUMKEYS(mp);
			if (nkeys > 1) {
				if (mp->mp_flags & P_LEAF2) {
					nodekey.mv_data = LEAF2KEY(mp,
						 nkeys-1, nodekey.mv_size);
				} else {
					leaf = NODEPTR(mp, nkeys-1);
					MDB_GET_KEY2(leaf, nodekey);
				}
				rc = mc->mc_dbx->md_cmp(key, &nodekey);
				if (rc == 0) {
					/* last node was the one we wanted */
					mc->mc_ki[mc->mc_top] = nkeys-1;
					if (exactp)
						*exactp = 1;
					goto set1;
				}
				if (rc < 0) {
					if (mc->mc_ki[mc->mc_top] < NUMKEYS(mp)) {
						/* This is definitely the right page, skip search_page */
						if (mp->mp_flags & P_LEAF2) {
							nodekey.mv_data = LEAF2KEY(mp,
								 mc->mc_ki[mc->mc_top], nodekey.mv_size);
						} else {
							leaf = NODEPTR(mp, mc->mc_ki[mc->mc_top]);
							MDB_GET_KEY2(leaf, nodekey);
						}
						rc = mc->mc_dbx->md_cmp(key, &nodekey);
						if (rc == 0) {
							/* current node was the one we wanted */
							if (exactp)
								*exactp = 1;
							goto set1;
						}
					}
					rc = 0;
					goto set2;
				}
			}
			/* If any parents have right-sibs, search.
			 * Otherwise, there's nothing further.
			 */
			for (i=0; i<mc->mc_top; i++)
				if (mc->mc_ki[i] <
					NUMKEYS(mc->mc_pg[i])-1)
					break;
			if (i == mc->mc_top) {
				/* There are no other pages */
				mc->mc_ki[mc->mc_top] = nkeys;
				return MDB_NOTFOUND;
			}
		}
		if (!mc->mc_top) {
			/* There are no other pages */
			mc->mc_ki[mc->mc_top] = 0;
			if (op == MDB_SET_RANGE && !exactp) {
				rc = 0;
				goto set1;
			} else
				return MDB_NOTFOUND;
		}
	}

	rc = mdb_page_search(mc, key, 0);
	if (rc != MDB_SUCCESS)
		return rc;

	mp = mc->mc_pg[mc->mc_top];
	mdb_cassert(mc, IS_LEAF(mp));

set2:
	leaf = mdb_node_search(mc, key, exactp);
	if (exactp != NULL && !*exactp) {
		/* MDB_SET specified and not an exact match. */
		return MDB_NOTFOUND;
	}

	if (leaf == NULL) {
		DPUTS("===> inexact leaf not found, goto sibling");
		if ((rc = mdb_cursor_sibling(mc, 1)) != MDB_SUCCESS) {
			mc->mc_flags |= C_EOF;
			return rc;		/* no entries matched */
		}
		mp = mc->mc_pg[mc->mc_top];
		mdb_cassert(mc, IS_LEAF(mp));
		leaf = NODEPTR(mp, 0);
	}

set1:
	mc->mc_flags |= C_INITIALIZED;
	mc->mc_flags &= ~C_EOF;

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

	if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
		mdb_xcursor_init1(mc, leaf);
	}
	if (data) {
		if (F_ISSET(leaf->mn_flags, F_DUPDATA)) {
			if (op == MDB_SET || op == MDB_SET_KEY || op == MDB_SET_RANGE) {
				rc = mdb_cursor_first(&mc->mc_xcursor->mx_cursor, data, NULL);
			} else {
				int ex2, *ex2p;
				if (op == MDB_GET_BOTH) {
					ex2p = &ex2;
					ex2 = 0;
				} else {
					ex2p = NULL;
				}
				rc = mdb_cursor_set(&mc->mc_xcursor->mx_cursor, data, NULL, MDB_SET_RANGE, ex2p);
				if (rc != MDB_SUCCESS)
					return rc;
			}
		} else if (op == MDB_GET_BOTH || op == MDB_GET_BOTH_RANGE) {
			MDB_val olddata;
			MDB_cmp_func *dcmp;
			if ((rc = mdb_node_read(mc->mc_txn, leaf, &olddata)) != MDB_SUCCESS)
				return rc;
			dcmp = mc->mc_dbx->md_dcmp;
#if UINT_MAX < SIZE_MAX
			if (dcmp == mdb_cmp_int && olddata.mv_size == sizeof(size_t))
				dcmp = mdb_cmp_clong;
#endif
			rc = dcmp(data, &olddata);
			if (rc) {
				if (op == MDB_GET_BOTH || rc > 0)
					return MDB_NOTFOUND;
				rc = 0;
				*data = olddata;
			}

		} else {
			if (mc->mc_xcursor)
				mc->mc_xcursor->mx_cursor.mc_flags &= ~(C_INITIALIZED|C_EOF);
			if ((rc = mdb_node_read(mc->mc_txn, leaf, data)) != MDB_SUCCESS)
				return rc;
		}
	}

	/* The key already matches in all other cases */
	if (op == MDB_SET_RANGE || op == MDB_SET_KEY)
		MDB_GET_KEY(leaf, key);
	DPRINTF(("==> cursor placed on key [%s]", DKEY(key)));

	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x79ac
movl $0xffff87c3, -0x4(%rbp) # imm = 0xFFFF87C3
jmp 0x8142
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x79c8
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x44(%rax), %ecx
andl $-0x4, %ecx
movl %ecx, 0x44(%rax)
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7d70
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movq 0x48(%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xc(%rax), %eax
subl $0x10, %eax
shrl %eax
cmpl $0x0, %eax
jne 0x7a24
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movw $0x0, 0x148(%rax,%rcx,2)
movl $0xffff87b2, -0x4(%rbp) # imm = 0xFFFF87B2
jmp 0x8142
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7a58
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl (%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq $0x10, %rax
imulq $0x0, -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x7a86
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzwl 0x6(%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x7ad1
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movw $0x0, 0x148(%rax,%rcx,2)
cmpq $0x0, -0x30(%rbp)
je 0x7acc
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7ebd
cmpl $0x0, -0x34(%rbp)
jle 0x7d28
movq -0x40(%rbp), %rax
movzwl 0xc(%rax), %eax
subl $0x10, %eax
shrl %eax
movl %eax, -0x60(%rbp)
cmpl $0x1, -0x60(%rbp)
jbe 0x7ca1
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7b23
movq -0x40(%rbp), %rax
addq $0x10, %rax
movl -0x60(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
imulq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x7b5a
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
movl -0x60(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
movzwl 0x10(%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzwl 0x6(%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x7bac
movl -0x60(%rbp), %eax
subl $0x1, %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movw %dx, 0x148(%rax,%rcx,2)
cmpq $0x0, -0x30(%rbp)
je 0x7ba7
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7ebd
cmpl $0x0, -0x34(%rbp)
jge 0x7c9f
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movzwl 0x148(%rax,%rcx,2), %eax
movq -0x40(%rbp), %rcx
movzwl 0xc(%rcx), %ecx
subl $0x10, %ecx
shrl %ecx
cmpl %ecx, %eax
jae 0x7c93
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7c19
movq -0x40(%rbp), %rax
addq $0x10, %rax
movq -0x10(%rbp), %rcx
movq -0x10(%rbp), %rdx
movzwl 0x42(%rdx), %edx
movzwl 0x148(%rcx,%rdx,2), %ecx
imulq -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x7c5c
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rsi
movzwl 0x42(%rsi), %esi
movzwl 0x148(%rdx,%rsi,2), %edx
movzwl 0x10(%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzwl 0x6(%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x7c91
cmpq $0x0, -0x30(%rbp)
je 0x7c8c
movq -0x30(%rbp), %rax
movl $0x1, (%rax)
jmp 0x7ebd
jmp 0x7c93
movl $0x0, -0x34(%rbp)
jmp 0x7de8
jmp 0x7ca1
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
cmpl %ecx, %eax
jae 0x7cf1
movq -0x10(%rbp), %rax
movl -0x5c(%rbp), %ecx
movzwl 0x148(%rax,%rcx,2), %eax
movq -0x10(%rbp), %rcx
movl -0x5c(%rbp), %edx
movq 0x48(%rcx,%rdx,8), %rcx
movzwl 0xc(%rcx), %ecx
subl $0x10, %ecx
shrl %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x7ce4
jmp 0x7cf1
jmp 0x7ce6
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x7ca8
movl -0x5c(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
cmpl %ecx, %eax
jne 0x7d26
movl -0x60(%rbp), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movw %dx, 0x148(%rax,%rcx,2)
movl $0xffff87b2, -0x4(%rbp) # imm = 0xFFFF87B2
jmp 0x8142
jmp 0x7d28
movq -0x10(%rbp), %rax
cmpw $0x0, 0x42(%rax)
jne 0x7d6e
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movw $0x0, 0x148(%rax,%rcx,2)
cmpl $0x11, -0x24(%rbp)
jne 0x7d62
cmpq $0x0, -0x30(%rbp)
jne 0x7d62
movl $0x0, -0x34(%rbp)
jmp 0x7ebd
movl $0xffff87b2, -0x4(%rbp) # imm = 0xFFFF87B2
jmp 0x8142
jmp 0x7d70
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0xeec0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x7d93
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8142
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movq 0x48(%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x2, %eax
cmpl $0x2, %eax
jne 0x7dba
jmp 0x7de6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdi
leaq 0xfc8c(%rip), %rsi      # 0x17a59
leaq 0xfc91(%rip), %rdx      # 0x17a65
leaq 0xf634(%rip), %rcx      # 0x1740f
movl $0x172f, %r8d           # imm = 0x172F
callq 0x133a0
jmp 0x7de8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xf1a0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x7e19
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x7e19
movl $0xffff87b2, -0x4(%rbp) # imm = 0xFFFF87B2
jmp 0x8142
cmpq $0x0, -0x48(%rbp)
jne 0x7ebb
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0xfe30
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x7e52
movq -0x10(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x44(%rax)
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8142
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzwl 0x42(%rcx), %ecx
movq 0x48(%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x2, %eax
cmpl $0x2, %eax
jne 0x7e79
jmp 0x7ea5
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rdi
leaq 0xfbcd(%rip), %rsi      # 0x17a59
leaq 0xfbd2(%rip), %rdx      # 0x17a65
leaq 0xf575(%rip), %rcx      # 0x1740f
movl $0x173f, %r8d           # imm = 0x173F
callq 0x133a0
movq -0x40(%rbp), %rax
movq -0x40(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x7ebd
movq -0x10(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x44(%rax)
movq -0x10(%rbp), %rax
movl 0x44(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x44(%rax)
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0x20, %eax
cmpl $0x20, %eax
jne 0x7f41
cmpl $0x11, -0x24(%rbp)
je 0x7ef3
cmpl $0x10, -0x24(%rbp)
jne 0x7f35
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl (%rax), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movzwl 0x42(%rdx), %edx
movzwl 0x148(%rax,%rdx,2), %eax
movq -0x18(%rbp), %rdx
imulq (%rdx), %rax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x8142
movq -0x48(%rbp), %rax
movzwl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x4, %eax
jne 0x7f5e
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x8800
cmpq $0x0, -0x20(%rbp)
je 0x8106
movq -0x48(%rbp), %rax
movzwl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x4, %eax
jne 0x8001
cmpl $0xf, -0x24(%rbp)
je 0x7f8f
cmpl $0x10, -0x24(%rbp)
je 0x7f8f
cmpl $0x11, -0x24(%rbp)
jne 0x7fa9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x8b00
movl %eax, -0x34(%rbp)
jmp 0x7ffc
cmpl $0x2, -0x24(%rbp)
jne 0x7fc0
leaq -0x64(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x64(%rbp)
jmp 0x7fc8
movq $0x0, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x70(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
movl $0x11, %ecx
callq 0x7970
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x7ffa
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8142
jmp 0x7ffc
jmp 0x8104
cmpl $0x2, -0x24(%rbp)
je 0x8011
cmpl $0x3, -0x24(%rbp)
jne 0x80bf
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x8a10
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x8039
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8142
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x88(%rbp)
leaq -0x4dc3(%rip), %rax     # 0x3290
cmpq %rax, -0x88(%rbp)
jne 0x8071
cmpq $0x8, -0x80(%rbp)
jne 0x8071
leaq -0x4d8a(%rip), %rax     # 0x32e0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq -0x20(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq *%rax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x80bd
cmpl $0x2, -0x24(%rbp)
je 0x8097
cmpl $0x0, -0x34(%rbp)
jle 0x80a3
movl $0xffff87b2, -0x4(%rbp) # imm = 0xFFFF87B2
jmp 0x8142
movl $0x0, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, (%rax)
movq -0x78(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x8102
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x80db
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x44(%rax), %ecx
andl $-0x4, %ecx
movl %ecx, 0x44(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x8a10
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x8100
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8142
jmp 0x8102
jmp 0x8104
jmp 0x8106
cmpl $0x11, -0x24(%rbp)
je 0x8112
cmpl $0x10, -0x24(%rbp)
jne 0x813c
cmpq $0x0, -0x18(%rbp)
je 0x813a
movq -0x48(%rbp), %rax
movzwl 0x6(%rax), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
addq $0x8, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x813c
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nop