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

```c
/*
  AOJ 0621
  Title:Russian Flag
  @kankichi573
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define min(x,y) (((x)<(y))?(x):(y))

int N,M;
char flag[51];
int  White[50],Blue[50],Red[50];

#define Paint2White(i) (Blue[i] +Red[i])
#define Paint2Blue(i)  (White[i]+Red[i])
#define Paint2Red(i)   (White[i]+Blue[i])


int init()   // ALL Red
{
  int i,ret;

  for(i=0;i<N;i++)
    ret += Paint2Red(i);
  return(ret);
}


main()
{
  int i,j,ret,init_v,min_;
  

  scanf("%d %d",&N,&M);
  
  memset(White,0,sizeof(White));
  memset(Blue ,0,sizeof(Blue));
  memset(Red  ,0,sizeof(Red));

  for(i=0;i<N;i++)
    {
      scanf("%s",flag);
      for(j=0;j<M;j++)
	{
	  if(flag[j]=='W')
	    White[i]++;
	  if(flag[j]=='B')
	    Blue[i]++;
	  if(flag[j]=='R')
	    Red[i]++;
	}
    }

  ret=init_v=min_=init();

    
  ret=INT_MAX;
  for(i=0;i<N-2;i++)
    {
      init_v += Paint2White(i)-Paint2Red(i);
      ret=init_v;

      for(j=i+1;j<N-1;j++)
	{
	  ret +=(Paint2Blue(j) -Paint2Red (j));
	  min_ = min(min_,ret);
	}
    }
  
 
  printf("%d\n",min_);
  
  return(0);
 }```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 51
flag:
	.zero	51
	.globl	White
	.align 32
	.type	White, @object
	.size	White, 200
White:
	.zero	200
	.globl	Blue
	.align 32
	.type	Blue, @object
	.size	Blue, 200
Blue:
	.zero	200
	.globl	Red
	.align 32
	.type	Red, @object
	.size	Red, 200
Red:
	.zero	200
	.text
	.globl	init
	.type	init, @function
init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	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	$200, %edx
	movl	$0, %esi
	leaq	White(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$200, %edx
	movl	$0, %esi
	leaq	Blue(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$200, %edx
	movl	$0, %esi
	leaq	Red(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -20(%rbp)
	jmp	.L6
.L12:
	leaq	flag(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L7
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L9
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L10:
	addl	$1, -16(%rbp)
.L7:
	movl	M(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	addl	$1, -20(%rbp)
.L6:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L12
	movl	$0, %eax
	call	init
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	$2147483647, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L13
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	White(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	addl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Blue(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	addl	%eax, -12(%rbp)
	movl	-4(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	addl	$1, -16(%rbp)
.L14:
	movl	N(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	addl	$1, -20(%rbp)
.L13:
	movl	N(%rip), %eax
	subl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	init
	.type	init, @function
init:
.LFB51:
	.cfi_startproc
	endbr64
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L6
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L7
	movl	%edx, %eax
	movdqa	White(%rip), %xmm0
	paddd	Blue(%rip), %xmm0
	shrl	$2, %eax
	cmpl	$1, %eax
	je	.L4
	paddd	16+Blue(%rip), %xmm0
	paddd	16+White(%rip), %xmm0
	cmpl	$2, %eax
	je	.L4
	paddd	32+Blue(%rip), %xmm0
	paddd	32+White(%rip), %xmm0
	cmpl	$3, %eax
	je	.L4
	paddd	48+Blue(%rip), %xmm0
	paddd	48+White(%rip), %xmm0
	cmpl	$4, %eax
	je	.L4
	paddd	64+Blue(%rip), %xmm0
	paddd	64+White(%rip), %xmm0
	cmpl	$5, %eax
	je	.L4
	paddd	80+Blue(%rip), %xmm0
	paddd	80+White(%rip), %xmm0
	cmpl	$6, %eax
	je	.L4
	paddd	96+Blue(%rip), %xmm0
	paddd	96+White(%rip), %xmm0
	cmpl	$7, %eax
	je	.L4
	paddd	112+Blue(%rip), %xmm0
	paddd	112+White(%rip), %xmm0
	cmpl	$8, %eax
	je	.L4
	paddd	128+Blue(%rip), %xmm0
	paddd	128+White(%rip), %xmm0
	cmpl	$9, %eax
	je	.L4
	paddd	144+Blue(%rip), %xmm0
	paddd	144+White(%rip), %xmm0
	cmpl	$10, %eax
	je	.L4
	paddd	160+Blue(%rip), %xmm0
	paddd	160+White(%rip), %xmm0
	cmpl	$11, %eax
	je	.L4
	paddd	176+Blue(%rip), %xmm0
	paddd	176+White(%rip), %xmm0
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	movl	%edx, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %dl
	je	.L42
.L3:
	movslq	%ecx, %r9
	leaq	White(%rip), %r8
	leaq	Blue(%rip), %rdi
	movl	(%rdi,%r9,4), %esi
	addl	(%r8,%r9,4), %esi
	addl	%esi, %eax
	leal	1(%rcx), %esi
	cmpl	%edx, %esi
	jge	.L1
	movslq	%esi, %rsi
	addl	$2, %ecx
	movl	(%rdi,%rsi,4), %r9d
	addl	(%r8,%rsi,4), %r9d
	addl	%r9d, %eax
	cmpl	%ecx, %edx
	jle	.L1
	movslq	%ecx, %rcx
	movl	(%r8,%rcx,4), %edx
	addl	(%rdi,%rcx,4), %edx
	addl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	ret
.L7:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	init, .-init
	.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:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	M(%rip), %rdx
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	leaq	Red(%rip), %r14
	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
	leaq	Blue(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$25, %ecx
	leaq	White(%rip), %rdi
	rep stosq
	movl	$25, %ecx
	movq	%rbx, %rdi
	rep stosq
	movl	$25, %ecx
	movq	%r14, %rdi
	rep stosq
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L44
	movq	%r14, %r9
	movq	%rbx, %r13
	leaq	White(%rip), %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L46:
	leaq	flag(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%r9, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	M(%rip), %esi
	movq	8(%rsp), %r9
	leaq	flag(%rip), %rax
	leaq	1(%rax), %rcx
	leal	-1(%rsi), %edi
	addq	%rcx, %rdi
	testl	%esi, %esi
	jg	.L52
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L106:
	cmpb	$82, %sil
	jne	.L49
	addl	$1, (%r9)
.L49:
	addq	$1, %rax
	cmpq	%rdi, %rax
	je	.L53
.L52:
	movzbl	(%rax), %esi
	cmpb	$87, %sil
	je	.L105
	cmpb	$66, %sil
	jne	.L106
	addq	$1, %rax
	addl	$1, 0(%r13)
	cmpq	%rdi, %rax
	jne	.L52
.L53:
	addl	$1, %ebp
	addq	$4, %r9
	addq	$4, %r13
	addq	$4, %r12
	movl	N(%rip), %eax
	cmpl	%ebp, %eax
	jg	.L46
	testl	%eax, %eax
	jle	.L44
	leal	-1(%rax), %ecx
	cmpl	$2, %ecx
	jbe	.L63
	movl	%eax, %edx
	movdqa	Blue(%rip), %xmm0
	paddd	White(%rip), %xmm0
	shrl	$2, %edx
	cmpl	$1, %edx
	je	.L55
	paddd	16+White(%rip), %xmm0
	paddd	16+Blue(%rip), %xmm0
	cmpl	$2, %edx
	je	.L55
	paddd	32+White(%rip), %xmm0
	paddd	32+Blue(%rip), %xmm0
	cmpl	$3, %edx
	je	.L55
	paddd	48+Blue(%rip), %xmm0
	paddd	48+White(%rip), %xmm0
	cmpl	$4, %edx
	je	.L55
	paddd	64+Blue(%rip), %xmm0
	paddd	64+White(%rip), %xmm0
	cmpl	$5, %edx
	je	.L55
	paddd	80+Blue(%rip), %xmm0
	paddd	80+White(%rip), %xmm0
	cmpl	$6, %edx
	je	.L55
	paddd	96+Blue(%rip), %xmm0
	paddd	96+White(%rip), %xmm0
	cmpl	$7, %edx
	je	.L55
	paddd	112+Blue(%rip), %xmm0
	paddd	112+White(%rip), %xmm0
	cmpl	$8, %edx
	je	.L55
	paddd	128+Blue(%rip), %xmm0
	paddd	128+White(%rip), %xmm0
	cmpl	$9, %edx
	je	.L55
	paddd	144+Blue(%rip), %xmm0
	paddd	144+White(%rip), %xmm0
	cmpl	$10, %edx
	je	.L55
	paddd	160+Blue(%rip), %xmm0
	paddd	160+White(%rip), %xmm0
	cmpl	$11, %edx
	je	.L55
	paddd	176+White(%rip), %xmm0
	paddd	176+Blue(%rip), %xmm0
	.p2align 4,,10
	.p2align 3
.L55:
	movdqa	%xmm0, %xmm1
	movl	%eax, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r15d
	testb	$3, %al
	je	.L56
.L54:
	movslq	%edx, %rdi
	leaq	White(%rip), %r8
	movl	(%rbx,%rdi,4), %esi
	addl	(%r8,%rdi,4), %esi
	addl	%esi, %r15d
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L59
	movslq	%esi, %rsi
	addl	$2, %edx
	movl	(%r8,%rsi,4), %edi
	addl	(%rbx,%rsi,4), %edi
	addl	%edi, %r15d
	cmpl	%edx, %eax
	jle	.L59
	movslq	%edx, %rdx
	movl	(%rbx,%rdx,4), %esi
	addl	(%r8,%rdx,4), %esi
	addl	%esi, %r15d
.L56:
	leal	-3(%rax), %edi
	movl	%r15d, %r9d
	movl	$1, %esi
	addq	$2, %rdi
	leaq	-4+Red(%rip), %r11
	leaq	-4+White(%rip), %r10
	.p2align 4,,10
	.p2align 3
.L62:
	addl	(%r11,%rsi,4), %r15d
	subl	(%r10,%rsi,4), %r15d
	cmpl	%esi, %ecx
	jle	.L60
	movq	%rsi, %rdx
	movl	%r15d, %eax
	.p2align 4,,10
	.p2align 3
.L61:
	addl	(%r14,%rdx,4), %eax
	subl	(%rbx,%rdx,4), %eax
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
	addq	$1, %rdx
	cmpl	%edx, %ecx
	jg	.L61
.L60:
	addq	$1, %rsi
	cmpq	%rsi, %rdi
	jne	.L62
.L57:
	movl	%r9d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$24, %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
.L105:
	.cfi_restore_state
	addl	$1, (%r12)
	jmp	.L49
.L59:
	movl	%r15d, %r9d
	cmpl	$2, %eax
	jg	.L56
	jmp	.L57
.L44:
	xorl	%r9d, %r9d
	jmp	.L57
.L63:
	xorl	%edx, %edx
	jmp	.L54
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	Red
	.bss
	.align 32
	.type	Red, @object
	.size	Red, 200
Red:
	.zero	200
	.globl	Blue
	.align 32
	.type	Blue, @object
	.size	Blue, 200
Blue:
	.zero	200
	.globl	White
	.align 32
	.type	White, @object
	.size	White, 200
White:
	.zero	200
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 51
flag:
	.zero	51
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	init
	.type	init, @function
init:
.LFB51:
	.cfi_startproc
	endbr64
	movl	N(%rip), %edx
	testl	%edx, %edx
	jle	.L6
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L7
	movl	%edx, %eax
	movdqa	White(%rip), %xmm0
	paddd	Blue(%rip), %xmm0
	shrl	$2, %eax
	cmpl	$1, %eax
	je	.L4
	paddd	16+Blue(%rip), %xmm0
	paddd	16+White(%rip), %xmm0
	cmpl	$2, %eax
	je	.L4
	paddd	32+Blue(%rip), %xmm0
	paddd	32+White(%rip), %xmm0
	cmpl	$3, %eax
	je	.L4
	paddd	48+Blue(%rip), %xmm0
	paddd	48+White(%rip), %xmm0
	cmpl	$4, %eax
	je	.L4
	paddd	64+Blue(%rip), %xmm0
	paddd	64+White(%rip), %xmm0
	cmpl	$5, %eax
	je	.L4
	paddd	80+Blue(%rip), %xmm0
	paddd	80+White(%rip), %xmm0
	cmpl	$6, %eax
	je	.L4
	paddd	96+Blue(%rip), %xmm0
	paddd	96+White(%rip), %xmm0
	cmpl	$7, %eax
	je	.L4
	paddd	112+Blue(%rip), %xmm0
	paddd	112+White(%rip), %xmm0
	cmpl	$8, %eax
	je	.L4
	paddd	128+Blue(%rip), %xmm0
	paddd	128+White(%rip), %xmm0
	cmpl	$9, %eax
	je	.L4
	paddd	144+Blue(%rip), %xmm0
	paddd	144+White(%rip), %xmm0
	cmpl	$10, %eax
	je	.L4
	paddd	160+Blue(%rip), %xmm0
	paddd	160+White(%rip), %xmm0
	cmpl	$11, %eax
	je	.L4
	paddd	176+Blue(%rip), %xmm0
	paddd	176+White(%rip), %xmm0
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	movl	%edx, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %dl
	je	.L42
.L3:
	movslq	%ecx, %r9
	leaq	White(%rip), %r8
	leaq	Blue(%rip), %rdi
	movl	(%rdi,%r9,4), %esi
	addl	(%r8,%r9,4), %esi
	addl	%esi, %eax
	leal	1(%rcx), %esi
	cmpl	%edx, %esi
	jge	.L1
	movslq	%esi, %rsi
	addl	$2, %ecx
	movl	(%rdi,%rsi,4), %r9d
	addl	(%r8,%rsi,4), %r9d
	addl	%r9d, %eax
	cmpl	%ecx, %edx
	jle	.L1
	movslq	%ecx, %rcx
	movl	(%r8,%rcx,4), %edx
	addl	(%rdi,%rcx,4), %edx
	addl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	ret
.L7:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	init, .-init
	.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:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	M(%rip), %rdx
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	leaq	Red(%rip), %r14
	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
	leaq	Blue(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$25, %ecx
	leaq	White(%rip), %rdi
	rep stosq
	movl	$25, %ecx
	movq	%rbx, %rdi
	rep stosq
	movl	$25, %ecx
	movq	%r14, %rdi
	rep stosq
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L44
	movq	%r14, %r9
	movq	%rbx, %r13
	leaq	White(%rip), %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L46:
	leaq	flag(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%r9, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	M(%rip), %esi
	movq	8(%rsp), %r9
	leaq	flag(%rip), %rax
	leaq	1(%rax), %rcx
	leal	-1(%rsi), %edi
	addq	%rcx, %rdi
	testl	%esi, %esi
	jg	.L52
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L106:
	cmpb	$82, %sil
	jne	.L49
	addl	$1, (%r9)
.L49:
	addq	$1, %rax
	cmpq	%rdi, %rax
	je	.L53
.L52:
	movzbl	(%rax), %esi
	cmpb	$87, %sil
	je	.L105
	cmpb	$66, %sil
	jne	.L106
	addq	$1, %rax
	addl	$1, 0(%r13)
	cmpq	%rdi, %rax
	jne	.L52
.L53:
	addl	$1, %ebp
	addq	$4, %r9
	addq	$4, %r13
	addq	$4, %r12
	movl	N(%rip), %eax
	cmpl	%ebp, %eax
	jg	.L46
	testl	%eax, %eax
	jle	.L44
	leal	-1(%rax), %ecx
	cmpl	$2, %ecx
	jbe	.L63
	movl	%eax, %edx
	movdqa	Blue(%rip), %xmm0
	paddd	White(%rip), %xmm0
	shrl	$2, %edx
	cmpl	$1, %edx
	je	.L55
	paddd	16+White(%rip), %xmm0
	paddd	16+Blue(%rip), %xmm0
	cmpl	$2, %edx
	je	.L55
	paddd	32+White(%rip), %xmm0
	paddd	32+Blue(%rip), %xmm0
	cmpl	$3, %edx
	je	.L55
	paddd	48+Blue(%rip), %xmm0
	paddd	48+White(%rip), %xmm0
	cmpl	$4, %edx
	je	.L55
	paddd	64+Blue(%rip), %xmm0
	paddd	64+White(%rip), %xmm0
	cmpl	$5, %edx
	je	.L55
	paddd	80+Blue(%rip), %xmm0
	paddd	80+White(%rip), %xmm0
	cmpl	$6, %edx
	je	.L55
	paddd	96+Blue(%rip), %xmm0
	paddd	96+White(%rip), %xmm0
	cmpl	$7, %edx
	je	.L55
	paddd	112+Blue(%rip), %xmm0
	paddd	112+White(%rip), %xmm0
	cmpl	$8, %edx
	je	.L55
	paddd	128+Blue(%rip), %xmm0
	paddd	128+White(%rip), %xmm0
	cmpl	$9, %edx
	je	.L55
	paddd	144+Blue(%rip), %xmm0
	paddd	144+White(%rip), %xmm0
	cmpl	$10, %edx
	je	.L55
	paddd	160+Blue(%rip), %xmm0
	paddd	160+White(%rip), %xmm0
	cmpl	$11, %edx
	je	.L55
	paddd	176+White(%rip), %xmm0
	paddd	176+Blue(%rip), %xmm0
	.p2align 4,,10
	.p2align 3
.L55:
	movdqa	%xmm0, %xmm1
	movl	%eax, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r15d
	testb	$3, %al
	je	.L56
.L54:
	movslq	%edx, %rdi
	leaq	White(%rip), %r8
	movl	(%rbx,%rdi,4), %esi
	addl	(%r8,%rdi,4), %esi
	addl	%esi, %r15d
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L59
	movslq	%esi, %rsi
	addl	$2, %edx
	movl	(%r8,%rsi,4), %edi
	addl	(%rbx,%rsi,4), %edi
	addl	%edi, %r15d
	cmpl	%edx, %eax
	jle	.L59
	movslq	%edx, %rdx
	movl	(%rbx,%rdx,4), %esi
	addl	(%r8,%rdx,4), %esi
	addl	%esi, %r15d
.L56:
	leal	-3(%rax), %edi
	movl	%r15d, %r9d
	movl	$1, %esi
	addq	$2, %rdi
	leaq	-4+Red(%rip), %r11
	leaq	-4+White(%rip), %r10
	.p2align 4,,10
	.p2align 3
.L62:
	addl	(%r11,%rsi,4), %r15d
	subl	(%r10,%rsi,4), %r15d
	cmpl	%esi, %ecx
	jle	.L60
	movq	%rsi, %rdx
	movl	%r15d, %eax
	.p2align 4,,10
	.p2align 3
.L61:
	addl	(%r14,%rdx,4), %eax
	subl	(%rbx,%rdx,4), %eax
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
	addq	$1, %rdx
	cmpl	%edx, %ecx
	jg	.L61
.L60:
	addq	$1, %rsi
	cmpq	%rsi, %rdi
	jne	.L62
.L57:
	movl	%r9d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$24, %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
.L105:
	.cfi_restore_state
	addl	$1, (%r12)
	jmp	.L49
.L59:
	movl	%r15d, %r9d
	cmpl	$2, %eax
	jg	.L56
	jmp	.L57
.L44:
	xorl	%r9d, %r9d
	jmp	.L57
.L63:
	xorl	%edx, %edx
	jmp	.L54
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	Red
	.bss
	.align 32
	.type	Red, @object
	.size	Red, 200
Red:
	.zero	200
	.globl	Blue
	.align 32
	.type	Blue, @object
	.size	Blue, 200
Blue:
	.zero	200
	.globl	White
	.align 32
	.type	White, @object
	.size	White, 200
White:
	.zero	200
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 51
flag:
	.zero	51
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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:

/*
  AOJ 0621
  Title:Russian Flag
  @kankichi573
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define min(x,y) (((x)<(y))?(x):(y))

int N,M;
char flag[51];
int  White[50],Blue[50],Red[50];

#define Paint2White(i) (Blue[i] +Red[i])
#define Paint2Blue(i)  (White[i]+Red[i])
#define Paint2Red(i)   (White[i]+Blue[i])


int init()   // ALL Red
{
  int i,ret;

  for(i=0;i<N;i++)
    ret += Paint2Red(i);
  return(ret);
}


main()
{
  int i,j,ret,init_v,min_;
  

  scanf("%d %d",&N,&M);
  
  memset(White,0,sizeof(White));
  memset(Blue ,0,sizeof(Blue));
  memset(Red  ,0,sizeof(Red));

  for(i=0;i<N;i++)
    {
      scanf("%s",flag);
      for(j=0;j<M;j++)
	{
	  if(flag[j]=='W')
	    White[i]++;
	  if(flag[j]=='B')
	    Blue[i]++;
	  if(flag[j]=='R')
	    Red[i]++;
	}
    }

  ret=init_v=min_=init();

    
  ret=INT_MAX;
  for(i=0;i<N-2;i++)
    {
      init_v += Paint2White(i)-Paint2Red(i);
      ret=init_v;

      for(j=i+1;j<N-1;j++)
	{
	  ret +=(Paint2Blue(j) -Paint2Red (j));
	  min_ = min(min_,ret);
	}
    }
  
 
  printf("%d\n",min_);
  
  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

268
 268
 265
 262
 265
 265
 257
 265
 257
 257

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

```c
/*
  AOJ 0621
  Title:Russian Flag
  @kankichi573
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define min(x,y) (((x)<(y))?(x):(y))

int N,M;
char flag[51];
int  White[50],Blue[50],Red[50];

#define Paint2White(i) (Blue[i] +Red[i])
#define Paint2Blue(i)  (White[i]+Red[i])
#define Paint2Red(i)   (White[i]+Blue[i])


int init()   // ALL Red
{
  int i,ret;

  for(i=0;i<N;i++)
    ret += Paint2Red(i);
  return(ret);
}


main()
{
  int i,j,ret,init_v,min_;
  

  scanf("%d %d",&N,&M);
  
  memset(White,0,sizeof(White));
  memset(Blue ,0,sizeof(Blue));
  memset(Red  ,0,sizeof(Red));

  for(i=0;i<N;i++)
    {
      scanf("%s",flag);
      for(j=0;j<M;j++)
	{
	  if(flag[j]=='W')
	    White[i]++;
	  if(flag[j]=='B')
	    Blue[i]++;
	  if(flag[j]=='R')
	    Red[i]++;
	}
    }

  ret=init_v=min_=init();

    
  ret=INT_MAX;
  for(i=0;i<N-2;i++)
    {
      init_v += Paint2White(i)-Paint2Red(i);
      ret=init_v;

      for(j=i+1;j<N-1;j++)
	{
	  ret +=(Paint2Blue(j) -Paint2Red (j));
	  min_ = min(min_,ret);
	}
    }
  
 
  printf("%d\n",min_);
  
  return(0);
 }```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 51
flag:
	.zero	51
	.globl	White
	.align 32
	.type	White, @object
	.size	White, 200
White:
	.zero	200
	.globl	Blue
	.align 32
	.type	Blue, @object
	.size	Blue, 200
Blue:
	.zero	200
	.globl	Red
	.align 32
	.type	Red, @object
	.size	Red, 200
Red:
	.zero	200
	.text
	.globl	init
	.type	init, @function
init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	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	$200, %edx
	movl	$0, %esi
	leaq	White(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$200, %edx
	movl	$0, %esi
	leaq	Blue(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$200, %edx
	movl	$0, %esi
	leaq	Red(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -20(%rbp)
	jmp	.L6
.L12:
	leaq	flag(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L7
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L9
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L10:
	addl	$1, -16(%rbp)
.L7:
	movl	M(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	addl	$1, -20(%rbp)
.L6:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L12
	movl	$0, %eax
	call	init
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	$2147483647, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L13
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	White(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	addl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Blue(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	addl	%eax, -12(%rbp)
	movl	-4(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	addl	$1, -16(%rbp)
.L14:
	movl	N(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	addl	$1, -20(%rbp)
.L13:
	movl	N(%rip), %eax
	subl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 51
flag:
	.zero	51
	.globl	White
	.align 32
	.type	White, @object
	.size	White, 200
White:
	.zero	200
	.globl	Blue
	.align 32
	.type	Blue, @object
	.size	Blue, 200
Blue:
	.zero	200
	.globl	Red
	.align 32
	.type	Red, @object
	.size	Red, 200
Red:
	.zero	200
	.text
	.globl	init
	.type	init, @function
init:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	addl	%eax, -4(%rbp)
	addl	$1, -8(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init, .-init
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	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	$200, %edx
	movl	$0, %esi
	leaq	White(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$200, %edx
	movl	$0, %esi
	leaq	Blue(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$200, %edx
	movl	$0, %esi
	leaq	Red(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -20(%rbp)
	jmp	.L6
.L12:
	leaq	flag(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -16(%rbp)
	jmp	.L7
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	White(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$66, %al
	jne	.L9
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Blue(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L10:
	addl	$1, -16(%rbp)
.L7:
	movl	M(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	addl	$1, -20(%rbp)
.L6:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L12
	movl	$0, %eax
	call	init
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	$2147483647, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L13
.L16:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	White(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	addl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Red(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Blue(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	addl	%eax, -12(%rbp)
	movl	-4(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	addl	$1, -16(%rbp)
.L14:
	movl	N(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	addl	$1, -20(%rbp)
.L13:
	movl	N(%rip), %eax
	subl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
