// File: /workspace/github_cpp_makefile_star2_O1/YSRKEN[P]Shioi/I401/main.cpp
// Function: Board::CountRenB2(std::array<std::array<PackedStone, 5ul>, 2ul> const&, unsigned long, Direction, unsigned long&)
RenCount CountRenB2(const Pattern &pattern, const size_t position, const Direction dir, size_t &block_position) {
		/* Count "Straight Shi-Shi"
		* 1. BO|BBB|OB   "Ryoutou-no-ShiShi"
		* 2. BBO|BB|OBB  "Chouda-no-ShiShi"
		* 3. BBBO|B|OBBB "Souryu-no-ShiShi"
		* 一直線上に出来る四々で、両頭の四々・長蛇の四々・双龍の四々
		*/
		namespace p = packed_stone;
		{
			//BO|BBB|OB
			if (MatchPatternB(pattern, position, dir, {{ p::nb, p::bbnb }})) return RenCount(0, 2, 0);
			if (MatchPatternB(pattern, position, dir, {{ p::bnb, p::bnb }})) return RenCount(0, 2, 0);
			if (MatchPatternB(pattern, position, dir, {{ p::bbnb, p::nb }})) return RenCount(0, 2, 0);
			//BBO|BB|OBB
			if (MatchPatternB(pattern, position, dir, {{ p::nbb, p::bnbb }})) return RenCount(0, 2, 0);
			if (MatchPatternB(pattern, position, dir, {{ p::bnbb, p::nbb }})) return RenCount(0, 2, 0);
			//BBBO|B|OBBB
			if (MatchPatternB(pattern, position, dir, {{ p::nbbb, p::nbbb }})) return RenCount(0, 2, 0);
		}
		// Count Shi-ren
		{
			if (MatchPatternB(pattern, position, dir, {{ p::n, p::bbbn }})) return RenCount(1, 0, 0);
			if (MatchPatternB(pattern, position, dir, {{ p::bn, p::bbn }})) return RenCount(1, 0, 0);
			if (MatchPatternB(pattern, position, dir, {{ p::bbbn, p::n }})) return RenCount(1, 0, 0);
			if (MatchPatternB(pattern, position, dir, {{ p::bbn, p::bn }})) return RenCount(1, 0, 0);
		}
		// Count Katsu-Shi
		auto GetPosition = [&position, &dir](int count) -> int {return position + kPositionoffset[dir] * count; };
		{
			//11110
			if (MatchPatternB(pattern, position, dir, {{ p::bbb, p::n }})) {
				block_position = GetPosition(1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::bb, p::bn }})) {
				block_position = GetPosition(2) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::b, p::bbn }})) {
				block_position = GetPosition(3) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, Side::Right, {{ p::bbbn }})) {
				block_position = GetPosition(4) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			//11101
			if (MatchPatternB(pattern, position, dir, Side::Left, {{ p::nbbb }})) {
				block_position = GetPosition(-1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::bb, p::nb }})) {
				block_position = GetPosition(1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::b, p::bnb }})) {
				block_position = GetPosition(2) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, Side::Right, {{ p::bbnb }})) {
				block_position = GetPosition(3) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			//11011
			if (MatchPatternB(pattern, position, dir, Side::Right, {{ p::bnbb }})) {
				block_position = GetPosition(2) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, { { Stone::Black, p::nbb } })) {
				block_position = GetPosition(1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::nbb, p::b }})) {
				block_position = GetPosition(-1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, Side::Left, {{ p::bnbb }})) {
				block_position = GetPosition(-2) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			//10111
			if (MatchPatternB(pattern, position, dir, Side::Right, {{ p::nbbb }})) {
				block_position = GetPosition(1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::nb, p::bb }})) {
				block_position = GetPosition(-1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::bnb, p::b }})) {
				block_position = GetPosition(-2) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, Side::Left, {{ p::bbnb }})) {
				block_position = GetPosition(-3) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			//01111
			if (MatchPatternB(pattern, position, dir, {{ p::n, p::bbb }})) {
				block_position = GetPosition(-1) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::bn, p::bb }})) {
				block_position = GetPosition(-2) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, {{ p::bbn, p::b }})) {
				block_position = GetPosition(-3) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
			if (MatchPatternB(pattern, position, dir, Side::Left, {{ p::bbbn }})) {
				block_position = GetPosition(-4) | limit2(0_sz, kBoardSize * kBoardSize);
				return RenCount(0, 1, 0);
			}
		}
		// Count Katsu-San
		{
			int offset1 = 0, offset2 = 0;
			while (true) {
				//011100
				if (MatchPatternB(pattern, position, dir, {{ p::bbn, p::nn }})) {
					offset1 = 1; offset2 = -3; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::bn, p::bnn }})) {
					offset1 = 2; offset2 = -2; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::n, p::bbnn }})) {
					offset1 = 3; offset2 = -1; break;
				}
				//011010
				if (MatchPatternB(pattern, position, dir, {{ p::nbbn, p::n }})) {
					offset1 = -1; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::bn, p::nbn }})) {
					offset1 = 1; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::n, p::bnbn }})) {
					offset1 = 2; break;
				}
				//010110
				if (MatchPatternB(pattern, position, dir, {{ p::n, p::nbbn }})) {
					offset1 = 1; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::nbn, p::bn }})) {
					offset1 = -1; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::bnbn, p::n }})) {
					offset1 = -2; break;
				}
				//001110
				if (MatchPatternB(pattern, position, dir, {{ p::nn, p::bbn }})) {
					offset1 = -1; offset2 = 3; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::bnn, p::bn }})) {
					offset1 = -2; offset2 = 2; break;
				}
				if (MatchPatternB(pattern, position, dir, {{ p::bbnn, p::n }})) {
					offset1 = -3; offset2 = 1; break;
				}
				break;
			}
			if (offset2 != 0) {
				int next_pos = GetPosition(offset2);
				if (next_pos >= 0 && static_cast<std::size_t>(next_pos) < kBoardSize * kBoardSize) {
					board_[position] = Stone::Black;
					auto valid_flg = IsValidMove(next_pos);
					board_[position] = Stone::None;
					if (valid_flg) return RenCount(0, 0, 1);
				}
			}
			if (offset1 != 0) {
				int next_pos = GetPosition(offset1);
				if (next_pos >= 0 && static_cast<std::size_t>(next_pos) < kBoardSize * kBoardSize) {
					board_[position] = Stone::Black;
					auto valid_flg = IsValidMove(next_pos);
					board_[position] = Stone::None;
					if (valid_flg) return RenCount(0, 0, 1);
				}
			}
		}
		return RenCount(0, 0, 0);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r14
