// File: jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb.c
// Function: mdb_freelist_save
static int
mdb_freelist_save(MDB_txn *txn)
{
	/* env->me_pghead[] can grow and shrink during this call.
	 * env->me_pglast and txn->mt_free_pgs[] can only grow.
	 * Page numbers cannot disappear from txn->mt_free_pgs[].
	 */
	MDB_cursor mc;
	MDB_env	*env = txn->mt_env;
	int rc, maxfree_1pg = env->me_maxfree_1pg, more = 1;
	txnid_t	pglast = 0, head_id = 0;
	pgno_t	freecnt = 0, *free_pgs, *mop;
	ssize_t	head_room = 0, total_room = 0, mop_len, clean_limit;

	mdb_cursor_init(&mc, txn, FREE_DBI, NULL);

	if (env->me_pghead) {
		/* Make sure first page of freeDB is touched and on freelist */
		rc = mdb_page_search(&mc, NULL, MDB_PS_FIRST|MDB_PS_MODIFY);
		if (rc && rc != MDB_NOTFOUND)
			return rc;
	}

	if (!env->me_pghead && txn->mt_loose_pgs) {
		/* Put loose page numbers in mt_free_pgs, since
		 * we may be unable to return them to me_pghead.
		 */
		MDB_page *mp = txn->mt_loose_pgs;
		if ((rc = mdb_midl_need(&txn->mt_free_pgs, txn->mt_loose_count)) != 0)
			return rc;
		for (; mp; mp = NEXT_LOOSE_PAGE(mp))
			mdb_midl_xappend(txn->mt_free_pgs, mp->mp_pgno);
		txn->mt_loose_pgs = NULL;
		txn->mt_loose_count = 0;
	}

	/* MDB_RESERVE cancels meminit in ovpage malloc (when no WRITEMAP) */
	clean_limit = (env->me_flags & (MDB_NOMEMINIT|MDB_WRITEMAP))
		? SSIZE_MAX : maxfree_1pg;

	for (;;) {
		/* Come back here after each Put() in case freelist changed */
		MDB_val key, data;
		pgno_t *pgs;
		ssize_t j;

		/* If using records from freeDB which we have not yet
		 * deleted, delete them and any we reserved for me_pghead.
		 */
		while (pglast < env->me_pglast) {
			rc = mdb_cursor_first(&mc, &key, NULL);
			if (rc)
				return rc;
			pglast = head_id = *(txnid_t *)key.mv_data;
			total_room = head_room = 0;
			mdb_tassert(txn, pglast <= env->me_pglast);
			rc = mdb_cursor_del(&mc, 0);
			if (rc)
				return rc;
		}

		/* Save the IDL of pages freed by this txn, to a single record */
		if (freecnt < txn->mt_free_pgs[0]) {
			if (!freecnt) {
				/* Make sure last page of freeDB is touched and on freelist */
				rc = mdb_page_search(&mc, NULL, MDB_PS_LAST|MDB_PS_MODIFY);
				if (rc && rc != MDB_NOTFOUND)
					return rc;
			}
			free_pgs = txn->mt_free_pgs;
			/* Write to last page of freeDB */
			key.mv_size = sizeof(txn->mt_txnid);
			key.mv_data = &txn->mt_txnid;
			do {
				freecnt = free_pgs[0];
				data.mv_size = MDB_IDL_SIZEOF(free_pgs);
				rc = mdb_cursor_put(&mc, &key, &data, MDB_RESERVE);
				if (rc)
					return rc;
				/* Retry if mt_free_pgs[] grew during the Put() */
				free_pgs = txn->mt_free_pgs;
			} while (freecnt < free_pgs[0]);
			mdb_midl_sort(free_pgs);
			memcpy(data.mv_data, free_pgs, data.mv_size);
#if (MDB_DEBUG) > 1
			{
				unsigned int i = free_pgs[0];
				DPRINTF(("IDL write txn %"Z"u root %"Z"u num %u",
					txn->mt_txnid, txn->mt_dbs[FREE_DBI].md_root, i));
				for (; i; i--)
					DPRINTF(("IDL %"Z"u", free_pgs[i]));
			}
#endif
			continue;
		}

		mop = env->me_pghead;
		mop_len = (mop ? mop[0] : 0) + txn->mt_loose_count;

		/* Reserve records for me_pghead[]. Split it if multi-page,
		 * to avoid searching freeDB for a page range. Use keys in
		 * range [1,me_pglast]: Smaller than txnid of oldest reader.
		 */
		if (total_room >= mop_len) {
			if (total_room == mop_len || --more < 0)
				break;
		} else if (head_room >= maxfree_1pg && head_id > 1) {
			/* Keep current record (overflow page), add a new one */
			head_id--;
			head_room = 0;
		}
		/* (Re)write {key = head_id, IDL length = head_room} */
		total_room -= head_room;
		head_room = mop_len - total_room;
		if (head_room > maxfree_1pg && head_id > 1) {
			/* Overflow multi-page for part of me_pghead */
			head_room /= head_id; /* amortize page sizes */
			head_room += maxfree_1pg - head_room % (maxfree_1pg + 1);
		} else if (head_room < 0) {
			/* Rare case, not bothering to delete this record */
			head_room = 0;
		}
		key.mv_size = sizeof(head_id);
		key.mv_data = &head_id;
		data.mv_size = (head_room + 1) * sizeof(pgno_t);
		rc = mdb_cursor_put(&mc, &key, &data, MDB_RESERVE);
		if (rc)
			return rc;
		/* IDL is initially empty, zero out at least the length */
		pgs = (pgno_t *)data.mv_data;
		j = head_room > clean_limit ? head_room : 0;
		do {
			pgs[j] = 0;
		} while (--j >= 0);
		total_room += head_room;
	}

	/* Return loose page numbers to me_pghead, though usually none are
	 * left at this point.  The pages themselves remain in dirty_list.
	 */
	if (txn->mt_loose_pgs) {
		MDB_page *mp = txn->mt_loose_pgs;
		unsigned count = txn->mt_loose_count;
		MDB_IDL loose;
		/* Room for loose pages + temp IDL with same */
		if ((rc = mdb_midl_need(&env->me_pghead, 2*count+1)) != 0)
			return rc;
		mop = env->me_pghead;
		loose = mop + MDB_IDL_ALLOCLEN(mop) - count;
		for (count = 0; mp; mp = NEXT_LOOSE_PAGE(mp))
			loose[ ++count ] = mp->mp_pgno;
		loose[0] = count;
		mdb_midl_sort(loose);
		mdb_midl_xmerge(mop, loose);
		txn->mt_loose_pgs = NULL;
		txn->mt_loose_count = 0;
		mop_len = mop[0];
	}

	/* Fill in the reserved me_pghead records */
	rc = MDB_SUCCESS;
	if (mop_len) {
		MDB_val key, data;

		mop += mop_len;
		rc = mdb_cursor_first(&mc, &key, &data);
		for (; !rc; rc = mdb_cursor_next(&mc, &key, &data, MDB_NEXT)) {
			txnid_t id = *(txnid_t *)key.mv_data;
			ssize_t	len = (ssize_t)(data.mv_size / sizeof(MDB_ID)) - 1;
			MDB_ID save;

			mdb_tassert(txn, len >= 0 && id <= env->me_pglast);
			key.mv_data = &id;
			if (len > mop_len) {
				len = mop_len;
				data.mv_size = (len + 1) * sizeof(MDB_ID);
			}
			data.mv_data = mop -= len;
			save = mop[0];
			mop[0] = len;
			rc = mdb_cursor_put(&mc, &key, &data, MDB_CURRENT);
			mop[0] = save;
			if (rc || !(mop_len -= len))
				break;
		}
	}
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
movl 0xd8(%rax), %eax
movl %eax, -0x1a8(%rbp)
movl $0x1, -0x1ac(%rbp)
movq $0x0, -0x1b8(%rbp)
movq $0x0, -0x1c0(%rbp)
movq $0x0, -0x1c8(%rbp)
movq $0x0, -0x1e0(%rbp)
movq $0x0, -0x1e8(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x198(%rbp), %rdi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x4d40
movq -0x1a0(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
je 0x6649
leaq -0x198(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x5, %edx
callq 0xeec0
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
je 0x6647
cmpl $0xffff87b2, -0x1a4(%rbp) # imm = 0xFFFF87B2
je 0x6647
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
jmp 0x6649
movq -0x1a0(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
jne 0x6727
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x6727
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x200(%rbp)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movq -0x10(%rbp), %rax
movl 0x38(%rax), %esi
callq 0x127b0
movl %eax, -0x1a4(%rbp)
cmpl $0x0, %eax
je 0x66a9
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
jmp 0x66ab
cmpq $0x0, -0x200(%rbp)
je 0x6710
jmp 0x66b7
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rcx
movq (%rcx), %rax
addq $0x1, %rax
movq %rax, (%rcx)
movq %rax, -0x210(%rbp)
movq -0x200(%rbp), %rax
movq (%rax), %rdx
movq -0x208(%rbp), %rax
movq -0x210(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x66fc
movq -0x200(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x200(%rbp)
jmp 0x66ab
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x1a0(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x1080000, %eax        # imm = 0x1080000
cmpl $0x0, %eax
je 0x674e
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x298(%rbp)
jmp 0x675c
movslq -0x1a8(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x298(%rbp), %rax
movq %rax, -0x1f8(%rbp)
jmp 0x676c
movq -0x1b8(%rbp), %rax
movq -0x1a0(%rbp), %rcx
cmpq 0xb8(%rcx), %rax
jae 0x685a
leaq -0x198(%rbp), %rdi
leaq -0x220(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x8b00
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
je 0x67bb
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
movq -0x218(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1c0(%rbp)
movq %rax, -0x1b8(%rbp)
movq $0x0, -0x1e0(%rbp)
movq $0x0, -0x1e8(%rbp)
movq -0x1b8(%rbp), %rax
movq -0x1a0(%rbp), %rcx
cmpq 0xb8(%rcx), %rax
ja 0x6802
jmp 0x682a
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x11152(%rip), %rsi     # 0x17963
leaq 0x11164(%rip), %rdx     # 0x1797c
leaq 0x10bf0(%rip), %rcx     # 0x1740f
movl $0xc11, %r8d            # imm = 0xC11
callq 0x133a0
leaq -0x198(%rbp), %rdi
xorl %esi, %esi
callq 0xcb70
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
je 0x6855
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
jmp 0x676c
movq -0x1c8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
cmpq (%rcx), %rax
jae 0x699c
cmpq $0x0, -0x1c8(%rbp)
jne 0x68bc
leaq -0x198(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x9, %edx
callq 0xeec0
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
je 0x68ba
cmpl $0xffff87b2, -0x1a4(%rbp) # imm = 0xFFFF87B2
je 0x68ba
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
jmp 0x68bc
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x1d0(%rbp)
movq $0x8, -0x220(%rbp)
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x218(%rbp)
movq -0x1d0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1d0(%rbp), %rax
movq (%rax), %rax
addq $0x1, %rax
shlq $0x3, %rax
movq %rax, -0x230(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x230(%rbp), %rdx
movl $0x10000, %ecx          # imm = 0x10000
callq 0x4eb0
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
je 0x694b
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rax
movq -0x1d0(%rbp), %rcx
cmpq (%rcx), %rax
jb 0x68e5
movq -0x1d0(%rbp), %rdi
callq 0x12bf0
movq -0x228(%rbp), %rdi
movq -0x1d0(%rbp), %rsi
movq -0x230(%rbp), %rdx
callq 0x2230
jmp 0x676a
movq -0x1a0(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x1d8(%rbp)
cmpq $0x0, -0x1d8(%rbp)
je 0x69ce
movq -0x1d8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x2a0(%rbp)
jmp 0x69d9
xorl %eax, %eax
movq %rax, -0x2a0(%rbp)
jmp 0x69d9
movq -0x2a0(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x38(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x1f0(%rbp)
movq -0x1e8(%rbp), %rax
cmpq -0x1f0(%rbp), %rax
jl 0x6a2d
movq -0x1e8(%rbp), %rax
cmpq -0x1f0(%rbp), %rax
je 0x6a26
movl -0x1ac(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1ac(%rbp)
cmpl $0x0, %eax
jge 0x6a2b
jmp 0x6c1e
jmp 0x6a69
movq -0x1e0(%rbp), %rax
movslq -0x1a8(%rbp), %rcx
cmpq %rcx, %rax
jl 0x6a67
cmpq $0x1, -0x1c0(%rbp)
jbe 0x6a67
movq -0x1c0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x1c0(%rbp)
movq $0x0, -0x1e0(%rbp)
jmp 0x6a69
movq -0x1e0(%rbp), %rcx
movq -0x1e8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x1e8(%rbp)
movq -0x1f0(%rbp), %rax
subq -0x1e8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x1e0(%rbp), %rax
movslq -0x1a8(%rbp), %rcx
cmpq %rcx, %rax
jle 0x6b0d
cmpq $0x1, -0x1c0(%rbp)
jbe 0x6b0d
movq -0x1c0(%rbp), %rcx
movq -0x1e0(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, -0x1e0(%rbp)
movslq -0x1a8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x1e0(%rbp), %rax
movl -0x1a8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cqto
idivq %rcx
movq -0x2a8(%rbp), %rax
subq %rdx, %rax
addq -0x1e0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
jmp 0x6b24
cmpq $0x0, -0x1e0(%rbp)
jge 0x6b22
movq $0x0, -0x1e0(%rbp)
jmp 0x6b24
movq $0x8, -0x220(%rbp)
leaq -0x1c0(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
shlq $0x3, %rax
movq %rax, -0x230(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x230(%rbp), %rdx
movl $0x10000, %ecx          # imm = 0x10000
callq 0x4eb0
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
je 0x6b8f
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
movq -0x228(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x1e0(%rbp), %rax
cmpq -0x1f8(%rbp), %rax
jle 0x6bbd
movq -0x1e0(%rbp), %rax
movq %rax, -0x2b0(%rbp)
jmp 0x6bc8
xorl %eax, %eax
movq %rax, -0x2b0(%rbp)
jmp 0x6bc8
movq -0x2b0(%rbp), %rax
movq %rax, -0x240(%rbp)
movq -0x238(%rbp), %rax
movq -0x240(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x240(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x240(%rbp)
cmpq $0x0, %rax
jge 0x6bd6
movq -0x1e0(%rbp), %rax
addq -0x1e8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
jmp 0x676a
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x6d70
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x248(%rbp)
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x24c(%rbp)
movq -0x1a0(%rbp), %rdi
addq $0xb0, %rdi
movl -0x24c(%rbp), %esi
shll %esi
addl $0x1, %esi
callq 0x127b0
movl %eax, -0x1a4(%rbp)
cmpl $0x0, %eax
je 0x6c80
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6f6a
movq -0x1a0(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rax
movq -0x1d8(%rbp), %rcx
movq -0x8(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movl -0x24c(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x258(%rbp)
movl $0x0, -0x24c(%rbp)
cmpq $0x0, -0x248(%rbp)
je 0x6d17
movq -0x248(%rbp), %rax
movq (%rax), %rdx
movq -0x258(%rbp), %rax
movl -0x24c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x24c(%rbp)
movl %ecx, %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x248(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x248(%rbp)
jmp 0x6cd3
movl -0x24c(%rbp), %eax
movl %eax, %ecx
movq -0x258(%rbp), %rax
movq %rcx, (%rax)
movq -0x258(%rbp), %rdi
callq 0x12bf0
movq -0x1d8(%rbp), %rdi
movq -0x258(%rbp), %rsi
callq 0x12b00
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x1d8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1f0(%rbp)
movl $0x0, -0x1a4(%rbp)
cmpq $0x0, -0x1f0(%rbp)
je 0x6f61
movq -0x1f0(%rbp), %rax
shlq $0x3, %rax
addq -0x1d8(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x278(%rbp), %rdx
callq 0x8b00
movl %eax, -0x1a4(%rbp)
cmpl $0x0, -0x1a4(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x6dd6
jmp 0x6f5f
movq -0x260(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x280(%rbp)
movq -0x278(%rbp), %rax
shrq $0x3, %rax
subq $0x1, %rax
movq %rax, -0x288(%rbp)
cmpq $0x0, -0x288(%rbp)
jl 0x6e20
movq -0x280(%rbp), %rax
movq -0x1a0(%rbp), %rcx
cmpq 0xb8(%rcx), %rax
ja 0x6e20
jmp 0x6e48
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x10b5f(%rip), %rsi     # 0x1798e
leaq 0x10b46(%rip), %rdx     # 0x1797c
leaq 0x105d2(%rip), %rcx     # 0x1740f
movl $0xc85, %r8d            # imm = 0xC85
callq 0x133a0
leaq -0x280(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x288(%rbp), %rax
cmpq -0x1f0(%rbp), %rax
jle 0x6e8a
movq -0x1f0(%rbp), %rax
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rax
addq $0x1, %rax
shlq $0x3, %rax
movq %rax, -0x278(%rbp)
movq -0x288(%rbp), %rdx
movq -0x1d8(%rbp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x1d8(%rbp)
movq %rax, -0x270(%rbp)
movq -0x1d8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x290(%rbp)
movq -0x288(%rbp), %rcx
movq -0x1d8(%rbp), %rax
movq %rcx, (%rax)
leaq -0x198(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x278(%rbp), %rdx
movl $0x40, %ecx
callq 0x4eb0
movl %eax, -0x1a4(%rbp)
movq -0x290(%rbp), %rcx
movq -0x1d8(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0x1a4(%rbp)
jne 0x6f31
movq -0x288(%rbp), %rcx
movq -0x1f0(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x1f0(%rbp)
cmpq $0x0, %rax
jne 0x6f33
jmp 0x6f5f
jmp 0x6f35
leaq -0x198(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x278(%rbp), %rdx
movl $0x8, %ecx
callq 0x8d30
movl %eax, -0x1a4(%rbp)
jmp 0x6dc1
jmp 0x6f61
movl -0x1a4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
nopw %cs:(%rax,%rax)