// File: codeandkey[P]neocortex/src/position.cpp
// Function: neocortex::Position::pseudolegal_moves_quiescence(neocortex::Move*)
int Position::pseudolegal_moves_quiescence(Move* out) {
	if (check()) {
		return pseudolegal_moves_evasions(out);
	}

	int count = 0;

	bitboard ctm = board.get_color_occ(color_to_move);
	bitboard opp = board.get_color_occ(!color_to_move);
	
	int oppking = bb::getlsb(opp & board.get_piece_occ(piece::KING));

	bitboard bchecks = attacks::bishop(oppking, board.get_global_occ()) & ~ctm;
	bitboard rchecks = attacks::rook(oppking, board.get_global_occ()) & ~ctm;
	bitboard nchecks = attacks::knight(oppking) & ~ctm;
	bitboard pchecks = attacks::pawn(!color_to_move, oppking);

	bitboard ep_mask = 0;
	int ep_square = ply.back().en_passant_square;

	if (square::is_valid(ep_square)) {
		ep_mask = bb::mask(ep_square);
	}

	/* Pawn moves */
	bitboard pawns = ctm & board.get_piece_occ(piece::PAWN);
	bitboard promoting_rank = (color_to_move == piece::WHITE) ? RANK_7 : RANK_2;

	int adv_dir = (color_to_move == piece::WHITE) ? NORTH : SOUTH;
	int left_dir = (color_to_move == piece::WHITE) ? NORTHWEST : SOUTHWEST;
	int right_dir = (color_to_move == piece::WHITE) ? NORTHEAST : SOUTHEAST;

	bitboard promoting_pawns = pawns & promoting_rank;

	/* Promoting left captures */
	bitboard promoting_left_cap = bb::shift(promoting_pawns & ~FILE_A, left_dir) & opp;

	while (promoting_left_cap) {
		int dst = bb::poplsb(promoting_left_cap);
		out[count++] = Move(dst - left_dir, dst, piece::QUEEN);
		out[count++] = Move(dst - left_dir, dst, piece::KNIGHT);
	}

	/* Promoting right captures */
	bitboard promoting_right_cap = bb::shift(promoting_pawns & ~FILE_H, right_dir) & opp;

	while (promoting_right_cap) {
		int dst = bb::poplsb(promoting_right_cap);
		out[count++] = Move(dst - right_dir, dst, piece::QUEEN);
		out[count++] = Move(dst - right_dir, dst, piece::KNIGHT);
	}

	/* Promoting advances */
	bitboard promoting_advances = bb::shift(promoting_pawns, adv_dir) & ~board.get_global_occ();

	while (promoting_advances) {
		int dst = bb::poplsb(promoting_advances);
		out[count++] = Move(dst - adv_dir, dst, piece::QUEEN);
		out[count++] = Move(dst - adv_dir, dst, piece::KNIGHT);
	}

	/* Nonpromoting pawn moves */
	bitboard npm_pawns = pawns & ~promoting_pawns;

	/* Left captures */
	bitboard npm_left_cap = bb::shift(npm_pawns & ~FILE_A, left_dir) & (opp | ep_mask);

	while (npm_left_cap) {
		int dst = bb::poplsb(npm_left_cap);
		out[count++] = Move(dst - left_dir, dst);
	}

	/* Right captures */
	bitboard npm_right_cap = bb::shift(npm_pawns & ~FILE_H, right_dir) & (opp | ep_mask);

	while (npm_right_cap) {
		int dst = bb::poplsb(npm_right_cap);
		out[count++] = Move(dst - right_dir, dst);
	}

	/* Pawn checks */
	bitboard npm_checks = bb::shift(npm_pawns, adv_dir) & ~board.get_global_occ() & pchecks;

	while (npm_checks) {
		int dst = bb::poplsb(npm_checks);
		out[count++] = Move(dst - adv_dir, dst);
	}

	/* Queen captures / checks */
	bitboard queens = ctm & board.get_piece_occ(piece::QUEEN);

	while (queens) {
		int src = bb::poplsb(queens);
		bitboard moves = attacks::queen(src, board.get_global_occ()) & (opp | bchecks | rchecks);

		while (moves) {
			int dst = bb::poplsb(moves);
			out[count++] = Move(src, dst);
		}
	}

	/* Rook captures / checks */
	bitboard rooks = ctm & board.get_piece_occ(piece::ROOK);

	while (rooks) {
		int src = bb::poplsb(rooks);
		bitboard moves = attacks::rook(src, board.get_global_occ()) & (opp | rchecks);

		while (moves) {
			int dst = bb::poplsb(moves);
			out[count++] = Move(src, dst);
		}
	}

	/* Knight captures / checks */
	bitboard knights = ctm & board.get_piece_occ(piece::KNIGHT);

	while (knights) {
		int src = bb::poplsb(knights);
		bitboard moves = attacks::knight(src) & (opp | nchecks);

		while (moves) {
			int dst = bb::poplsb(moves);
			out[count++] = Move(src, dst);
		}
	}

	/* Bishop captures / checks */
	bitboard bishops = ctm & board.get_piece_occ(piece::BISHOP);

	while (bishops) {
		int src = bb::poplsb(bishops);
		bitboard moves = attacks::bishop(src, board.get_global_occ()) & (opp | bchecks);

		while (moves) {
			int dst = bb::poplsb(moves);
			out[count++] = Move(src, dst);
		}
	}

	/* King captures */
	bitboard kings = ctm & board.get_piece_occ(piece::KING);

	while (kings) {
		int src = bb::poplsb(kings);
		bitboard moves = attacks::king(src) & opp;

		while (moves) {
			int dst = bb::poplsb(moves);
			out[count++] = Move(src, dst);
		}
	}

	assert(count <= MAX_PL_MOVES);
	return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0xbc10
testb $0x1, %al
jne 0xff19
jmp 0xff31
movq -0x228(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xf0a0
movl %eax, -0x4(%rbp)
jmp 0x10a93
movq -0x228(%rbp), %rdi
movl $0x0, -0x1c(%rbp)
movl 0x170(%rdi), %esi
callq 0x14e30
movq -0x228(%rbp), %rdi
movq %rax, -0x28(%rbp)
cmpl $0x0, 0x170(%rdi)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %esi
callq 0x14e30
movq -0x228(%rbp), %rdi
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x238(%rbp)
movl $0x5, %esi
callq 0x14e50
movq -0x238(%rbp), %rdi
andq %rax, %rdi
callq 0x9030
movq -0x228(%rbp), %rdi
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x230(%rbp)
callq 0x14e70
movl -0x230(%rbp), %edi
movq %rax, %rsi
callq 0x8e10
movq -0x228(%rbp), %rdi
movq -0x28(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x22c(%rbp)
callq 0x14e70
movl -0x22c(%rbp), %edi
movq %rax, %rsi
callq 0x8eb0
movq -0x28(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x34(%rbp), %edi
callq 0x8df0
movq %rax, %rcx
movq -0x228(%rbp), %rax
movq -0x28(%rbp), %rdx
xorq $-0x1, %rdx
andq %rdx, %rcx
movq %rcx, -0x50(%rbp)
cmpl $0x0, 0x170(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edi
movl -0x34(%rbp), %esi
callq 0x8dc0
movq -0x228(%rbp), %rdi
movq %rax, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
addq $0x158, %rdi            # imm = 0x158
callq 0xbce0
movl 0xc(%rax), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %edi
callq 0x6d10
testb $0x1, %al
jne 0x1006e
jmp 0x1007a
movl -0x64(%rbp), %edi
callq 0x6bd0
movq %rax, -0x60(%rbp)
movq -0x228(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x240(%rbp)
xorl %esi, %esi
callq 0x14e50
movq -0x240(%rbp), %rcx
movq %rax, %rdx
movq -0x228(%rbp), %rax
andq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movl 0x170(%rax), %esi
movl $0xff00, %ecx           # imm = 0xFF00
movabsq $0xff000000000000, %rdx # imm = 0xFF000000000000
cmpl $0x0, %esi
cmoveq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movl 0x170(%rax), %esi
movl $0xfffffff8, %ecx       # imm = 0xFFFFFFF8
movl $0x8, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movl %ecx, -0x7c(%rbp)
movl 0x170(%rax), %esi
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
movl $0x7, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movl %ecx, -0x80(%rbp)
movl 0x170(%rax), %edx
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
movl $0x9, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x84(%rbp)
movq -0x70(%rbp), %rax
andq -0x78(%rbp), %rax
movq %rax, -0x90(%rbp)
movabsq $-0x101010101010102, %rdi # imm = 0xFEFEFEFEFEFEFEFE
andq -0x90(%rbp), %rdi
movl -0x80(%rbp), %esi
callq 0x6ca0
andq -0x30(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x10209
leaq -0x98(%rbp), %rdi
callq 0x8f70
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %esi
subl -0x80(%rbp), %esi
movl -0x9c(%rbp), %edx
leaq -0xa8(%rbp), %rdi
movl $0x4, %ecx
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0xa8(%rbp), %rcx
movq %rcx, (%rax)
movl -0xa0(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x9c(%rbp), %esi
subl -0x80(%rbp), %esi
movl -0x9c(%rbp), %edx
leaq -0xb4(%rbp), %rdi
movl $0x2, %ecx
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0xb4(%rbp), %rcx
movq %rcx, (%rax)
movl -0xac(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x1014c
movabsq $0x7f7f7f7f7f7f7f7f, %rdi # imm = 0x7F7F7F7F7F7F7F7F
andq -0x90(%rbp), %rdi
movl -0x84(%rbp), %esi
callq 0x6ca0
andq -0x30(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x102f3
leaq -0xc0(%rbp), %rdi
callq 0x8f70
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %esi
subl -0x84(%rbp), %esi
movl -0xc4(%rbp), %edx
leaq -0xd0(%rbp), %rdi
movl $0x4, %ecx
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movl -0xc8(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0xc4(%rbp), %esi
subl -0x84(%rbp), %esi
movl -0xc4(%rbp), %edx
leaq -0xdc(%rbp), %rdi
movl $0x2, %ecx
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0xdc(%rbp), %rcx
movq %rcx, (%rax)
movl -0xd4(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x10230
movq -0x90(%rbp), %rdi
movl -0x7c(%rbp), %esi
callq 0x6ca0
movq -0x228(%rbp), %rdi
movq %rax, -0x248(%rbp)
callq 0x14e70
movq %rax, %rcx
movq -0x248(%rbp), %rax
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
je 0x103ea
leaq -0xe8(%rbp), %rdi
callq 0x8f70
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %esi
subl -0x7c(%rbp), %esi
movl -0xec(%rbp), %edx
leaq -0xf8(%rbp), %rdi
movl $0x4, %ecx
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0xf8(%rbp), %rcx
movq %rcx, (%rax)
movl -0xf0(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0xec(%rbp), %esi
subl -0x7c(%rbp), %esi
movl -0xec(%rbp), %edx
leaq -0x104(%rbp), %rdi
movl $0x2, %ecx
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x104(%rbp), %rcx
movq %rcx, (%rax)
movl -0xfc(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x1032d
movq -0x70(%rbp), %rax
movq -0x90(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x110(%rbp)
movabsq $-0x101010101010102, %rdi # imm = 0xFEFEFEFEFEFEFEFE
andq -0x110(%rbp), %rdi
movl -0x80(%rbp), %esi
callq 0x6ca0
movq -0x30(%rbp), %rcx
orq -0x60(%rbp), %rcx
andq %rcx, %rax
movq %rax, -0x118(%rbp)
cmpq $0x0, -0x118(%rbp)
je 0x10498
leaq -0x118(%rbp), %rdi
callq 0x8f70
movl %eax, -0x11c(%rbp)
movl -0x11c(%rbp), %esi
subl -0x80(%rbp), %esi
movl -0x11c(%rbp), %edx
leaq -0x128(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x128(%rbp), %rcx
movq %rcx, (%rax)
movl -0x120(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x1042e
movabsq $0x7f7f7f7f7f7f7f7f, %rdi # imm = 0x7F7F7F7F7F7F7F7F
andq -0x110(%rbp), %rdi
movl -0x84(%rbp), %esi
callq 0x6ca0
movq -0x30(%rbp), %rcx
orq -0x60(%rbp), %rcx
andq %rcx, %rax
movq %rax, -0x130(%rbp)
cmpq $0x0, -0x130(%rbp)
je 0x10533
leaq -0x130(%rbp), %rdi
callq 0x8f70
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %esi
subl -0x84(%rbp), %esi
movl -0x134(%rbp), %edx
leaq -0x140(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x140(%rbp), %rcx
movq %rcx, (%rax)
movl -0x138(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x104c6
movq -0x110(%rbp), %rdi
movl -0x7c(%rbp), %esi
callq 0x6ca0
movq -0x228(%rbp), %rdi
movq %rax, -0x250(%rbp)
callq 0x14e70
movq %rax, %rcx
movq -0x250(%rbp), %rax
xorq $-0x1, %rcx
andq %rcx, %rax
andq -0x58(%rbp), %rax
movq %rax, -0x148(%rbp)
cmpq $0x0, -0x148(%rbp)
je 0x105db
leaq -0x148(%rbp), %rdi
callq 0x8f70
movl %eax, -0x14c(%rbp)
movl -0x14c(%rbp), %esi
subl -0x7c(%rbp), %esi
movl -0x14c(%rbp), %edx
leaq -0x158(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x158(%rbp), %rcx
movq %rcx, (%rax)
movl -0x150(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x10571
movq -0x228(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x258(%rbp)
movl $0x4, %esi
callq 0x14e50
movq %rax, %rcx
movq -0x258(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x160(%rbp)
cmpq $0x0, -0x160(%rbp)
je 0x106d3
leaq -0x160(%rbp), %rdi
callq 0x8f70
movq -0x228(%rbp), %rdi
movl %eax, -0x164(%rbp)
movl -0x164(%rbp), %eax
movl %eax, -0x25c(%rbp)
callq 0x14e70
movl -0x25c(%rbp), %edi
movq %rax, %rsi
callq 0x14e90
movq -0x30(%rbp), %rcx
orq -0x40(%rbp), %rcx
orq -0x48(%rbp), %rcx
andq %rcx, %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, -0x170(%rbp)
je 0x106ce
leaq -0x170(%rbp), %rdi
callq 0x8f70
movl %eax, -0x174(%rbp)
movl -0x164(%rbp), %esi
movl -0x174(%rbp), %edx
leaq -0x180(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x180(%rbp), %rcx
movq %rcx, (%rax)
movl -0x178(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x10667
jmp 0x1060b
movq -0x228(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x268(%rbp)
movl $0x3, %esi
callq 0x14e50
movq %rax, %rcx
movq -0x268(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x188(%rbp)
cmpq $0x0, -0x188(%rbp)
je 0x107c7
leaq -0x188(%rbp), %rdi
callq 0x8f70
movq -0x228(%rbp), %rdi
movl %eax, -0x18c(%rbp)
movl -0x18c(%rbp), %eax
movl %eax, -0x26c(%rbp)
callq 0x14e70
movl -0x26c(%rbp), %edi
movq %rax, %rsi
callq 0x8eb0
movq -0x30(%rbp), %rcx
orq -0x48(%rbp), %rcx
andq %rcx, %rax
movq %rax, -0x198(%rbp)
cmpq $0x0, -0x198(%rbp)
je 0x107c2
leaq -0x198(%rbp), %rdi
callq 0x8f70
movl %eax, -0x19c(%rbp)
movl -0x18c(%rbp), %esi
movl -0x19c(%rbp), %edx
leaq -0x1a8(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x1a8(%rbp), %rcx
movq %rcx, (%rax)
movl -0x1a0(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x1075b
jmp 0x10703
movq -0x228(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x278(%rbp)
movl $0x2, %esi
callq 0x14e50
movq %rax, %rcx
movq -0x278(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x1b0(%rbp)
cmpq $0x0, -0x1b0(%rbp)
je 0x108a0
leaq -0x1b0(%rbp), %rdi
callq 0x8f70
movl %eax, -0x1b4(%rbp)
movl -0x1b4(%rbp), %edi
callq 0x8df0
movq -0x30(%rbp), %rcx
orq -0x50(%rbp), %rcx
andq %rcx, %rax
movq %rax, -0x1c0(%rbp)
cmpq $0x0, -0x1c0(%rbp)
je 0x1089b
leaq -0x1c0(%rbp), %rdi
callq 0x8f70
movl %eax, -0x1c4(%rbp)
movl -0x1b4(%rbp), %esi
movl -0x1c4(%rbp), %edx
leaq -0x1d0(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x1d0(%rbp), %rcx
movq %rcx, (%rax)
movl -0x1c8(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x10834
jmp 0x107f7
movq -0x228(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x280(%rbp)
movl $0x1, %esi
callq 0x14e50
movq %rax, %rcx
movq -0x280(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x1d8(%rbp)
cmpq $0x0, -0x1d8(%rbp)
je 0x10994
leaq -0x1d8(%rbp), %rdi
callq 0x8f70
movq -0x228(%rbp), %rdi
movl %eax, -0x1dc(%rbp)
movl -0x1dc(%rbp), %eax
movl %eax, -0x284(%rbp)
callq 0x14e70
movl -0x284(%rbp), %edi
movq %rax, %rsi
callq 0x8e10
movq -0x30(%rbp), %rcx
orq -0x40(%rbp), %rcx
andq %rcx, %rax
movq %rax, -0x1e8(%rbp)
cmpq $0x0, -0x1e8(%rbp)
je 0x1098f
leaq -0x1e8(%rbp), %rdi
callq 0x8f70
movl %eax, -0x1ec(%rbp)
movl -0x1dc(%rbp), %esi
movl -0x1ec(%rbp), %edx
leaq -0x1f8(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x1f8(%rbp), %rcx
movq %rcx, (%rax)
movl -0x1f0(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x10928
jmp 0x108d0
movq -0x228(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x290(%rbp)
movl $0x5, %esi
callq 0x14e50
movq %rax, %rcx
movq -0x290(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x200(%rbp)
cmpq $0x0, -0x200(%rbp)
je 0x10a66
leaq -0x200(%rbp), %rdi
callq 0x8f70
movl %eax, -0x204(%rbp)
movl -0x204(%rbp), %edi
callq 0x8f50
andq -0x30(%rbp), %rax
movq %rax, -0x210(%rbp)
cmpq $0x0, -0x210(%rbp)
je 0x10a61
leaq -0x210(%rbp), %rdi
callq 0x8f70
movl %eax, -0x214(%rbp)
movl -0x204(%rbp), %esi
movl -0x214(%rbp), %edx
leaq -0x220(%rbp), %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xa8a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq -0x220(%rbp), %rcx
movq %rcx, (%rax)
movl -0x218(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0x109fa
jmp 0x109c4
cmpl $0x64, -0x1c(%rbp)
jg 0x10a6e
jmp 0x10a8d
leaq 0x16ede(%rip), %rdi     # 0x27953
leaq 0x16d49(%rip), %rsi     # 0x277c5
movl $0x36c, %edx            # imm = 0x36C
leaq 0x16f58(%rip), %rcx     # 0x279e0
callq 0x5290
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nop