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 s[n+1];
  scanf("%s", s);
  int west[n];
  west[0] = 0;
  for (int i = 0; i < n-1; i++) {
    west[i+1] = west[i];
    if (s[i] == 'W') {
      west[i+1]++;
    }
  }
  int east[n];
  east[n-1] = 0;
  for (int i = n-1; i > 0; i--) {
    east[i-1] = east[i];
    if (s[i] == 'E') {
      east[i-1]++;
    }
  }
  int min = west[0]+east[0];
  for (int i = 1; i < n; i++) {
    if (west[i]+east[i] < min) {
      min = west[i]+east[i];
    }
  }
  printf("%d\n", min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$152, %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	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movl	$16, %edx
	subq	$1, %rdx
	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	$0, %rax
	movq	%rax, -96(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	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
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -120(%rbp)
	jmp	.L8
.L10:
	movl	-120(%rbp), %eax
	leal	1(%rax), %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-96(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L9
	movl	-120(%rbp), %eax
	addl	$1, %eax
	movq	-80(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-80(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L9:
	addl	$1, -120(%rbp)
.L8:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jl	.L10
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -116(%rbp)
	jmp	.L14
.L16:
	movl	-116(%rbp), %eax
	leal	-1(%rax), %esi
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$69, %al
	jne	.L15
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movq	-64(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-64(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L15:
	subl	$1, -116(%rbp)
.L14:
	cmpl	$0, -116(%rbp)
	jg	.L16
	movq	-80(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -112(%rbp)
	movl	$1, -108(%rbp)
	jmp	.L17
.L19:
	movq	-80(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%ecx, %eax
	cmpl	%eax, -112(%rbp)
	jle	.L18
	movq	-80(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%ecx, %eax
	movl	%eax, -112(%rbp)
.L18:
	addl	$1, -108(%rbp)
.L17:
	movl	-124(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L19
	movl	-112(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%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	.L21
	call	__stack_chk_fail@PLT
.L21:
	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
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L47:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L47
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L48
.L4:
	leaq	.LC1(%rip), %rdi
	movq	%rsp, %rsi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movslq	-28(%rbp), %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %r9
	movq	%rax, %rdi
	movq	%r9, %rcx
	movq	%r9, %rax
	andq	$-4096, %rcx
	andq	$-16, %rax
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L48:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L49
.L7:
	leaq	3(%rsp), %rcx
	leal	-1(%rdi), %r8d
	movq	%rcx, %rax
	andq	$-4, %rcx
	shrq	$2, %rax
	movl	$0, 0(,%rax,4)
	testl	%r8d, %r8d
	jle	.L8
	leal	-2(%rdi), %esi
	movl	$1, %eax
	xorl	%edx, %edx
	addq	$2, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$87, -1(%rbx,%rax)
	movl	%edx, (%rcx,%rax,4)
	jne	.L9
	addl	$1, %edx
	movl	%edx, (%rcx,%rax,4)
.L9:
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L10
	movq	%r9, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r9
	andq	$-16, %rax
	subq	%r9, %rdx
.L19:
	cmpq	%rdx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	movq	%rsp, %rsi
	movslq	%r8d, %rax
	xorl	%edx, %edx
	movl	$0, (%rsi,%rax,4)
	movq	%rsi, %r9
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	$69, (%rbx,%rax)
	movl	%edx, -4(%rsi,%rax,4)
	jne	.L12
	addl	$1, %edx
	movl	%edx, -4(%rsi,%rax,4)
.L12:
	subq	$1, %rax
	testl	%eax, %eax
	jg	.L13
.L25:
	movl	(%r9), %edx
	cmpl	$1, %edi
	jle	.L14
	leal	-2(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L27
	movl	%r8d, %eax
	movd	%edx, %xmm4
	shrl	$2, %eax
	pshufd	$0, %xmm4, %xmm0
	leal	-1(%rax), %edx
	movl	$4, %eax
	salq	$4, %rdx
	addq	$20, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%rcx,%rax), %xmm2
	movdqu	(%r9,%rax), %xmm3
	addq	$16, %rax
	paddd	%xmm3, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L16
	movdqa	%xmm0, %xmm2
	movl	%r8d, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm1
	leal	1(%rax), %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	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	%eax, %r8d
	je	.L14
.L15:
	movslq	%esi, %rax
	salq	$2, %rax
	addq	%rax, %rcx
	addq	%r9, %rax
	movl	(%rcx), %r8d
	addl	(%rax), %r8d
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	leal	1(%rsi), %r8d
	cmpl	%edi, %r8d
	jge	.L14
	movl	4(%rax), %r8d
	addl	4(%rcx), %r8d
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	addl	$2, %esi
	cmpl	%esi, %edi
	jle	.L14
	movl	8(%rax), %eax
	addl	8(%rcx), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L14:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L50
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L8:
	.cfi_restore_state
	movq	%r9, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r9
	andq	$-16, %rax
	subq	%r9, %rdx
.L22:
	cmpq	%rdx, %rsp
	je	.L23
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L22
.L27:
	movl	$1, %esi
	jmp	.L15
.L49:
	orq	$0, -8(%rsp,%rax)
	jmp	.L7
.L23:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L24
	orq	$0, -8(%rsp,%rax)
.L24:
	movq	%rsp, %r9
	movslq	%r8d, %rax
	movl	$0, (%r9,%rax,4)
	jmp	.L25
.L50:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L47:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L47
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L48
.L4:
	leaq	.LC1(%rip), %rdi
	movq	%rsp, %rsi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movslq	-28(%rbp), %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %r9
	movq	%rax, %rdi
	movq	%r9, %rcx
	movq	%r9, %rax
	andq	$-4096, %rcx
	andq	$-16, %rax
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L48:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L49
.L7:
	leaq	3(%rsp), %rcx
	leal	-1(%rdi), %r8d
	movq	%rcx, %rax
	andq	$-4, %rcx
	shrq	$2, %rax
	movl	$0, 0(,%rax,4)
	testl	%r8d, %r8d
	jle	.L8
	leal	-2(%rdi), %esi
	movl	$1, %eax
	xorl	%edx, %edx
	addq	$2, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$87, -1(%rbx,%rax)
	movl	%edx, (%rcx,%rax,4)
	jne	.L9
	addl	$1, %edx
	movl	%edx, (%rcx,%rax,4)
.L9:
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L10
	movq	%r9, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r9
	andq	$-16, %rax
	subq	%r9, %rdx
.L19:
	cmpq	%rdx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	movq	%rsp, %rsi
	movslq	%r8d, %rax
	xorl	%edx, %edx
	movl	$0, (%rsi,%rax,4)
	movq	%rsi, %r9
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	$69, (%rbx,%rax)
	movl	%edx, -4(%rsi,%rax,4)
	jne	.L12
	addl	$1, %edx
	movl	%edx, -4(%rsi,%rax,4)
.L12:
	subq	$1, %rax
	testl	%eax, %eax
	jg	.L13
.L25:
	movl	(%r9), %edx
	cmpl	$1, %edi
	jle	.L14
	leal	-2(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L27
	movl	%r8d, %eax
	movd	%edx, %xmm4
	shrl	$2, %eax
	pshufd	$0, %xmm4, %xmm0
	leal	-1(%rax), %edx
	movl	$4, %eax
	salq	$4, %rdx
	addq	$20, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%rcx,%rax), %xmm2
	movdqu	(%r9,%rax), %xmm3
	addq	$16, %rax
	paddd	%xmm3, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L16
	movdqa	%xmm0, %xmm2
	movl	%r8d, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm1
	leal	1(%rax), %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	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	%eax, %r8d
	je	.L14
.L15:
	movslq	%esi, %rax
	salq	$2, %rax
	addq	%rax, %rcx
	addq	%r9, %rax
	movl	(%rcx), %r8d
	addl	(%rax), %r8d
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	leal	1(%rsi), %r8d
	cmpl	%edi, %r8d
	jge	.L14
	movl	4(%rax), %r8d
	addl	4(%rcx), %r8d
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	addl	$2, %esi
	cmpl	%esi, %edi
	jle	.L14
	movl	8(%rax), %eax
	addl	8(%rcx), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L14:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L50
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L8:
	.cfi_restore_state
	movq	%r9, %rax
	movq	%rsp, %rdx
	andq	$-4096, %r9
	andq	$-16, %rax
	subq	%r9, %rdx
.L22:
	cmpq	%rdx, %rsp
	je	.L23
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L22
.L27:
	movl	$1, %esi
	jmp	.L15
.L49:
	orq	$0, -8(%rsp,%rax)
	jmp	.L7
.L23:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L24
	orq	$0, -8(%rsp,%rax)
.L24:
	movq	%rsp, %r9
	movslq	%r8d, %rax
	movl	$0, (%r9,%rax,4)
	jmp	.L25
.L50:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>

int main(void) {

  int n;
  scanf("%d", &n);
  char s[n+1];
  scanf("%s", s);
  int west[n];
  west[0] = 0;
  for (int i = 0; i < n-1; i++) {
    west[i+1] = west[i];
    if (s[i] == 'W') {
      west[i+1]++;
    }
  }
  int east[n];
  east[n-1] = 0;
  for (int i = n-1; i > 0; i--) {
    east[i-1] = east[i];
    if (s[i] == 'E') {
      east[i-1]++;
    }
  }
  int min = west[0]+east[0];
  for (int i = 1; i < n; i++) {
    if (west[i]+east[i] < min) {
      min = west[i]+east[i];
    }
  }
  printf("%d\n", min);

  return 0;
}
5
WEEWW

1

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 s[n+1];
  scanf("%s", s);
  int west[n];
  west[0] = 0;
  for (int i = 0; i < n-1; i++) {
    west[i+1] = west[i];
    if (s[i] == 'W') {
      west[i+1]++;
    }
  }
  int east[n];
  east[n-1] = 0;
  for (int i = n-1; i > 0; i--) {
    east[i-1] = east[i];
    if (s[i] == 'E') {
      east[i-1]++;
    }
  }
  int min = west[0]+east[0];
  for (int i = 1; i < n; i++) {
    if (west[i]+east[i] < min) {
      min = west[i]+east[i];
    }
  }
  printf("%d\n", min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$152, %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	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movl	$16, %edx
	subq	$1, %rdx
	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	$0, %rax
	movq	%rax, -96(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	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
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -120(%rbp)
	jmp	.L8
.L10:
	movl	-120(%rbp), %eax
	leal	1(%rax), %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-96(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L9
	movl	-120(%rbp), %eax
	addl	$1, %eax
	movq	-80(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-80(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L9:
	addl	$1, -120(%rbp)
.L8:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jl	.L10
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -116(%rbp)
	jmp	.L14
.L16:
	movl	-116(%rbp), %eax
	leal	-1(%rax), %esi
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$69, %al
	jne	.L15
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movq	-64(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-64(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L15:
	subl	$1, -116(%rbp)
.L14:
	cmpl	$0, -116(%rbp)
	jg	.L16
	movq	-80(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -112(%rbp)
	movl	$1, -108(%rbp)
	jmp	.L17
.L19:
	movq	-80(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%ecx, %eax
	cmpl	%eax, -112(%rbp)
	jle	.L18
	movq	-80(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%ecx, %eax
	movl	%eax, -112(%rbp)
.L18:
	addl	$1, -108(%rbp)
.L17:
	movl	-124(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L19
	movl	-112(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%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	.L21
	call	__stack_chk_fail@PLT
.L21:
	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"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$152, %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	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movl	$16, %edx
	subq	$1, %rdx
	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	$0, %rax
	movq	%rax, -96(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	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
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -120(%rbp)
	jmp	.L8
.L10:
	movl	-120(%rbp), %eax
	leal	1(%rax), %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-96(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L9
	movl	-120(%rbp), %eax
	addl	$1, %eax
	movq	-80(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-80(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L9:
	addl	$1, -120(%rbp)
.L8:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jl	.L10
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -116(%rbp)
	jmp	.L14
.L16:
	movl	-116(%rbp), %eax
	leal	-1(%rax), %esi
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$69, %al
	jne	.L15
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movq	-64(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-64(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L15:
	subl	$1, -116(%rbp)
.L14:
	cmpl	$0, -116(%rbp)
	jg	.L16
	movq	-80(%rbp), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -112(%rbp)
	movl	$1, -108(%rbp)
	jmp	.L17
.L19:
	movq	-80(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%ecx, %eax
	cmpl	%eax, -112(%rbp)
	jle	.L18
	movq	-80(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%ecx, %eax
	movl	%eax, -112(%rbp)
.L18:
	addl	$1, -108(%rbp)
.L17:
	movl	-124(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L19
	movl	-112(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%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	.L21
	call	__stack_chk_fail@PLT
.L21:
	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:
