// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
pxor %xmm0, %xmm0
movdqu %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0xb0(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x20c0
movq %r14, 0x10(%rsp)
movq 0x1008(%r14), %rax
movq %rax, %rcx
shrq $0x20, %rcx
testl %ecx, %ecx
jle 0x7f8a
movq 0x10(%rsp), %rdx
movq 0x1000(%rdx), %rcx
leaq 0x102c(%rdx), %rsi
movq %rcx, %rdx
sarq $0x20, %rdx
movq %rdx, 0x20(%rsp)
leaq 0x4b8(%rsp), %r14
movdqa 0x3639(%rip), %xmm2     # 0xb250
pcmpeqd %xmm3, %xmm3
movl $0x80, %r9d
leaq 0x8(%rsp), %r13
movq %rbx, 0x28(%rsp)
movq %rsi, 0x88(%rsp)
testl %eax, %eax
jle 0x7f5d
movq 0x20(%rsp), %rdi
movq %rdi, %r8
shlq $0x7, %r8
movq 0x10(%rsp), %rdx
leaq (%rdx,%r8), %r10
movq %rdi, %rdx
shlq $0x5, %rdx
leaq (%rsp,%rdx), %rdi
addq $0xb0, %rdi
movl %ecx, %r11d
movq %r8, 0xa0(%rsp)
movq %r10, 0x98(%rsp)
movq %rdi, 0x90(%rsp)
movslq %r11d, %rdx
cmpl $0x0, (%r10,%rdx,4)
movq %rdx, 0xa8(%rsp)
jne 0x7f41
cmpb $0x0, (%rdx,%rdi)
jne 0x7f41
movl %r11d, 0x1c(%rsp)
pxor %xmm0, %xmm0
leaq 0x24e8(%rsp), %rax
movdqu %xmm0, 0x70(%rax)
movdqu %xmm0, 0x60(%rax)
movdqu %xmm0, 0x50(%rax)
movdqu %xmm0, 0x40(%rax)
movdqu %xmm0, 0x30(%rax)
movdqu %xmm0, 0x20(%rax)
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
movq 0x10(%rsp), %rcx
xorl %edx, %edx
xorl %esi, %esi
movdqu (%rcx,%rsi,4), %xmm0
movdqa %xmm0, %xmm1
pcmpgtd %xmm2, %xmm1
pand %xmm1, %xmm0
paddd %xmm1, %xmm0
psubd %xmm3, %xmm0
movdqu %xmm0, (%r14,%rsi,4)
addq $0x4, %rsi
cmpq $0x20, %rsi
jne 0x7cde
incq %rdx
addq %r9, %rcx
addq %r9, %r14
cmpq $0x20, %rdx
jne 0x7cdc
pxor %xmm0, %xmm0
movdqa %xmm0, 0x70(%rsp)
movdqa %xmm0, 0x60(%rsp)
movdqa %xmm0, 0x50(%rsp)
movdqa %xmm0, 0x40(%rsp)
movdqa %xmm0, 0x30(%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x59c6
movl 0x1c(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movl %eax, 0xc(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x92b8
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x7e9b
movq 0x68(%rsp), %rdi
cmpq %rdi, %rax
je 0x7d89
movl -0x8(%rax), %ebx
movl -0x4(%rax), %ebp
addq $-0x8, %rax
jmp 0x7dd3
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movl 0x1f8(%rax), %ebx
movl 0x1fc(%rax), %ebp
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)
movl $0x1f8, %ecx            # imm = 0x1F8
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movslq %ebp, %rbp
movslq %ebx, %r15
movq %rbp, %rcx
shlq $0x5, %rcx
addq %rsp, %rcx
addq $0xb0, %rcx
cmpb $0x0, (%r15,%rcx)
jne 0x7d68
addq %r15, %rcx
movb $0x1, (%rcx)
movq %rbp, %rax
shlq $0x7, %rax
addq %rsp, %rax
addq $0x4b8, %rax            # imm = 0x4B8
movl $0x0, (%rax,%r15,4)
xorl %r14d, %r14d
leaq 0x347e(%rip), %rax      # 0xb2a0
movslq (%r14,%rax), %rbx
addq %rbp, %rbx
leaq 0x3490(%rip), %rax      # 0xb2c0
movslq (%r14,%rax), %r12
addq %r15, %r12
movl %r12d, 0x8(%rsp)
movl %ebx, 0xc(%rsp)
movq %r13, %rdi
callq 0x9b40
testb %al, %al
je 0x7e8c
movq %rbx, %rax
shlq $0x7, %rax
addq 0x10(%rsp), %rax
cmpl $0x0, (%rax,%r12,4)
jne 0x7e8c
movq %rbx, %rax
shlq $0x5, %rax
addq %rsp, %rax
addq $0xb0, %rax
cmpb $0x0, (%r12,%rax)
jne 0x7e8c
movl %r12d, 0x8(%rsp)
movl %ebx, 0xc(%rsp)
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x92b8
addq $0x4, %r14
cmpq $0x10, %r14
jne 0x7e1b
jmp 0x7d63
leaq 0x4b8(%rsp), %r14
movq %r14, %rdi
movq 0x28(%rsp), %rbx
callq 0x761e
movq %r14, %rdi
callq 0x7798
movq 0x8(%rbx), %rbp
cmpq 0x10(%rbx), %rbp
je 0x7edf
movl $0x20b0, %edx           # imm = 0x20B0
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2140
addq $0x20b0, %rbp           # imm = 0x20B0
movq %rbp, 0x8(%rbx)
jmp 0x7eed
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x93ce
leaq 0x30(%rsp), %rdi
callq 0x6148
movq 0x10(%rsp), %rax
movq 0x1000(%rax), %rcx
movq 0x1008(%rax), %rax
movq 0x88(%rsp), %rsi
movdqa 0x3336(%rip), %xmm2     # 0xb250
pcmpeqd %xmm3, %xmm3
movl $0x80, %r9d
movq 0xa0(%rsp), %r8
movq 0x98(%rsp), %r10
movq 0x90(%rsp), %rdi
movl 0x1c(%rsp), %r11d
leaq (%rsi,%r8), %rdx
movq 0xa8(%rsp), %r15
addl (%rdx,%r15,4), %r11d
leal (%rax,%rcx), %edx
cmpl %edx, %r11d
jl 0x7c7d
movq 0x20(%rsp), %r8
incq %r8
movq %rax, %rdx
movabsq $-0x100000000, %rdi     # imm = 0xFFFFFFFF00000000
andq %rdi, %rdx
addq %rcx, %rdx
sarq $0x20, %rdx
movq %r8, 0x20(%rsp)
cmpq %rdx, %r8
jl 0x7c33
movq %rbx, %rax
addq $0x2568, %rsp           # imm = 0x2568
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7fa6
movq %rax, %r14
jmp 0x7fbf
movq %rax, %r14
jmp 0x7fb5
jmp 0x7fad
movq %rax, %r14
movq 0x28(%rsp), %rbx
leaq 0x30(%rsp), %rdi
callq 0x6148
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x7fd3
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2190
movq %r14, %rdi
callq 0x22a0
nop