Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void){
    int n,m;
    char s[55][55];
    int i,j,k,c;
    int row,ans=2500,count;

    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++) scanf("%s",s[i]);


    for(i=1;i<=n-2;i++){
	for(j=1;i+j<=n-1;j++){
	    row=0;count=0;

	    for(k=0;k<i;k++){
		for(c=0;c<m;c++){
		    if(s[row][c]!='W') count++;
		}
		row++;
	    }
	    for(k=0;k<j;k++){
                for(c=0;c<m;c++){
                    if(s[row][c]!='B') count++;
                }
                row++;
            }
	    for(k=0;k<n-i-j;k++){
                for(c=0;c<m;c++){
                    if(s[row][c]!='R') count++;
                }
                row++;
            }

	    if(count<ans) ans=count;
	}
    }

    printf("%d\n",ans);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$3088, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$2500, -3048(%rbp)
	leaq	-3072(%rbp), %rdx
	leaq	-3076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3068(%rbp)
	jmp	.L2
.L3:
	leaq	-3040(%rbp), %rcx
	movl	-3068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -3068(%rbp)
.L2:
	movl	-3076(%rbp), %eax
	cmpl	%eax, -3068(%rbp)
	jl	.L3
	movl	$1, -3068(%rbp)
	jmp	.L4
.L23:
	movl	$1, -3064(%rbp)
	jmp	.L5
.L22:
	movl	$0, -3052(%rbp)
	movl	$0, -3044(%rbp)
	movl	$0, -3060(%rbp)
	jmp	.L6
.L10:
	movl	$0, -3056(%rbp)
	jmp	.L7
.L9:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$87, %al
	je	.L8
	addl	$1, -3044(%rbp)
.L8:
	addl	$1, -3056(%rbp)
.L7:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L9
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L6:
	movl	-3060(%rbp), %eax
	cmpl	-3068(%rbp), %eax
	jl	.L10
	movl	$0, -3060(%rbp)
	jmp	.L11
.L15:
	movl	$0, -3056(%rbp)
	jmp	.L12
.L14:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L13
	addl	$1, -3044(%rbp)
.L13:
	addl	$1, -3056(%rbp)
.L12:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L14
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L11:
	movl	-3060(%rbp), %eax
	cmpl	-3064(%rbp), %eax
	jl	.L15
	movl	$0, -3060(%rbp)
	jmp	.L16
.L20:
	movl	$0, -3056(%rbp)
	jmp	.L17
.L19:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$82, %al
	je	.L18
	addl	$1, -3044(%rbp)
.L18:
	addl	$1, -3056(%rbp)
.L17:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L19
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L16:
	movl	-3076(%rbp), %eax
	subl	-3068(%rbp), %eax
	subl	-3064(%rbp), %eax
	cmpl	%eax, -3060(%rbp)
	jl	.L20
	movl	-3044(%rbp), %eax
	cmpl	-3048(%rbp), %eax
	jge	.L21
	movl	-3044(%rbp), %eax
	movl	%eax, -3048(%rbp)
.L21:
	addl	$1, -3064(%rbp)
.L5:
	movl	-3068(%rbp), %edx
	movl	-3064(%rbp), %eax
	addl	%eax, %edx
	movl	-3076(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L22
	addl	$1, -3068(%rbp)
.L4:
	movl	-3076(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -3068(%rbp)
	jl	.L23
	movl	-3048(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$3112, %rsp
	.cfi_def_cfa_offset 3168
	movq	%fs:40, %rax
	movq	%rax, 3096(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rdx
	leaq	56(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %eax
	movl	%eax, 32(%rsp)
	testl	%eax, %eax
	jle	.L2
	leaq	64(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %eax
	addq	$55, %rbp
	movl	%eax, 32(%rsp)
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	32(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 44(%rsp)
	cmpl	$1, %eax
	jle	.L76
	movl	60(%rsp), %edx
	leaq	119(%rsp), %rax
	movl	$2500, 12(%rsp)
	movl	$1, %r14d
	movq	%rax, 24(%rsp)
	movdqa	.LC2(%rip), %xmm5
	movl	$1, 40(%rsp)
	movl	%edx, %r9d
	movl	%edx, %edi
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC3(%rip), %xmm3
	leal	-1(%rdx), %r15d
	shrl	$4, %r9d
	andl	$-16, %edi
	movdqa	.LC5(%rip), %xmm2
.L5:
	movl	40(%rsp), %eax
	movl	32(%rsp), %ecx
	movl	%eax, 36(%rsp)
	addl	$1, %eax
	movl	%eax, 40(%rsp)
	cmpl	%ecx, %eax
	jge	.L72
	subl	%eax, %ecx
	movl	%eax, %ebp
	leaq	64(%rsp), %rax
	movdqa	.LC3(%rip), %xmm6
	movq	%rax, 16(%rsp)
	movl	%ecx, %r13d
	.p2align 4,,10
	.p2align 3
.L74:
	movq	16(%rsp), %r10
	xorl	%eax, %eax
	xorl	%r11d, %r11d
	pxor	%xmm9, %xmm9
	pxor	%xmm8, %xmm8
	.p2align 4,,10
	.p2align 3
.L73:
	testl	%edx, %edx
	jle	.L27
	cmpl	$14, %r15d
	jbe	.L77
	movdqu	(%r10), %xmm1
	movdqa	%xmm9, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpeqb	%xmm5, %xmm1
	pandn	%xmm6, %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm0, %xmm7
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm7, %xmm10
	movdqa	%xmm7, %xmm11
	movdqa	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	punpcklwd	%xmm10, %xmm11
	punpckhwd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	paddd	%xmm11, %xmm0
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %r9d
	jbe	.L7
	movdqu	16(%r10), %xmm1
	movdqa	%xmm9, %xmm11
	pcmpeqb	%xmm5, %xmm1
	pandn	%xmm6, %xmm1
	pcmpgtb	%xmm1, %xmm11
	movdqa	%xmm1, %xmm10
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm11, %xmm10
	punpckhbw	%xmm11, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm1
	punpcklwd	%xmm11, %xmm1
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpgtw	%xmm7, %xmm10
	punpcklwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	punpckhwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	cmpl	$2, %r9d
	je	.L7
	movdqu	32(%r10), %xmm1
	movdqa	%xmm9, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpeqb	%xmm5, %xmm1
	pandn	%xmm6, %xmm1
	pcmpgtb	%xmm1, %xmm7
	movdqa	%xmm1, %xmm10
	punpcklbw	%xmm7, %xmm10
	punpckhbw	%xmm7, %xmm1
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm7
	punpcklwd	%xmm11, %xmm7
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	paddd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
.L7:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	cmpl	%edi, %edx
	je	.L27
	movl	%edi, %ecx
.L6:
	movslq	%r11d, %r8
	movslq	%ecx, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$87, -3040(%rbx,%rsi)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	1(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	2(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	3(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	4(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	5(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	6(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	7(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	8(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	9(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %eax
	leal	10(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L27
	movslq	%esi, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	xorl	%r8d, %r8d
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$87, -3040(%rbx,%rsi)
	setne	%r8b
	addl	%r8d, %eax
	leal	11(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L27
	movslq	%r8d, %r8
	cmpb	$87, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	12(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L27
	movslq	%r8d, %r8
	cmpb	$87, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	13(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L27
	movslq	%r8d, %r8
	cmpb	$87, -3040(%rsi,%r8)
	setne	%r8b
	addl	$14, %ecx
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	cmpl	%ecx, %edx
	jle	.L27
	movslq	%ecx, %rcx
	cmpb	$87, -3040(%rsi,%rcx)
	setne	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %eax
	.p2align 4,,10
	.p2align 3
.L27:
	addl	$1, %r11d
	addq	$55, %r10
	cmpl	%r14d, %r11d
	jne	.L73
	movq	24(%rsp), %r10
	movl	36(%rsp), %r11d
	pxor	%xmm9, %xmm9
	pxor	%xmm8, %xmm8
	.p2align 4,,10
	.p2align 3
.L25:
	testl	%edx, %edx
	jle	.L50
	cmpl	$14, %r15d
	jbe	.L79
	movdqu	(%r10), %xmm1
	movdqa	%xmm9, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpeqb	%xmm4, %xmm1
	pandn	%xmm3, %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm0, %xmm7
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm7, %xmm10
	movdqa	%xmm7, %xmm11
	movdqa	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	punpcklwd	%xmm10, %xmm11
	punpckhwd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	paddd	%xmm11, %xmm0
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %r9d
	jbe	.L29
	movdqu	16(%r10), %xmm1
	movdqa	%xmm9, %xmm11
	pcmpeqb	%xmm4, %xmm1
	pandn	%xmm3, %xmm1
	pcmpgtb	%xmm1, %xmm11
	movdqa	%xmm1, %xmm10
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm11, %xmm10
	punpckhbw	%xmm11, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm1
	punpcklwd	%xmm11, %xmm1
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpgtw	%xmm7, %xmm10
	punpcklwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	punpckhwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	cmpl	$2, %r9d
	je	.L29
	movdqu	32(%r10), %xmm1
	movdqa	%xmm9, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpeqb	%xmm4, %xmm1
	pandn	%xmm3, %xmm1
	pcmpgtb	%xmm1, %xmm7
	movdqa	%xmm1, %xmm10
	punpcklbw	%xmm7, %xmm10
	punpckhbw	%xmm7, %xmm1
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm7
	punpcklwd	%xmm11, %xmm7
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	paddd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
.L29:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	cmpl	%edi, %edx
	je	.L50
	movl	%edi, %ecx
.L28:
	movslq	%r11d, %r8
	movslq	%ecx, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$66, -3040(%rbx,%rsi)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	1(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	2(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	3(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	4(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	5(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	6(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	7(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	8(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	9(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %eax
	leal	10(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L50
	movslq	%esi, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	xorl	%r8d, %r8d
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$66, -3040(%rbx,%rsi)
	setne	%r8b
	addl	%r8d, %eax
	leal	11(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L50
	movslq	%r8d, %r8
	cmpb	$66, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	12(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L50
	movslq	%r8d, %r8
	cmpb	$66, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	13(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L50
	movslq	%r8d, %r8
	cmpb	$66, -3040(%rsi,%r8)
	setne	%r8b
	addl	$14, %ecx
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	cmpl	%ecx, %edx
	jle	.L50
	movslq	%ecx, %rcx
	cmpb	$66, -3040(%rsi,%rcx)
	setne	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %eax
	.p2align 4,,10
	.p2align 3
.L50:
	addl	$1, %r11d
	addq	$55, %r10
	movl	%ebp, %r8d
	cmpl	%ebp, %r11d
	jne	.L25
	testl	%r13d, %r13d
	jle	.L47
	movslq	%ebp, %rcx
	leal	0(%r13,%rbp), %r12d
	pxor	%xmm9, %xmm9
	movdqa	.LC3(%rip), %xmm10
	leaq	(%rcx,%rcx,4), %rsi
	pxor	%xmm8, %xmm8
	leaq	(%rcx,%rsi,2), %rcx
	leaq	(%rcx,%rcx,4), %r10
	addq	16(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L48:
	testl	%edx, %edx
	jle	.L71
	cmpl	$14, %r15d
	jbe	.L80
	movdqu	(%r10), %xmm1
	movdqa	%xmm9, %xmm0
	movdqa	%xmm8, %xmm11
	pcmpeqb	%xmm2, %xmm1
	pandn	%xmm10, %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm0, %xmm7
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm7, %xmm11
	movdqa	%xmm7, %xmm12
	movdqa	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	punpcklwd	%xmm11, %xmm12
	punpckhwd	%xmm11, %xmm0
	movdqa	%xmm1, %xmm11
	paddd	%xmm12, %xmm0
	punpcklwd	%xmm7, %xmm11
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm11, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %r9d
	jbe	.L52
	movdqu	16(%r10), %xmm1
	movdqa	%xmm9, %xmm12
	pcmpeqb	%xmm2, %xmm1
	pandn	%xmm10, %xmm1
	pcmpgtb	%xmm1, %xmm12
	movdqa	%xmm1, %xmm11
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm12, %xmm11
	punpckhbw	%xmm12, %xmm7
	movdqa	%xmm8, %xmm12
	pcmpgtw	%xmm11, %xmm12
	movdqa	%xmm11, %xmm1
	punpcklwd	%xmm12, %xmm1
	punpckhwd	%xmm12, %xmm11
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	paddd	%xmm11, %xmm0
	movdqa	%xmm8, %xmm11
	pcmpgtw	%xmm7, %xmm11
	punpcklwd	%xmm11, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	punpckhwd	%xmm11, %xmm1
	paddd	%xmm1, %xmm0
	cmpl	$2, %r9d
	je	.L52
	movdqu	32(%r10), %xmm1
	movdqa	%xmm9, %xmm7
	movdqa	%xmm8, %xmm12
	pcmpeqb	%xmm2, %xmm1
	pandn	%xmm10, %xmm1
	pcmpgtb	%xmm1, %xmm7
	movdqa	%xmm1, %xmm11
	punpcklbw	%xmm7, %xmm11
	punpckhbw	%xmm7, %xmm1
	pcmpgtw	%xmm11, %xmm12
	movdqa	%xmm11, %xmm7
	punpcklwd	%xmm12, %xmm7
	punpckhwd	%xmm12, %xmm11
	paddd	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	paddd	%xmm11, %xmm0
	movdqa	%xmm1, %xmm11
	punpcklwd	%xmm7, %xmm11
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm11, %xmm0
	paddd	%xmm1, %xmm0
.L52:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	cmpl	%edi, %edx
	je	.L71
	movl	%edi, %ecx
.L51:
	movslq	%r8d, %r11
	movslq	%ecx, %rbx
	leaq	(%r11,%r11,4), %rsi
	leaq	(%r11,%rsi,2), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$82, -3040(%rbx,%rsi)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	1(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	2(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	3(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	4(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	5(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	6(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	7(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	8(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	9(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %eax
	leal	10(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L71
	movslq	%esi, %rbx
	leaq	(%r11,%r11,4), %rsi
	leaq	(%r11,%rsi,2), %rsi
	xorl	%r11d, %r11d
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$82, -3040(%rbx,%rsi)
	setne	%r11b
	addl	%r11d, %eax
	leal	11(%rcx), %r11d
	cmpl	%r11d, %edx
	jle	.L71
	movslq	%r11d, %r11
	cmpb	$82, -3040(%rsi,%r11)
	setne	%r11b
	movzbl	%r11b, %r11d
	addl	%r11d, %eax
	leal	12(%rcx), %r11d
	cmpl	%r11d, %edx
	jle	.L71
	movslq	%r11d, %r11
	cmpb	$82, -3040(%rsi,%r11)
	setne	%r11b
	movzbl	%r11b, %r11d
	addl	%r11d, %eax
	leal	13(%rcx), %r11d
	cmpl	%r11d, %edx
	jle	.L71
	movslq	%r11d, %r11
	cmpb	$82, -3040(%rsi,%r11)
	setne	%r11b
	addl	$14, %ecx
	movzbl	%r11b, %r11d
	addl	%r11d, %eax
	cmpl	%ecx, %edx
	jle	.L71
	movslq	%ecx, %rcx
	cmpb	$82, -3040(%rsi,%rcx)
	setne	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %eax
	.p2align 4,,10
	.p2align 3
.L71:
	addl	$1, %r8d
	addq	$55, %r10
	cmpl	%r12d, %r8d
	jne	.L48
.L47:
	movl	12(%rsp), %ecx
	cmpl	%eax, %ecx
	cmovle	%ecx, %eax
	subl	$1, %r13d
	addl	$1, %ebp
	movl	%eax, 12(%rsp)
	cmpl	32(%rsp), %ebp
	jne	.L74
.L72:
	addq	$55, 24(%rsp)
	movl	40(%rsp), %ecx
	addl	$1, %r14d
	cmpl	%ecx, 44(%rsp)
	jne	.L5
.L4:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	3096(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L96
	addq	$3112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L80:
	.cfi_restore_state
	xorl	%ecx, %ecx
	jmp	.L51
.L77:
	xorl	%ecx, %ecx
	jmp	.L6
.L79:
	xorl	%ecx, %ecx
	jmp	.L28
.L76:
	movl	$2500, 12(%rsp)
	jmp	.L4
.L96:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.align 16
.LC3:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.align 16
.LC4:
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.align 16
.LC5:
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$3112, %rsp
	.cfi_def_cfa_offset 3168
	movq	%fs:40, %rax
	movq	%rax, 3096(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rdx
	leaq	56(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %eax
	movl	%eax, 32(%rsp)
	testl	%eax, %eax
	jle	.L2
	leaq	64(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %eax
	addq	$55, %rbp
	movl	%eax, 32(%rsp)
	cmpl	%ebx, %eax
	jg	.L3
.L2:
	movl	32(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 44(%rsp)
	cmpl	$1, %eax
	jle	.L76
	movl	60(%rsp), %edx
	leaq	119(%rsp), %rax
	movl	$2500, 12(%rsp)
	movl	$1, %r14d
	movq	%rax, 24(%rsp)
	movdqa	.LC2(%rip), %xmm5
	movl	$1, 40(%rsp)
	movl	%edx, %r9d
	movl	%edx, %edi
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC3(%rip), %xmm3
	leal	-1(%rdx), %r15d
	shrl	$4, %r9d
	andl	$-16, %edi
	movdqa	.LC5(%rip), %xmm2
.L5:
	movl	40(%rsp), %eax
	movl	32(%rsp), %ecx
	movl	%eax, 36(%rsp)
	addl	$1, %eax
	movl	%eax, 40(%rsp)
	cmpl	%ecx, %eax
	jge	.L72
	subl	%eax, %ecx
	movl	%eax, %ebp
	leaq	64(%rsp), %rax
	movdqa	.LC3(%rip), %xmm6
	movq	%rax, 16(%rsp)
	movl	%ecx, %r13d
	.p2align 4,,10
	.p2align 3
.L74:
	movq	16(%rsp), %r10
	xorl	%eax, %eax
	xorl	%r11d, %r11d
	pxor	%xmm9, %xmm9
	pxor	%xmm8, %xmm8
	.p2align 4,,10
	.p2align 3
.L73:
	testl	%edx, %edx
	jle	.L27
	cmpl	$14, %r15d
	jbe	.L77
	movdqu	(%r10), %xmm1
	movdqa	%xmm9, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpeqb	%xmm5, %xmm1
	pandn	%xmm6, %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm0, %xmm7
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm7, %xmm10
	movdqa	%xmm7, %xmm11
	movdqa	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	punpcklwd	%xmm10, %xmm11
	punpckhwd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	paddd	%xmm11, %xmm0
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %r9d
	jbe	.L7
	movdqu	16(%r10), %xmm1
	movdqa	%xmm9, %xmm11
	pcmpeqb	%xmm5, %xmm1
	pandn	%xmm6, %xmm1
	pcmpgtb	%xmm1, %xmm11
	movdqa	%xmm1, %xmm10
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm11, %xmm10
	punpckhbw	%xmm11, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm1
	punpcklwd	%xmm11, %xmm1
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpgtw	%xmm7, %xmm10
	punpcklwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	punpckhwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	cmpl	$2, %r9d
	je	.L7
	movdqu	32(%r10), %xmm1
	movdqa	%xmm9, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpeqb	%xmm5, %xmm1
	pandn	%xmm6, %xmm1
	pcmpgtb	%xmm1, %xmm7
	movdqa	%xmm1, %xmm10
	punpcklbw	%xmm7, %xmm10
	punpckhbw	%xmm7, %xmm1
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm7
	punpcklwd	%xmm11, %xmm7
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	paddd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
.L7:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	cmpl	%edi, %edx
	je	.L27
	movl	%edi, %ecx
.L6:
	movslq	%r11d, %r8
	movslq	%ecx, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$87, -3040(%rbx,%rsi)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	1(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	2(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	3(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	4(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	5(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	6(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	7(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	8(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	9(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L27
	movslq	%ebx, %rbx
	cmpb	$87, -3040(%rsi,%rbx)
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %eax
	leal	10(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L27
	movslq	%esi, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	xorl	%r8d, %r8d
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$87, -3040(%rbx,%rsi)
	setne	%r8b
	addl	%r8d, %eax
	leal	11(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L27
	movslq	%r8d, %r8
	cmpb	$87, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	12(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L27
	movslq	%r8d, %r8
	cmpb	$87, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	13(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L27
	movslq	%r8d, %r8
	cmpb	$87, -3040(%rsi,%r8)
	setne	%r8b
	addl	$14, %ecx
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	cmpl	%ecx, %edx
	jle	.L27
	movslq	%ecx, %rcx
	cmpb	$87, -3040(%rsi,%rcx)
	setne	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %eax
	.p2align 4,,10
	.p2align 3
.L27:
	addl	$1, %r11d
	addq	$55, %r10
	cmpl	%r14d, %r11d
	jne	.L73
	movq	24(%rsp), %r10
	movl	36(%rsp), %r11d
	pxor	%xmm9, %xmm9
	pxor	%xmm8, %xmm8
	.p2align 4,,10
	.p2align 3
.L25:
	testl	%edx, %edx
	jle	.L50
	cmpl	$14, %r15d
	jbe	.L79
	movdqu	(%r10), %xmm1
	movdqa	%xmm9, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpeqb	%xmm4, %xmm1
	pandn	%xmm3, %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm0, %xmm7
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm7, %xmm10
	movdqa	%xmm7, %xmm11
	movdqa	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	punpcklwd	%xmm10, %xmm11
	punpckhwd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	paddd	%xmm11, %xmm0
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %r9d
	jbe	.L29
	movdqu	16(%r10), %xmm1
	movdqa	%xmm9, %xmm11
	pcmpeqb	%xmm4, %xmm1
	pandn	%xmm3, %xmm1
	pcmpgtb	%xmm1, %xmm11
	movdqa	%xmm1, %xmm10
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm11, %xmm10
	punpckhbw	%xmm11, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm1
	punpcklwd	%xmm11, %xmm1
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	movdqa	%xmm8, %xmm10
	pcmpgtw	%xmm7, %xmm10
	punpcklwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	punpckhwd	%xmm10, %xmm1
	paddd	%xmm1, %xmm0
	cmpl	$2, %r9d
	je	.L29
	movdqu	32(%r10), %xmm1
	movdqa	%xmm9, %xmm7
	movdqa	%xmm8, %xmm11
	pcmpeqb	%xmm4, %xmm1
	pandn	%xmm3, %xmm1
	pcmpgtb	%xmm1, %xmm7
	movdqa	%xmm1, %xmm10
	punpcklbw	%xmm7, %xmm10
	punpckhbw	%xmm7, %xmm1
	pcmpgtw	%xmm10, %xmm11
	movdqa	%xmm10, %xmm7
	punpcklwd	%xmm11, %xmm7
	punpckhwd	%xmm11, %xmm10
	paddd	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	paddd	%xmm10, %xmm0
	movdqa	%xmm1, %xmm10
	punpcklwd	%xmm7, %xmm10
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm10, %xmm0
	paddd	%xmm1, %xmm0
.L29:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	cmpl	%edi, %edx
	je	.L50
	movl	%edi, %ecx
.L28:
	movslq	%r11d, %r8
	movslq	%ecx, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$66, -3040(%rbx,%rsi)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	1(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	2(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	3(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	4(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	5(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	6(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	7(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	8(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	9(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L50
	movslq	%ebx, %rbx
	cmpb	$66, -3040(%rsi,%rbx)
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %eax
	leal	10(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L50
	movslq	%esi, %rbx
	leaq	(%r8,%r8,4), %rsi
	leaq	(%r8,%rsi,2), %rsi
	xorl	%r8d, %r8d
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$66, -3040(%rbx,%rsi)
	setne	%r8b
	addl	%r8d, %eax
	leal	11(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L50
	movslq	%r8d, %r8
	cmpb	$66, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	12(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L50
	movslq	%r8d, %r8
	cmpb	$66, -3040(%rsi,%r8)
	setne	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	leal	13(%rcx), %r8d
	cmpl	%r8d, %edx
	jle	.L50
	movslq	%r8d, %r8
	cmpb	$66, -3040(%rsi,%r8)
	setne	%r8b
	addl	$14, %ecx
	movzbl	%r8b, %r8d
	addl	%r8d, %eax
	cmpl	%ecx, %edx
	jle	.L50
	movslq	%ecx, %rcx
	cmpb	$66, -3040(%rsi,%rcx)
	setne	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %eax
	.p2align 4,,10
	.p2align 3
.L50:
	addl	$1, %r11d
	addq	$55, %r10
	movl	%ebp, %r8d
	cmpl	%ebp, %r11d
	jne	.L25
	testl	%r13d, %r13d
	jle	.L47
	movslq	%ebp, %rcx
	leal	0(%r13,%rbp), %r12d
	pxor	%xmm9, %xmm9
	movdqa	.LC3(%rip), %xmm10
	leaq	(%rcx,%rcx,4), %rsi
	pxor	%xmm8, %xmm8
	leaq	(%rcx,%rsi,2), %rcx
	leaq	(%rcx,%rcx,4), %r10
	addq	16(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L48:
	testl	%edx, %edx
	jle	.L71
	cmpl	$14, %r15d
	jbe	.L80
	movdqu	(%r10), %xmm1
	movdqa	%xmm9, %xmm0
	movdqa	%xmm8, %xmm11
	pcmpeqb	%xmm2, %xmm1
	pandn	%xmm10, %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm0, %xmm7
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm7, %xmm11
	movdqa	%xmm7, %xmm12
	movdqa	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	punpcklwd	%xmm11, %xmm12
	punpckhwd	%xmm11, %xmm0
	movdqa	%xmm1, %xmm11
	paddd	%xmm12, %xmm0
	punpcklwd	%xmm7, %xmm11
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm11, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %r9d
	jbe	.L52
	movdqu	16(%r10), %xmm1
	movdqa	%xmm9, %xmm12
	pcmpeqb	%xmm2, %xmm1
	pandn	%xmm10, %xmm1
	pcmpgtb	%xmm1, %xmm12
	movdqa	%xmm1, %xmm11
	movdqa	%xmm1, %xmm7
	punpcklbw	%xmm12, %xmm11
	punpckhbw	%xmm12, %xmm7
	movdqa	%xmm8, %xmm12
	pcmpgtw	%xmm11, %xmm12
	movdqa	%xmm11, %xmm1
	punpcklwd	%xmm12, %xmm1
	punpckhwd	%xmm12, %xmm11
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	paddd	%xmm11, %xmm0
	movdqa	%xmm8, %xmm11
	pcmpgtw	%xmm7, %xmm11
	punpcklwd	%xmm11, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm7, %xmm1
	punpckhwd	%xmm11, %xmm1
	paddd	%xmm1, %xmm0
	cmpl	$2, %r9d
	je	.L52
	movdqu	32(%r10), %xmm1
	movdqa	%xmm9, %xmm7
	movdqa	%xmm8, %xmm12
	pcmpeqb	%xmm2, %xmm1
	pandn	%xmm10, %xmm1
	pcmpgtb	%xmm1, %xmm7
	movdqa	%xmm1, %xmm11
	punpcklbw	%xmm7, %xmm11
	punpckhbw	%xmm7, %xmm1
	pcmpgtw	%xmm11, %xmm12
	movdqa	%xmm11, %xmm7
	punpcklwd	%xmm12, %xmm7
	punpckhwd	%xmm12, %xmm11
	paddd	%xmm7, %xmm0
	movdqa	%xmm8, %xmm7
	pcmpgtw	%xmm1, %xmm7
	paddd	%xmm11, %xmm0
	movdqa	%xmm1, %xmm11
	punpcklwd	%xmm7, %xmm11
	punpckhwd	%xmm7, %xmm1
	paddd	%xmm11, %xmm0
	paddd	%xmm1, %xmm0
.L52:
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	cmpl	%edi, %edx
	je	.L71
	movl	%edi, %ecx
.L51:
	movslq	%r8d, %r11
	movslq	%ecx, %rbx
	leaq	(%r11,%r11,4), %rsi
	leaq	(%r11,%rsi,2), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$82, -3040(%rbx,%rsi)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	1(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	2(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	3(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	4(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	5(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	6(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	7(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	8(%rcx), %ebx
	cmpl	%edx, %ebx
	jge	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%bl
	movzbl	%bl, %ebx
	addl	%ebx, %eax
	leal	9(%rcx), %ebx
	cmpl	%ebx, %edx
	jle	.L71
	movslq	%ebx, %rbx
	cmpb	$82, -3040(%rsi,%rbx)
	setne	%sil
	movzbl	%sil, %esi
	addl	%esi, %eax
	leal	10(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L71
	movslq	%esi, %rbx
	leaq	(%r11,%r11,4), %rsi
	leaq	(%r11,%rsi,2), %rsi
	xorl	%r11d, %r11d
	leaq	(%rsi,%rsi,4), %rsi
	addq	$3104, %rsi
	addq	%rsp, %rsi
	cmpb	$82, -3040(%rbx,%rsi)
	setne	%r11b
	addl	%r11d, %eax
	leal	11(%rcx), %r11d
	cmpl	%r11d, %edx
	jle	.L71
	movslq	%r11d, %r11
	cmpb	$82, -3040(%rsi,%r11)
	setne	%r11b
	movzbl	%r11b, %r11d
	addl	%r11d, %eax
	leal	12(%rcx), %r11d
	cmpl	%r11d, %edx
	jle	.L71
	movslq	%r11d, %r11
	cmpb	$82, -3040(%rsi,%r11)
	setne	%r11b
	movzbl	%r11b, %r11d
	addl	%r11d, %eax
	leal	13(%rcx), %r11d
	cmpl	%r11d, %edx
	jle	.L71
	movslq	%r11d, %r11
	cmpb	$82, -3040(%rsi,%r11)
	setne	%r11b
	addl	$14, %ecx
	movzbl	%r11b, %r11d
	addl	%r11d, %eax
	cmpl	%ecx, %edx
	jle	.L71
	movslq	%ecx, %rcx
	cmpb	$82, -3040(%rsi,%rcx)
	setne	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %eax
	.p2align 4,,10
	.p2align 3
.L71:
	addl	$1, %r8d
	addq	$55, %r10
	cmpl	%r12d, %r8d
	jne	.L48
.L47:
	movl	12(%rsp), %ecx
	cmpl	%eax, %ecx
	cmovle	%ecx, %eax
	subl	$1, %r13d
	addl	$1, %ebp
	movl	%eax, 12(%rsp)
	cmpl	32(%rsp), %ebp
	jne	.L74
.L72:
	addq	$55, 24(%rsp)
	movl	40(%rsp), %ecx
	addl	$1, %r14d
	cmpl	%ecx, 44(%rsp)
	jne	.L5
.L4:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	3096(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L96
	addq	$3112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L80:
	.cfi_restore_state
	xorl	%ecx, %ecx
	jmp	.L51
.L77:
	xorl	%ecx, %ecx
	jmp	.L6
.L79:
	xorl	%ecx, %ecx
	jmp	.L28
.L76:
	movl	$2500, 12(%rsp)
	jmp	.L4
.L96:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.align 16
.LC3:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.align 16
.LC4:
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.byte	66
	.align 16
.LC5:
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.byte	82
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
int main(void){
    int n,m;
    char s[55][55];
    int i,j,k,c;
    int row,ans=2500,count;

    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++) scanf("%s",s[i]);


    for(i=1;i<=n-2;i++){
	for(j=1;i+j<=n-1;j++){
	    row=0;count=0;

	    for(k=0;k<i;k++){
		for(c=0;c<m;c++){
		    if(s[row][c]!='W') count++;
		}
		row++;
	    }
	    for(k=0;k<j;k++){
                for(c=0;c<m;c++){
                    if(s[row][c]!='B') count++;
                }
                row++;
            }
	    for(k=0;k<n-i-j;k++){
                for(c=0;c<m;c++){
                    if(s[row][c]!='R') count++;
                }
                row++;
            }

	    if(count<ans) ans=count;
	}
    }

    printf("%d\n",ans);

    return 0;
}
4 5
WRWRW
BRWWB
WRWRW
RWBWR
 4 5
WRWRW
BWRWB
WRWRW
RWBWQ
 4 5
WQWRW
BWRXB
RVWRW
WQBWQ
 4 3
WQWRW
BWRXB
RVWRW
RWBWQ
 4 5
WQWRW
BWRXC
RVWRW
WQBWQ
 4 10
WRWQW
BWRXB
RVWRW
RWBWQ
 4 0
WQXRW
BWRXB
VRWRW
RWBWQ
 4 16
WRWQW
BWRXB
RVWRW
RWBWQ
 4 1
WRWRW
BWRWB
VRWRW
QWBWR
 5 1
WRWRW
BWRWB
VRWRW
QWBWR

11
 12
 13
 7
 14
 32
 0
 56
 2
 3

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void){
    int n,m;
    char s[55][55];
    int i,j,k,c;
    int row,ans=2500,count;

    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++) scanf("%s",s[i]);


    for(i=1;i<=n-2;i++){
	for(j=1;i+j<=n-1;j++){
	    row=0;count=0;

	    for(k=0;k<i;k++){
		for(c=0;c<m;c++){
		    if(s[row][c]!='W') count++;
		}
		row++;
	    }
	    for(k=0;k<j;k++){
                for(c=0;c<m;c++){
                    if(s[row][c]!='B') count++;
                }
                row++;
            }
	    for(k=0;k<n-i-j;k++){
                for(c=0;c<m;c++){
                    if(s[row][c]!='R') count++;
                }
                row++;
            }

	    if(count<ans) ans=count;
	}
    }

    printf("%d\n",ans);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$3088, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$2500, -3048(%rbp)
	leaq	-3072(%rbp), %rdx
	leaq	-3076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3068(%rbp)
	jmp	.L2
.L3:
	leaq	-3040(%rbp), %rcx
	movl	-3068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -3068(%rbp)
.L2:
	movl	-3076(%rbp), %eax
	cmpl	%eax, -3068(%rbp)
	jl	.L3
	movl	$1, -3068(%rbp)
	jmp	.L4
.L23:
	movl	$1, -3064(%rbp)
	jmp	.L5
.L22:
	movl	$0, -3052(%rbp)
	movl	$0, -3044(%rbp)
	movl	$0, -3060(%rbp)
	jmp	.L6
.L10:
	movl	$0, -3056(%rbp)
	jmp	.L7
.L9:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$87, %al
	je	.L8
	addl	$1, -3044(%rbp)
.L8:
	addl	$1, -3056(%rbp)
.L7:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L9
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L6:
	movl	-3060(%rbp), %eax
	cmpl	-3068(%rbp), %eax
	jl	.L10
	movl	$0, -3060(%rbp)
	jmp	.L11
.L15:
	movl	$0, -3056(%rbp)
	jmp	.L12
.L14:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L13
	addl	$1, -3044(%rbp)
.L13:
	addl	$1, -3056(%rbp)
.L12:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L14
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L11:
	movl	-3060(%rbp), %eax
	cmpl	-3064(%rbp), %eax
	jl	.L15
	movl	$0, -3060(%rbp)
	jmp	.L16
.L20:
	movl	$0, -3056(%rbp)
	jmp	.L17
.L19:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$82, %al
	je	.L18
	addl	$1, -3044(%rbp)
.L18:
	addl	$1, -3056(%rbp)
.L17:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L19
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L16:
	movl	-3076(%rbp), %eax
	subl	-3068(%rbp), %eax
	subl	-3064(%rbp), %eax
	cmpl	%eax, -3060(%rbp)
	jl	.L20
	movl	-3044(%rbp), %eax
	cmpl	-3048(%rbp), %eax
	jge	.L21
	movl	-3044(%rbp), %eax
	movl	%eax, -3048(%rbp)
.L21:
	addl	$1, -3064(%rbp)
.L5:
	movl	-3068(%rbp), %edx
	movl	-3064(%rbp), %eax
	addl	%eax, %edx
	movl	-3076(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L22
	addl	$1, -3068(%rbp)
.L4:
	movl	-3076(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -3068(%rbp)
	jl	.L23
	movl	-3048(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$3088, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$2500, -3048(%rbp)
	leaq	-3072(%rbp), %rdx
	leaq	-3076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3068(%rbp)
	jmp	.L2
.L3:
	leaq	-3040(%rbp), %rcx
	movl	-3068(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -3068(%rbp)
.L2:
	movl	-3076(%rbp), %eax
	cmpl	%eax, -3068(%rbp)
	jl	.L3
	movl	$1, -3068(%rbp)
	jmp	.L4
.L23:
	movl	$1, -3064(%rbp)
	jmp	.L5
.L22:
	movl	$0, -3052(%rbp)
	movl	$0, -3044(%rbp)
	movl	$0, -3060(%rbp)
	jmp	.L6
.L10:
	movl	$0, -3056(%rbp)
	jmp	.L7
.L9:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$87, %al
	je	.L8
	addl	$1, -3044(%rbp)
.L8:
	addl	$1, -3056(%rbp)
.L7:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L9
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L6:
	movl	-3060(%rbp), %eax
	cmpl	-3068(%rbp), %eax
	jl	.L10
	movl	$0, -3060(%rbp)
	jmp	.L11
.L15:
	movl	$0, -3056(%rbp)
	jmp	.L12
.L14:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L13
	addl	$1, -3044(%rbp)
.L13:
	addl	$1, -3056(%rbp)
.L12:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L14
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L11:
	movl	-3060(%rbp), %eax
	cmpl	-3064(%rbp), %eax
	jl	.L15
	movl	$0, -3060(%rbp)
	jmp	.L16
.L20:
	movl	$0, -3056(%rbp)
	jmp	.L17
.L19:
	movl	-3056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3052(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$3040, %rax
	movzbl	(%rax), %eax
	cmpb	$82, %al
	je	.L18
	addl	$1, -3044(%rbp)
.L18:
	addl	$1, -3056(%rbp)
.L17:
	movl	-3072(%rbp), %eax
	cmpl	%eax, -3056(%rbp)
	jl	.L19
	addl	$1, -3052(%rbp)
	addl	$1, -3060(%rbp)
.L16:
	movl	-3076(%rbp), %eax
	subl	-3068(%rbp), %eax
	subl	-3064(%rbp), %eax
	cmpl	%eax, -3060(%rbp)
	jl	.L20
	movl	-3044(%rbp), %eax
	cmpl	-3048(%rbp), %eax
	jge	.L21
	movl	-3044(%rbp), %eax
	movl	%eax, -3048(%rbp)
.L21:
	addl	$1, -3064(%rbp)
.L5:
	movl	-3068(%rbp), %edx
	movl	-3064(%rbp), %eax
	addl	%eax, %edx
	movl	-3076(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L22
	addl	$1, -3068(%rbp)
.L4:
	movl	-3076(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -3068(%rbp)
	jl	.L23
	movl	-3048(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
