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()
{
    int n, i;
    int r = 0, w = 0;
    char c[200000];

    scanf("%d", &n);
    getchar();

    for (i = 0; i < n; i++) {
        c[i] = getchar();
        if (c[i] == 'R')
            r++;
    }

    for (i = 0; i < r; i++) {
        if (c[i] == 'W')
            w++;
    }

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

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3424, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -200024(%rbp)
	movl	$0, -200020(%rbp)
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	movl	$0, -200028(%rbp)
	jmp	.L2
.L4:
	call	getchar@PLT
	movl	%eax, %edx
	movl	-200028(%rbp), %eax
	cltq
	movb	%dl, -200016(%rbp,%rax)
	movl	-200028(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L3
	addl	$1, -200024(%rbp)
.L3:
	addl	$1, -200028(%rbp)
.L2:
	movl	-200032(%rbp), %eax
	cmpl	%eax, -200028(%rbp)
	jl	.L4
	movl	$0, -200028(%rbp)
	jmp	.L5
.L7:
	movl	-200028(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L6
	addl	$1, -200020(%rbp)
.L6:
	addl	$1, -200028(%rbp)
.L5:
	movl	-200028(%rbp), %eax
	cmpl	-200024(%rbp), %eax
	jl	.L7
	movl	-200020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196640
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200064
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpb	$82, %al
	movb	%al, (%rbx,%rbp)
	sete	%al
	addq	$1, %rbx
	movzbl	%al, %eax
	addl	%eax, %r12d
	cmpl	%ebx, 12(%rsp)
	jg	.L4
	testl	%r12d, %r12d
	je	.L2
	leal	-1(%r12), %eax
	cmpl	$14, %eax
	jbe	.L28
	movl	%r12d, %edx
	pxor	%xmm1, %xmm1
	pxor	%xmm5, %xmm5
	movq	%rbp, %rax
	shrl	$4, %edx
	movdqa	.LC1(%rip), %xmm7
	movdqa	.LC2(%rip), %xmm6
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm7, %xmm0
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	pand	%xmm6, %xmm0
	pcmpgtb	%xmm0, %xmm3
	movdqa	%xmm0, %xmm2
	punpcklbw	%xmm3, %xmm2
	punpckhbw	%xmm3, %xmm0
	movdqa	%xmm4, %xmm3
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm8
	punpcklwd	%xmm3, %xmm8
	punpckhwd	%xmm3, %xmm2
	movdqa	%xmm0, %xmm3
	paddd	%xmm8, %xmm1
	paddd	%xmm2, %xmm1
	movdqa	%xmm4, %xmm2
	pcmpgtw	%xmm0, %xmm2
	punpcklwd	%xmm2, %xmm3
	punpckhwd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	paddd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L8
	movdqa	%xmm1, %xmm0
	movl	%r12d, %eax
	psrldq	$8, %xmm0
	andl	$-16, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$15, %r12b
	je	.L6
.L7:
	movslq	%eax, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L11
	addl	$1, %edx
.L11:
	leal	1(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L37
.L12:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L38
.L13:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L39
.L14:
	leal	4(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L40
.L15:
	leal	5(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L16
	addl	$1, %edx
.L16:
	leal	6(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L17
	addl	$1, %edx
.L17:
	leal	7(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L18
	addl	$1, %edx
.L18:
	leal	8(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L19
	addl	$1, %edx
.L19:
	leal	9(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L41
.L20:
	leal	10(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L42
.L21:
	leal	11(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L43
.L22:
	leal	12(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L44
.L23:
	leal	13(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L24
	addl	$1, %edx
.L24:
	addl	$14, %eax
	cmpl	%eax, %r12d
	jle	.L6
	cltq
	cmpb	$87, 16(%rsp,%rax)
	jne	.L6
	addl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L37:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L12
.L38:
	addl	$1, %edx
	jmp	.L13
.L39:
	addl	$1, %edx
	jmp	.L14
.L40:
	addl	$1, %edx
	jmp	.L15
.L41:
	addl	$1, %edx
	jmp	.L20
.L42:
	addl	$1, %edx
	jmp	.L21
.L43:
	addl	$1, %edx
	jmp	.L22
.L44:
	addl	$1, %edx
	jmp	.L23
.L2:
	xorl	%edx, %edx
	jmp	.L6
.L28:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L7
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196640
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200064
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpb	$82, %al
	movb	%al, (%rbx,%rbp)
	sete	%al
	addq	$1, %rbx
	movzbl	%al, %eax
	addl	%eax, %r12d
	cmpl	%ebx, 12(%rsp)
	jg	.L4
	testl	%r12d, %r12d
	je	.L2
	leal	-1(%r12), %eax
	cmpl	$14, %eax
	jbe	.L28
	movl	%r12d, %edx
	pxor	%xmm1, %xmm1
	pxor	%xmm5, %xmm5
	movq	%rbp, %rax
	shrl	$4, %edx
	movdqa	.LC1(%rip), %xmm7
	movdqa	.LC2(%rip), %xmm6
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm7, %xmm0
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	pand	%xmm6, %xmm0
	pcmpgtb	%xmm0, %xmm3
	movdqa	%xmm0, %xmm2
	punpcklbw	%xmm3, %xmm2
	punpckhbw	%xmm3, %xmm0
	movdqa	%xmm4, %xmm3
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm8
	punpcklwd	%xmm3, %xmm8
	punpckhwd	%xmm3, %xmm2
	movdqa	%xmm0, %xmm3
	paddd	%xmm8, %xmm1
	paddd	%xmm2, %xmm1
	movdqa	%xmm4, %xmm2
	pcmpgtw	%xmm0, %xmm2
	punpcklwd	%xmm2, %xmm3
	punpckhwd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	paddd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L8
	movdqa	%xmm1, %xmm0
	movl	%r12d, %eax
	psrldq	$8, %xmm0
	andl	$-16, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$15, %r12b
	je	.L6
.L7:
	movslq	%eax, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L11
	addl	$1, %edx
.L11:
	leal	1(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L37
.L12:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L38
.L13:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L39
.L14:
	leal	4(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L40
.L15:
	leal	5(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L16
	addl	$1, %edx
.L16:
	leal	6(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L17
	addl	$1, %edx
.L17:
	leal	7(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L18
	addl	$1, %edx
.L18:
	leal	8(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L19
	addl	$1, %edx
.L19:
	leal	9(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L41
.L20:
	leal	10(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L42
.L21:
	leal	11(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L43
.L22:
	leal	12(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	je	.L44
.L23:
	leal	13(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L6
	movslq	%ecx, %rcx
	cmpb	$87, 16(%rsp,%rcx)
	jne	.L24
	addl	$1, %edx
.L24:
	addl	$14, %eax
	cmpl	%eax, %r12d
	jle	.L6
	cltq
	cmpb	$87, 16(%rsp,%rax)
	jne	.L6
	addl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L37:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L12
.L38:
	addl	$1, %edx
	jmp	.L13
.L39:
	addl	$1, %edx
	jmp	.L14
.L40:
	addl	$1, %edx
	jmp	.L15
.L41:
	addl	$1, %edx
	jmp	.L20
.L42:
	addl	$1, %edx
	jmp	.L21
.L43:
	addl	$1, %edx
	jmp	.L22
.L44:
	addl	$1, %edx
	jmp	.L23
.L2:
	xorl	%edx, %edx
	jmp	.L6
.L28:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L7
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.byte	87
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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()
{
    int n, i;
    int r = 0, w = 0;
    char c[200000];

    scanf("%d", &n);
    getchar();

    for (i = 0; i < n; i++) {
        c[i] = getchar();
        if (c[i] == 'R')
            r++;
    }

    for (i = 0; i < r; i++) {
        if (c[i] == 'W')
            w++;
    }

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

    return 0;
}
8
RRWRWWRW
 2
RQ
 8
RRWWWRRW
 8
WRWWWRRR
 8
WWWWRRRR
 8
RRWRVWRW
 4
RRWW
 4
RWWR
 2
RS
 4
RRVW

1
 0
 2
 3
 4
 1
 0
 1
 0
 0

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()
{
    int n, i;
    int r = 0, w = 0;
    char c[200000];

    scanf("%d", &n);
    getchar();

    for (i = 0; i < n; i++) {
        c[i] = getchar();
        if (c[i] == 'R')
            r++;
    }

    for (i = 0; i < r; i++) {
        if (c[i] == 'W')
            w++;
    }

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

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3424, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -200024(%rbp)
	movl	$0, -200020(%rbp)
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	movl	$0, -200028(%rbp)
	jmp	.L2
.L4:
	call	getchar@PLT
	movl	%eax, %edx
	movl	-200028(%rbp), %eax
	cltq
	movb	%dl, -200016(%rbp,%rax)
	movl	-200028(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L3
	addl	$1, -200024(%rbp)
.L3:
	addl	$1, -200028(%rbp)
.L2:
	movl	-200032(%rbp), %eax
	cmpl	%eax, -200028(%rbp)
	jl	.L4
	movl	$0, -200028(%rbp)
	jmp	.L5
.L7:
	movl	-200028(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L6
	addl	$1, -200020(%rbp)
.L6:
	addl	$1, -200028(%rbp)
.L5:
	movl	-200028(%rbp), %eax
	cmpl	-200024(%rbp), %eax
	jl	.L7
	movl	-200020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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"
.LC1:
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3424, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -200024(%rbp)
	movl	$0, -200020(%rbp)
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	movl	$0, -200028(%rbp)
	jmp	.L2
.L4:
	call	getchar@PLT
	movl	%eax, %edx
	movl	-200028(%rbp), %eax
	cltq
	movb	%dl, -200016(%rbp,%rax)
	movl	-200028(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L3
	addl	$1, -200024(%rbp)
.L3:
	addl	$1, -200028(%rbp)
.L2:
	movl	-200032(%rbp), %eax
	cmpl	%eax, -200028(%rbp)
	jl	.L4
	movl	$0, -200028(%rbp)
	jmp	.L5
.L7:
	movl	-200028(%rbp), %eax
	cltq
	movzbl	-200016(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L6
	addl	$1, -200020(%rbp)
.L6:
	addl	$1, -200028(%rbp)
.L5:
	movl	-200028(%rbp), %eax
	cmpl	-200024(%rbp), %eax
	jl	.L7
	movl	-200020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