movl %r8d, %r12d
movq %rcx, %r15
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x18(%rsp), %r8
movq $0x1, (%r8)
movq $0x2, 0x8(%r8)
movq $0x51, 0x10(%r8)
movq $0x4, 0x18(%r8)
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8164
movl $0x11, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movl $0x3, %ecx
movq %rcx, 0x8(%r8)
movq %rax, 0x10(%r8)
movq %rcx, 0x18(%r8)
movzbl %r12b, %r12d
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8164
leaq 0x18(%rsp), %r8
movq $0x51, (%r8)
movq $0x4, 0x8(%r8)
movq $0x1, 0x10(%r8)
movq $0x2, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8164
leaq 0x18(%rsp), %r8
movq $0x5, (%r8)
movq $0x3, 0x8(%r8)
movq $0x45, 0x10(%r8)
movq $0x4, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8164
leaq 0x18(%rsp), %r8
movq $0x45, (%r8)
movq $0x4, 0x8(%r8)
movq $0x5, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8164
movl $0x15, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movl $0x4, %ecx
movq %rcx, 0x8(%r8)
movq %rax, 0x10(%r8)
movq %rcx, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8187
xorl %eax, %eax
movq %rax, (%rbx)
movq $0x2, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %r8
movq $0x0, (%r8)
movq $0x1, 0x8(%r8)
movq $0x54, 0x10(%r8)
movq $0x4, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x826f
leaq 0x18(%rsp), %r8
movq $0x4, (%r8)
movq $0x2, 0x8(%r8)
movq $0x14, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x826f
leaq 0x18(%rsp), %r8
movq $0x54, (%r8)
movq $0x4, 0x8(%r8)
movq $0x0, 0x10(%r8)
movq $0x1, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x826f
leaq 0x18(%rsp), %r8
movq $0x14, (%r8)
movq $0x3, 0x8(%r8)
movq $0x4, 0x10(%r8)
movq $0x2, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8282
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x1, 0x10(%rbx)
jmp 0x8175
leaq 0x18(%rsp), %r8
movq $0x15, (%r8)
movq $0x3, 0x8(%r8)
movq $0x0, 0x10(%r8)
movq $0x1, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x82df
leaq 0x410e(%rip), %rax      # 0xc3d0
addq (%rax,%r12,8), %r15
testl %r15d, %r15d
js 0x83ce
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %r15d, %r15d
jmp 0x83be
leaq 0x18(%rsp), %r8
movq $0x5, (%r8)
movl $0x2, %eax
movq %rax, 0x8(%r8)
movq $0x4, 0x10(%r8)
movq %rax, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8329
leaq 0x40b4(%rip), %rax      # 0xc3d0
movq (%rax,%r12,8), %rax
leaq (%r15,%rax,2), %rcx
jmp 0x83b1
movl $0x1, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movq %rax, 0x8(%r8)
movq $0x14, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8373
leaq 0x406a(%rip), %rax      # 0xc3d0
movq (%rax,%r12,8), %rax
leaq (%rax,%rax,2), %rcx
addq %r15, %rcx
jmp 0x83b1
leaq 0x18(%rsp), %r9
movq $0x54, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x7ea2
testb %al, %al
je 0x83e8
leaq 0x4027(%rip), %rax      # 0xc3d0
movq (%rax,%r12,8), %rax
leaq (%r15,%rax,4), %rcx
testl %ecx, %ecx
js 0x83ce
movl %ecx, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %ecx, %ecx
sete %cl
cmpq $0xe1, %rax
setb %dl
orb %cl, %dl
jne 0x83d3
movl $0xe1, %eax
movq %rax, (%r14)
xorl %eax, %eax
movq %rax, (%rbx)
movq $0x1, 0x8(%rbx)
jmp 0x8171
leaq 0x18(%rsp), %r9
movq $0x15, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x7ea2
testb %al, %al
je 0x842e
leaq 0x3fb5(%rip), %rax      # 0xc3d0
movq (%rax,%r12,8), %rax
movq %rax, %rcx
shlq $0x20, %rcx
subq %rax, %rcx
jmp 0x836e
leaq 0x18(%rsp), %r8
movq $0x5, (%r8)
movl $0x2, %eax
movq %rax, 0x8(%r8)
movq $0x1, 0x10(%r8)
movq %rax, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x82bb
movl $0x1, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movq %rax, 0x8(%r8)
movq $0x11, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8315
leaq 0x18(%rsp), %r9
movq $0x51, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x7ea2
testb %al, %al
jne 0x835f
leaq 0x18(%rsp), %r9
movq $0x45, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x7ea2
testb %al, %al
jne 0x8315
movl $0x1, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movq %rax, 0x8(%r8)
movq $0x5, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x82bb
leaq 0x18(%rsp), %r8
movq $0x5, (%r8)
movq $0x3, 0x8(%r8)
movl $0x1, %eax
movq %rax, 0x10(%r8)
movq %rax, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8414
leaq 0x18(%rsp), %r9
movq $0x45, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x7ea2
testb %al, %al
je 0x85eb
leaq 0x3e21(%rip), %rcx      # 0xc3d0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
decq %rax
imulq (%rcx,%r12,8), %rax
addq %r15, %rax
testl %eax, %eax
js 0x85de
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
testl %eax, %eax
sete %al
cmpq $0xe1, %rcx
setb %dl
orb %al, %dl
jne 0x85e3
movl $0xe1, %ecx
movq %rcx, (%r14)
jmp 0x83d6
leaq 0x18(%rsp), %r9
movq $0x15, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x7ea2
testb %al, %al
jne 0x82bb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %r8
movq $0x1, (%r8)
movl $0x2, %eax
movq %rax, 0x8(%r8)
movq $0x5, 0x10(%r8)
movq %rax, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x866f
leaq 0x3d6b(%rip), %rax      # 0xc3d0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0x86f2
leaq 0x18(%rsp), %r8
movq $0x11, (%r8)
movq $0x3, 0x8(%r8)
movl $0x1, %eax
movq %rax, 0x10(%r8)
movq %rax, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x86b6
leaq 0x3d24(%rip), %rax      # 0xc3d0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
decq %rdx
jmp 0x86f2
leaq 0x18(%rsp), %r9
movq $0x51, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x7ea2
testb %al, %al
je 0x870a
leaq 0x3ce7(%rip), %rax      # 0xc3d0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $-0x2, %rdx
imulq (%rax,%r12,8), %rdx
addq %r15, %rdx
testl %edx, %edx
js 0x83ce
movq %rdx, %rcx
jmp 0x83b5
leaq 0x18(%rsp), %r8
movq $0x0, (%r8)
movq $0x1, 0x8(%r8)
movq $0x15, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x865e
leaq 0x18(%rsp), %r8
movq $0x4, (%r8)
movl $0x2, %eax
movq %rax, 0x8(%r8)
movq $0x5, 0x10(%r8)
movq %rax, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x86a5
leaq 0x18(%rsp), %r8
movq $0x14, (%r8)
movq $0x3, 0x8(%r8)
movl $0x1, %eax
movq %rax, 0x10(%r8)
movq %rax, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x86e2
leaq 0x18(%rsp), %r9
movq $0x54, (%r9)
movq $0x4, 0x8(%r9)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x7ea2
testb %al, %al
je 0x87fc
leaq 0x3be2(%rip), %rax      # 0xc3d0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $-0x3, %rdx
jmp 0x86f2
leaq 0x18(%rsp), %r8
movq $0x14, (%r8)
movq $0x3, 0x8(%r8)
movq $0x0, 0x10(%r8)
movq $0x2, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
movl $0x1, %r14d
testb %al, %al
je 0x8850
addq $-0x2, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
jmp 0x894d
leaq 0x18(%rsp), %r8
movq $0x4, (%r8)
movq $0x2, 0x8(%r8)
movq $0x10, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x88a3
decq 0x10(%rsp)
movl $0x0, 0xc(%rsp)
xorl %ebp, %ebp
movl $0x2, %r14d
jmp 0x894d
leaq 0x18(%rsp), %r8
movq $0x0, (%r8)
movq $0x1, 0x8(%r8)
movq $0x50, 0x10(%r8)
movq $0x4, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x88f9
movl $0x3, %r14d
movl $0x0, 0xc(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x10(%rsp)
jmp 0x8849
leaq 0x18(%rsp), %r8
movq $0x14, (%r8)
movq $0x4, 0x8(%r8)
movq $0x0, 0x10(%r8)
movq $0x1, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
movb $0x1, %cl
movl %ecx, 0xc(%rsp)
testb %al, %al
je 0x89ed
movq $0x0, 0x10(%rsp)
xorl %ebp, %ebp
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpb $0x0, 0xc(%rsp)
jne 0x898e
leaq 0x3a75(%rip), %rax      # 0xc3d0
movq 0x10(%rsp), %rcx
imulq (%rax,%r12,8), %rcx
addq %r15, %rcx
cmpl $0xe0, %ecx
ja 0x898e
movq %rcx, %rax
movzbl %al, %esi
movb $0x1, (%r13,%r15)
movq %r13, %rdi
callq 0x509e
movb $0x0, (%r13,%r15)
testb %al, %al
jne 0x89c7
testb %bpl, %bpl
jne 0x89da
leaq 0x3a36(%rip), %rax      # 0xc3d0
imulq (%rax,%r12,8), %r14
addq %r15, %r14
cmpl $0xe0, %r14d
ja 0x89da
movzbl %r14b, %esi
movb $0x1, (%r13,%r15)
movq %r13, %rdi
callq 0x509e
movb $0x0, (%r13,%r15)
testb %al, %al
je 0x89da
movq $0x1, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
jmp 0x8175
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
jmp 0x8175
movl $0x4, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movq $0x2, 0x8(%r8)
movq %rax, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8b23
leaq 0x18(%rsp), %r8
movq $0x0, (%r8)
movq $0x1, 0x8(%r8)
movq $0x44, 0x10(%r8)
movq $0x4, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8a6e
movq $0x0, 0x10(%rsp)
jmp 0x8896
leaq 0x18(%rsp), %r8
movq $0x0, (%r8)
movq $0x1, 0x8(%r8)
movq $0x14, 0x10(%r8)
movq $0x4, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x8b23
movl $0x4, %eax
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movq $0x3, 0x8(%r8)
movq %rax, 0x10(%r8)
movq $0x2, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
jne 0x893c
leaq 0x18(%rsp), %r8
movq $0x44, (%r8)
movq $0x4, 0x8(%r8)
movq $0x0, 0x10(%r8)
movq $0x1, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq -0x1(%rcx), %r14
testb %al, %al
je 0x8b31
movq $0x0, 0x10(%rsp)
jmp 0x8849
leaq 0x18(%rsp), %r8
movq $0x0, (%r8)
movq $0x2, 0x8(%r8)
movq $0x14, 0x10(%r8)
movq $0x3, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8b81
movl $0x3, %eax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
jmp 0x8945
leaq 0x18(%rsp), %r8
movq $0x10, (%r8)
movq $0x3, 0x8(%r8)
movq $0x4, 0x10(%r8)
movq $0x2, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8bc1
movl $0x2, %eax
jmp 0x8c09
leaq 0x18(%rsp), %r8
movq $0x50, (%r8)
movq $0x4, 0x8(%r8)
movq $0x0, 0x10(%r8)
movq $0x1, 0x18(%r8)
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x7e16
testb %al, %al
je 0x8c13
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
addq $-0x2, %r14
movl $0x1, %eax
movq %rax, 0x10(%rsp)
jmp 0x8841
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x1, %bpl
xorl %r14d, %r14d
jmp 0x894d
nop