// File: /workspace/github_cpp_makefile_star2_O1/codeandkey[P]neocortex/src/position.cpp
// Function: neocortex::Position::pseudolegal_moves_evasions(neocortex::Move*)
int Position::pseudolegal_moves_evasions(Move* out) {
	int count = 0;

	assert(check());

	bitboard ctm = board.get_color_occ(color_to_move);
	bitboard opp = board.get_color_occ(!color_to_move);

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

	/* Also grab attackers */
	int king_sq = bb::getlsb(kings);
	bitboard attackers = board.attacks_on(king_sq) & opp;

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

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

	if (bb::popcount(attackers) > 1) {
		/* double check, king moves only */
		return count;
	}

	/* Only one attacker -- look for pieces that can capture it */
	int attacker_square = bb::getlsb(attackers);

	/* If checker is sliding piece, add blocking moves */
	bitboard block_dsts = bb::between(king_sq, attacker_square);

	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;
	bitboard starting_rank = (color_to_move == piece::WHITE) ? RANK_2 : RANK_7;

	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) & attackers;

	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);
		out[count++] = Move(dst - left_dir, dst, piece::ROOK);
		out[count++] = Move(dst - left_dir, dst, piece::BISHOP);
	}

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

	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);
		out[count++] = Move(dst - right_dir, dst, piece::ROOK);
		out[count++] = Move(dst - right_dir, dst, piece::BISHOP);
	}

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

	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);
		out[count++] = Move(dst - adv_dir, dst, piece::ROOK);
		out[count++] = Move(dst - adv_dir, dst, piece::BISHOP);
	}

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

	/* Blocking advances */
	bitboard npm_advances = bb::shift(npm_pawns, adv_dir) & ~board.get_global_occ() & block_dsts;

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

	/* Left captures */
	bitboard npm_left_cap = bb::shift(npm_pawns & ~FILE_A, left_dir) & (attackers | 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) & (attackers | ep_mask);

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

	/* Jumps */
	bitboard npm_jumps = bb::shift(pawns & starting_rank, adv_dir) & ~board.get_global_occ();
	npm_jumps = bb::shift(npm_jumps, adv_dir) & ~board.get_global_occ() & block_dsts;

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

	/* Queen moves */
	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()) & (block_dsts | attackers);

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

	/* Rook moves */
	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()) & (block_dsts | attackers);

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

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

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

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

	/* Bishop moves */
	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()) & (block_dsts | attackers);

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0x28(%rsp)
movq 0x160(%rdi), %rax
cmpl $0x0, -0x14(%rax)
je 0xb5c8
movslq 0x170(%rdi), %rax
movq 0x8(%rdi,%rax,8), %rbx
movq 0x40(%rdi), %r14
andq %rbx, %r14
je 0xb5a9
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movq 0x8(%rdi,%rcx,8), %rax
movq %rax, 0x30(%rsp)
bsfq %r14, %rsi
movq %rdi, 0x40(%rsp)
movq %rsi, 0x60(%rsp)
callq 0x684c
movq %rax, 0x48(%rsp)
movq %rbx, 0x50(%rsp)
notq %rbx
movq %rbx, 0x18(%rsp)
movl $0x0, (%rsp)
leaq 0x4(%rsp), %rbp
movq %r14, 0x10(%rsp)
bsfq %r14, %r15
movl $0x1, %eax
movl %r15d, %ecx
shlq %cl, %rax
movq %rax, 0x38(%rsp)
leaq 0x16b18(%rip), %rax     # 0x21590
movq (%rax,%r15,8), %rbx
andq 0x18(%rsp), %rbx
je 0xaada
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r13
movq %rbx, %r12
bsfq %rbx, %rcx
movl $0x1, %r14d
shlq %cl, %r14
btcq %rcx, %r12
movq %rbp, %rdi
movl %r15d, %esi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r13)
movq 0x4(%rsp), %rax
movq %rax, (%r13)
addq $0xc, %r13
incl (%rsp)
cmpq %rbx, %r14
movq %r12, %rbx
jne 0xaa97
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %r15, %rax
cmpq %rcx, 0x38(%rsp)
movq %rax, %r14
jne 0xaa58
movq 0x48(%rsp), %rsi
andq 0x30(%rsp), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0xb594
testq %rsi, %rsi
je 0xb5a9
movq 0x40(%rsp), %rdx
movq 0x18(%rdx), %rax
andq 0x50(%rsp), %rax
movl 0x170(%rdx), %r9d
xorl %edi, %edi
testl %r9d, %r9d
sete %dil
movabsq $0xff000000000000, %r8  # imm = 0xFF000000000000
movl $0xff00, %r10d          # imm = 0xFF00
cmoveq %r8, %r10
shll $0x4, %edi
leal -0x9(%rdi), %ecx
movq %rax, 0x78(%rsp)
andq %rax, %r10
movabsq $0xfe00000000fe00, %r11 # imm = 0xFE00000000FE00
movq %r10, 0x58(%rsp)
andq %r10, %r11
movq %r11, %rax
movq %rcx, 0x38(%rsp)
shlq %cl, %rax
movl $0xff00, %ecx           # imm = 0xFF00
shrq $0x9, %r11
movl %r9d, 0x24(%rsp)
testl %r9d, %r9d
cmoveq %rcx, %r8
movq %r8, 0x80(%rsp)
cmoveq %rax, %r11
movq 0x60(%rsp), %r8
shll $0x9, %r8d
addq 0x163de(%rip), %r8      # 0x20f80
movq 0x160(%rdx), %rax
movl -0x2c(%rax), %ecx
movl $0x1, %eax
shlq %cl, %rax
bsfq %rsi, %rdx
movq (%r8,%rdx,8), %rdx
movq %rdx, 0x30(%rsp)
xorl %edx, %edx
cmpl $0x40, %ecx
cmovbq %rax, %rdx
movq %rdx, 0x68(%rsp)
movq %rdi, 0x10(%rsp)
leal -0x7(%rdi), %eax
movl %eax, 0x60(%rsp)
movq %rsi, 0x48(%rsp)
andq %rsi, %r11
je 0xaccb
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
movq %r11, %r15
movq %r11, 0x18(%rsp)
bsfq %r11, %rbx
movl $0x1, %r14d
movl %ebx, %ecx
shlq %cl, %r14
btcq %rbx, %r15
movl %ebx, %r13d
subl 0x38(%rsp), %r13d
leaq 0x4(%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x4, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r12)
movq 0x4(%rsp), %rax
movq %rax, (%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x2, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x14(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0xc(%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x3, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x20(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0x18(%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x1, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x2c(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0x24(%r12)
addq $0x30, %r12
addl $0x4, (%rsp)
cmpq 0x18(%rsp), %r14
movq %r15, %r11
jne 0xabfd
movq 0x10(%rsp), %rax
addl $-0x8, %eax
movq %rax, 0x10(%rsp)
movabsq $0x7f000000007f00, %rsi # imm = 0x7F000000007F00
andq 0x58(%rsp), %rsi
movq %rsi, %rax
movl 0x60(%rsp), %edx
movl %edx, %ecx
shlq %cl, %rax
shrq $0x7, %rsi
cmpl $0x0, 0x24(%rsp)
cmoveq %rax, %rsi
andq 0x48(%rsp), %rsi
je 0xaded
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
movq %rsi, %r15
movq %rsi, 0x18(%rsp)
bsfq %rsi, %rbx
movl $0x1, %r14d
movl %ebx, %ecx
shlq %cl, %r14
btcq %rbx, %r15
movl %ebx, %r13d
subl 0x60(%rsp), %r13d
leaq 0x4(%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x4, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r12)
movq 0x4(%rsp), %rax
movq %rax, (%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x2, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x14(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0xc(%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x3, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x20(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0x18(%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x1, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x2c(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0x24(%r12)
addq $0x30, %r12
addl $0x4, (%rsp)
cmpq 0x18(%rsp), %r14
movq %r15, %rsi
jne 0xad1f
movq 0x58(%rsp), %rsi
movq %rsi, %rax
movq 0x10(%rsp), %rdx
movl %edx, %ecx
shlq %cl, %rax
movq %rsi, %rcx
shrq $0x8, %rcx
cmpl $0x0, 0x24(%rsp)
movl %edx, %esi
movq %rsi, 0x70(%rsp)
cmoveq %rax, %rcx
movq 0x40(%rsp), %rax
movq (%rax), %rsi
notq %rsi
andq %rcx, %rsi
andq 0x30(%rsp), %rsi
je 0xaf14
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
movq %rsi, %r15
movq %rsi, 0x18(%rsp)
bsfq %rsi, %rbx
movl $0x1, %r14d
movl %ebx, %ecx
shlq %cl, %r14
btcq %rbx, %r15
movl %ebx, %r13d
subl %edx, %r13d
leaq 0x4(%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x4, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r12)
movq 0x4(%rsp), %rax
movq %rax, (%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x2, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x14(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0xc(%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x3, %ecx
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x20(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0x18(%r12)
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x1, %ecx
callq 0x7658
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %eax
movl %eax, 0x2c(%r12)
movq 0x4(%rsp), %rax
movq %rax, 0x24(%r12)
addq $0x30, %r12
addl $0x4, (%rsp)
cmpq 0x18(%rsp), %r14
movq %r15, %rsi
jne 0xae43
movl 0x60(%rsp), %eax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rsi
xorq 0x78(%rsp), %rsi
movq %rsi, %rax
movq 0x70(%rsp), %rcx
shlq %cl, %rax
movq %rsi, 0x58(%rsp)
movq %rsi, %rcx
shrq $0x8, %rcx
cmpl $0x0, 0x24(%rsp)
cmoveq %rax, %rcx
movq 0x40(%rsp), %rax
movq (%rax), %r14
notq %r14
andq %rcx, %r14
andq 0x30(%rsp), %r14
je 0xafbd
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r15
leaq 0x4(%rsp), %rbx
movq %r14, %r12
bsfq %r14, %rcx
movl $0x1, %r13d
shlq %cl, %r13
btcq %rcx, %r12
movl %ecx, %esi
subl %edx, %esi
movq %rbx, %rdi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r15)
movq 0x4(%rsp), %rax
movq %rax, (%r15)
addq $0xc, %r15
incl (%rsp)
cmpq %r14, %r13
movq %r12, %r14
jne 0xaf75
movabsq $-0x101010101010102, %r14 # imm = 0xFEFEFEFEFEFEFEFE
andq 0x58(%rsp), %r14
movq %r14, %rax
movq 0x38(%rsp), %rdx
movl %edx, %ecx
shlq %cl, %rax
shrq $0x9, %r14
cmpl $0x0, 0x24(%rsp)
cmoveq %rax, %r14
movq 0x68(%rsp), %rax
orq 0x48(%rsp), %rax
movq %rax, 0x68(%rsp)
andq %rax, %r14
je 0xb05b
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r15
leaq 0x4(%rsp), %rbx
movq %r14, %r12
bsfq %r14, %rcx
movl $0x1, %r13d
shlq %cl, %r13
btcq %rcx, %r12
movl %ecx, %esi
subl %edx, %esi
movq %rbx, %rdi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movq 0x38(%rsp), %rdx
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r15)
movq 0x4(%rsp), %rax
movq %rax, (%r15)
addq $0xc, %r15
incl (%rsp)
cmpq %r14, %r13
movq %r12, %r14
jne 0xb013
movabsq $0x7f7f7f7f7f7f7f7f, %rax # imm = 0x7F7F7F7F7F7F7F7F
movq 0x58(%rsp), %r13
andq %rax, %r13
movq %r13, %rax
movq 0x18(%rsp), %rcx
shlq %cl, %rax
shrq $0x7, %r13
cmpl $0x0, 0x24(%rsp)
cmoveq %rax, %r13
andq 0x68(%rsp), %r13
je 0xb0ec
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r14
leaq 0x4(%rsp), %rbp
movq %r13, %r15
movl 0x60(%rsp), %ebx
bsfq %r13, %rcx
movl $0x1, %r12d
shlq %cl, %r12
btcq %rcx, %r15
movl %ecx, %esi
subl %ebx, %esi
movq %rbp, %rdi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r14)
movq 0x4(%rsp), %rax
movq %rax, (%r14)
addq $0xc, %r14
incl (%rsp)
cmpq %r13, %r12
movq %r15, %r13
jne 0xb0a9
movq 0x80(%rsp), %r13
andq 0x78(%rsp), %r13
movq %r13, %rax
movq 0x70(%rsp), %rcx
shlq %cl, %rax
shrq $0x8, %r13
movl 0x24(%rsp), %edi
testl %edi, %edi
cmoveq %rax, %r13
movq 0x40(%rsp), %rax
movq (%rax), %rax
notq %rax
andq %rax, %r13
movq %r13, %rdx
shlq %cl, %rdx
shrq $0x8, %r13
testl %edi, %edi
cmoveq %rdx, %r13
andq %rax, %r13
andq 0x30(%rsp), %r13
je 0xb19d
movq 0x10(%rsp), %rbx
addl %ebx, %ebx
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r14
leaq 0x4(%rsp), %rbp
movq %r13, %r15
bsfq %r13, %rcx
movl $0x1, %r12d
shlq %cl, %r12
btcq %rcx, %r15
movl %ecx, %esi
subl %ebx, %esi
movq %rbp, %rdi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r14)
movq 0x4(%rsp), %rax
movq %rax, (%r14)
addq $0xc, %r14
incl (%rsp)
cmpq %r13, %r12
movq %r15, %r13
jne 0xb15a
movq 0x40(%rsp), %rsi
movq 0x38(%rsi), %rax
andq 0x50(%rsp), %rax
je 0xb2e3
movq 0x30(%rsp), %rcx
orq 0x48(%rsp), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x4(%rsp), %r12
movq %rax, 0x10(%rsp)
bsfq %rax, %rbp
movl $0x1, %eax
movl %ebp, %ecx
shlq %cl, %rax
movq %rax, 0x38(%rsp)
movq (%rsi), %rdx
leal (,%rbp,4), %esi
xorl %ecx, %ecx
leaq 0xe560(%rip), %rax      # 0x19750
subb (%rsi,%rax), %cl
leal (,%rbp,8), %r9d
xorl %eax, %eax
leaq 0xea4c(%rip), %r8       # 0x19c50
subb (%rsi,%r8), %al
leaq 0xe141(%rip), %rsi      # 0x19350
movq (%r9,%rsi), %rsi
andq %rdx, %rsi
leaq 0xe333(%rip), %r8       # 0x19550
imulq (%r9,%r8), %rsi
shrq %cl, %rsi
leaq 0xe624(%rip), %rcx      # 0x19850
andq (%r9,%rcx), %rdx
leaq 0xe819(%rip), %rcx      # 0x19a50
imulq (%r9,%rcx), %rdx
movl %eax, %ecx
shrq %cl, %rdx
leaq 0x17548(%rip), %rax     # 0x22790
movq (%rax,%r9), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rbx
leaq 0x17336(%rip), %rax     # 0x22590
movq (%rax,%r9), %rax
movslq %esi, %rcx
orq (%rax,%rcx,8), %rbx
andq 0x18(%rsp), %rbx
je 0xb2c7
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r13
movq %rbx, %r14
bsfq %rbx, %rcx
movl $0x1, %r15d
shlq %cl, %r15
btcq %rcx, %r14
movq %r12, %rdi
movl %ebp, %esi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movl (%rsp), %ecx
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r13)
movq 0x4(%rsp), %rax
movq %rax, (%r13)
addq $0xc, %r13
incl %ecx
movl %ecx, (%rsp)
cmpq %rbx, %r15
movq %r14, %rbx
jne 0xb280
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %rbp, %rax
cmpq %rcx, 0x38(%rsp)
movq 0x40(%rsp), %rsi
jne 0xb1c5
movq 0x30(%rsi), %rax
andq 0x50(%rsp), %rax
je 0xb3d9
movq 0x30(%rsp), %rcx
orq 0x48(%rsp), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x4(%rsp), %r14
movq %rax, 0x10(%rsp)
bsfq %rax, %rbp
movl $0x1, %eax
movl %ebp, %ecx
shlq %cl, %rax
movq %rax, 0x38(%rsp)
leal (,%rbp,8), %eax
leaq 0xe024(%rip), %rcx      # 0x19350
movq (%rax,%rcx), %rdx
andq (%rsi), %rdx
leaq 0xe216(%rip), %rcx      # 0x19550
imulq (%rax,%rcx), %rdx
xorl %ecx, %ecx
leaq 0xe408(%rip), %rsi      # 0x19750
subb (%rsi,%rbp,4), %cl
shrq %cl, %rdx
leaq 0x1723b(%rip), %rcx     # 0x22590
movq (%rcx,%rax), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rbx
andq 0x18(%rsp), %rbx
je 0xb3bd
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r13
movq %rbx, %r12
bsfq %rbx, %rcx
movl $0x1, %r15d
shlq %cl, %r15
btcq %rcx, %r12
movq %r14, %rdi
movl %ebp, %esi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r13)
movq 0x4(%rsp), %rax
movq %rax, (%r13)
addq $0xc, %r13
incl (%rsp)
cmpq %rbx, %r15
movq %r12, %rbx
jne 0xb37b
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %rbp, %rax
cmpq %rcx, 0x38(%rsp)
movq 0x40(%rsp), %rsi
jne 0xb306
movq 0x28(%rsi), %rax
andq 0x50(%rsp), %rax
je 0xb495
movq 0x30(%rsp), %rcx
orq 0x48(%rsp), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x4(%rsp), %rbp
movq %rax, 0x10(%rsp)
bsfq %rax, %r15
movl $0x1, %eax
movl %r15d, %ecx
shlq %cl, %rax
movq %rax, 0x38(%rsp)
leaq 0x16374(%rip), %rax     # 0x21790
movq (%rax,%r15,8), %rbx
andq 0x18(%rsp), %rbx
je 0xb47e
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r13
movq %rbx, %r12
bsfq %rbx, %rcx
movl $0x1, %r14d
shlq %cl, %r14
btcq %rcx, %r12
movq %rbp, %rdi
movl %r15d, %esi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r13)
movq 0x4(%rsp), %rax
movq %rax, (%r13)
addq $0xc, %r13
incl (%rsp)
cmpq %rbx, %r14
movq %r12, %rbx
jne 0xb43b
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %r15, %rax
cmpq %rcx, 0x38(%rsp)
jne 0xb3fc
movq 0x40(%rsp), %rsi
movq 0x50(%rsp), %rax
andq 0x20(%rsi), %rax
je 0xb58e
movq 0x30(%rsp), %rcx
orq 0x48(%rsp), %rcx
movq %rcx, 0x30(%rsp)
leaq 0x4(%rsp), %r14
movq %rax, 0x50(%rsp)
bsfq %rax, %rbp
movl $0x1, %eax
movl %ebp, %ecx
shlq %cl, %rax
movq %rax, 0x10(%rsp)
leal (,%rbp,8), %eax
leaq 0xe36d(%rip), %rcx      # 0x19850
movq (%rax,%rcx), %rdx
andq (%rsi), %rdx
leaq 0xe55f(%rip), %rcx      # 0x19a50
imulq (%rax,%rcx), %rdx
xorl %ecx, %ecx
leaq 0xe751(%rip), %rsi      # 0x19c50
subb (%rsi,%rbp,4), %cl
shrq %cl, %rdx
leaq 0x17284(%rip), %rcx     # 0x22790
movq (%rcx,%rax), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %r12
andq 0x30(%rsp), %r12
je 0xb572
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %rbx
movq %r12, %r13
bsfq %r12, %rcx
movl $0x1, %r15d
shlq %cl, %r15
btcq %rcx, %r13
movq %r14, %rdi
movl %ebp, %esi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7658
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rbx)
movq 0x4(%rsp), %rax
movq %rax, (%rbx)
addq $0xc, %rbx
incl (%rsp)
cmpq %r12, %r15
movq %r13, %r12
jne 0xb532
movq 0x50(%rsp), %rcx
movq %rcx, %rax
btcq %rbp, %rax
cmpq %rcx, 0x10(%rsp)
movq 0x40(%rsp), %rsi
jne 0xb4bd
cmpl $0x65, (%rsp)
jge 0xb5e7
movl (%rsp), %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd532(%rip), %rdi      # 0x18ae2
leaq 0xc4e1(%rip), %rsi      # 0x17a98
leaq 0xdc79(%rip), %rcx      # 0x19237
movl $0x66, %edx
callq 0x4190
leaq 0xd7ad(%rip), %rdi      # 0x18d7c
leaq 0xd5cf(%rip), %rsi      # 0x18ba5
leaq 0xd7a7(%rip), %rcx      # 0x18d84
movl $0x222, %edx            # imm = 0x222
callq 0x4190
leaq 0xd745(%rip), %rdi      # 0x18d33
leaq 0xd5b0(%rip), %rsi      # 0x18ba5
leaq 0xd788(%rip), %rcx      # 0x18d84
movl $0x2cf, %edx            # imm = 0x2CF
callq 0x4190