// File: /workspace/github_cpp_makefile_star2_O3/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 0xb67b
movslq 0x170(%rdi), %rax
movq 0x8(%rdi,%rax,8), %rbx
movq 0x40(%rdi), %r14
andq %rbx, %r14
je 0xb65c
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 0x6952
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 0x17a66(%rip), %rax     # 0x22590
movq (%rax,%r15,8), %rbx
andq 0x18(%rsp), %rbx
je 0xab8c
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 0x7768
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 0xab49
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %r15, %rax
cmpq %rcx, 0x38(%rsp)
movq %rax, %r14
jne 0xab0a
movq 0x48(%rsp), %rsi
andq 0x30(%rsp), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0xb647
testq %rsi, %rsi
je 0xb65c
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 0x1732c(%rip), %r8      # 0x21f80
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 0xad7d
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 0x7768
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 0x7768
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 0x7768
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 0x7768
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 0xacaf
movq 0x10(%rsp), %rax
addl $-0x8, %eax
movq %rax, 0x10(%rsp)
movabsq $0x7f000000007f00, %rdx # imm = 0x7F000000007F00
andq 0x58(%rsp), %rdx
movq %rdx, %rax
movl 0x60(%rsp), %esi
movl %esi, %ecx
shlq %cl, %rax
shrq $0x7, %rdx
cmpl $0x0, 0x24(%rsp)
cmoveq %rax, %rdx
andq 0x48(%rsp), %rdx
je 0xaea1
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
movq %rdx, %r15
movq %rdx, 0x18(%rsp)
bsfq %rdx, %rbx
movl $0x1, %r14d
movl %ebx, %ecx
shlq %cl, %r14
btcq %rbx, %r15
movl %ebx, %r13d
subl %esi, %r13d
leaq 0x4(%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x4, %ecx
callq 0x7768
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 0x7768
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 0x7768
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 0x7768
movl 0x60(%rsp), %esi
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, %rdx
jne 0xadd1
movq 0x58(%rsp), %r14
movq %r14, %rax
movq 0x10(%rsp), %rdi
movl %edi, %ecx
shlq %cl, %rax
movq %r14, %rdx
shrq $0x8, %rdx
cmpl $0x0, 0x24(%rsp)
movl %edi, %ecx
movq %rcx, 0x70(%rsp)
cmoveq %rax, %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rax
notq %rax
andq %rax, %rdx
andq 0x30(%rsp), %rdx
je 0xafdc
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rcx
leaq (%rcx,%rax,4), %r12
leaq 0x4(%rsp), %rbp
movq %rdx, %r15
movq %rdx, 0x18(%rsp)
bsfq %rdx, %rbx
movl $0x1, %r14d
movl %ebx, %ecx
shlq %cl, %r14
btcq %rbx, %r15
movl %ebx, %r13d
subl %edi, %r13d
movq %rbp, %rdi
movl %r13d, %esi
movl %ebx, %edx
movl $0x4, %ecx
callq 0x7768
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 0x7768
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 0x7768
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 0x7768
movq 0x10(%rsp), %rdi
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, %rdx
jne 0xaefc
movq 0x40(%rsp), %rax
movq (%rax), %rax
notq %rax
movq 0x58(%rsp), %r14
movl 0x60(%rsp), %esi
xorq 0x78(%rsp), %r14
movq %r14, %rdx
movq 0x70(%rsp), %rcx
shlq %cl, %rdx
movl %esi, %ecx
movq %rcx, 0x18(%rsp)
movq %r14, 0x58(%rsp)
shrq $0x8, %r14
cmpl $0x0, 0x24(%rsp)
cmoveq %rdx, %r14
andq %rax, %r14
andq 0x30(%rsp), %r14
je 0xb070
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 %edi, %esi
movq %rbx, %rdi
movl %ecx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x7768
movq 0x10(%rsp), %rdi
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 0xb028
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 0xb10e
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 0x7768
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 0xb0c6
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 0xb19f
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 0x7768
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 0xb15c
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 0xb250
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 0x7768
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 0xb20d
movq 0x40(%rsp), %rsi
movq 0x38(%rsi), %rax
andq 0x50(%rsp), %rax
je 0xb396
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 0xf59d(%rip), %rax      # 0x1a840
subb (%rsi,%rax), %cl
leal (,%rbp,8), %r9d
xorl %eax, %eax
leaq 0xfa89(%rip), %r8       # 0x1ad40
subb (%rsi,%r8), %al
leaq 0xf17e(%rip), %rsi      # 0x1a440
movq (%r9,%rsi), %rsi
andq %rdx, %rsi
leaq 0xf370(%rip), %r8       # 0x1a640
imulq (%r9,%r8), %rsi
shrq %cl, %rsi
leaq 0xf661(%rip), %rcx      # 0x1a940
andq (%r9,%rcx), %rdx
leaq 0xf856(%rip), %rcx      # 0x1ab40
imulq (%r9,%rcx), %rdx
movl %eax, %ecx
shrq %cl, %rdx
leaq 0x18495(%rip), %rax     # 0x23790
movq (%rax,%r9), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rbx
leaq 0x18283(%rip), %rax     # 0x23590
movq (%rax,%r9), %rax
movslq %esi, %rcx
orq (%rax,%rcx,8), %rbx
andq 0x18(%rsp), %rbx
je 0xb37a
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 0x7768
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 0xb333
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %rbp, %rax
cmpq %rcx, 0x38(%rsp)
movq 0x40(%rsp), %rsi
jne 0xb278
movq 0x30(%rsi), %rax
andq 0x50(%rsp), %rax
je 0xb48c
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 0xf061(%rip), %rcx      # 0x1a440
movq (%rax,%rcx), %rdx
andq (%rsi), %rdx
leaq 0xf253(%rip), %rcx      # 0x1a640
imulq (%rax,%rcx), %rdx
xorl %ecx, %ecx
leaq 0xf445(%rip), %rsi      # 0x1a840
subb (%rsi,%rbp,4), %cl
shrq %cl, %rdx
leaq 0x18188(%rip), %rcx     # 0x23590
movq (%rcx,%rax), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rbx
andq 0x18(%rsp), %rbx
je 0xb470
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 0x7768
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 0xb42e
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %rbp, %rax
cmpq %rcx, 0x38(%rsp)
movq 0x40(%rsp), %rsi
jne 0xb3b9
movq 0x28(%rsi), %rax
andq 0x50(%rsp), %rax
je 0xb548
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 0x172c1(%rip), %rax     # 0x22790
movq (%rax,%r15,8), %rbx
andq 0x18(%rsp), %rbx
je 0xb531
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 0x7768
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 0xb4ee
movq 0x10(%rsp), %rcx
movq %rcx, %rax
btcq %r15, %rax
cmpq %rcx, 0x38(%rsp)
jne 0xb4af
movq 0x40(%rsp), %rsi
movq 0x50(%rsp), %rax
andq 0x20(%rsi), %rax
je 0xb641
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 0xf3aa(%rip), %rcx      # 0x1a940
movq (%rax,%rcx), %rdx
andq (%rsi), %rdx
leaq 0xf59c(%rip), %rcx      # 0x1ab40
imulq (%rax,%rcx), %rdx
xorl %ecx, %ecx
leaq 0xf78e(%rip), %rsi      # 0x1ad40
subb (%rsi,%rbp,4), %cl
shrq %cl, %rdx
leaq 0x181d1(%rip), %rcx     # 0x23790
movq (%rcx,%rax), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %r12
andq 0x30(%rsp), %r12
je 0xb625
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 0x7768
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 0xb5e5
movq 0x50(%rsp), %rcx
movq %rcx, %rax
btcq %rbp, %rax
cmpq %rcx, 0x10(%rsp)
movq 0x40(%rsp), %rsi
jne 0xb570
cmpl $0x65, (%rsp)
jge 0xb69a
movl (%rsp), %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe4bf(%rip), %rdi      # 0x19b22
leaq 0xec4c(%rip), %rsi      # 0x1a2b6
leaq 0xecb7(%rip), %rcx      # 0x1a328
movl $0x66, %edx
callq 0x4190
leaq 0xe7ba(%rip), %rdi      # 0x19e3c
leaq 0xe5dc(%rip), %rsi      # 0x19c65
leaq 0xe7b4(%rip), %rcx      # 0x19e44
movl $0x222, %edx            # imm = 0x222
callq 0x4190
leaq 0xe752(%rip), %rdi      # 0x19df3
leaq 0xe5bd(%rip), %rsi      # 0x19c65
leaq 0xe795(%rip), %rcx      # 0x19e44
movl $0x2cf, %edx            # imm = 0x2CF
callq 0x4190
nop