// File: /workspace/github_cpp_makefile_star2_O2/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), %r14d
movq 0x48(%rdi,%r14,8), %rsi
movq 0x18(%rdi), %r13
movq 0x20(%r13), %rdi
movl 0x10(%rdi), %r8d
addl $-0x10, %r8d
movzwl 0xe(%rsi), %eax
movzwl 0xc(%rsi), %ecx
subl %ecx, %eax
movzwl %ax, %eax
movl %r8d, %edx
subl %eax, %edx
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
xorl %r15d, %r15d
xorl %edx, %edx
divq %r8
cmpq $0xfa, %rax
jb 0xa207
movzwl 0xa(%rsi), %eax
andl $0x1, %eax
incl %eax
addl $-0x10, %ecx
shrl %ecx
cmpl %eax, %ecx
jae 0xa815
leaq 0x48(%rbx), %rdx
cmpw $0x1, 0x40(%rbx)
ja 0xa2b1
movq (%rdx), %r12
movzwl 0xa(%r12), %eax
xorl %r15d, %r15d
testb $0x40, %al
jne 0xa815
movzwl 0xc(%r12), %ecx
addl $-0x10, %ecx
cmpl $0x1, %ecx
ja 0xa544
movq 0x28(%rbx), %rax
orq $-0x1, 0x28(%rax)
andw $0x0, 0x6(%rax)
andq $0x0, 0x10(%rax)
addq $0x28, %r13
movq (%r12), %rsi
movq %r13, %rdi
callq 0xb24b
testl %eax, %eax
jne 0xa5a0
andl $0x0, 0x40(%rbx)
andb $-0x2, 0x44(%rbx)
movl 0x20(%rbx), %eax
movq 0x18(%rbx), %rcx
shlq $0x3, %rax
addq 0x68(%rcx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xa815
testb $0x4, 0x44(%rbx)
movq %rax, %rcx
je 0xa297
movq 0x10(%rax), %rcx
movzwl 0x40(%rcx), %edx
cmpw 0x40(%rbx), %dx
jb 0xa27e
cmpq %r12, 0x48(%rcx)
jne 0xa27e
andl $0x0, 0x40(%rcx)
andb $-0x2, 0x44(%rcx)
jmp 0xa27e
leal -0x1(%r14), %ebp
movq %rdx, (%rsp)
movq (%rdx,%rbp,8), %r15
movzwl 0xc(%r15), %eax
andl $-0x4, %eax
cmpw $0x10, %ax
je 0xab8e
leaq 0x58(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xac08
andq $0x0, 0x10(%r12)
movzwl 0x148(%rbx,%r14,2), %r14d
cmpw $0x0, 0x148(%rbx,%rbp,2)
movzwl 0x1a0(%rsp,%rbp,2), %eax
je 0xa374
decl %eax
movw %ax, 0x1a0(%rsp,%rbp,2)
movzwl %ax, %eax
movzwl 0x10(%r15,%rax,2), %eax
movl (%r15,%rax), %ecx
movzwl 0x4(%r15,%rax), %esi
shlq $0x20, %rsi
orq %rcx, %rsi
movzwl 0x9a(%rsp), %eax
leaq (%r12,%rax,8), %rdx
addq $0x48, %rdx
movq %r13, %rdi
xorl %ecx, %ecx
callq 0x6fba
testl %eax, %eax
jne 0xa5a0
movzwl 0x9a(%rsp), %ecx
movq 0xa0(%rsp,%rcx,8), %rax
movzwl 0xc(%rax), %eax
addl $0x1fff0, %eax          # imm = 0x1FFF0
shrl %eax
decl %eax
movw %ax, 0x1a0(%rsp,%rcx,2)
movzwl 0x42(%rbx), %eax
xorl %edx, %edx
jmp 0xa3e0
incl %eax
movw %ax, 0x1a0(%rsp,%rbp,2)
movzwl %ax, %eax
movzwl 0x10(%r15,%rax,2), %eax
movl (%r15,%rax), %ecx
movzwl 0x4(%r15,%rax), %esi
shlq $0x20, %rsi
orq %rcx, %rsi
movzwl 0x9a(%rsp), %eax
leaq (%r12,%rax,8), %rdx
addq $0x48, %rdx
movq %r13, %rdi
xorl %ecx, %ecx
callq 0x6fba
testl %eax, %eax
jne 0xa5a0
movzwl 0x9a(%rsp), %ecx
andw $0x0, 0x1a0(%rsp,%rcx,2)
movzwl 0x42(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rdx
movzwl 0xc(%rdx), %edx
addl $0x1fff0, %edx          # imm = 0x1FFF0
shrl %edx
movw %dx, 0x148(%rbx,%rax,2)
movq 0xa0(%rsp,%rcx,8), %r8
movq 0x18(%rbx), %rsi
movq 0x20(%rsi), %rax
movl 0x10(%rax), %r9d
addl $-0x10, %r9d
movzwl 0xe(%r8), %eax
movzwl 0xc(%r8), %edi
subl %edi, %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 0xa4ec
movzwl 0xa(%r8), %eax
andl $0x1, %eax
incl %eax
leal -0x10(%rdi), %edx
shrl %edx
cmpl %eax, %edx
jbe 0xa4ec
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x9908
testl %eax, %eax
jne 0xa7f7
movq %rbx, %rdi
callq 0x9908
testl %eax, %eax
jne 0xa7f7
movzwl 0x9a(%rsp), %edx
movq 0xa0(%rsp,%rdx,8), %rcx
movzwl 0xa(%rcx), %eax
testb $0x20, %al
jne 0xa6d6
movzwl 0x1a0(%rsp,%rdx,2), %edx
movzwl 0x10(%rcx,%rdx,2), %r13d
addq %rcx, %r13
testb $0x1, %r13b
jne 0xaba6
movl (%r13), %esi
movzwl 0x4(%r13), %r9d
testb $0x1, %al
je 0xa713
testw %dx, %dx
jne 0xa713
movq %rsi, 0x18(%rsp)
movq %r9, 0x28(%rsp)
movl %r14d, 0x20(%rsp)
leaq 0x58(%rsp), %rdi
movzwl 0x40(%rdi), %r14d
callq 0xb029
testl %eax, %eax
je 0xa72e
movl %eax, %r15d
movl 0x20(%rsp), %r14d
jmp 0xa7fa
cmpw $0x0, 0x148(%rbx,%rbp,2)
je 0xa5a8
addl $0x1fff0, %edi          # imm = 0x1FFF0
shrl %edi
addl %edi, %r14d
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 0xa5ba
movq %rcx, 0x58(%rsp)
jmp 0xa5d0
testb $0x1, %al
je 0xa815
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0xa815
movq %rdx, %r14
addq $0x28, %r13
movq (%r12), %rsi
movq %r13, %rdi
callq 0xb24b
testl %eax, %eax
jne 0xa5a0
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
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x6fba
testl %eax, %eax
je 0xa617
movl %eax, %r15d
jmp 0xa815
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0xac59
movl %eax, %r15d
jmp 0xa60e
leaq 0x1e0(%rsp), %rdx
movq %rcx, (%rdx)
movq %rdx, (%rax)
leaq 0x1f0(%rsp), %rax
movq %r12, (%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xac59
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 0xac08
andb $-0x3, 0x44(%rbx)
jmp 0xa808
movq 0x28(%rbx), %rax
decw 0x6(%rax)
decq 0x8(%rax)
movzwl 0x14a(%rbx), %ecx
movw %cx, 0x148(%rbx)
movl $0xa6, %ecx
leaq -0xa5(%rcx), %rdx
movzwl 0x6(%rax), %esi
cmpq %rsi, %rdx
jae 0xa664
movq -0x4d8(%rbx,%rcx,8), %rdx
movq %rdx, -0x4e0(%rbx,%rcx,8)
movzwl (%rbx,%rcx,2), %edx
movw %dx, -0x2(%rbx,%rcx,2)
incq %rcx
jmp 0xa636
movl 0x20(%rbx), %eax
movq 0x18(%rbx), %rcx
shlq $0x3, %rax
addq 0x68(%rcx), %rax
xorl %r15d, %r15d
movq (%rax), %rax
testq %rax, %rax
je 0xa815
testb $0x4, 0x44(%rbx)
movq %rax, %rcx
je 0xa68f
movq 0x10(%rax), %rcx
cmpq %rbx, %rcx
je 0xa676
movzwl 0x40(%rcx), %edx
cmpw 0x40(%rbx), %dx
jb 0xa676
cmpq %r12, 0x48(%rcx)
jne 0xa676
xorl %esi, %esi
cmpq %rdx, %rsi
jae 0xa6ca
movq 0x50(%rcx,%rsi,8), %rdi
movq %rdi, 0x48(%rcx,%rsi,8)
movzwl 0x14a(%rcx,%rsi,2), %edi
movw %di, 0x148(%rcx,%rsi,2)
incq %rsi
jmp 0xa6a6
decl %edx
movw %dx, 0x40(%rcx)
decw 0x42(%rcx)
jmp 0xa676
movq 0x80(%rsp), %rax
movl (%rax), %r13d
movq %r13, 0x8(%rsp)
movzwl 0x1a0(%rsp,%rdx,2), %eax
imulq %r13, %rax
addq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x10(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x30(%rsp)
xorl %r9d, %r9d
xorl %r8d, %r8d
jmp 0xa7bb
movzwl 0x6(%r13), %eax
movq %rax, 0x8(%rsp)
leaq 0x8(%r13), %rcx
movq %rcx, 0x10(%rsp)
movq %rsi, %rcx
movq %rax, %rdx
jmp 0xa79d
movzwl 0x9a(%rsp), %eax
movq 0xa0(%rsp,%rax,8), %rax
testb $0x20, 0xa(%rax)
jne 0xa755
movzwl 0x10(%rax), %ecx
addq %rcx, %rax
addq $0x8, %rax
movzwl -0x2(%rax), %ecx
jmp 0xa763
movq 0x80(%rsp), %rcx
movl (%rcx), %ecx
addq $0x10, %rax
movq 0x28(%rsp), %r9
movq 0x18(%rsp), %rsi
movq %rcx, %rdx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
leal -0x1(%r14), %eax
movw %r14w, 0x98(%rsp)
movw %ax, 0x9a(%rsp)
movl (%r13), %ecx
movzwl 0x6(%r13), %eax
movl 0x20(%rsp), %r14d
movq %r9, %r8
shlq $0x20, %r8
orq %rsi, %r8
movq %rcx, 0x30(%rsp)
addq %r13, %rax
addq $0x8, %rax
movq %rax, 0x38(%rsp)
movq %rdx, %r13
movzwl 0x42(%rbx), %eax
movq 0x48(%rbx,%rax,8), %rcx
testb $0x1, 0xa(%rcx)
je 0xa7d9
cmpw $0x0, 0x148(%rbx,%rax,2)
je 0xa934
movzwl 0x148(%rbx,%rax,2), %esi
leaq 0x8(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movq %rbx, %rdi
callq 0x8110
testl %eax, %eax
je 0xa82a
movl %eax, %r15d
cmpw $0x1, 0x148(%rbx,%rbp,2)
sbbw $-0x1, %r14w
movzwl 0x42(%rbx), %eax
movw %r14w, 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
movq %r12, %rdi
movl %r13d, %esi
callq 0x6e79
movl 0x78(%rsp), %eax
movzwl 0x9a(%rsp), %ecx
movq 0xa0(%rsp,%rcx,8), %rcx
movq 0x70(%rsp), %rdx
shlq $0x3, %rax
addq 0x68(%rdx), %rax
movl 0x9c(%rsp), %edx
movq (%rax), %rax
testq %rax, %rax
je 0xa8c0
movq %rax, %rsi
testb $0x4, %dl
je 0xa871
movq 0x10(%rax), %rsi
cmpq %r12, %rsi
je 0xa85d
movzwl 0x9a(%rsp), %edi
cmpq %rcx, 0x48(%rsi,%rdi,8)
jne 0xa85d
leal (%rdi,%rdi), %r8d
movzwl 0x148(%rsi,%r8), %r9d
cmpw 0x1a0(%rsp,%r8), %r9w
jne 0xa85d
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)
jmp 0xa85d
movzwl 0x9a(%rsp), %eax
movl %eax, %ecx
cmpw $0x0, 0x1a0(%rsp,%rax,2)
je 0xa975
movq (%rsp), %rsi
movzwl 0x42(%rbx), %eax
xorl %r15d, %r15d
cmpw $0x0, 0x148(%rbx,%rax,2)
jne 0xa7fa
cmpw $0x0, 0x146(%rbx,%rax,2)
je 0xab41
movzwl %cx, %ecx
movq 0xa0(%rsp,%rcx,8), %rcx
movq (%rsi,%rax,8), %rax
testb $0x20, 0xa(%rcx)
jne 0xaaf1
movzwl 0x10(%rax), %ecx
addq %rcx, %rax
addq $0x8, %rax
movzwl -0x2(%rax), %ecx
movq %rcx, 0x8(%rsp)
jmp 0xaaf5
movq %r8, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %r9, 0x28(%rsp)
movl %r14d, %r13d
movzwl 0x40(%rbx), %r14d
leaq 0x1e0(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xac08
movq %r15, %rdi
callq 0xb029
testl %eax, %eax
je 0xa9ac
movl %eax, %r15d
movl %r13d, %r14d
jmp 0xa7fa
cmpw $0x0, 0x19e(%rsp,%rax,2)
movq (%rsp), %rsi
je 0xaa38
movq 0xa0(%rsp,%rax,8), %rax
testb $0x20, 0xa(%rax)
jne 0xa9de
movzwl 0x10(%rax), %ecx
addq %rcx, %rax
addq $0x8, %rax
movzwl -0x2(%rax), %ecx
movq %rcx, 0x8(%rsp)
jmp 0xa9e2
movzwl %r14w, %eax
movzwl 0x222(%rsp), %ecx
movq 0x228(%rsp,%rcx,8), %rcx
testb $0x20, 0xa(%rcx)
jne 0xaa93
movzwl 0x10(%rcx), %edx
addq %rdx, %rcx
addq $0x8, %rcx
movzwl -0x2(%rcx), %edx
jmp 0xaaa1
addq $0x10, %rax
leaq 0x8(%rsp), %r15
movq %rax, 0x8(%r15)
leaq 0x58(%rsp), %rdi
leaq 0x1e0(%rsp), %r12
movq %r12, %rsi
callq 0xac08
movq 0x40(%r12), %xmm0
pcmpeqd %xmm1, %xmm1
paddw %xmm0, %xmm1
movd %xmm1, 0x40(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq 0x699a
testl %eax, %eax
jne 0xa7f7
movzwl 0x9a(%rsp), %ecx
movzwl %cx, %eax
movq (%rsp), %rsi
movq 0xa0(%rsp,%rax,8), %rdx
testb $0x1, 0xa(%rdx)
je 0xa8dd
movl %r14d, %r12d
leaq 0x48(%rsp), %rsi
andq $0x0, (%rsi)
movzwl 0x1a0(%rsp,%rax,2), %r14d
andw $0x0, 0x1a0(%rsp,%rax,2)
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x699a
movzwl 0x42(%r15), %ecx
movw %r14w, 0x1a0(%rsp,%rcx,2)
testl %eax, %eax
jne 0xabc7
movl %r12d, %r14d
jmp 0xa8d9
movq 0x208(%rsp), %rdx
movl (%rdx), %edx
addq $0x10, %rcx
leaq 0x48(%rsp), %rsi
movq %rdx, (%rsi)
movq %rcx, 0x8(%rsi)
leal -0x1(%rax), %ecx
leaq 0x1e0(%rsp), %rdi
movw %ax, 0x40(%rdi)
movw %cx, 0x42(%rdi)
andw $0x0, 0x328(%rsp,%rcx,2)
callq 0x699a
testl %eax, %eax
movl %r13d, %r14d
jne 0xa7f7
movzwl 0x42(%rbx), %eax
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %r13
movq 0x18(%rsp), %r8
jmp 0xa7d9
addq $0x10, %rax
leaq 0x8(%rsp), %r12
movq %rax, 0x8(%r12)
leaq 0x1e0(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xac08
movq 0x40(%r13), %xmm0
pcmpeqd %xmm1, %xmm1
paddw %xmm0, %xmm1
movd %xmm1, 0x40(%r13)
movq %r13, %rdi
movq %r12, %rsi
callq 0x699a
testl %eax, %eax
jne 0xa7f7
movzwl 0x42(%rbx), %eax
movq (%rsp), %rsi
movq (%rsi,%rax,8), %rcx
testb $0x1, 0xa(%rcx)
je 0xa7fa
movl %r14d, %r12d
movzwl 0x148(%rbx,%rax,2), %r14d
leaq 0x48(%rsp), %rsi
andq $0x0, (%rsi)
andw $0x0, 0x148(%rbx,%rax,2)
movq %rbx, %rdi
callq 0x699a
movzwl 0x42(%rbx), %ecx
movw %r14w, 0x148(%rbx,%rcx,2)
testl %eax, %eax
jne 0xabe8
movl %r12d, %r14d
jmp 0xa7fa
leaq 0x404b(%rip), %rsi      # 0xebe0
leaq 0x4061(%rip), %rdx      # 0xebfd
movl $0x1f33, %ecx           # imm = 0x1F33
callq 0xb672
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x4055(%rip), %rsi      # 0xec0b
leaq 0x4065(%rip), %rdx      # 0xec22
movl $0x1d92, %ecx           # imm = 0x1D92
callq 0xb672
movq 0x70(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x4059(%rip), %rsi      # 0xec30
leaq 0x4044(%rip), %rdx      # 0xec22
movl $0x1e05, %ecx           # imm = 0x1E05
callq 0xb672
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rdi
leaq 0x4039(%rip), %rsi      # 0xec30
leaq 0x4024(%rip), %rdx      # 0xec22
movl $0x1e21, %ecx           # imm = 0x1E21
callq 0xb672