// File: /workspace/github_cpp_makefile_star2_O1/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 $0x2568, %rsp           # imm = 0x2568
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0xb0(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x20c0
movq 0x1000(%r14), %rdx
movq %rdx, %rax
shrq $0x20, %rax
movl 0x100c(%r14), %ecx
addl %eax, %ecx
cmpl %eax, %ecx
jle 0x82b2
leaq 0x102c(%r14), %rcx
movq %rdx, %rax
sarq $0x20, %rax
movq %rax, 0x18(%rsp)
leaq 0x4b8(%rsp), %r12
movl $0x1, %ebx
movl $0x80, %r8d
leaq 0x30(%rsp), %r13
movq %r15, 0x10(%rsp)
movq %r14, 0x28(%rsp)
movq %rcx, 0x88(%rsp)
movl 0x1008(%r14), %eax
addl 0x1000(%r14), %eax
cmpl %edx, %eax
jle 0x827b
movq 0x18(%rsp), %rax
movq %rax, %rsi
shlq $0x7, %rsi
leaq (%r14,%rsi), %rdi
shlq $0x5, %rax
leaq (%rsp,%rax), %r9
addq $0xb0, %r9
movq %rsi, 0xa0(%rsp)
movq %rdi, 0x98(%rsp)
movq %r9, 0x90(%rsp)
movslq %edx, %r10
cmpl $0x0, (%rdi,%r10,4)
jne 0x825d
cmpb $0x0, (%r10,%r9)
jne 0x825d
movq %rdx, 0x20(%rsp)
xorps %xmm0, %xmm0
leaq 0x24e8(%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 %r14, %rax
xorl %edx, %edx
xorl %esi, %esi
movl (%rax,%rsi,4), %edi
cmpl $0x2, %edi
cmovll %ebx, %edi
movl %edi, (%r12,%rsi,4)
incq %rsi
cmpq $0x20, %rsi
jne 0x800f
incq %rdx
addq %r8, %r12
addq %r8, %rax
cmpq $0x20, %rdx
jne 0x800d
movq %r10, 0xa8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x59fa
movq 0x20(%rsp), %rax
movl %eax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movl %eax, 0xc(%rsp)
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x9608
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x81cb
movq 0x68(%rsp), %rdi
movq %rax, %rcx
cmpq %rdi, %rax
jne 0x80af
movq 0x78(%rsp), %rcx
movq -0x8(%rcx), %rcx
movl $0x200, %edx            # imm = 0x200
addq %rdx, %rcx
movslq -0x8(%rcx), %r15
movslq -0x4(%rcx), %r14
cmpq %rdi, %rax
je 0x80c2
addq $-0x8, %rax
jmp 0x80f5
movl $0x200, %esi            # imm = 0x200
callq 0x2190
movq 0x78(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0x68(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x70(%rsp)
addq $0x1f8, %rax            # imm = 0x1F8
movq %rax, 0x60(%rsp)
movq %r14, %rax
shlq $0x5, %rax
addq %rsp, %rax
addq $0xb0, %rax
cmpb $0x0, (%r15,%rax)
jne 0x81b6
addq %r15, %rax
movb $0x1, (%rax)
movq %r14, %rax
shlq $0x7, %rax
addq %rsp, %rax
addq $0x4b8, %rax            # imm = 0x4B8
movl $0x0, (%rax,%r15,4)
xorl %r12d, %r12d
leaq 0x3153(%rip), %rax      # 0xb290
movslq (%r12,%rax), %rbp
addq %r14, %rbp
leaq 0x3165(%rip), %rax      # 0xb2b0
movslq (%r12,%rax), %r13
addq %r15, %r13
movl %r13d, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x9f30
testb %al, %al
je 0x81ac
movq %rbp, %rax
shlq $0x7, %rax
addq 0x28(%rsp), %rax
cmpl $0x0, (%rax,%r13,4)
jne 0x81ac
movq %rbp, %rax
shlq $0x5, %rax
addq %rsp, %rax
addq $0xb0, %rax
cmpb $0x0, (%r13,%rax)
jne 0x81ac
movl %r13d, 0x8(%rsp)
movl %ebp, 0xc(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9608
addq $0x4, %r12
cmpq $0x10, %r12
jne 0x8136
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
leaq 0x30(%rsp), %r13
jne 0x8091
leaq 0x4b8(%rsp), %r12
movq %r12, %rdi
movq 0x10(%rsp), %r15
callq 0x780c
movq 0x28(%rsp), %r14
movq %r12, %rdi
callq 0x7a76
movq 0x8(%r15), %rbp
cmpq 0x10(%r15), %rbp
je 0x8214
movl $0x20b0, %edx           # imm = 0x20B0
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2140
addq $0x20b0, %rbp           # imm = 0x20B0
movq %rbp, 0x8(%r15)
jmp 0x8222
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x9718
movq %r13, %rdi
callq 0x6174
movq 0x20(%rsp), %rdx
movq 0x88(%rsp), %rcx
movl $0x80, %r8d
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %r9
movq 0xa8(%rsp), %r10
leaq (%rcx,%rsi), %rax
addl (%rax,%r10,4), %edx
movl 0x1008(%r14), %eax
addl 0x1000(%r14), %eax
cmpl %eax, %edx
jl 0x7fc0
movq 0x18(%rsp), %rdi
incq %rdi
movq 0x1000(%r14), %rdx
movl 0x100c(%r14), %eax
shlq $0x20, %rax
addq %rdx, %rax
sarq $0x20, %rax
movq %rdi, 0x18(%rsp)
cmpq %rax, %rdi
leaq 0x4b8(%rsp), %r12
jl 0x7f73
movq %r15, %rax
addq $0x2568, %rsp           # imm = 0x2568
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x82d5
movq %rax, %r14
jmp 0x82e7
movq %rax, %r14
jmp 0x82dd
jmp 0x82d5
movq %rax, %r14
movq 0x10(%rsp), %r15
leaq 0x30(%rsp), %rdi
callq 0x6174
movq (%r15), %rdi
testq %rdi, %rdi
je 0x82fb
movq 0x10(%r15), %rsi
subq %rdi, %rsi
callq 0x2190
movq %r14, %rdi
callq 0x22a0
nop