// File: YSRKEN[P]Shioi/I401/main.cpp
// Function: Board::GetRange() const
array<size_t, 4> GetRange() const noexcept {
		//                       left,       top,    right, bottom
		array<size_t, 4> range{{ kBoardSize, kBoardSize, 0, 0 }};
		//外接四角形を求める
		for (size_t y : rep(kBoardSize)) {
			for (size_t x : rep(kBoardSize)) {
				size_t p = x + y * kBoardSize;
				if (board_[p] == Stone::None) continue;
				range[0] = std::min(range[0], x);
				//range[1] = std::min(range[1], y);
				range[2] = std::max(range[2], x);
				range[3] = std::max(range[3], y);
			}
			if (kBoardSize == range[1] && kBoardSize != range[0]) range[1] = y;//いくら分岐予測効くとはいえ毎ループstd::minは呼びたくない
		}

		if (range[0] <= 2) range[0] = 0; else range[0] -= 2;
		if (range[1] <= 2) range[1] = 0; else range[1] -= 2;
		if (range[2] + 2 >= kBoardSize) range[2] = kBoardSize - 1; else range[2] += 2;
		if (range[3] + 2 >= kBoardSize) range[3] = kBoardSize - 1; else range[3] += 2;
		return range;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, %rax
movq %rax, -0x80(%rbp)
movq %rsi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0xbef4(%rip), %rax      # 0x1e5d0
movq %rax, (%rdi)
movq 0xbef2(%rip), %rax      # 0x1e5d8
movq %rax, 0x8(%rdi)
movq 0xbeef(%rip), %rax      # 0x1e5e0
movq %rax, 0x10(%rdi)
movq 0xbeec(%rip), %rax      # 0x1e5e8
movq %rax, 0x18(%rdi)
movl $0xf, %edi
callq 0x54a0
movq %rax, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x54e0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5510
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5550
testb $0x1, %al
jne 0x1274a
jmp 0x12921
leaq -0x28(%rbp), %rdi
callq 0x5580
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movl $0xf, %edi
callq 0x54a0
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x54e0
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5510
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5550
testb $0x1, %al
jne 0x127a4
jmp 0x128b0
leaq -0x58(%rbp), %rdi
callq 0x5580
movq -0x78(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
imulq $0xf, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rsi
callq 0x4770
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x127de
jmp 0x128a2
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12a70
movq %rax, %rdi
leaq -0x68(%rbp), %rsi
callq 0x56a0
movq -0x88(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x12a70
movq -0xa0(%rbp), %rcx
movq -0x88(%rbp), %rdi
movq %rcx, (%rax)
movl $0x2, %esi
callq 0x12a70
movq %rax, %rdi
leaq -0x68(%rbp), %rsi
callq 0x55e0
movq -0x88(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movl $0x2, %esi
callq 0x12a70
movq -0x98(%rbp), %rcx
movq -0x88(%rbp), %rdi
movq %rcx, (%rax)
movl $0x3, %esi
callq 0x12a70
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0x55e0
movq -0x88(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movl $0x3, %esi
callq 0x12a70
movq -0x90(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x55c0
jmp 0x1278e
movq -0x88(%rbp), %rdi
movl $0x1, %esi
callq 0x12a70
movq %rax, %rcx
movl $0xf, %eax
cmpq (%rcx), %rax
jne 0x12911
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12a70
movq %rax, %rcx
movl $0xf, %eax
cmpq (%rcx), %rax
je 0x12911
movq -0x88(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x1, %esi
callq 0x12a70
movq -0xa8(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x12913
leaq -0x28(%rbp), %rdi
callq 0x55c0
jmp 0x12734
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12a70
cmpq $0x2, (%rax)
ja 0x12950
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12a70
movq $0x0, (%rax)
jmp 0x1296a
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12a70
movq (%rax), %rcx
subq $0x2, %rcx
movq %rcx, (%rax)
movq -0x88(%rbp), %rdi
movl $0x1, %esi
callq 0x12a70
cmpq $0x2, (%rax)
ja 0x1299b
movq -0x88(%rbp), %rdi
movl $0x1, %esi
callq 0x12a70
movq $0x0, (%rax)
jmp 0x129b6
movq -0x88(%rbp), %rdi
movl $0x1, %esi
callq 0x12a70
movq (%rax), %rcx
subq $0x2, %rcx
movq %rcx, (%rax)
movq -0x88(%rbp), %rdi
movl $0x2, %esi
callq 0x12a70
movq (%rax), %rax
addq $0x2, %rax
cmpq $0xf, %rax
jb 0x129ee
movq -0x88(%rbp), %rdi
movl $0x2, %esi
callq 0x12a70
movq $0xe, (%rax)
jmp 0x12a09
movq -0x88(%rbp), %rdi
movl $0x2, %esi
callq 0x12a70
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movq -0x88(%rbp), %rdi
movl $0x3, %esi
callq 0x12a70
movq (%rax), %rax
addq $0x2, %rax
cmpq $0xf, %rax
jb 0x12a41
movq -0x88(%rbp), %rdi
movl $0x3, %esi
callq 0x12a70
movq $0xe, (%rax)
jmp 0x12a5c
movq -0x88(%rbp), %rdi
movl $0x3, %esi
callq 0x12a70
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movq -0x80(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)