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;
    scanf("%d",&N);
    char po[310000];
    scanf(" %s",po);
    int A[N+1];
    A[0]=0;
    for(int i=1;i<=N;i++)A[i]=A[i-1]+(po[i-1]=='W'?1:0);
    int ans=1145141919;
    for(int i=1;i<=N;i++){
        int buri=A[i-1]+N-i-(A[N]-A[i]);
        if(ans>buri)ans=buri;
    }
    printf("%d",ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %s"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-307200(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2872, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-310100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-310064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-310100(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -310080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -310072(%rbp)
	movq	-310072(%rbp), %rax
	movl	$0, (%rax)
	movl	$1, -310096(%rbp)
	jmp	.L5
.L6:
	movl	-310096(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-310096(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-310064(%rbp,%rax), %eax
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	leal	(%rdx,%rax), %ecx
	movq	-310072(%rbp), %rax
	movl	-310096(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -310096(%rbp)
.L5:
	movl	-310100(%rbp), %eax
	cmpl	%eax, -310096(%rbp)
	jle	.L6
	movl	$1145141919, -310092(%rbp)
	movl	$1, -310088(%rbp)
	jmp	.L7
.L9:
	movl	-310088(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-310100(%rbp), %eax
	addl	%edx, %eax
	subl	-310088(%rbp), %eax
	movl	%eax, %ecx
	movl	-310100(%rbp), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movq	-310072(%rbp), %rax
	movl	-310088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	subl	%eax, %esi
	movl	%esi, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -310084(%rbp)
	movl	-310092(%rbp), %eax
	cmpl	-310084(%rbp), %eax
	jle	.L8
	movl	-310084(%rbp), %eax
	movl	%eax, -310092(%rbp)
.L8:
	addl	$1, -310088(%rbp)
.L7:
	movl	-310100(%rbp), %eax
	cmpl	%eax, -310088(%rbp)
	jle	.L9
	movl	-310092(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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
.LC2:
	.string	"%d"
.LC3:
	.string	" %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	leaq	-307200(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2832, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	leaq	.LC2(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-310036(%rbp), %rsi
	leaq	-310032(%rbp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-310036(%rbp), %esi
	movq	%rsp, %rcx
	leal	1(%rsi), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L21
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L22
.L4:
	leaq	3(%rsp), %rdi
	movq	%rdi, %rax
	andq	$-4, %rdi
	shrq	$2, %rax
	movl	$0, 0(,%rax,4)
	testl	%esi, %esi
	jle	.L12
	leal	-1(%rsi), %r9d
	movl	%esi, %r8d
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%ecx, %ecx
	cmpb	$87, (%rbx,%rax)
	sete	%cl
	addl	%ecx, %edx
	movl	%edx, 4(%rdi,%rax,4)
	addq	$1, %rax
	cmpq	%rax, %r8
	jne	.L6
	movslq	%esi, %rax
	movl	(%rdi,%rax,4), %ecx
	cmpl	$2, %r9d
	jbe	.L13
	movl	%esi, %edx
	movd	%esi, %xmm4
	movd	%ecx, %xmm5
	movq	%rdi, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm6
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC1(%rip), %xmm1
	salq	$4, %rdx
	movdqa	.LC4(%rip), %xmm4
	pshufd	$0, %xmm5, %xmm5
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rax), %xmm0
	movdqa	%xmm3, %xmm2
	addq	$16, %rax
	paddd	%xmm4, %xmm3
	movdqu	-12(%rax), %xmm7
	paddd	%xmm6, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm5, %xmm2
	psubd	%xmm7, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rdx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm2
	movl	%esi, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm0
	leal	1(%rax), %r8d
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%esi, %eax
	je	.L5
.L7:
	movslq	%r8d, %r10
	salq	$2, %r10
	movl	-4(%rdi,%r10), %ebx
	leaq	(%rdi,%r10), %r9
	movl	%ecx, %r10d
	movl	(%r9), %eax
	addl	%esi, %ebx
	movl	%ebx, %edi
	subl	%eax, %r10d
	subl	%r8d, %edi
	subl	%r10d, %edi
	cmpl	%edi, %edx
	cmovg	%edi, %edx
	leal	1(%r8), %edi
	cmpl	%edi, %esi
	jl	.L5
	addl	%esi, %eax
	movl	4(%r9), %r10d
	subl	%edi, %eax
	movl	%ecx, %edi
	subl	%r10d, %edi
	subl	%edi, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	addl	$2, %r8d
	cmpl	%r8d, %esi
	jl	.L5
	addl	%r10d, %esi
	subl	8(%r9), %ecx
	subl	%r8d, %esi
	subl	%ecx, %esi
	cmpl	%esi, %edx
	cmovg	%esi, %edx
.L5:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L23
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L22:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L12:
	movl	$1145141919, %edx
	jmp	.L5
.L13:
	movl	$1, %r8d
	movl	$1145141919, %edx
	jmp	.L7
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC1:
	.long	1145141919
	.long	1145141919
	.long	1145141919
	.long	1145141919
	.align 16
.LC4:
	.long	4
	.long	4
	.long	4
	.long	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
.LC3:
	.string	" %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	leaq	-307200(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2832, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	leaq	.LC2(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-310036(%rbp), %rsi
	leaq	-310032(%rbp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-310036(%rbp), %esi
	movq	%rsp, %rcx
	leal	1(%rsi), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L21
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L22
.L4:
	leaq	3(%rsp), %rdi
	movq	%rdi, %rax
	andq	$-4, %rdi
	shrq	$2, %rax
	movl	$0, 0(,%rax,4)
	testl	%esi, %esi
	jle	.L12
	leal	-1(%rsi), %r9d
	movl	%esi, %r8d
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%ecx, %ecx
	cmpb	$87, (%rbx,%rax)
	sete	%cl
	addl	%ecx, %edx
	movl	%edx, 4(%rdi,%rax,4)
	addq	$1, %rax
	cmpq	%rax, %r8
	jne	.L6
	movslq	%esi, %rax
	movl	(%rdi,%rax,4), %ecx
	cmpl	$2, %r9d
	jbe	.L13
	movl	%esi, %edx
	movd	%esi, %xmm4
	movd	%ecx, %xmm5
	movq	%rdi, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm6
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC1(%rip), %xmm1
	salq	$4, %rdx
	movdqa	.LC4(%rip), %xmm4
	pshufd	$0, %xmm5, %xmm5
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rax), %xmm0
	movdqa	%xmm3, %xmm2
	addq	$16, %rax
	paddd	%xmm4, %xmm3
	movdqu	-12(%rax), %xmm7
	paddd	%xmm6, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm5, %xmm2
	psubd	%xmm7, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rdx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm2
	movl	%esi, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm0
	leal	1(%rax), %r8d
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%esi, %eax
	je	.L5
.L7:
	movslq	%r8d, %r10
	salq	$2, %r10
	movl	-4(%rdi,%r10), %ebx
	leaq	(%rdi,%r10), %r9
	movl	%ecx, %r10d
	movl	(%r9), %eax
	addl	%esi, %ebx
	movl	%ebx, %edi
	subl	%eax, %r10d
	subl	%r8d, %edi
	subl	%r10d, %edi
	cmpl	%edi, %edx
	cmovg	%edi, %edx
	leal	1(%r8), %edi
	cmpl	%edi, %esi
	jl	.L5
	addl	%esi, %eax
	movl	4(%r9), %r10d
	subl	%edi, %eax
	movl	%ecx, %edi
	subl	%r10d, %edi
	subl	%edi, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	addl	$2, %r8d
	cmpl	%r8d, %esi
	jl	.L5
	addl	%r10d, %esi
	subl	8(%r9), %ecx
	subl	%r8d, %esi
	subl	%ecx, %esi
	cmpl	%esi, %edx
	cmovg	%esi, %edx
.L5:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L23
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L22:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L12:
	movl	$1145141919, %edx
	jmp	.L5
.L13:
	movl	$1, %r8d
	movl	$1145141919, %edx
	jmp	.L7
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC1:
	.long	1145141919
	.long	1145141919
	.long	1145141919
	.long	1145141919
	.align 16
.LC4:
	.long	4
	.long	4
	.long	4
	.long	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:

#include <stdio.h>




int main(void){
    int N;
    scanf("%d",&N);
    char po[310000];
    scanf(" %s",po);
    int A[N+1];
    A[0]=0;
    for(int i=1;i<=N;i++)A[i]=A[i-1]+(po[i-1]=='W'?1:0);
    int ans=1145141919;
    for(int i=1;i<=N;i++){
        int buri=A[i-1]+N-i-(A[N]-A[i]);
        if(ans>buri)ans=buri;
    }
    printf("%d",ans);
    return 0;
}

12
EWWWEEEWEWEW
 5
WWEEW
 12
WWWWEEEWEWEE
 8
WEWWWEWE
 8
EEEWWWWW
 5
EWEWW
 12
EWWEWEEEWWWE
 5
WWEWE
 12
WEWWEEWWEWEE
 5
WEWEW

5 2 6 3 0 1 4 2 6 2
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;
    scanf("%d",&N);
    char po[310000];
    scanf(" %s",po);
    int A[N+1];
    A[0]=0;
    for(int i=1;i<=N;i++)A[i]=A[i-1]+(po[i-1]=='W'?1:0);
    int ans=1145141919;
    for(int i=1;i<=N;i++){
        int buri=A[i-1]+N-i-(A[N]-A[i]);
        if(ans>buri)ans=buri;
    }
    printf("%d",ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %s"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-307200(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2872, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-310100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-310064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-310100(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -310080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -310072(%rbp)
	movq	-310072(%rbp), %rax
	movl	$0, (%rax)
	movl	$1, -310096(%rbp)
	jmp	.L5
.L6:
	movl	-310096(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-310096(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-310064(%rbp,%rax), %eax
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	leal	(%rdx,%rax), %ecx
	movq	-310072(%rbp), %rax
	movl	-310096(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -310096(%rbp)
.L5:
	movl	-310100(%rbp), %eax
	cmpl	%eax, -310096(%rbp)
	jle	.L6
	movl	$1145141919, -310092(%rbp)
	movl	$1, -310088(%rbp)
	jmp	.L7
.L9:
	movl	-310088(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-310100(%rbp), %eax
	addl	%edx, %eax
	subl	-310088(%rbp), %eax
	movl	%eax, %ecx
	movl	-310100(%rbp), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movq	-310072(%rbp), %rax
	movl	-310088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	subl	%eax, %esi
	movl	%esi, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -310084(%rbp)
	movl	-310092(%rbp), %eax
	cmpl	-310084(%rbp), %eax
	jle	.L8
	movl	-310084(%rbp), %eax
	movl	%eax, -310092(%rbp)
.L8:
	addl	$1, -310088(%rbp)
.L7:
	movl	-310100(%rbp), %eax
	cmpl	%eax, -310088(%rbp)
	jle	.L9
	movl	-310092(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	" %s"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-307200(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2872, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-310100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-310064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-310100(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -310080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -310072(%rbp)
	movq	-310072(%rbp), %rax
	movl	$0, (%rax)
	movl	$1, -310096(%rbp)
	jmp	.L5
.L6:
	movl	-310096(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-310096(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-310064(%rbp,%rax), %eax
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	leal	(%rdx,%rax), %ecx
	movq	-310072(%rbp), %rax
	movl	-310096(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -310096(%rbp)
.L5:
	movl	-310100(%rbp), %eax
	cmpl	%eax, -310096(%rbp)
	jle	.L6
	movl	$1145141919, -310092(%rbp)
	movl	$1, -310088(%rbp)
	jmp	.L7
.L9:
	movl	-310088(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-310100(%rbp), %eax
	addl	%edx, %eax
	subl	-310088(%rbp), %eax
	movl	%eax, %ecx
	movl	-310100(%rbp), %edx
	movq	-310072(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movq	-310072(%rbp), %rax
	movl	-310088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	subl	%eax, %esi
	movl	%esi, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -310084(%rbp)
	movl	-310092(%rbp), %eax
	cmpl	-310084(%rbp), %eax
	jle	.L8
	movl	-310084(%rbp), %eax
	movl	%eax, -310092(%rbp)
.L8:
	addl	$1, -310088(%rbp)
.L7:
	movl	-310100(%rbp), %eax
	cmpl	%eax, -310088(%rbp)
	jle	.L9
	movl	-310092(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
