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>

#define IM 3956649

#define N_MAX 50
#define M_MAX 50

typedef struct {
	int w;
	int b;
	int r;
} tricoro;

tricoro color[N_MAX];

int n, m;

int solve(){
	int answer = IM;

	int whitecost = 0, whitediff, isdiff;
	int bluebegin = 0;
	int redsbegin = 0;
	int redblues, lowestrb;
	for (;;) {
		// whitediff = 0;
		// isdiff = 0;
		// while (bluebegin < n - 1 && (!isdiff || whitediff > 0)) {
		// 	whitecost += color[bluebegin].w;
		// 	whitediff += color[bluebegin].w - color[bluebegin].b;
		// 	bluebegin++;
		// 	isdiff = 1;
		// 	fprintf(stderr, "cost: %d, diff:  %d, begin: %d\n", whitecost, whitediff, bluebegin);
		// }
		
		whitecost += color[bluebegin++].w;

		if (bluebegin >= n - 1) break;

		// fprintf(stderr, ":: [%d]) %d\n", bluebegin, whitecost);

		redblues = 0;
		redsbegin = n;
		while (--redsbegin >= bluebegin) {
			redblues += color[redsbegin].r;
		}

		lowestrb = redblues;
		redsbegin++;
		while (redsbegin + 1 <= n - 1) {
			redblues -= color[redsbegin].r;
			redblues += color[redsbegin].b;
			redsbegin++;

			if (lowestrb > redblues) {
				lowestrb = redblues;
				// fprintf(stderr, "::: %d)...\n", redsbegin);
			}
		}

		// fprintf(stderr, "::: %d\n", lowestrb);

		if (answer > whitecost + lowestrb) answer = whitecost + lowestrb;
	}


	return answer;
}

