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,max,i,j,sum,k,r[50],b[50],w[50];
	char s[50][51];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		w[i]=0;
		b[i]=0;
		r[i]=0;
	}
	for(i=0;i<n;i++){
		scanf("%s",s[i]);
		for(j=0;j<m;j++){
			if(s[i][j]!='W'){
				w[i]++;
			}
			if(s[i][j]!='B'){
				b[i]++;
			}
			if(s[i][j]!='R'){
				r[i]++;
			}
		}
	}
	max=2501;
	for(i=0;i<n-2;i++){
		for(j=0;j<n-1;j++){
			sum=0;
			for(k=0;k<=i;k++){
				sum+=w[k];
			}
			for(k=i+1;k<=j;k++){
				sum+=b[k];
			}
			for(k=j+1;k<n;k++){
				sum+=r[k];
			}
			if(sum<max){
				max=sum;
			}
		}
	}
	printf("%d\n",max);
	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	$3216, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-3208(%rbp), %rdx
	leaq	-3212(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3200(%rbp)
	jmp	.L2
.L3:
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -2768(%rbp,%rax,4)
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -2976(%rbp,%rax,4)
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -3184(%rbp,%rax,4)
	addl	$1, -3200(%rbp)
.L2:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L3
	movl	$0, -3200(%rbp)
	jmp	.L4
.L10:
	leaq	-2560(%rbp), %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$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
	movl	$0, -3196(%rbp)
	jmp	.L5
.L9:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$87, %al
	je	.L6
	movl	-3200(%rbp), %eax
	cltq
	movl	-2768(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -2768(%rbp,%rax,4)
.L6:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L7
	movl	-3200(%rbp), %eax
	cltq
	movl	-2976(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -2976(%rbp,%rax,4)
.L7:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$82, %al
	je	.L8
	movl	-3200(%rbp), %eax
	cltq
	movl	-3184(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -3184(%rbp,%rax,4)
.L8:
	addl	$1, -3196(%rbp)
.L5:
	movl	-3208(%rbp), %eax
	cmpl	%eax, -3196(%rbp)
	jl	.L9
	addl	$1, -3200(%rbp)
.L4:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L10
	movl	$2501, -3204(%rbp)
	movl	$0, -3200(%rbp)
	jmp	.L11
.L21:
	movl	$0, -3196(%rbp)
	jmp	.L12
.L20:
	movl	$0, -3192(%rbp)
	movl	$0, -3188(%rbp)
	jmp	.L13
.L14:
	movl	-3188(%rbp), %eax
	cltq
	movl	-2768(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L13:
	movl	-3188(%rbp), %eax
	cmpl	-3200(%rbp), %eax
	jle	.L14
	movl	-3200(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -3188(%rbp)
	jmp	.L15
.L16:
	movl	-3188(%rbp), %eax
	cltq
	movl	-2976(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L15:
	movl	-3188(%rbp), %eax
	cmpl	-3196(%rbp), %eax
	jle	.L16
	movl	-3196(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -3188(%rbp)
	jmp	.L17
.L18:
	movl	-3188(%rbp), %eax
	cltq
	movl	-3184(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L17:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3188(%rbp)
	jl	.L18
	movl	-3192(%rbp), %eax
	cmpl	-3204(%rbp), %eax
	jge	.L19
	movl	-3192(%rbp), %eax
	movl	%eax, -3204(%rbp)
.L19:
	addl	$1, -3196(%rbp)
.L12:
	movl	-3212(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -3196(%rbp)
	jl	.L20
	addl	$1, -3200(%rbp)
.L11:
	movl	-3212(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L21
	movl	-3204(%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	.L23
	call	__stack_chk_fail@PLT
.L23:
	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"
.LC2:
	.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	$3224, %rsp
	.cfi_def_cfa_offset 3280
	movq	%fs:40, %rax
	movq	%rax, 3208(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %r11
	testl	%r11d, %r11d
	jle	.L2
	leaq	0(,%r11,4), %r12
	xorl	%esi, %esi
	xorl	%r15d, %r15d
	leaq	448(%rsp), %rbx
	movq	%r12, %rdx
	leaq	240(%rsp), %r13
	movq	%rbx, %rdi
	leaq	32(%rsp), %rbp
	leaq	656(%rsp), %r14
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rcx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jg	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L178:
	addl	$1, (%rbx)
	cmpb	$66, %dl
	je	.L7
	addl	$1, 0(%r13)
	cmpb	$82, %dl
	jne	.L7
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L11
.L10:
	movzbl	(%r14,%rax), %edx
	cmpb	$87, %dl
	jne	.L178
	addl	$1, 0(%r13)
.L7:
	addq	$1, %rax
	addl	$1, 0(%rbp)
	cmpq	%rcx, %rax
	jne	.L10
.L11:
	addl	$1, %r15d
	addq	$51, %r14
	addq	$4, %r13
	addq	$4, %rbp
	movl	24(%rsp), %r11d
	addq	$4, %rbx
	cmpl	%r15d, %r11d
	jg	.L4
.L2:
	leal	-2(%r11), %eax
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	jle	.L39
	movdqa	448(%rsp), %xmm1
	leal	-1(%r11), %eax
	movdqa	464(%rsp), %xmm2
	leaq	244(%rsp), %r10
	movdqa	480(%rsp), %xmm4
	movl	%eax, 4(%rsp)
	xorl	%edi, %edi
	xorl	%ebp, %ebp
	movdqa	496(%rsp), %xmm5
	paddd	%xmm1, %xmm2
	movdqa	512(%rsp), %xmm6
	movl	$2501, %r8d
	movdqa	528(%rsp), %xmm7
	paddd	%xmm2, %xmm4
	movdqa	544(%rsp), %xmm8
	movdqa	560(%rsp), %xmm9
	paddd	%xmm4, %xmm5
	movdqa	576(%rsp), %xmm11
	movdqa	592(%rsp), %xmm10
	paddd	%xmm5, %xmm6
	movdqa	608(%rsp), %xmm12
	movdqa	624(%rsp), %xmm3
	paddd	%xmm6, %xmm7
	paddd	%xmm7, %xmm8
	paddd	%xmm8, %xmm9
	paddd	%xmm9, %xmm11
	paddd	%xmm11, %xmm10
	paddd	%xmm10, %xmm12
	paddd	%xmm12, %xmm3
	.p2align 4,,10
	.p2align 3
.L13:
	movl	4(%rsp), %eax
	movl	%ebp, 8(%rsp)
	addl	$1, %ebp
	testl	%eax, %eax
	jle	.L37
	movl	4(%rsp), %ebx
	movl	%ebp, %r9d
	movl	%ebp, %r14d
	leaq	36(%rsp), %rcx
	cmpl	%ebp, %ebx
	movl	%ebx, %r15d
	cmovg	%ebp, %r15d
	shrl	$2, %r9d
	andl	$-4, %r14d
	xorl	%edx, %edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L180:
	cmpl	$2, %r9d
	je	.L42
	cmpl	$3, %r9d
	je	.L43
	cmpl	$4, %r9d
	je	.L44
	cmpl	$5, %r9d
	je	.L45
	cmpl	$6, %r9d
	je	.L46
	cmpl	$7, %r9d
	je	.L47
	cmpl	$8, %r9d
	je	.L48
	cmpl	$9, %r9d
	je	.L49
	cmpl	$10, %r9d
	je	.L50
	cmpl	$11, %r9d
	je	.L51
	movdqa	%xmm3, %xmm0
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	%xmm0, %xmm13
	movl	%r14d, %esi
	psrldq	$8, %xmm13
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %eax
	cmpl	%ebp, %r14d
	je	.L16
.L14:
	movslq	%esi, %r12
	addl	448(%rsp,%r12,4), %eax
	leal	1(%rsi), %r12d
	cmpl	%r12d, %edi
	jl	.L16
	movslq	%r12d, %r12
	addl	$2, %esi
	addl	448(%rsp,%r12,4), %eax
	cmpl	%esi, %edi
	jl	.L16
	movslq	%esi, %rsi
	addl	448(%rsp,%rsi,4), %eax
.L16:
	addl	$1, %edx
	leal	-1(%rbx), %r12d
	cmpl	%r11d, %edx
	jge	.L17
	cmpl	$2, %r12d
	jbe	.L52
	movl	%ebx, %esi
	movdqu	(%rcx), %xmm0
	shrl	$2, %esi
	cmpl	$1, %esi
	je	.L19
	movdqu	16(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$2, %esi
	je	.L19
	movdqu	32(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$3, %esi
	je	.L19
	movdqu	48(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$4, %esi
	je	.L19
	movdqu	64(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$5, %esi
	je	.L19
	movdqu	80(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$6, %esi
	je	.L19
	movdqu	96(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$7, %esi
	je	.L19
	movdqu	112(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$8, %esi
	je	.L19
	movdqu	128(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$9, %esi
	je	.L19
	movdqu	144(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$10, %esi
	je	.L19
	movdqu	160(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$11, %esi
	je	.L19
	movdqu	176(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	.p2align 4,,10
	.p2align 3
.L19:
	movdqa	%xmm0, %xmm13
	movl	%ebx, %r13d
	psrldq	$8, %xmm13
	andl	$-4, %r13d
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %esi
	addl	%esi, %eax
	leal	0(%r13,%rdx), %esi
	cmpl	%ebx, %r13d
	je	.L17
.L18:
	movslq	%esi, %rbx
	addl	32(%rsp,%rbx,4), %eax
	leal	1(%rsi), %ebx
	cmpl	%ebx, %r11d
	jle	.L17
	movslq	%ebx, %rbx
	addl	$2, %esi
	addl	32(%rsp,%rbx,4), %eax
	cmpl	%esi, %r11d
	jle	.L17
	movslq	%esi, %rsi
	addl	32(%rsp,%rsi,4), %eax
.L17:
	cmpl	%eax, %r8d
	movl	%r12d, %ebx
	cmovg	%eax, %r8d
	addq	$4, %rcx
	cmpl	%r15d, %edx
	jge	.L179
.L22:
	cmpq	$2, %rdi
	jbe	.L40
	cmpl	$1, %r9d
	ja	.L180
	movdqa	%xmm1, %xmm0
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L42:
	movdqa	%xmm2, %xmm0
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L37:
	addq	$1, %rdi
	addq	$4, %r10
	cmpl	%ebp, 12(%rsp)
	jne	.L13
.L12:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	3208(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L181
	addq	$3224, %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
	.p2align 4,,10
	.p2align 3
.L179:
	.cfi_restore_state
	cmpl	%edx, 4(%rsp)
	jle	.L37
	movl	4(%rsp), %r12d
	movl	%edx, %ecx
	movslq	%edx, %rax
	movl	%ebp, %ebx
	subl	%edi, %ecx
	movl	%ebp, %r14d
	leaq	32(%rsp,%rax,4), %rsi
	shrl	$2, %ebx
	subl	%edx, %r12d
	subl	$1, %ecx
	andl	$-4, %r14d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L182:
	cmpl	$2, %ebx
	je	.L55
	cmpl	$3, %ebx
	je	.L56
	cmpl	$4, %ebx
	je	.L57
	cmpl	$5, %ebx
	je	.L58
	cmpl	$6, %ebx
	je	.L59
	cmpl	$7, %ebx
	je	.L60
	cmpl	$8, %ebx
	je	.L61
	cmpl	$9, %ebx
	je	.L62
	cmpl	$10, %ebx
	je	.L63
	cmpl	$11, %ebx
	je	.L64
	movdqa	%xmm3, %xmm0
	.p2align 4,,10
	.p2align 3
.L24:
	movdqa	%xmm0, %xmm13
	movl	%r14d, %r9d
	psrldq	$8, %xmm13
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %eax
	cmpl	%r14d, %ebp
	je	.L25
.L23:
	movslq	%r9d, %r13
	addl	448(%rsp,%r13,4), %eax
	leal	1(%r9), %r13d
	cmpl	%r13d, %edi
	jl	.L25
	movslq	%r13d, %r13
	addl	$2, %r9d
	addl	448(%rsp,%r13,4), %eax
	cmpl	%r9d, %edi
	jl	.L25
	movslq	%r9d, %r9
	addl	448(%rsp,%r9,4), %eax
.L25:
	leal	1(%rcx), %r13d
	cmpl	8(%rsp), %edx
	movl	$1, %r9d
	cmovg	%r13d, %r9d
	cmpl	%edi, %edx
	jle	.L65
	cmpl	$2, %ecx
	jbe	.L65
	movl	%r9d, %ecx
	movdqu	(%r10), %xmm0
	shrl	$2, %ecx
	cmpl	$1, %ecx
	je	.L27
	movdqu	16(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$2, %ecx
	je	.L27
	movdqu	32(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$3, %ecx
	je	.L27
	movdqu	48(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$4, %ecx
	je	.L27
	movdqu	64(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$5, %ecx
	je	.L27
	movdqu	80(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$6, %ecx
	je	.L27
	movdqu	96(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$7, %ecx
	je	.L27
	movdqu	112(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$8, %ecx
	je	.L27
	movdqu	128(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$9, %ecx
	je	.L27
	movdqu	144(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$10, %ecx
	je	.L27
	movdqu	160(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$11, %ecx
	je	.L27
	movdqu	176(%r10), %xmm15
	paddd	%xmm15, %xmm0
	.p2align 4,,10
	.p2align 3
.L27:
	movdqa	%xmm0, %xmm13
	movl	%r9d, %r15d
	psrldq	$8, %xmm13
	andl	$-4, %r15d
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	leal	(%r15,%rbp), %ecx
	cmpl	%r15d, %r9d
	je	.L28
.L26:
	movslq	%ecx, %r9
	addl	240(%rsp,%r9,4), %eax
	leal	1(%rcx), %r9d
	cmpl	%r9d, %edx
	jl	.L28
	movslq	%r9d, %r9
	addl	$2, %ecx
	addl	240(%rsp,%r9,4), %eax
	cmpl	%ecx, %edx
	jl	.L28
	movslq	%ecx, %rcx
	addl	240(%rsp,%rcx,4), %eax
.L28:
	addl	$1, %edx
	leal	-1(%r12), %r9d
	cmpl	%r11d, %edx
	jge	.L29
	cmpl	$2, %r9d
	jbe	.L66
	movl	%r12d, %ecx
	movdqu	4(%rsi), %xmm0
	shrl	$2, %ecx
	cmpl	$1, %ecx
	je	.L31
	movdqu	20(%rsi), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$2, %ecx
	je	.L31
	movdqu	36(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$3, %ecx
	je	.L31
	movdqu	52(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$4, %ecx
	je	.L31
	movdqu	68(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$5, %ecx
	je	.L31
	movdqu	84(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$6, %ecx
	je	.L31
	movdqu	100(%rsi), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$7, %ecx
	je	.L31
	movdqu	116(%rsi), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$8, %ecx
	je	.L31
	movdqu	132(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$9, %ecx
	je	.L31
	movdqu	148(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$10, %ecx
	je	.L31
	movdqu	164(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$11, %ecx
	je	.L31
	movdqu	180(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	.p2align 4,,10
	.p2align 3
.L31:
	movdqa	%xmm0, %xmm13
	movl	%r12d, %r15d
	psrldq	$8, %xmm13
	andl	$-4, %r15d
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	leal	(%r15,%rdx), %ecx
	cmpl	%r12d, %r15d
	je	.L29
.L30:
	movslq	%ecx, %r12
	addl	32(%rsp,%r12,4), %eax
	leal	1(%rcx), %r12d
	cmpl	%r11d, %r12d
	jge	.L29
	movslq	%r12d, %r12
	addl	$2, %ecx
	addl	32(%rsp,%r12,4), %eax
	cmpl	%r11d, %ecx
	jge	.L29
	movslq	%ecx, %rcx
	addl	32(%rsp,%rcx,4), %eax
.L29:
	cmpl	%eax, %r8d
	movl	%r9d, %r12d
	cmovg	%eax, %r8d
	addq	$4, %rsi
	cmpl	%edx, 4(%rsp)
	jle	.L37
	movl	%r13d, %ecx
.L33:
	cmpq	$2, %rdi
	jbe	.L53
	cmpl	$1, %ebx
	ja	.L182
	movdqa	%xmm1, %xmm0
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L55:
	movdqa	%xmm2, %xmm0
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L56:
	movdqa	%xmm4, %xmm0
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L43:
	movdqa	%xmm4, %xmm0
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L53:
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L40:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%ebp, %ecx
	jmp	.L26
.L52:
	movl	%edx, %esi
	jmp	.L18
.L66:
	movl	%edx, %ecx
	jmp	.L30
.L57:
	movdqa	%xmm5, %xmm0
	jmp	.L24
.L44:
	movdqa	%xmm5, %xmm0
	jmp	.L15
.L45:
	movdqa	%xmm6, %xmm0
	jmp	.L15
.L58:
	movdqa	%xmm6, %xmm0
	jmp	.L24
.L46:
	movdqa	%xmm7, %xmm0
	jmp	.L15
.L59:
	movdqa	%xmm7, %xmm0
	jmp	.L24
.L60:
	movdqa	%xmm8, %xmm0
	jmp	.L24
.L47:
	movdqa	%xmm8, %xmm0
	jmp	.L15
.L61:
	movdqa	%xmm9, %xmm0
	jmp	.L24
.L48:
	movdqa	%xmm9, %xmm0
	jmp	.L15
.L49:
	movdqa	%xmm11, %xmm0
	jmp	.L15
.L62:
	movdqa	%xmm11, %xmm0
	jmp	.L24
.L50:
	movdqa	%xmm10, %xmm0
	jmp	.L15
.L63:
	movdqa	%xmm10, %xmm0
	jmp	.L24
.L51:
	movdqa	%xmm12, %xmm0
	jmp	.L15
.L64:
	movdqa	%xmm12, %xmm0
	jmp	.L24
.L39:
	movl	$2501, %r8d
	jmp	.L12
.L181:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.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	$3224, %rsp
	.cfi_def_cfa_offset 3280
	movq	%fs:40, %rax
	movq	%rax, 3208(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %r11
	testl	%r11d, %r11d
	jle	.L2
	leaq	0(,%r11,4), %r12
	xorl	%esi, %esi
	xorl	%r15d, %r15d
	leaq	448(%rsp), %rbx
	movq	%r12, %rdx
	leaq	240(%rsp), %r13
	movq	%rbx, %rdi
	leaq	32(%rsp), %rbp
	leaq	656(%rsp), %r14
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rcx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jg	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L178:
	addl	$1, (%rbx)
	cmpb	$66, %dl
	je	.L7
	addl	$1, 0(%r13)
	cmpb	$82, %dl
	jne	.L7
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L11
.L10:
	movzbl	(%r14,%rax), %edx
	cmpb	$87, %dl
	jne	.L178
	addl	$1, 0(%r13)
.L7:
	addq	$1, %rax
	addl	$1, 0(%rbp)
	cmpq	%rcx, %rax
	jne	.L10
.L11:
	addl	$1, %r15d
	addq	$51, %r14
	addq	$4, %r13
	addq	$4, %rbp
	movl	24(%rsp), %r11d
	addq	$4, %rbx
	cmpl	%r15d, %r11d
	jg	.L4
.L2:
	leal	-2(%r11), %eax
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	jle	.L39
	movdqa	448(%rsp), %xmm1
	leal	-1(%r11), %eax
	movdqa	464(%rsp), %xmm2
	leaq	244(%rsp), %r10
	movdqa	480(%rsp), %xmm4
	movl	%eax, 4(%rsp)
	xorl	%edi, %edi
	xorl	%ebp, %ebp
	movdqa	496(%rsp), %xmm5
	paddd	%xmm1, %xmm2
	movdqa	512(%rsp), %xmm6
	movl	$2501, %r8d
	movdqa	528(%rsp), %xmm7
	paddd	%xmm2, %xmm4
	movdqa	544(%rsp), %xmm8
	movdqa	560(%rsp), %xmm9
	paddd	%xmm4, %xmm5
	movdqa	576(%rsp), %xmm11
	movdqa	592(%rsp), %xmm10
	paddd	%xmm5, %xmm6
	movdqa	608(%rsp), %xmm12
	movdqa	624(%rsp), %xmm3
	paddd	%xmm6, %xmm7
	paddd	%xmm7, %xmm8
	paddd	%xmm8, %xmm9
	paddd	%xmm9, %xmm11
	paddd	%xmm11, %xmm10
	paddd	%xmm10, %xmm12
	paddd	%xmm12, %xmm3
	.p2align 4,,10
	.p2align 3
.L13:
	movl	4(%rsp), %eax
	movl	%ebp, 8(%rsp)
	addl	$1, %ebp
	testl	%eax, %eax
	jle	.L37
	movl	4(%rsp), %ebx
	movl	%ebp, %r9d
	movl	%ebp, %r14d
	leaq	36(%rsp), %rcx
	cmpl	%ebp, %ebx
	movl	%ebx, %r15d
	cmovg	%ebp, %r15d
	shrl	$2, %r9d
	andl	$-4, %r14d
	xorl	%edx, %edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L180:
	cmpl	$2, %r9d
	je	.L42
	cmpl	$3, %r9d
	je	.L43
	cmpl	$4, %r9d
	je	.L44
	cmpl	$5, %r9d
	je	.L45
	cmpl	$6, %r9d
	je	.L46
	cmpl	$7, %r9d
	je	.L47
	cmpl	$8, %r9d
	je	.L48
	cmpl	$9, %r9d
	je	.L49
	cmpl	$10, %r9d
	je	.L50
	cmpl	$11, %r9d
	je	.L51
	movdqa	%xmm3, %xmm0
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	%xmm0, %xmm13
	movl	%r14d, %esi
	psrldq	$8, %xmm13
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %eax
	cmpl	%ebp, %r14d
	je	.L16
.L14:
	movslq	%esi, %r12
	addl	448(%rsp,%r12,4), %eax
	leal	1(%rsi), %r12d
	cmpl	%r12d, %edi
	jl	.L16
	movslq	%r12d, %r12
	addl	$2, %esi
	addl	448(%rsp,%r12,4), %eax
	cmpl	%esi, %edi
	jl	.L16
	movslq	%esi, %rsi
	addl	448(%rsp,%rsi,4), %eax
.L16:
	addl	$1, %edx
	leal	-1(%rbx), %r12d
	cmpl	%r11d, %edx
	jge	.L17
	cmpl	$2, %r12d
	jbe	.L52
	movl	%ebx, %esi
	movdqu	(%rcx), %xmm0
	shrl	$2, %esi
	cmpl	$1, %esi
	je	.L19
	movdqu	16(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$2, %esi
	je	.L19
	movdqu	32(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$3, %esi
	je	.L19
	movdqu	48(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$4, %esi
	je	.L19
	movdqu	64(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$5, %esi
	je	.L19
	movdqu	80(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$6, %esi
	je	.L19
	movdqu	96(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$7, %esi
	je	.L19
	movdqu	112(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$8, %esi
	je	.L19
	movdqu	128(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$9, %esi
	je	.L19
	movdqu	144(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$10, %esi
	je	.L19
	movdqu	160(%rcx), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$11, %esi
	je	.L19
	movdqu	176(%rcx), %xmm14
	paddd	%xmm14, %xmm0
	.p2align 4,,10
	.p2align 3
.L19:
	movdqa	%xmm0, %xmm13
	movl	%ebx, %r13d
	psrldq	$8, %xmm13
	andl	$-4, %r13d
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %esi
	addl	%esi, %eax
	leal	0(%r13,%rdx), %esi
	cmpl	%ebx, %r13d
	je	.L17
.L18:
	movslq	%esi, %rbx
	addl	32(%rsp,%rbx,4), %eax
	leal	1(%rsi), %ebx
	cmpl	%ebx, %r11d
	jle	.L17
	movslq	%ebx, %rbx
	addl	$2, %esi
	addl	32(%rsp,%rbx,4), %eax
	cmpl	%esi, %r11d
	jle	.L17
	movslq	%esi, %rsi
	addl	32(%rsp,%rsi,4), %eax
.L17:
	cmpl	%eax, %r8d
	movl	%r12d, %ebx
	cmovg	%eax, %r8d
	addq	$4, %rcx
	cmpl	%r15d, %edx
	jge	.L179
.L22:
	cmpq	$2, %rdi
	jbe	.L40
	cmpl	$1, %r9d
	ja	.L180
	movdqa	%xmm1, %xmm0
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L42:
	movdqa	%xmm2, %xmm0
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L37:
	addq	$1, %rdi
	addq	$4, %r10
	cmpl	%ebp, 12(%rsp)
	jne	.L13
.L12:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	3208(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L181
	addq	$3224, %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
	.p2align 4,,10
	.p2align 3
.L179:
	.cfi_restore_state
	cmpl	%edx, 4(%rsp)
	jle	.L37
	movl	4(%rsp), %r12d
	movl	%edx, %ecx
	movslq	%edx, %rax
	movl	%ebp, %ebx
	subl	%edi, %ecx
	movl	%ebp, %r14d
	leaq	32(%rsp,%rax,4), %rsi
	shrl	$2, %ebx
	subl	%edx, %r12d
	subl	$1, %ecx
	andl	$-4, %r14d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L182:
	cmpl	$2, %ebx
	je	.L55
	cmpl	$3, %ebx
	je	.L56
	cmpl	$4, %ebx
	je	.L57
	cmpl	$5, %ebx
	je	.L58
	cmpl	$6, %ebx
	je	.L59
	cmpl	$7, %ebx
	je	.L60
	cmpl	$8, %ebx
	je	.L61
	cmpl	$9, %ebx
	je	.L62
	cmpl	$10, %ebx
	je	.L63
	cmpl	$11, %ebx
	je	.L64
	movdqa	%xmm3, %xmm0
	.p2align 4,,10
	.p2align 3
.L24:
	movdqa	%xmm0, %xmm13
	movl	%r14d, %r9d
	psrldq	$8, %xmm13
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %eax
	cmpl	%r14d, %ebp
	je	.L25
.L23:
	movslq	%r9d, %r13
	addl	448(%rsp,%r13,4), %eax
	leal	1(%r9), %r13d
	cmpl	%r13d, %edi
	jl	.L25
	movslq	%r13d, %r13
	addl	$2, %r9d
	addl	448(%rsp,%r13,4), %eax
	cmpl	%r9d, %edi
	jl	.L25
	movslq	%r9d, %r9
	addl	448(%rsp,%r9,4), %eax
.L25:
	leal	1(%rcx), %r13d
	cmpl	8(%rsp), %edx
	movl	$1, %r9d
	cmovg	%r13d, %r9d
	cmpl	%edi, %edx
	jle	.L65
	cmpl	$2, %ecx
	jbe	.L65
	movl	%r9d, %ecx
	movdqu	(%r10), %xmm0
	shrl	$2, %ecx
	cmpl	$1, %ecx
	je	.L27
	movdqu	16(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$2, %ecx
	je	.L27
	movdqu	32(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$3, %ecx
	je	.L27
	movdqu	48(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$4, %ecx
	je	.L27
	movdqu	64(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$5, %ecx
	je	.L27
	movdqu	80(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$6, %ecx
	je	.L27
	movdqu	96(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$7, %ecx
	je	.L27
	movdqu	112(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$8, %ecx
	je	.L27
	movdqu	128(%r10), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$9, %ecx
	je	.L27
	movdqu	144(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$10, %ecx
	je	.L27
	movdqu	160(%r10), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$11, %ecx
	je	.L27
	movdqu	176(%r10), %xmm15
	paddd	%xmm15, %xmm0
	.p2align 4,,10
	.p2align 3
.L27:
	movdqa	%xmm0, %xmm13
	movl	%r9d, %r15d
	psrldq	$8, %xmm13
	andl	$-4, %r15d
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	leal	(%r15,%rbp), %ecx
	cmpl	%r15d, %r9d
	je	.L28
.L26:
	movslq	%ecx, %r9
	addl	240(%rsp,%r9,4), %eax
	leal	1(%rcx), %r9d
	cmpl	%r9d, %edx
	jl	.L28
	movslq	%r9d, %r9
	addl	$2, %ecx
	addl	240(%rsp,%r9,4), %eax
	cmpl	%ecx, %edx
	jl	.L28
	movslq	%ecx, %rcx
	addl	240(%rsp,%rcx,4), %eax
.L28:
	addl	$1, %edx
	leal	-1(%r12), %r9d
	cmpl	%r11d, %edx
	jge	.L29
	cmpl	$2, %r9d
	jbe	.L66
	movl	%r12d, %ecx
	movdqu	4(%rsi), %xmm0
	shrl	$2, %ecx
	cmpl	$1, %ecx
	je	.L31
	movdqu	20(%rsi), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$2, %ecx
	je	.L31
	movdqu	36(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$3, %ecx
	je	.L31
	movdqu	52(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$4, %ecx
	je	.L31
	movdqu	68(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$5, %ecx
	je	.L31
	movdqu	84(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$6, %ecx
	je	.L31
	movdqu	100(%rsi), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$7, %ecx
	je	.L31
	movdqu	116(%rsi), %xmm15
	paddd	%xmm15, %xmm0
	cmpl	$8, %ecx
	je	.L31
	movdqu	132(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$9, %ecx
	je	.L31
	movdqu	148(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$10, %ecx
	je	.L31
	movdqu	164(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	cmpl	$11, %ecx
	je	.L31
	movdqu	180(%rsi), %xmm14
	paddd	%xmm14, %xmm0
	.p2align 4,,10
	.p2align 3
.L31:
	movdqa	%xmm0, %xmm13
	movl	%r12d, %r15d
	psrldq	$8, %xmm13
	andl	$-4, %r15d
	paddd	%xmm13, %xmm0
	movdqa	%xmm0, %xmm13
	psrldq	$4, %xmm13
	paddd	%xmm13, %xmm0
	movd	%xmm0, %ecx
	addl	%ecx, %eax
	leal	(%r15,%rdx), %ecx
	cmpl	%r12d, %r15d
	je	.L29
.L30:
	movslq	%ecx, %r12
	addl	32(%rsp,%r12,4), %eax
	leal	1(%rcx), %r12d
	cmpl	%r11d, %r12d
	jge	.L29
	movslq	%r12d, %r12
	addl	$2, %ecx
	addl	32(%rsp,%r12,4), %eax
	cmpl	%r11d, %ecx
	jge	.L29
	movslq	%ecx, %rcx
	addl	32(%rsp,%rcx,4), %eax
.L29:
	cmpl	%eax, %r8d
	movl	%r9d, %r12d
	cmovg	%eax, %r8d
	addq	$4, %rsi
	cmpl	%edx, 4(%rsp)
	jle	.L37
	movl	%r13d, %ecx
.L33:
	cmpq	$2, %rdi
	jbe	.L53
	cmpl	$1, %ebx
	ja	.L182
	movdqa	%xmm1, %xmm0
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L55:
	movdqa	%xmm2, %xmm0
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L56:
	movdqa	%xmm4, %xmm0
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L43:
	movdqa	%xmm4, %xmm0
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L53:
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L40:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%ebp, %ecx
	jmp	.L26
.L52:
	movl	%edx, %esi
	jmp	.L18
.L66:
	movl	%edx, %ecx
	jmp	.L30
.L57:
	movdqa	%xmm5, %xmm0
	jmp	.L24
.L44:
	movdqa	%xmm5, %xmm0
	jmp	.L15
.L45:
	movdqa	%xmm6, %xmm0
	jmp	.L15
.L58:
	movdqa	%xmm6, %xmm0
	jmp	.L24
.L46:
	movdqa	%xmm7, %xmm0
	jmp	.L15
.L59:
	movdqa	%xmm7, %xmm0
	jmp	.L24
.L60:
	movdqa	%xmm8, %xmm0
	jmp	.L24
.L47:
	movdqa	%xmm8, %xmm0
	jmp	.L15
.L61:
	movdqa	%xmm9, %xmm0
	jmp	.L24
.L48:
	movdqa	%xmm9, %xmm0
	jmp	.L15
.L49:
	movdqa	%xmm11, %xmm0
	jmp	.L15
.L62:
	movdqa	%xmm11, %xmm0
	jmp	.L24
.L50:
	movdqa	%xmm10, %xmm0
	jmp	.L15
.L63:
	movdqa	%xmm10, %xmm0
	jmp	.L24
.L51:
	movdqa	%xmm12, %xmm0
	jmp	.L15
.L64:
	movdqa	%xmm12, %xmm0
	jmp	.L24
.L39:
	movl	$2501, %r8d
	jmp	.L12
.L181:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>
int main(void)
{
	int n,m,max,i,j,sum,k,r[50],b[50],w[50];
	char s[50][51];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		w[i]=0;
		b[i]=0;
		r[i]=0;
	}
	for(i=0;i<n;i++){
		scanf("%s",s[i]);
		for(j=0;j<m;j++){
			if(s[i][j]!='W'){
				w[i]++;
			}
			if(s[i][j]!='B'){
				b[i]++;
			}
			if(s[i][j]!='R'){
				r[i]++;
			}
		}
	}
	max=2501;
	for(i=0;i<n-2;i++){
		for(j=0;j<n-1;j++){
			sum=0;
			for(k=0;k<=i;k++){
				sum+=w[k];
			}
			for(k=i+1;k<=j;k++){
				sum+=b[k];
			}
			for(k=j+1;k<n;k++){
				sum+=r[k];
			}
			if(sum<max){
				max=sum;
			}
		}
	}
	printf("%d\n",max);
	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,max,i,j,sum,k,r[50],b[50],w[50];
	char s[50][51];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		w[i]=0;
		b[i]=0;
		r[i]=0;
	}
	for(i=0;i<n;i++){
		scanf("%s",s[i]);
		for(j=0;j<m;j++){
			if(s[i][j]!='W'){
				w[i]++;
			}
			if(s[i][j]!='B'){
				b[i]++;
			}
			if(s[i][j]!='R'){
				r[i]++;
			}
		}
	}
	max=2501;
	for(i=0;i<n-2;i++){
		for(j=0;j<n-1;j++){
			sum=0;
			for(k=0;k<=i;k++){
				sum+=w[k];
			}
			for(k=i+1;k<=j;k++){
				sum+=b[k];
			}
			for(k=j+1;k<n;k++){
				sum+=r[k];
			}
			if(sum<max){
				max=sum;
			}
		}
	}
	printf("%d\n",max);
	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	$3216, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-3208(%rbp), %rdx
	leaq	-3212(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3200(%rbp)
	jmp	.L2
.L3:
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -2768(%rbp,%rax,4)
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -2976(%rbp,%rax,4)
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -3184(%rbp,%rax,4)
	addl	$1, -3200(%rbp)
.L2:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L3
	movl	$0, -3200(%rbp)
	jmp	.L4
.L10:
	leaq	-2560(%rbp), %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$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
	movl	$0, -3196(%rbp)
	jmp	.L5
.L9:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$87, %al
	je	.L6
	movl	-3200(%rbp), %eax
	cltq
	movl	-2768(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -2768(%rbp,%rax,4)
.L6:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L7
	movl	-3200(%rbp), %eax
	cltq
	movl	-2976(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -2976(%rbp,%rax,4)
.L7:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$82, %al
	je	.L8
	movl	-3200(%rbp), %eax
	cltq
	movl	-3184(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -3184(%rbp,%rax,4)
.L8:
	addl	$1, -3196(%rbp)
.L5:
	movl	-3208(%rbp), %eax
	cmpl	%eax, -3196(%rbp)
	jl	.L9
	addl	$1, -3200(%rbp)
.L4:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L10
	movl	$2501, -3204(%rbp)
	movl	$0, -3200(%rbp)
	jmp	.L11
.L21:
	movl	$0, -3196(%rbp)
	jmp	.L12
.L20:
	movl	$0, -3192(%rbp)
	movl	$0, -3188(%rbp)
	jmp	.L13
.L14:
	movl	-3188(%rbp), %eax
	cltq
	movl	-2768(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L13:
	movl	-3188(%rbp), %eax
	cmpl	-3200(%rbp), %eax
	jle	.L14
	movl	-3200(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -3188(%rbp)
	jmp	.L15
.L16:
	movl	-3188(%rbp), %eax
	cltq
	movl	-2976(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L15:
	movl	-3188(%rbp), %eax
	cmpl	-3196(%rbp), %eax
	jle	.L16
	movl	-3196(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -3188(%rbp)
	jmp	.L17
.L18:
	movl	-3188(%rbp), %eax
	cltq
	movl	-3184(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L17:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3188(%rbp)
	jl	.L18
	movl	-3192(%rbp), %eax
	cmpl	-3204(%rbp), %eax
	jge	.L19
	movl	-3192(%rbp), %eax
	movl	%eax, -3204(%rbp)
.L19:
	addl	$1, -3196(%rbp)
.L12:
	movl	-3212(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -3196(%rbp)
	jl	.L20
	addl	$1, -3200(%rbp)
.L11:
	movl	-3212(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L21
	movl	-3204(%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	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	$3216, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-3208(%rbp), %rdx
	leaq	-3212(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3200(%rbp)
	jmp	.L2
.L3:
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -2768(%rbp,%rax,4)
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -2976(%rbp,%rax,4)
	movl	-3200(%rbp), %eax
	cltq
	movl	$0, -3184(%rbp,%rax,4)
	addl	$1, -3200(%rbp)
.L2:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L3
	movl	$0, -3200(%rbp)
	jmp	.L4
.L10:
	leaq	-2560(%rbp), %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$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
	movl	$0, -3196(%rbp)
	jmp	.L5
.L9:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$87, %al
	je	.L6
	movl	-3200(%rbp), %eax
	cltq
	movl	-2768(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -2768(%rbp,%rax,4)
.L6:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L7
	movl	-3200(%rbp), %eax
	cltq
	movl	-2976(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -2976(%rbp,%rax,4)
.L7:
	movl	-3196(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3200(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$2560, %rax
	movzbl	(%rax), %eax
	cmpb	$82, %al
	je	.L8
	movl	-3200(%rbp), %eax
	cltq
	movl	-3184(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-3200(%rbp), %eax
	cltq
	movl	%edx, -3184(%rbp,%rax,4)
.L8:
	addl	$1, -3196(%rbp)
.L5:
	movl	-3208(%rbp), %eax
	cmpl	%eax, -3196(%rbp)
	jl	.L9
	addl	$1, -3200(%rbp)
.L4:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L10
	movl	$2501, -3204(%rbp)
	movl	$0, -3200(%rbp)
	jmp	.L11
.L21:
	movl	$0, -3196(%rbp)
	jmp	.L12
.L20:
	movl	$0, -3192(%rbp)
	movl	$0, -3188(%rbp)
	jmp	.L13
.L14:
	movl	-3188(%rbp), %eax
	cltq
	movl	-2768(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L13:
	movl	-3188(%rbp), %eax
	cmpl	-3200(%rbp), %eax
	jle	.L14
	movl	-3200(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -3188(%rbp)
	jmp	.L15
.L16:
	movl	-3188(%rbp), %eax
	cltq
	movl	-2976(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L15:
	movl	-3188(%rbp), %eax
	cmpl	-3196(%rbp), %eax
	jle	.L16
	movl	-3196(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -3188(%rbp)
	jmp	.L17
.L18:
	movl	-3188(%rbp), %eax
	cltq
	movl	-3184(%rbp,%rax,4), %eax
	addl	%eax, -3192(%rbp)
	addl	$1, -3188(%rbp)
.L17:
	movl	-3212(%rbp), %eax
	cmpl	%eax, -3188(%rbp)
	jl	.L18
	movl	-3192(%rbp), %eax
	cmpl	-3204(%rbp), %eax
	jge	.L19
	movl	-3192(%rbp), %eax
	movl	%eax, -3204(%rbp)
.L19:
	addl	$1, -3196(%rbp)
.L12:
	movl	-3212(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -3196(%rbp)
	jl	.L20
	addl	$1, -3200(%rbp)
.L11:
	movl	-3212(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -3200(%rbp)
	jl	.L21
	movl	-3204(%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	.L23
	call	__stack_chk_fail@PLT
.L23:
	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:
