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

```c
#include<stdio.h>
int i,N[7],T,F,R,t;
char S[105];
int main()
{
	for(i=1;i<=6;i++)scanf("%d",N+i);
	gets(S);
	gets(S);
	for(T=1,F=2,R=3,i=0;S[i];i++)
	{
		switch(S[i])
		{
		case 'N':t=T,T=F,F=7-t;break;
		case 'E':t=R,R=T,T=7-t;break;
		case 'S':t=F,F=T,T=7-t;break;
		case 'W':t=T,T=R,R=7-t;break;
		}
	}
	printf("%d\n",N[T]);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	N(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	$1, i(%rip)
	.p2align 4,,10
	.p2align 3
.L2:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	$6, %eax
	jle	.L2
	leaq	S(%rip), %r12
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	gets@PLT
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	gets@PLT
	movzbl	S(%rip), %eax
	movl	$1, T(%rip)
	movl	$2, F(%rip)
	movl	$3, R(%rip)
	movl	$0, i(%rip)
	testb	%al, %al
	je	.L4
	movl	$1, %edx
	xorl	%r12d, %r12d
	movl	$3, %esi
	xorl	%r13d, %r13d
	movl	$2, %edi
	xorl	%r10d, %r10d
	movl	$1, %ecx
	movl	$7, %r11d
	leaq	-1+S(%rip), %r9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L29:
	cmpb	$78, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
.L9:
	movl	%edx, %r8d
	addq	$1, %rdx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	je	.L28
.L3:
	cmpb	$83, %al
	je	.L5
	jg	.L6
	cmpb	$69, %al
	jne	.L29
	movl	%r11d, %eax
	movl	%edx, %r8d
	addq	$1, %rdx
	movl	%esi, %ebp
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	$1, %r12d
	movl	$1, %r10d
	movl	%eax, %ecx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r8d, i(%rip)
	testb	%r12b, %r12b
	je	.L11
	movl	%esi, R(%rip)
.L11:
	testb	%r13b, %r13b
	je	.L12
	movl	%edi, F(%rip)
.L12:
	testb	%r10b, %r10b
	je	.L4
	movl	%ebp, t(%rip)
	movl	%ecx, T(%rip)
.L4:
	movslq	T(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	(%rbx,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpb	$87, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r12d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%esi, %ecx
	movl	%eax, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r11d, %eax
	movl	%edi, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%edi, %eax
	movl	%ecx, %edi
	movl	%eax, %ecx
	jmp	.L9
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	F
	.align 4
	.type	F, @object
	.size	F, 4
F:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	N
	.align 16
	.type	N, @object
	.size	N, 28
N:
	.zero	28
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	N(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	$1, i(%rip)
	.p2align 4,,10
	.p2align 3
.L2:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	$6, %eax
	jle	.L2
	leaq	S(%rip), %r12
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	gets@PLT
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	gets@PLT
	movzbl	S(%rip), %eax
	movl	$1, T(%rip)
	movl	$2, F(%rip)
	movl	$3, R(%rip)
	movl	$0, i(%rip)
	testb	%al, %al
	je	.L4
	movl	$1, %edx
	xorl	%r12d, %r12d
	movl	$3, %esi
	xorl	%r13d, %r13d
	movl	$2, %edi
	xorl	%r10d, %r10d
	movl	$1, %ecx
	movl	$7, %r11d
	leaq	-1+S(%rip), %r9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L29:
	cmpb	$78, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
.L9:
	movl	%edx, %r8d
	addq	$1, %rdx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	je	.L28
.L3:
	cmpb	$83, %al
	je	.L5
	jg	.L6
	cmpb	$69, %al
	jne	.L29
	movl	%r11d, %eax
	movl	%edx, %r8d
	addq	$1, %rdx
	movl	%esi, %ebp
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	$1, %r12d
	movl	$1, %r10d
	movl	%eax, %ecx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r8d, i(%rip)
	testb	%r12b, %r12b
	je	.L11
	movl	%esi, R(%rip)
.L11:
	testb	%r13b, %r13b
	je	.L12
	movl	%edi, F(%rip)
.L12:
	testb	%r10b, %r10b
	je	.L4
	movl	%ebp, t(%rip)
	movl	%ecx, T(%rip)
.L4:
	movslq	T(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	(%rbx,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpb	$87, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r12d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%esi, %ecx
	movl	%eax, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r11d, %eax
	movl	%edi, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%edi, %eax
	movl	%ecx, %edi
	movl	%eax, %ecx
	jmp	.L9
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	F
	.align 4
	.type	F, @object
	.size	F, 4
F:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	N
	.align 16
	.type	N, @object
	.size	N, 28
N:
	.zero	28
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	N(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	$1, i(%rip)
	.p2align 4,,10
	.p2align 3
.L2:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	$6, %eax
	jle	.L2
	leaq	S(%rip), %r12
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	gets@PLT
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	gets@PLT
	movzbl	S(%rip), %eax
	movl	$1, T(%rip)
	movl	$2, F(%rip)
	movl	$3, R(%rip)
	movl	$0, i(%rip)
	testb	%al, %al
	je	.L4
	movl	$1, %edx
	xorl	%r12d, %r12d
	movl	$3, %esi
	xorl	%r13d, %r13d
	movl	$2, %edi
	xorl	%r10d, %r10d
	movl	$1, %ecx
	movl	$7, %r11d
	leaq	-1+S(%rip), %r9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L29:
	cmpb	$78, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
.L9:
	movl	%edx, %r8d
	addq	$1, %rdx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	je	.L28
.L3:
	cmpb	$83, %al
	je	.L5
	jg	.L6
	cmpb	$69, %al
	jne	.L29
	movl	%r11d, %eax
	movl	%edx, %r8d
	addq	$1, %rdx
	movl	%esi, %ebp
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	$1, %r12d
	movl	$1, %r10d
	movl	%eax, %ecx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r8d, i(%rip)
	testb	%r12b, %r12b
	je	.L11
	movl	%esi, R(%rip)
.L11:
	testb	%r13b, %r13b
	je	.L12
	movl	%edi, F(%rip)
.L12:
	testb	%r10b, %r10b
	je	.L4
	movl	%ebp, t(%rip)
	movl	%ecx, T(%rip)
.L4:
	movslq	T(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	(%rbx,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpb	$87, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r12d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%esi, %ecx
	movl	%eax, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r11d, %eax
	movl	%edi, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%edi, %eax
	movl	%ecx, %edi
	movl	%eax, %ecx
	jmp	.L9
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	F
	.align 4
	.type	F, @object
	.size	F, 4
F:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	N
	.align 16
	.type	N, @object
	.size	N, 28
N:
	.zero	28
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```
```c
#include<stdio.h>
int i,N[7],T,F,R,t;
char S[105];
int main()
{
	for(i=1;i<=6;i++)scanf("%d",N+i);
	gets(S);
	gets(S);
	for(T=1,F=2,R=3,i=0;S[i];i++)
	{
		switch(S[i])
		{
		case 'N':t=T,T=F,F=7-t;break;
		case 'E':t=R,R=T,T=7-t;break;
		case 'S':t=F,F=T,T=7-t;break;
		case 'W':t=T,T=R,R=7-t;break;
		}
	}
	printf("%d\n",N[T]);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int i,N[7],T,F,R,t;
char S[105];
int main()
{
	for(i=1;i<=6;i++)scanf("%d",N+i);
	gets(S);
	gets(S);
	for(T=1,F=2,R=3,i=0;S[i];i++)
	{
		switch(S[i])
		{
		case 'N':t=T,T=F,F=7-t;break;
		case 'E':t=R,R=T,T=7-t;break;
		case 'S':t=F,F=T,T=7-t;break;
		case 'W':t=T,T=R,R=7-t;break;
		}
	}
	printf("%d\n",N[T]);
	return 0;
}```

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.
Optimized Assembly Code:

0 2 4 8 16 32
EESWN
 1 2 4 6 16 32
SE
 0 2 4 8 16 30
EESWN
 1 2 4 0 16 32
SE
 1 2 4 -1 16 32
SE
 0 2 0 8 16 23
EESWN
 1 2 4 8 16 32
ES
 1 2 4 8 27 32
ES
 0 4 4 8 16 5
EESWN
 1 4 4 -1 24 32
ES

32
 6
 30
 0
 -1
 23
 16
 27
 5
 24

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

```c
#include<stdio.h>
int i,N[7],T,F,R,t;
char S[105];
int main()
{
	for(i=1;i<=6;i++)scanf("%d",N+i);
	gets(S);
	gets(S);
	for(T=1,F=2,R=3,i=0;S[i];i++)
	{
		switch(S[i])
		{
		case 'N':t=T,T=F,F=7-t;break;
		case 'E':t=R,R=T,T=7-t;break;
		case 'S':t=F,F=T,T=7-t;break;
		case 'W':t=T,T=R,R=7-t;break;
		}
	}
	printf("%d\n",N[T]);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	N(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	$1, i(%rip)
	.p2align 4,,10
	.p2align 3
.L2:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	$6, %eax
	jle	.L2
	leaq	S(%rip), %r12
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	gets@PLT
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	gets@PLT
	movzbl	S(%rip), %eax
	movl	$1, T(%rip)
	movl	$2, F(%rip)
	movl	$3, R(%rip)
	movl	$0, i(%rip)
	testb	%al, %al
	je	.L4
	movl	$1, %edx
	xorl	%r12d, %r12d
	movl	$3, %esi
	xorl	%r13d, %r13d
	movl	$2, %edi
	xorl	%r10d, %r10d
	movl	$1, %ecx
	movl	$7, %r11d
	leaq	-1+S(%rip), %r9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L29:
	cmpb	$78, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
.L9:
	movl	%edx, %r8d
	addq	$1, %rdx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	je	.L28
.L3:
	cmpb	$83, %al
	je	.L5
	jg	.L6
	cmpb	$69, %al
	jne	.L29
	movl	%r11d, %eax
	movl	%edx, %r8d
	addq	$1, %rdx
	movl	%esi, %ebp
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	$1, %r12d
	movl	$1, %r10d
	movl	%eax, %ecx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r8d, i(%rip)
	testb	%r12b, %r12b
	je	.L11
	movl	%esi, R(%rip)
.L11:
	testb	%r13b, %r13b
	je	.L12
	movl	%edi, F(%rip)
.L12:
	testb	%r10b, %r10b
	je	.L4
	movl	%ebp, t(%rip)
	movl	%ecx, T(%rip)
.L4:
	movslq	T(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	(%rbx,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpb	$87, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r12d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%esi, %ecx
	movl	%eax, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r11d, %eax
	movl	%edi, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%edi, %eax
	movl	%ecx, %edi
	movl	%eax, %ecx
	jmp	.L9
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	F
	.align 4
	.type	F, @object
	.size	F, 4
F:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	N
	.align 16
	.type	N, @object
	.size	N, 28
N:
	.zero	28
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	N(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	$1, i(%rip)
	.p2align 4,,10
	.p2align 3
.L2:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	$6, %eax
	jle	.L2
	leaq	S(%rip), %r12
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	gets@PLT
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	gets@PLT
	movzbl	S(%rip), %eax
	movl	$1, T(%rip)
	movl	$2, F(%rip)
	movl	$3, R(%rip)
	movl	$0, i(%rip)
	testb	%al, %al
	je	.L4
	movl	$1, %edx
	xorl	%r12d, %r12d
	movl	$3, %esi
	xorl	%r13d, %r13d
	movl	$2, %edi
	xorl	%r10d, %r10d
	movl	$1, %ecx
	movl	$7, %r11d
	leaq	-1+S(%rip), %r9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L29:
	cmpb	$78, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
.L9:
	movl	%edx, %r8d
	addq	$1, %rdx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	je	.L28
.L3:
	cmpb	$83, %al
	je	.L5
	jg	.L6
	cmpb	$69, %al
	jne	.L29
	movl	%r11d, %eax
	movl	%edx, %r8d
	addq	$1, %rdx
	movl	%esi, %ebp
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	$1, %r12d
	movl	$1, %r10d
	movl	%eax, %ecx
	movzbl	(%r9,%rdx), %eax
	testb	%al, %al
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r8d, i(%rip)
	testb	%r12b, %r12b
	je	.L11
	movl	%esi, R(%rip)
.L11:
	testb	%r13b, %r13b
	je	.L12
	movl	%edi, F(%rip)
.L12:
	testb	%r10b, %r10b
	je	.L4
	movl	%ebp, t(%rip)
	movl	%ecx, T(%rip)
.L4:
	movslq	T(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	(%rbx,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpb	$87, %al
	jne	.L9
	movl	%r11d, %eax
	movl	%ecx, %ebp
	movl	$1, %r12d
	movl	$1, %r10d
	subl	%ecx, %eax
	movl	%esi, %ecx
	movl	%eax, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r11d, %eax
	movl	%edi, %ebp
	movl	$1, %r13d
	movl	$1, %r10d
	subl	%edi, %eax
	movl	%ecx, %edi
	movl	%eax, %ecx
	jmp	.L9
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 105
S:
	.zero	105
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	F
	.align 4
	.type	F, @object
	.size	F, 4
F:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	N
	.align 16
	.type	N, @object
	.size	N, 28
N:
	.zero	28
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```