int main(void){
	char str[M_MAX + 1];
	int i;

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++) {
		int j;
		scanf("%s", str);
		color[i].w = color[i].b = color[i].r = m;
		for (j = 0; j < m; j++) {
			switch (str[j]) {
			case 'W':
				color[i].w--;
				break;
			case 'B':
				color[i].b--;
				break;
			case 'R':
				color[i].r--;
				break;
			}
		}
	}

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

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 600
color:
	.zero	600
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$3956649, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
.L9:
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jge	.L12
	movl	$0, -8(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
.L4:
	subl	$1, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L5
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	addl	$1, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L6
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L6:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	jmp	.L9
.L12:
	nop
	movl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	jmp	.L14
.L21:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, -68(%rbp)
	jmp	.L15
.L20:
	movl	-68(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$87, %eax
	je	.L16
	cmpl	$87, %eax
	jg	.L17
	cmpl	$66, %eax
	je	.L18
	cmpl	$82, %eax
	je	.L19
	jmp	.L17
.L16:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L17
.L18:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L17
.L19:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	nop
.L17:
	addl	$1, -68(%rbp)
.L15:
	movl	m(%rip), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L20
	addl	$1, -72(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L21
	movl	$0, %eax
	call	solve
	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
.LFE1:
	.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
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rax
	movl	color(%rip), %r8d
	leal	-1(%rax), %edi
	cmpl	$1, %edi
	jle	.L10
	leal	-2(%rax), %r11d
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	(%rax,%rax,2), %rax
	movl	$1, %esi
	cmpl	%edi, %r11d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	color(%rip), %rbp
	movl	$3956649, %r9d
	cmovg	%edi, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	16(%rbp), %r10
	leaq	0(%rbp,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rcx
	movl	%edi, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %edx
	addl	-4(%rcx), %eax
	subq	$12, %rcx
	cmpl	%esi, %edx
	jge	.L3
	cmpl	%esi, %edi
	jle	.L11
	movq	%r10, %rdx
	movl	%eax, %ecx
	movl	%esi, %r12d
	.p2align 4,,10
	.p2align 3
.L5:
	subl	4(%rdx), %eax
	addl	(%rdx), %eax
	addl	$1, %r12d
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	addq	$12, %rdx
	cmpl	%edi, %r12d
	jl	.L5
.L4:
	addl	%r8d, %ecx
	cmpl	%ecx, %r9d
	cmovg	%ecx, %r9d
	addl	$1, %esi
	addl	-4(%r10), %r8d
	addq	$12, %r10
	cmpl	%r11d, %esi
	jle	.L6
	cmpl	%edi, %esi
	jge	.L1
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%r8d, %r9d
	cmovg	%r8d, %r9d
	addl	$1, %esi
	addl	(%rax), %r8d
	addq	$12, %rax
	cmpl	%esi, %edi
	jg	.L9
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r9d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	%eax, %ecx
	jmp	.L4
.L10:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$3956649, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	solve, .-solve
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L21
	leaq	color(%rip), %rbx
	xorl	%r13d, %r13d
	movq	%rsp, %r14
	leaq	.LC1(%rip), %rbp
	leaq	1(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movd	%edx, %xmm1
	movl	%edx, 8(%rbx)
	pshufd	$0xe0, %xmm1, %xmm0
	movq	%xmm0, (%rbx)
	testl	%edx, %edx
	jle	.L22
	leal	-1(%rdx), %ecx
	movq	%r14, %rax
	addq	%r12, %rcx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L34:
	cmpb	$66, %dl
	je	.L33
.L26:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L22
.L27:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	je	.L23
	cmpb	$87, %dl
	jne	.L34
	addq	$1, %rax
	subl	$1, (%rbx)
	cmpq	%rcx, %rax
	jne	.L27
.L22:
	addl	$1, %r13d
	addq	$12, %rbx
	cmpl	%r13d, n(%rip)
	jg	.L28
.L21:
	xorl	%eax, %eax
	call	solve
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	subl	$1, 8(%rbx)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L33:
	subl	$1, 4(%rbx)
	jmp	.L26
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 600
color:
	.zero	600
	.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
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rax
	movl	color(%rip), %r8d
	leal	-1(%rax), %edi
	cmpl	$1, %edi
	jle	.L10
	leal	-2(%rax), %r11d
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	(%rax,%rax,2), %rax
	movl	$1, %esi
	cmpl	%edi, %r11d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	color(%rip), %rbp
	movl	$3956649, %r9d
	cmovg	%edi, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	16(%rbp), %r10
	leaq	0(%rbp,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rcx
	movl	%edi, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %edx
	addl	-4(%rcx), %eax
	subq	$12, %rcx
	cmpl	%esi, %edx
	jge	.L3
	cmpl	%esi, %edi
	jle	.L11
	movq	%r10, %rdx
	movl	%eax, %ecx
	movl	%esi, %r12d
	.p2align 4,,10
	.p2align 3
.L5:
	subl	4(%rdx), %eax
	addl	(%rdx), %eax
	addl	$1, %r12d
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	addq	$12, %rdx
	cmpl	%edi, %r12d
	jl	.L5
.L4:
	addl	%r8d, %ecx
	cmpl	%ecx, %r9d
	cmovg	%ecx, %r9d
	addl	$1, %esi
	addl	-4(%r10), %r8d
	addq	$12, %r10
	cmpl	%r11d, %esi
	jle	.L6
	cmpl	%edi, %esi
	jge	.L1
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%r8d, %r9d
	cmovg	%r8d, %r9d
	addl	$1, %esi
	addl	(%rax), %r8d
	addq	$12, %rax
	cmpl	%esi, %edi
	jg	.L9
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r9d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	%eax, %ecx
	jmp	.L4
.L10:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$3956649, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	solve, .-solve
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	m(%rip), %rdx
	leaq	n(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L21
	leaq	color(%rip), %rbx
	xorl	%r13d, %r13d
	movq	%rsp, %r14
	leaq	.LC1(%rip), %rbp
	leaq	1(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movd	%edx, %xmm1
	movl	%edx, 8(%rbx)
	pshufd	$0xe0, %xmm1, %xmm0
	movq	%xmm0, (%rbx)
	testl	%edx, %edx
	jle	.L22
	leal	-1(%rdx), %ecx
	movq	%r14, %rax
	addq	%r12, %rcx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L34:
	cmpb	$66, %dl
	je	.L33
.L26:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L22
.L27:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	je	.L23
	cmpb	$87, %dl
	jne	.L34
	addq	$1, %rax
	subl	$1, (%rbx)
	cmpq	%rcx, %rax
	jne	.L27
.L22:
	addl	$1, %r13d
	addq	$12, %rbx
	cmpl	%r13d, n(%rip)
	jg	.L28
.L21:
	xorl	%eax, %eax
	call	solve
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	subl	$1, 8(%rbx)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L33:
	subl	$1, 4(%rbx)
	jmp	.L26
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	color
	.align 32
	.type	color, @object
	.size	color, 600
color:
	.zero	600
	.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>

#define IM 3956649

#define N_MAX 50
#define M_MAX 50

typedef struct {
	int w;
	int b;
	int r;
} tricoro;

tricoro color[N_MAX];

int n, m;

int solve(){
	int answer = IM;

	int whitecost = 0, whitediff, isdiff;
	int bluebegin = 0;
	int redsbegin = 0;
	int redblues, lowestrb;
	for (;;) {
		// whitediff = 0;
		// isdiff = 0;
		// while (bluebegin < n - 1 && (!isdiff || whitediff > 0)) {
		// 	whitecost += color[bluebegin].w;
		// 	whitediff += color[bluebegin].w - color[bluebegin].b;
		// 	bluebegin++;
		// 	isdiff = 1;
		// 	fprintf(stderr, "cost: %d, diff:  %d, begin: %d\n", whitecost, whitediff, bluebegin);
		// }
		
		whitecost += color[bluebegin++].w;

		if (bluebegin >= n - 1) break;

		// fprintf(stderr, ":: [%d]) %d\n", bluebegin, whitecost);

		redblues = 0;
		redsbegin = n;
		while (--redsbegin >= bluebegin) {
			redblues += color[redsbegin].r;
		}

		lowestrb = redblues;
		redsbegin++;
		while (redsbegin + 1 <= n - 1) {
			redblues -= color[redsbegin].r;
			redblues += color[redsbegin].b;
			redsbegin++;

			if (lowestrb > redblues) {
				lowestrb = redblues;
				// fprintf(stderr, "::: %d)...\n", redsbegin);
			}
		}

		// fprintf(stderr, "::: %d\n", lowestrb);

		if (answer > whitecost + lowestrb) answer = whitecost + lowestrb;
	}


	return answer;
}

int main(void){
	char str[M_MAX + 1];
	int i;

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++) {
		int j;
		scanf("%s", str);
		color[i].w = color[i].b = color[i].r = m;
		for (j = 0; j < m; j++) {
			switch (str[j]) {
			case 'W':
				color[i].w--;
				break;
			case 'B':
				color[i].b--;
				break;
			case 'R':
				color[i].r--;
				break;
			}
		}
	}

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

	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>

#define IM 3956649

#define N_MAX 50
#define M_MAX 50

typedef struct {
	int w;
	int b;
	int r;
} tricoro;

tricoro color[N_MAX];

int n, m;

int solve(){
	int answer = IM;

	int whitecost = 0, whitediff, isdiff;
	int bluebegin = 0;
	int redsbegin = 0;
	int redblues, lowestrb;
	for (;;) {
		// whitediff = 0;
		// isdiff = 0;
		// while (bluebegin < n - 1 && (!isdiff || whitediff > 0)) {
		// 	whitecost += color[bluebegin].w;
		// 	whitediff += color[bluebegin].w - color[bluebegin].b;
		// 	bluebegin++;
		// 	isdiff = 1;
		// 	fprintf(stderr, "cost: %d, diff:  %d, begin: %d\n", whitecost, whitediff, bluebegin);
		// }
		
		whitecost += color[bluebegin++].w;

		if (bluebegin >= n - 1) break;

		// fprintf(stderr, ":: [%d]) %d\n", bluebegin, whitecost);

		redblues = 0;
		redsbegin = n;
		while (--redsbegin >= bluebegin) {
			redblues += color[redsbegin].r;
		}

		lowestrb = redblues;
		redsbegin++;
		while (redsbegin + 1 <= n - 1) {
			redblues -= color[redsbegin].r;
			redblues += color[redsbegin].b;
			redsbegin++;

			if (lowestrb > redblues) {
				lowestrb = redblues;
				// fprintf(stderr, "::: %d)...\n", redsbegin);
			}
		}

		// fprintf(stderr, "::: %d\n", lowestrb);

		if (answer > whitecost + lowestrb) answer = whitecost + lowestrb;
	}


	return answer;
}

int main(void){
	char str[M_MAX + 1];
	int i;

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++) {
		int j;
		scanf("%s", str);
		color[i].w = color[i].b = color[i].r = m;
		for (j = 0; j < m; j++) {
			switch (str[j]) {
			case 'W':
				color[i].w--;
				break;
			case 'B':
				color[i].b--;
				break;
			case 'R':
				color[i].r--;
				break;
			}
		}
	}

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

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 600
color:
	.zero	600
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$3956649, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
.L9:
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jge	.L12
	movl	$0, -8(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
.L4:
	subl	$1, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L5
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	addl	$1, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L6
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L6:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	jmp	.L9
.L12:
	nop
	movl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	jmp	.L14
.L21:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, -68(%rbp)
	jmp	.L15
.L20:
	movl	-68(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$87, %eax
	je	.L16
	cmpl	$87, %eax
	jg	.L17
	cmpl	$66, %eax
	je	.L18
	cmpl	$82, %eax
	je	.L19
	jmp	.L17
.L16:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L17
.L18:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L17
.L19:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	nop
.L17:
	addl	$1, -68(%rbp)
.L15:
	movl	m(%rip), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L20
	addl	$1, -72(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L21
	movl	$0, %eax
	call	solve
	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
.LFE1:
	.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
	.globl	color
	.bss
	.align 32
	.type	color, @object
	.size	color, 600
color:
	.zero	600
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$3956649, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
.L9:
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jge	.L12
	movl	$0, -8(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
.L4:
	subl	$1, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L5
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	addl	$1, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L6
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
.L6:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -24(%rbp)
	jmp	.L9
.L12:
	nop
	movl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	jmp	.L14
.L21:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	color(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, -68(%rbp)
	jmp	.L15
.L20:
	movl	-68(%rbp), %eax
	cltq
	movzbl	-64(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$87, %eax
	je	.L16
	cmpl	$87, %eax
	jg	.L17
	cmpl	$66, %eax
	je	.L18
	cmpl	$82, %eax
	je	.L19
	jmp	.L17
.L16:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L17
.L18:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L17
.L19:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+color(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	nop
.L17:
	addl	$1, -68(%rbp)
.L15:
	movl	m(%rip), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L20
	addl	$1, -72(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L21
	movl	$0, %eax
	call	solve
	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
.LFE1:
	.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:
