// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_rebalance
static int
mdb_rebalance(MDB_cursor *mc)
{
	MDB_node	*node;
	int rc;
	unsigned int ptop, minkeys;
	MDB_cursor	mn;
	indx_t oldki;

	minkeys = 1 + (IS_BRANCH(mc->mc_pg[mc->mc_top]));
	DPRINTF(("rebalancing %s page %"Z"u (has %u keys, %.1f%% full)",
	    IS_LEAF(mc->mc_pg[mc->mc_top]) ? "leaf" : "branch",
	    mdb_dbg_pgno(mc->mc_pg[mc->mc_top]), NUMKEYS(mc->mc_pg[mc->mc_top]),
		(float)PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) / 10));

	if (PAGEFILL(mc->mc_txn->mt_env, mc->mc_pg[mc->mc_top]) >= FILL_THRESHOLD &&
		NUMKEYS(mc->mc_pg[mc->mc_top]) >= minkeys) {
		DPRINTF(("no need to rebalance page %"Z"u, above fill threshold",
		    mdb_dbg_pgno(mc->mc_pg[mc->mc_top])));
		return MDB_SUCCESS;
	}

	if (mc->mc_snum < 2) {
		MDB_page *mp = mc->mc_pg[0];
		if (IS_SUBP(mp)) {
			DPUTS("Can't rebalance a subpage, ignoring");
			return MDB_SUCCESS;
		}
		if (NUMKEYS(mp) == 0) {
			DPUTS("tree is completely empty");
			mc->mc_db->md_root = P_INVALID;
			mc->mc_db->md_depth = 0;
			mc->mc_db->md_leaf_pages = 0;
			rc = mdb_midl_append(&mc->mc_txn->mt_free_pgs, mp->mp_pgno);
			if (rc)
				return rc;
			/* Adjust cursors pointing to mp */
			mc->mc_snum = 0;
			mc->mc_top = 0;
			mc->mc_flags &= ~C_INITIALIZED;
			{
				MDB_cursor *m2, *m3;
				MDB_dbi dbi = mc->mc_dbi;

				for (m2 = mc->mc_txn->mt_cursors[dbi]; m2; m2=m2->mc_next) {
					if (mc->mc_flags & C_SUB)
						m3 = &m2->mc_xcursor->mx_cursor;
					else
						m3 = m2;
					if (m3->mc_snum < mc->mc_snum) continue;
					if (m3->mc_pg[0] == mp) {
						m3->mc_snum = 0;
						m3->mc_top = 0;
						m3->mc_flags &= ~C_INITIALIZED;
					}
				}
			}
		} else if (IS_BRANCH(mp) && NUMKEYS(mp) == 1) {
			int i;
			DPUTS("collapsing root page!");
			rc = mdb_midl_append(&mc->mc_txn->mt_free_pgs, mp->mp_pgno);
			if (rc)
				return rc;
			mc->mc_db->md_root = NODEPGNO(NODEPTR(mp, 0));
			rc = mdb_page_get(mc->mc_txn,mc->mc_db->md_root,&mc->mc_pg[0],NULL);
			if (rc)
				return rc;
			mc->mc_db->md_depth--;
			mc->mc_db->md_branch_pages--;
			mc->mc_ki[0] = mc->mc_ki[1];
			for (i = 1; i<mc->mc_db->md_depth; i++) {
				mc->mc_pg[i] = mc->mc_pg[i+1];
				mc->mc_ki[i] = mc->mc_ki[i+1];
			}
			{
				/* Adjust other cursors pointing to mp */
				MDB_cursor *m2, *m3;
				MDB_dbi dbi = mc->mc_dbi;

				for (m2 = mc->mc_txn->mt_cursors[dbi]; m2; m2=m2->mc_next) {
					if (mc->mc_flags & C_SUB)
						m3 = &m2->mc_xcursor->mx_cursor;
					else
						m3 = m2;
					if (m3 == mc || m3->mc_snum < mc->mc_snum) continue;
					if (m3->mc_pg[0] == mp) {
						for (i=0; i<m3->mc_snum; i++) {
							m3->mc_pg[i] = m3->mc_pg[i+1];
							m3->mc_ki[i] = m3->mc_ki[i+1];
						}
						m3->mc_snum--;
						m3->mc_top--;
					}
				}
			}
		} else
			DPUTS("root page doesn't need rebalancing");
		return MDB_SUCCESS;
	}

	/* The parent (branch page) must have at least 2 pointers,
	 * otherwise the tree is invalid.
	 */
	ptop = mc->mc_top-1;
	mdb_cassert(mc, NUMKEYS(mc->mc_pg[ptop]) > 1);

	/* Leaf page fill factor is below the threshold.
	 * Try to move keys from left or right neighbor, or
	 * merge with a neighbor page.
	 */

	/* Find neighbors.
	 */
	mdb_cursor_copy(mc, &mn);
	mn.mc_xcursor = NULL;

	oldki = mc->mc_ki[mc->mc_top];
	if (mc->mc_ki[ptop] == 0) {
		/* We're the leftmost leaf in our parent.
		 */
		DPUTS("reading right neighbor");
		mn.mc_ki[ptop]++;
		node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]);
		rc = mdb_page_get(mc->mc_txn,NODEPGNO(node),&mn.mc_pg[mn.mc_top],NULL);
		if (rc)
			return rc;
		mn.mc_ki[mn.mc_top] = 0;
		mc->mc_ki[mc->mc_top] = NUMKEYS(mc->mc_pg[mc->mc_top]);
	} else {
		/* There is at least one neighbor to the left.
		 */
		DPUTS("reading left neighbor");
		mn.mc_ki[ptop]--;
		node = NODEPTR(mc->mc_pg[ptop], mn.mc_ki[ptop]);
		rc = mdb_page_get(mc->mc_txn,NODEPGNO(node),&mn.mc_pg[mn.mc_top],NULL);
		if (rc)
			return rc;
		mn.mc_ki[mn.mc_top] = NUMKEYS(mn.mc_pg[mn.mc_top]) - 1;
		mc->mc_ki[mc->mc_top] = 0;
	}

	DPRINTF(("found neighbor page %"Z"u (%u keys, %.1f%% full)",
	    mn.mc_pg[mn.mc_top]->mp_pgno, NUMKEYS(mn.mc_pg[mn.mc_top]),
		(float)PAGEFILL(mc->mc_txn->mt_env, mn.mc_pg[mn.mc_top]) / 10));

	/* If the neighbor page is above threshold and has enough keys,
	 * move one key from it. Otherwise we should try to merge them.
	 * (A branch page must never have less than 2 keys.)
	 */
	minkeys = 1 + (IS_BRANCH(mn.mc_pg[mn.mc_top]));
	if (PAGEFILL(mc->mc_txn->mt_env, mn.mc_pg[mn.mc_top]) >= FILL_THRESHOLD && NUMKEYS(mn.mc_pg[mn.mc_top]) > minkeys) {
		rc = mdb_node_move(&mn, mc);
		if (mc->mc_ki[ptop]) {
			oldki++;
		}
	} else {
		if (mc->mc_ki[ptop] == 0) {
			rc = mdb_page_merge(&mn, mc);
		} else {
			MDB_cursor dummy;
			oldki += NUMKEYS(mn.mc_pg[mn.mc_top]);
			mn.mc_ki[mn.mc_top] += mc->mc_ki[mn.mc_top] + 1;
			/* We want mdb_rebalance to find mn when doing fixups */
			if (mc->mc_flags & C_SUB) {
				dummy.mc_next = mc->mc_txn->mt_cursors[mc->mc_dbi];
				mc->mc_txn->mt_cursors[mc->mc_dbi] = &dummy;
				dummy.mc_xcursor = (MDB_xcursor *)&mn;
			} else {
				mn.mc_next = mc->mc_txn->mt_cursors[mc->mc_dbi];
				mc->mc_txn->mt_cursors[mc->mc_dbi] = &mn;
			}
			rc = mdb_page_merge(mc, &mn);
			if (mc->mc_flags & C_SUB)
				mc->mc_txn->mt_cursors[mc->mc_dbi] = dummy.mc_next;
			else
				mc->mc_txn->mt_cursors[mc->mc_dbi] = mn.mc_next;
			mdb_cursor_copy(&mn, mc);
		}
		mc->mc_flags &= ~C_EOF;
	}
	mc->mc_ki[mc->mc_top] = oldki;
	return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %rdi, %rbx
movzwl 0x42(%rdi), %r13d
movq 0x48(%rdi,%r13,8), %r8
movq 0x18(%rdi), %rdi
movq 0x20(%rdi), %rcx
movl 0x10(%rcx), %r9d
addl $-0x10, %r9d
movzwl 0xe(%r8), %eax
movzwl 0xc(%r8), %esi
subl %esi, %eax
movzwl %ax, %eax
movl %r9d, %edx
subl %eax, %edx
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
xorl %r15d, %r15d
xorl %edx, %edx
divq %r9
cmpq $0xfa, %rax
jb 0xaea9
movzwl 0xa(%r8), %eax
andl $0x1, %eax
incl %eax
addl $-0x10, %esi
shrl %esi
cmpl %eax, %esi
jae 0xb5be
leaq 0x48(%rbx), %r14
cmpw $0x1, 0x40(%rbx)
ja 0xaf5d
movq (%r14), %r12
movzwl 0xa(%r12), %eax
xorl %r15d, %r15d
testb $0x40, %al
jne 0xb5be
movzwl 0xc(%r12), %ecx
addl $-0x10, %ecx
cmpl $0x1, %ecx
ja 0xb07a
movq 0x28(%rbx), %rax
movq $-0x1, 0x28(%rax)
movw $0x0, 0x6(%rax)
movq $0x0, 0x10(%rax)
addq $0x28, %rdi
movq (%r12), %rsi
callq 0xbfd5
testl %eax, %eax
jne 0xb072
movl $0x0, 0x40(%rbx)
andb $-0x2, 0x44(%rbx)
movl 0x20(%rbx), %eax
movq 0x18(%rbx), %rcx
movq 0x68(%rcx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xb3ed
testb $0x4, 0x44(%rbx)
movq %rax, %rcx
je 0xaf3d
movq 0x10(%rax), %rcx
movzwl 0x40(%rcx), %edx
cmpw 0x40(%rbx), %dx
jb 0xaf58
cmpq %r12, 0x48(%rcx)
jne 0xaf58
movl $0x0, 0x40(%rcx)
andb $-0x2, 0x44(%rcx)
movq (%rax), %rax
jmp 0xaf27
decl %r13d
movq (%r14,%r13,8), %rax
movzwl 0xc(%rax), %eax
andl $-0x4, %eax
cmpw $0x10, %ax
je 0xb87b
leaq 0x58(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb8b7
movq $0x0, 0x10(%r12)
movzwl 0x42(%rbx), %eax
movzwl 0x148(%rbx,%rax,2), %ebp
cmpw $0x0, 0x148(%rbx,%r13,2)
movzwl 0x1a0(%rsp,%r13,2), %eax
je 0xb029
decl %eax
movw %ax, 0x1a0(%rsp,%r13,2)
movq 0x48(%rbx,%r13,8), %rcx
movzwl %ax, %eax
movzwl 0x10(%rcx,%rax,2), %eax
movq 0x18(%rbx), %rdi
movl (%rcx,%rax), %edx
movzwl 0x4(%rcx,%rax), %esi
shlq $0x20, %rsi
orq %rdx, %rsi
movzwl 0x9a(%rsp), %eax
leaq (%rsp,%rax,8), %rdx
addq $0xa0, %rdx
xorl %ecx, %ecx
callq 0x789a
testl %eax, %eax
jne 0xb072
movzwl 0x9a(%rsp), %eax
movq 0xa0(%rsp,%rax,8), %rcx
movzwl 0xc(%rcx), %ecx
addl $0x1fff0, %ecx          # imm = 0x1FFF0
shrl %ecx
decl %ecx
movw %cx, 0x1a0(%rsp,%rax,2)
movzwl 0x42(%rbx), %eax
xorl %ecx, %ecx
jmp 0xb0d5
incl %eax
movw %ax, 0x1a0(%rsp,%r13,2)
movq 0x48(%rbx,%r13,8), %rcx
movzwl %ax, %eax
movzwl 0x10(%rcx,%rax,2), %eax
movq 0x18(%rbx), %rdi
movl (%rcx,%rax), %edx
movzwl 0x4(%rcx,%rax), %esi
shlq $0x20, %rsi
orq %rdx, %rsi
movzwl 0x9a(%rsp), %eax
leaq (%rsp,%rax,8), %rdx
addq $0xa0, %rdx
xorl %ecx, %ecx
callq 0x789a
testl %eax, %eax
je 0xb0ae
movl %eax, %r15d
jmp 0xb5be
testb $0x1, %al
je 0xb3ed
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0xb3ed
addq $0x28, %rdi
movq (%r12), %rsi
callq 0xbfd5
testl %eax, %eax
je 0xb2d5
movl %eax, %r15d
xorl %r13d, %r13d
jmp 0xb3e4
movzwl 0x9a(%rsp), %eax
movw $0x0, 0x1a0(%rsp,%rax,2)
movzwl 0x42(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rcx
movzwl 0xc(%rcx), %ecx
addl $0x1fff0, %ecx          # imm = 0x1FFF0
shrl %ecx
movw %cx, 0x148(%rbx,%rax,2)
movzwl 0x9a(%rsp), %ecx
movq 0xa0(%rsp,%rcx,8), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rsi), %rax
movl 0x10(%rax), %r9d
addl $-0x10, %r9d
movzwl 0xe(%rdi), %eax
movzwl 0xc(%rdi), %r8d
subl %r8d, %eax
movzwl %ax, %eax
movl %r9d, %edx
subl %eax, %edx
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
xorl %edx, %edx
divq %r9
cmpq $0xfa, %rax
jb 0xb216
movzwl 0xa(%rdi), %eax
andl $0x1, %eax
incl %eax
addl $-0x10, %r8d
shrl %r8d
cmpl %eax, %r8d
jbe 0xb216
leaq 0x58(%rsp), %rdi
callq 0xa4f1
testl %eax, %eax
jne 0xb5a1
movq %rbx, %rdi
callq 0xa4f1
testl %eax, %eax
jne 0xb5a1
movzwl 0x9a(%rsp), %edx
movq 0xa0(%rsp,%rdx,8), %rcx
movzwl 0xa(%rcx), %eax
testb $0x20, %al
jne 0xb3f5
movzwl 0x1a0(%rsp,%rdx,2), %edx
movzwl 0x10(%rcx,%rdx,2), %r12d
addq %rcx, %r12
testb $0x1, %r12b
jne 0xb896
movl (%r12), %ecx
movzwl 0x4(%r12), %r9d
testb $0x1, %al
je 0xb42d
testw %dx, %dx
jne 0xb42d
movq %rcx, 0x18(%rsp)
movq %r9, 0x20(%rsp)
leaq 0x58(%rsp), %rdi
movzwl 0x40(%rdi), %eax
movq %rax, 0x28(%rsp)
callq 0xbd70
movl %eax, %r15d
testl %eax, %eax
jne 0xb5a4
movq 0x28(%rsp), %rdx
movzwl 0x9a(%rsp), %eax
movq 0xa0(%rsp,%rax,8), %rax
testb $0x20, 0xa(%rax)
jne 0xb444
movzwl 0x10(%rax), %ecx
addq %rcx, %rax
addq $0x8, %rax
movzwl -0x2(%rax), %ecx
movq %rcx, 0x8(%rsp)
jmp 0xb457
cmpw $0x0, 0x148(%rbx,%r13,2)
je 0xb266
movzwl 0xc(%rdi), %eax
addl $0x1fff0, %eax          # imm = 0x1FFF0
shrl %eax
addl %eax, %ebp
addl %ecx, %ecx
movzwl 0x148(%rbx,%rcx), %eax
addw 0x1a0(%rsp,%rcx), %ax
incl %eax
movw %ax, 0x1a0(%rsp,%rcx)
testb $0x4, 0x44(%rbx)
movq 0x68(%rsi), %rax
movl 0x20(%rbx), %ecx
leaq (%rax,%rcx,8), %rax
movq (%rax), %rcx
jne 0xb278
movq %rcx, 0x58(%rsp)
jmp 0xb28e
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0xb91b
movl %eax, %r15d
jmp 0xb2cc
leaq 0x1e0(%rsp), %rdx
movq %rcx, (%rdx)
movq %rdx, (%rax)
leaq 0x1f0(%rsp), %rax
movq %r12, (%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb91b
movl %eax, %r15d
testb $0x4, 0x44(%rbx)
leaq 0x1e0(%rsp), %rax
cmoveq %r12, %rax
movq (%rax), %rax
movq 0x18(%rbx), %rcx
movq 0x68(%rcx), %rcx
movl 0x20(%rbx), %edx
movq %rax, (%rcx,%rdx,8)
movq %r12, %rdi
movq %rbx, %rsi
callq 0xb8b7
andb $-0x3, 0x44(%rbx)
jmp 0xb5b2
movzwl 0x10(%r12), %eax
movl (%r12,%rax), %ecx
movzwl 0x4(%r12,%rax), %esi
shlq $0x20, %rsi
orq %rcx, %rsi
movq 0x28(%rbx), %rax
movq %rsi, 0x28(%rax)
movq 0x18(%rbx), %rdi
xorl %r13d, %r13d
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x789a
testl %eax, %eax
je 0xb311
movl %eax, %r15d
jmp 0xb3e4
movq 0x28(%rbx), %rax
decw 0x6(%rax)
decq 0x8(%rax)
movzwl 0x14a(%rbx), %ecx
movw %cx, 0x148(%rbx)
cmpw $0x2, 0x6(%rax)
jb 0xb362
xorl %ecx, %ecx
movq 0x58(%rbx,%rcx,8), %rdx
movq %rdx, 0x50(%rbx,%rcx,8)
movzwl 0x14c(%rbx,%rcx,2), %edx
movw %dx, 0x14a(%rbx,%rcx,2)
movzwl 0x6(%rax), %edx
leaq 0x1(%rcx), %rsi
addq $0x2, %rcx
cmpq %rdx, %rcx
movq %rsi, %rcx
jb 0xb334
movl 0x20(%rbx), %eax
movq 0x18(%rbx), %rcx
movq 0x68(%rcx), %rcx
movq (%rcx,%rax,8), %rax
movb $0x1, %r13b
testq %rax, %rax
je 0xb3e4
movl 0x44(%rbx), %ecx
movq %rax, %rdx
testb $0x4, %cl
je 0xb388
movq 0x10(%rax), %rdx
cmpq %rbx, %rdx
je 0xb3dc
movzwl 0x40(%rdx), %esi
cmpw 0x40(%rbx), %si
jb 0xb3dc
cmpq %r12, 0x48(%rdx)
jne 0xb3dc
movzwl 0x40(%rdx), %esi
testw %si, %si
je 0xb3d2
xorl %edi, %edi
movq 0x50(%rdx,%rdi,8), %rsi
movq %rsi, 0x48(%rdx,%rdi,8)
movzwl 0x14a(%rdx,%rdi,2), %esi
movw %si, 0x148(%rdx,%rdi,2)
leaq 0x1(%rdi), %r8
movzwl 0x40(%rdx), %esi
movq %r8, %rdi
cmpq %rsi, %r8
jb 0xb3a8
decl %esi
movw %si, 0x40(%rdx)
decw 0x42(%rdx)
movq (%rax), %rax
testq %rax, %rax
jne 0xb37c
testb %r13b, %r13b
je 0xb5be
xorl %r15d, %r15d
jmp 0xb5be
movq 0x80(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x8(%rsp)
movzwl 0x1a0(%rsp,%rdx,2), %edx
imulq %rax, %rdx
leaq (%rcx,%rdx), %rax
addq $0x10, %rax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
xorl %r9d, %r9d
xorl %r8d, %r8d
jmp 0xb49e
movzwl 0x6(%r12), %eax
movq %rax, 0x8(%rsp)
leaq 0x8(%r12), %rax
movq %rax, 0x10(%rsp)
jmp 0xb479
movq 0x80(%rsp), %rcx
movl (%rcx), %ecx
movq %rcx, 0x8(%rsp)
addq $0x10, %rax
movq 0x20(%rsp), %r9
movq 0x18(%rsp), %rcx
movq %rax, 0x10(%rsp)
leal -0x1(%rdx), %eax
movw %dx, 0x98(%rsp)
movw %ax, 0x9a(%rsp)
movq %r9, %r8
shlq $0x20, %r8
orq %rcx, %r8
movl (%r12), %eax
movq %rax, 0x40(%rsp)
movzwl 0x6(%r12), %eax
addq %r12, %rax
addq $0x8, %rax
movq %rax, 0x48(%rsp)
movzwl 0x42(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rcx
testb $0x1, 0xa(%rcx)
je 0xb57f
cmpw $0x0, 0x148(%rbx,%rax,2)
jne 0xb57f
movq %r8, 0x18(%rsp)
movq %r9, 0x20(%rsp)
movzwl 0x40(%rbx), %eax
movw %ax, 0x28(%rsp)
leaq 0x1e0(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb8b7
movq %r12, %rdi
callq 0xbd70
testl %eax, %eax
je 0xb4f9
xorl %ecx, %ecx
movl %eax, %r15d
jmp 0xb571
movzwl 0x28(%rsp), %eax
movzwl 0x222(%rsp), %ecx
movq 0x228(%rsp,%rcx,8), %rcx
testb $0x20, 0xa(%rcx)
jne 0xb52a
movzwl 0x10(%rcx), %edx
addq %rdx, %rcx
addq $0x8, %rcx
movzwl -0x2(%rcx), %edx
movq %rdx, 0x30(%rsp)
jmp 0xb53d
movq 0x208(%rsp), %rdx
movl (%rdx), %edx
movq %rdx, 0x30(%rsp)
addq $0x10, %rcx
leaq 0x30(%rsp), %rsi
movq %rcx, 0x8(%rsi)
leal -0x1(%rax), %ecx
leaq 0x1e0(%rsp), %rdi
movw %ax, 0x40(%rdi)
movw %cx, 0x42(%rdi)
movw $0x0, 0x328(%rsp,%rcx,2)
callq 0x71ec
testl %eax, %eax
sete %cl
cmovnel %eax, %r15d
testb %cl, %cl
movq 0x20(%rsp), %r9
movq 0x18(%rsp), %r8
je 0xb5a4
movzwl 0x42(%rbx), %eax
movzwl 0x148(%rbx,%rax,2), %esi
leaq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq %rbx, %rdi
callq 0x8b01
testl %eax, %eax
je 0xb5d3
movl %eax, %r15d
cmpw $0x1, 0x148(%rbx,%r13,2)
sbbw $-0x1, %bp
movzwl 0x42(%rbx), %eax
movw %bp, 0x148(%rbx,%rax,2)
movl %r15d, %eax
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rsp), %esi
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x776d
movl 0x20(%r15), %eax
movq 0x18(%r15), %rcx
movq 0x68(%rcx), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xb671
movzwl 0x9a(%rsp), %ecx
movq 0xa0(%rsp,%rcx,8), %rcx
movl 0x9c(%rsp), %edx
movq %rax, %rsi
testb $0x4, %dl
je 0xb61c
movq 0x10(%rax), %rsi
cmpq %r15, %rsi
je 0xb669
movzwl 0x9a(%rsp), %edi
cmpq %rcx, 0x48(%rsi,%rdi,8)
jne 0xb669
leal (%rdi,%rdi), %r8d
movzwl 0x148(%rsi,%r8), %r9d
cmpw 0x1a0(%rsp,%r8), %r9w
jne 0xb669
movzwl 0x42(%rbx), %r8d
movq 0x48(%rbx,%r8,8), %r9
movq %r9, 0x48(%rsi,%rdi,8)
movzwl 0x148(%rbx,%r8,2), %r8d
movw %r8w, 0x148(%rsi,%rdi,2)
movq (%rax), %rax
testq %rax, %rax
jne 0xb610
movzwl 0x9a(%rsp), %eax
cmpw $0x0, 0x1a0(%rsp,%rax,2)
je 0xb6e0
movzwl 0x42(%rbx), %eax
xorl %r15d, %r15d
cmpw $0x0, 0x148(%rbx,%rax,2)
jne 0xb5a4
cmpw $0x0, 0x146(%rbx,%rax,2)
je 0xb80c
movzwl 0x9a(%rsp), %ecx
movq 0xa0(%rsp,%rcx,8), %rcx
movq (%r14,%rax,8), %rax
testb $0x20, 0xa(%rcx)
jne 0xb7cd
movzwl 0x10(%rax), %ecx
addq %rcx, %rax
addq $0x8, %rax
movzwl -0x2(%rax), %ecx
movq %rcx, 0x8(%rsp)
jmp 0xb7d1
cmpw $0x0, 0x19e(%rsp,%rax,2)
je 0xb750
movq 0xa0(%rsp,%rax,8), %rax
testb $0x20, 0xa(%rax)
jne 0xb70f
movzwl 0x10(%rax), %ecx
addq %rcx, %rax
addq $0x8, %rax
movzwl -0x2(%rax), %ecx
movq %rcx, 0x8(%rsp)
jmp 0xb713
addq $0x10, %rax
leaq 0x8(%rsp), %r15
movq %rax, 0x8(%r15)
leaq 0x58(%rsp), %rdi
leaq 0x1e0(%rsp), %r12
movq %r12, %rsi
callq 0xb8b7
decw 0x40(%r12)
decw 0x42(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq 0x71ec
testl %eax, %eax
jne 0xb5a1
movzwl 0x9a(%rsp), %eax
movq 0xa0(%rsp,%rax,8), %rcx
testb $0x1, 0xa(%rcx)
je 0xb684
movzwl 0x1a0(%rsp,%rax,2), %r12d
leaq 0x30(%rsp), %rsi
movq $0x0, (%rsi)
movw $0x0, 0x1a0(%rsp,%rax,2)
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x71ec
movzwl 0x42(%r15), %ecx
movw %r12w, 0x1a0(%rsp,%rcx,2)
testl %eax, %eax
je 0xb684
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x4454(%rip), %rsi      # 0xfc10
leaq 0x443f(%rip), %rdx      # 0xfc02
movl $0x1e05, %ecx           # imm = 0x1E05
callq 0xc43e
addq $0x10, %rax
leaq 0x8(%rsp), %r14
movq %rax, 0x8(%r14)
leaq 0x1e0(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb8b7
decw 0x40(%r12)
decw 0x42(%r12)
movq %r12, %rdi
movq %r14, %rsi
callq 0x71ec
testl %eax, %eax
jne 0xb5a1
movzwl 0x42(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rcx
testb $0x1, 0xa(%rcx)
je 0xb5a4
movzwl 0x148(%rbx,%rax,2), %r14d
leaq 0x30(%rsp), %rsi
movq $0x0, (%rsi)
movw $0x0, 0x148(%rbx,%rax,2)
movq %rbx, %rdi
callq 0x71ec
movzwl 0x42(%rbx), %ecx
movw %r14w, 0x148(%rbx,%rcx,2)
testl %eax, %eax
je 0xb5a4
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rdi
leaq 0x43a6(%rip), %rsi      # 0xfc10
leaq 0x4391(%rip), %rdx      # 0xfc02
movl $0x1e21, %ecx           # imm = 0x1E21
callq 0xc43e
leaq 0x433e(%rip), %rsi      # 0xfbc0
leaq 0x4354(%rip), %rdx      # 0xfbdd
movq %rcx, %rdi
movl $0x1f33, %ecx           # imm = 0x1F33
callq 0xc43e
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x4345(%rip), %rsi      # 0xfbeb
leaq 0x4355(%rip), %rdx      # 0xfc02
movl $0x1d92, %ecx           # imm = 0x1D92
callq 0xc43e