// File: /workspace/github_cpp_makefile_star2_O1/kmyk[P]topcoder-marathon-match-100-same-color-pairs/./SameColorPairs.cpp
// Function: SameColorPairs::removePairs(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>)
vector<string> removePairs(vector<string> a_board) {
        double clock_begin = rdtsc();

        // parse input
        int H = a_board.size();
        int W = a_board[0].size();
        vector<vector<int> > board(H, vector<int>(W));
        int C = 0;
        REP (y, H) REP (x, W) {
            board[y][x] = a_board[y][x] - '0';
            chmax(C, board[y][x] + 1);
        }

        // assertion
        assert (10 <= H and H <= 100);
        assert (10 <= W and W <= 100);
        assert (2  <= C and C <= 6);

        // debug output
        cerr << "H = " << H << endl;
        cerr << "W = " << W << endl;
        cerr << "C = " << C << endl;
#ifdef LOCAL
        REP (y, H) {
            REP (x, W) {
                cerr << board[y][x];
            }
            cerr << endl;
        }
#endif

        // solve
        vector<array<int, 4> > result = solve(H, W, C, board);

        // make output
        vector<string> answer;
        for (auto rect : result) {
            ostringstream oss;
            oss << rect[0] << ' ';
            oss << rect[1] << ' ';
            oss << rect[2] << ' ';
            oss << rect[3];
            answer.push_back(oss.str());
        }
        double t = rdtsc() - clock_begin;
        cerr << "time = " << t << endl;
        cerr << "!\t" << H << "\t" << W << "\t" << C << "\t" << (H * W - 2 * int(answer.size())) << "\t" << t << endl;
        return answer;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdx, %rbx
movq %rdi, 0x8(%rsp)
rdtsc
movl %eax, %r12d
movl %edx, %ebp
movq (%rbx), %r14
movq 0x8(%rbx), %r15
movq 0x8(%r14), %r13
movslq %r13d, %rsi
leaq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x42ce
subq %r14, %r15
shrq $0x5, %r15
movslq %r15d, %rsi
leaq 0x88(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
leaq 0x48(%rsp), %rcx
callq 0x4358
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x486f
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
movl %r12d, 0x10(%rsp)
testl %r15d, %r15d
jle 0x48ea
movq 0x88(%rsp), %rax
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %r15, %rcx
andq %rsi, %rcx
movq %r13, %rdx
andq %rsi, %rdx
xorl %esi, %esi
xorl %edi, %edi
testl %r13d, %r13d
jle 0x48da
movq (%rbx), %r8
movq %rsi, %r9
shlq $0x5, %r9
movq (%r8,%r9), %r8
leaq (%rsi,%rsi,2), %r9
movq (%rax,%r9,8), %r9
xorl %r10d, %r10d
movsbl (%r8,%r10), %r12d
leal -0x30(%r12), %r11d
addl $-0x2f, %r12d
cmpl %r12d, %edi
cmovgl %edi, %r12d
movl %r11d, (%r9,%r10,4)
incq %r10
movl %r12d, %edi
cmpq %r10, %rdx
jne 0x48b4
jmp 0x48dd
movl %edi, %r12d
incq %rsi
movl %r12d, %edi
cmpq %rcx, %rsi
jne 0x4896
jmp 0x48ed
xorl %r12d, %r12d
leal -0xa(%r15), %eax
cmpl $0x5b, %eax
jae 0x4d61
leal -0xa(%r13), %eax
cmpl $0x5b, %eax
jae 0x4d80
leal -0x2(%r12), %eax
cmpl $0x5, %eax
jae 0x4d9f
movq 0x86d4(%rip), %rdi      # 0xcff0
leaq 0x4a46(%rip), %rsi      # 0x9369
movl $0x4, %edx
callq 0x21a0
movq 0x86bc(%rip), %rdi      # 0xcff0
movl %r15d, %esi
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x8683(%rip), %rdi      # 0xcff0
leaq 0x49fa(%rip), %rsi      # 0x936e
movl $0x4, %edx
callq 0x21a0
movq 0x866b(%rip), %rdi      # 0xcff0
movl %r13d, %esi
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x8632(%rip), %rdi      # 0xcff0
leaq 0x49ae(%rip), %rsi      # 0x9373
movl $0x4, %edx
callq 0x21a0
movq 0x861a(%rip), %rdi      # 0xcff0
movl %r12d, %esi
callq 0x2250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq 0x48(%rsp), %rdi
leaq 0x88(%rsp), %r8
movl %r15d, %esi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x2f87
movq %rbp, 0x78(%rsp)
movq %r13, 0x18(%rsp)
movq %r15, 0x20(%rsp)
xorpd %xmm0, %xmm0
movq 0x8(%rsp), %rax
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq 0x48(%rsp), %r14
movq 0x50(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq %rax, %r14
je 0x4b61
leaq 0xa0(%rsp), %rbx
leaq 0x28(%rsp), %r13
movl (%r14), %ebp
movl 0x4(%r14), %r15d
movl 0x8(%r14), %eax
movl %eax, 0x60(%rsp)
movl 0xc(%r14), %eax
movl %eax, 0x14(%rsp)
movq %rbx, %rdi
callq 0x21c0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2250
movb $0x20, 0x28(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2250
movb $0x20, 0x28(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rbx, %rdi
movl 0x60(%rsp), %esi
callq 0x2250
movb $0x20, 0x28(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x21a0
movq %rbx, %rdi
movl 0x14(%rsp), %esi
callq 0x2250
movq %r13, %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2200
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x4ffa
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4b33
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
movq 0x8483(%rip), %rsi      # 0xcfc0
callq 0x20b0
leaq 0x110(%rsp), %rdi
callq 0x2050
addq $0x10, %r14
cmpq 0x80(%rsp), %r14
jne 0x4a6f
rdtsc
movl %edx, %ebx
movl %eax, %ebp
movq 0x8482(%rip), %rdi      # 0xcff0
leaq 0x4803(%rip), %rsi      # 0x9378
movl $0x7, %edx
callq 0x21a0
movl 0x10(%rsp), %eax
movq 0x78(%rsp), %rcx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, %xmm0
punpckldq 0x4474(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x447c(%rip), %xmm0     # 0x9020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x4488(%rip), %xmm1     # 0x9040
shlq $0x20, %rbx
movl %ebp, %eax
orq %rbx, %rax
movq %rax, %xmm2
punpckldq 0x4442(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x444a(%rip), %xmm2     # 0x9020
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
mulsd 0x4456(%rip), %xmm0     # 0x9040
subsd %xmm1, %xmm0
movq 0x83fb(%rip), %rdi      # 0xcff0
movapd %xmm0, 0x60(%rsp)
callq 0x2210
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x83bf(%rip), %rdi      # 0xcff0
leaq 0x4748(%rip), %rsi      # 0x9380
movl $0x2, %edx
callq 0x21a0
movq 0x83a7(%rip), %rdi      # 0xcff0
movq 0x20(%rsp), %rsi
callq 0x2250
movq %rax, %rbx
leaq 0x4724(%rip), %rsi      # 0x9381
movl $0x1, %edx
movq %rax, %rdi
callq 0x21a0
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x2250
movq %rax, %rbx
leaq 0x4700(%rip), %rsi      # 0x9381
movl $0x1, %edx
movq %rax, %rdi
callq 0x21a0
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2250
movq %rax, %rbx
leaq 0x46de(%rip), %rsi      # 0x9381
movl $0x1, %edx
movq %rax, %rdi
callq 0x21a0
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
movq 0x20(%rsp), %rsi
imull 0x18(%rsp), %esi
shrq $0x4, %rax
andl $-0x2, %eax
subl %eax, %esi
movq %rbx, %rdi
callq 0x2250
movq %rax, %rbx
leaq 0x46a0(%rip), %rsi      # 0x9381
movl $0x1, %edx
movq %rax, %rdi
callq 0x21a0
movq %rbx, %rdi
movapd 0x60(%rsp), %xmm0
callq 0x2210
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x4d3d
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
leaq 0x88(%rsp), %rdi
callq 0x442c
movq 0x8(%rsp), %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x458a(%rip), %rdi      # 0x92f2
leaq 0x44dd(%rip), %rsi      # 0x924c
leaq 0x4591(%rip), %rcx      # 0x9307
movl $0x259, %edx            # imm = 0x259
callq 0x20e0
leaq 0x45bb(%rip), %rdi      # 0x9342
leaq 0x44be(%rip), %rsi      # 0x924c
leaq 0x4572(%rip), %rcx      # 0x9307
movl $0x25a, %edx            # imm = 0x25A
callq 0x20e0
leaq 0x45b1(%rip), %rdi      # 0x9357
leaq 0x449f(%rip), %rsi      # 0x924c
leaq 0x4553(%rip), %rcx      # 0x9307
movl $0x25b, %edx            # imm = 0x25B
callq 0x20e0
jmp 0x4df1
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4e72
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
jmp 0x4e72
movq %rax, %rbx
jmp 0x4e72
movq %rax, %rbx
jmp 0x4e65
jmp 0x4df8
movq %rax, %rbx
jmp 0x4e44
jmp 0x4e20
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4e23
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x4e23
movq %rax, %rbx
movq 0x8196(%rip), %rsi      # 0xcfc0
leaq 0xa0(%rsp), %rdi
callq 0x20b0
leaq 0x110(%rsp), %rdi
callq 0x2050
movq 0x8(%rsp), %rdi
callq 0x4f04
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x4e65
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x2190
leaq 0x88(%rsp), %rdi
callq 0x442c
movq %rbx, %rdi
callq 0x2260