// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]procon26/procon26.cpp
// Function: board::split() const
std::vector<board> board::split() const {
    std::vector<board> result;
    bool used[board_size][board_size] = {};
    repeat_from (y, offset().y, offset().y+size().y) {
        repeat_from (x, offset().x, offset().x+size().x) {
            if (m_cell[y][x] == 0 and not used[y][x]) {
                board brd;
                copy_cell_map(m_cell, brd.m_cell, [](int x) -> int { return std::max(1, x); });
                std::stack<point_t> stk;
                stk.push({ x, y });
                while (not stk.empty()) {
                    point_t p = stk.top(); stk.pop();
                    if (used[p.y][p.x]) continue;
                    used[p.y][p.x] = true;
                    brd.m_cell[p.y][p.x] = 0;
                    repeat (i,4) {
                        int ny = p.y + dy[i];
                        int nx = p.x + dx[i];
                        if (not is_on_board({ nx, ny })) continue;
                        if (m_cell[ny][nx] == 0 and not used[ny][nx]) {
                            stk.push({ nx, ny });
                        }
                    }
                }
                brd.shrink();
                brd.update();
                result.push_back(brd);
            }
            x += m_skips[y][x] - 1;
        }
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2558, %rsp           # imm = 0x2558
movq %rsi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, 0x18(%rsp)
andq $0x0, 0x10(%rdi)
leaq 0xa0(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x20b0
movq 0x1000(%rbx), %rax
movq 0x1008(%rbx), %rcx
movq %rbx, 0x10(%rsp)
addq $0x102c, %rbx           # imm = 0x102C
movq %rax, %r14
sarq $0x20, %r14
leaq 0x4a8(%rsp), %r12
leaq 0x50(%rsp), %r13
movl $0x80, %r8d
pushq $0x1
popq %r15
movq %rbx, 0x20(%rsp)
movq %rcx, %rdx
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
andq %rsi, %rdx
addq %rax, %rdx
sarq $0x20, %rdx
cmpq %rdx, %r14
jge 0x7f38
movq %r14, %rbp
shlq $0x7, %rbp
movq 0x10(%rsp), %rdx
addq %rbp, %rdx
movq %rdx, 0x40(%rsp)
movq %r14, %rdx
shlq $0x5, %rdx
addq %rsp, %rdx
addq $0xa0, %rdx
movq %rdx, 0x38(%rsp)
movl %eax, %esi
movq %r14, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
leal (%rcx,%rax), %edx
cmpl %edx, %esi
jge 0x7f30
movl %esi, 0xc(%rsp)
movslq %esi, %rsi
movq 0x40(%rsp), %rdx
cmpl $0x0, (%rdx,%rsi,4)
movq %rsi, 0x48(%rsp)
jne 0x7f1b
movq 0x38(%rsp), %rdx
cmpb $0x0, (%rsi,%rdx)
jne 0x7f1b
xorps %xmm0, %xmm0
leaq 0x24d8(%rsp), %rax
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x10(%rsp), %rax
xorl %edx, %edx
cmpq $0x20, %rdx
je 0x7da1
xorl %esi, %esi
cmpq $0x20, %rsi
je 0x7d96
movl (%rax,%rsi,4), %edi
cmpl $0x2, %edi
cmovll %r15d, %edi
movl %edi, (%r12,%rsi,4)
incq %rsi
jmp 0x7d7d
incq %rdx
addq %r8, %r12
addq %r8, %rax
jmp 0x7d75
movq %r13, %rdi
callq 0x4300
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rsp)
movl %r14d, 0x8(%rsp)
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
callq 0x92fc
movq 0x80(%rsp), %rax
cmpq 0x60(%rsp), %rax
je 0x7ec1
cmpq 0x88(%rsp), %rax
leaq 0x50(%rsp), %rdi
jne 0x7df9
movq 0x98(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movslq -0x8(%rax), %r12
movslq -0x4(%rax), %r14
callq 0x599c
movq %r14, %rax
shlq $0x5, %rax
addq %rsp, %rax
addq $0xa0, %rax
cmpb $0x0, (%r12,%rax)
jne 0x7dc3
addq %r12, %rax
movb $0x1, (%rax)
movq %r14, %rax
shlq $0x7, %rax
addq %rsp, %rax
addq $0x4a8, %rax            # imm = 0x4A8
andl $0x0, (%rax,%r12,4)
xorl %ebp, %ebp
cmpq $0x10, %rbp
je 0x7dc3
leaq 0x3449(%rip), %rax      # 0xb290
movslq (%rbp,%rax), %rbx
addq %r14, %rbx
leaq 0x345a(%rip), %rax      # 0xb2b0
movslq (%rbp,%rax), %r13
addq %r12, %r13
movl %r13d, 0x4(%rsp)
movl %ebx, 0x8(%rsp)
leaq 0x4(%rsp), %rdi
callq 0x9de0
testb %al, %al
je 0x7eb8
movq %rbx, %rax
shlq $0x7, %rax
addq 0x10(%rsp), %rax
cmpl $0x0, (%rax,%r13,4)
jne 0x7eb8
movq %rbx, %rax
shlq $0x5, %rax
addq %rsp, %rax
addq $0xa0, %rax
cmpb $0x0, (%r13,%rax)
jne 0x7eb8
movl %r13d, 0x4(%rsp)
movl %ebx, 0x8(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x92fc
addq $0x4, %rbp
jmp 0x7e3a
leaq 0x4a8(%rsp), %r12
movq %r12, %rdi
callq 0x7692
leaq 0x50(%rsp), %r13
movq %r12, %rdi
callq 0x7850
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x8d82
movq %r13, %rdi
callq 0x5e48
movq 0x10(%rsp), %rcx
movq 0x1000(%rcx), %rax
movq 0x1008(%rcx), %rcx
movq 0x20(%rsp), %rbx
movq 0x30(%rsp), %r14
movl $0x80, %r8d
movq 0x28(%rsp), %rbp
leaq (%rbx,%rbp), %rdx
movl 0xc(%rsp), %esi
movq 0x48(%rsp), %rdi
addl (%rdx,%rdi,4), %esi
jmp 0x7d0f
incq %r14
jmp 0x7cb9
movq 0x18(%rsp), %rax
addq $0x2558, %rsp           # imm = 0x2558
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x7f67
jmp 0x7f5a
jmp 0x7f5a
jmp 0x7f5a
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x5e48
movq 0x18(%rsp), %rdi
callq 0x4d30
movq %r14, %rdi
callq 0x2270
nop