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 main(void){
    // Your code here!
    int i,d[6],b;
    char a[101];
    
    for(i=0;i<6;i++){
        scanf("%d", &d[i]);
    }
    
    scanf("%s",a);
    
    for(i=0;a[i]!='\0';i++){

            if(a[i]=='S'){
                b=d[0];
                d[0]=d[4];
                d[4]=d[5];
                d[5]=d[1];
                d[1]=b;
            }
            if(a[i]=='E'){
                b=d[0];
                d[0]=d[3];
                d[3]=d[5];
                d[5]=d[2];
                d[2]=b;
            }
            if(a[i]=='W'){
                b=d[0];
                d[0]=d[2];
                d[2]=d[5];
                d[5]=d[3];
                d[3]=b;
            }
            if(a[i]=='N'){
                b=d[0];
                d[0]=d[1];
                d[1]=d[5];
                d[5]=d[4];
                d[4]=b;
            }
    }
    printf("%d\n", d[0]);
    
    return 0;
}

```

Assembly Code:

```assembly
	.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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %eax
	movl	(%rsp), %r12d
	testb	%al, %al
	je	.L4
	movl	12(%rsp), %edi
	movl	20(%rsp), %ecx
	movl	%r12d, %esi
	leaq	33(%rsp), %rdx
	movl	8(%rsp), %r8d
	movl	16(%rsp), %r11d
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movl	4(%rsp), %r10d
	xorl	%r9d, %r9d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L33:
	cmpb	$69, %al
	je	.L17
	cmpb	$87, %al
	jne	.L31
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%r8d, %esi
	movl	$1, %r9d
	movl	%ecx, %r8d
	movl	%edi, %ecx
	movl	%eax, %edi
.L5:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L32
.L6:
	cmpb	$83, %al
	jne	.L33
	movl	%esi, %eax
	addq	$1, %rdx
	movl	%r11d, %esi
	movl	%ecx, %r11d
	movl	%r10d, %ecx
	movl	%eax, %r10d
	movzbl	-1(%rdx), %eax
	movl	$1, %ebp
	movl	$1, %r9d
	testb	%al, %al
	jne	.L6
.L32:
	testb	%bl, %bl
	je	.L7
	movl	%r8d, 8(%rsp)
	movl	%edi, 12(%rsp)
.L7:
	testb	%bpl, %bpl
	je	.L8
	movl	%r10d, 4(%rsp)
	testb	%r9b, %r9b
	je	.L9
	movl	%ecx, 20(%rsp)
	movl	%r11d, 16(%rsp)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$78, %al
	jne	.L5
	movl	%esi, %eax
	movl	$1, %ebp
	movl	%r10d, %esi
	movl	$1, %r9d
	movl	%ecx, %r10d
	movl	%r11d, %ecx
	movl	%eax, %r11d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%edi, %esi
	movl	$1, %r9d
	movl	%ecx, %edi
	movl	%r8d, %ecx
	movl	%eax, %r8d
	jmp	.L5
.L9:
	movl	%r11d, 16(%rsp)
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$144, %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
.L8:
	.cfi_restore_state
	testb	%r9b, %r9b
	je	.L4
	movl	%ecx, 20(%rsp)
.L12:
	movl	%esi, (%rsp)
	movl	%esi, %r12d
	jmp	.L4
.L34:
	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:
```

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	"%s"
.LC2:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %eax
	movl	(%rsp), %r12d
	testb	%al, %al
	je	.L4
	movl	12(%rsp), %edi
	movl	20(%rsp), %ecx
	movl	%r12d, %esi
	leaq	33(%rsp), %rdx
	movl	8(%rsp), %r8d
	movl	16(%rsp), %r11d
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movl	4(%rsp), %r10d
	xorl	%r9d, %r9d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L33:
	cmpb	$69, %al
	je	.L17
	cmpb	$87, %al
	jne	.L31
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%r8d, %esi
	movl	$1, %r9d
	movl	%ecx, %r8d
	movl	%edi, %ecx
	movl	%eax, %edi
.L5:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L32
.L6:
	cmpb	$83, %al
	jne	.L33
	movl	%esi, %eax
	addq	$1, %rdx
	movl	%r11d, %esi
	movl	%ecx, %r11d
	movl	%r10d, %ecx
	movl	%eax, %r10d
	movzbl	-1(%rdx), %eax
	movl	$1, %ebp
	movl	$1, %r9d
	testb	%al, %al
	jne	.L6
.L32:
	testb	%bl, %bl
	je	.L7
	movl	%r8d, 8(%rsp)
	movl	%edi, 12(%rsp)
.L7:
	testb	%bpl, %bpl
	je	.L8
	movl	%r10d, 4(%rsp)
	testb	%r9b, %r9b
	je	.L9
	movl	%ecx, 20(%rsp)
	movl	%r11d, 16(%rsp)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$78, %al
	jne	.L5
	movl	%esi, %eax
	movl	$1, %ebp
	movl	%r10d, %esi
	movl	$1, %r9d
	movl	%ecx, %r10d
	movl	%r11d, %ecx
	movl	%eax, %r11d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%edi, %esi
	movl	$1, %r9d
	movl	%ecx, %edi
	movl	%r8d, %ecx
	movl	%eax, %r8d
	jmp	.L5
.L9:
	movl	%r11d, 16(%rsp)
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$144, %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
.L8:
	.cfi_restore_state
	testb	%r9b, %r9b
	je	.L4
	movl	%ecx, 20(%rsp)
.L12:
	movl	%esi, (%rsp)
	movl	%esi, %r12d
	jmp	.L4
.L34:
	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
```assembly
	.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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %eax
	movl	(%rsp), %r12d
	testb	%al, %al
	je	.L4
	movl	12(%rsp), %edi
	movl	20(%rsp), %ecx
	movl	%r12d, %esi
	leaq	33(%rsp), %rdx
	movl	8(%rsp), %r8d
	movl	16(%rsp), %r11d
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movl	4(%rsp), %r10d
	xorl	%r9d, %r9d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L33:
	cmpb	$69, %al
	je	.L17
	cmpb	$87, %al
	jne	.L31
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%r8d, %esi
	movl	$1, %r9d
	movl	%ecx, %r8d
	movl	%edi, %ecx
	movl	%eax, %edi
.L5:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L32
.L6:
	cmpb	$83, %al
	jne	.L33
	movl	%esi, %eax
	addq	$1, %rdx
	movl	%r11d, %esi
	movl	%ecx, %r11d
	movl	%r10d, %ecx
	movl	%eax, %r10d
	movzbl	-1(%rdx), %eax
	movl	$1, %ebp
	movl	$1, %r9d
	testb	%al, %al
	jne	.L6
.L32:
	testb	%bl, %bl
	je	.L7
	movl	%r8d, 8(%rsp)
	movl	%edi, 12(%rsp)
.L7:
	testb	%bpl, %bpl
	je	.L8
	movl	%r10d, 4(%rsp)
	testb	%r9b, %r9b
	je	.L9
	movl	%ecx, 20(%rsp)
	movl	%r11d, 16(%rsp)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$78, %al
	jne	.L5
	movl	%esi, %eax
	movl	$1, %ebp
	movl	%r10d, %esi
	movl	$1, %r9d
	movl	%ecx, %r10d
	movl	%r11d, %ecx
	movl	%eax, %r11d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%edi, %esi
	movl	$1, %r9d
	movl	%ecx, %edi
	movl	%r8d, %ecx
	movl	%eax, %r8d
	jmp	.L5
.L9:
	movl	%r11d, 16(%rsp)
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$144, %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
.L8:
	.cfi_restore_state
	testb	%r9b, %r9b
	je	.L4
	movl	%ecx, 20(%rsp)
.L12:
	movl	%esi, (%rsp)
	movl	%esi, %r12d
	jmp	.L4
.L34:
	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:
```
```c
#include <stdio.h>
int main(void){
    // Your code here!
    int i,d[6],b;
    char a[101];
    
    for(i=0;i<6;i++){
        scanf("%d", &d[i]);
    }
    
    scanf("%s",a);
    
    for(i=0;a[i]!='\0';i++){

            if(a[i]=='S'){
                b=d[0];
                d[0]=d[4];
                d[4]=d[5];
                d[5]=d[1];
                d[1]=b;
            }
            if(a[i]=='E'){
                b=d[0];
                d[0]=d[3];
                d[3]=d[5];
                d[5]=d[2];
                d[2]=b;
            }
            if(a[i]=='W'){
                b=d[0];
                d[0]=d[2];
                d[2]=d[5];
                d[5]=d[3];
                d[3]=b;
            }
            if(a[i]=='N'){
                b=d[0];
                d[0]=d[1];
                d[1]=d[5];
                d[5]=d[4];
                d[4]=b;
            }
    }
    printf("%d\n", d[0]);
    
    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 main(void){
    // Your code here!
    int i,d[6],b;
    char a[101];
    
    for(i=0;i<6;i++){
        scanf("%d", &d[i]);
    }
    
    scanf("%s",a);
    
    for(i=0;a[i]!='\0';i++){

            if(a[i]=='S'){
                b=d[0];
                d[0]=d[4];
                d[4]=d[5];
                d[5]=d[1];
                d[1]=b;
            }
            if(a[i]=='E'){
                b=d[0];
                d[0]=d[3];
                d[3]=d[5];
                d[5]=d[2];
                d[2]=b;
            }
            if(a[i]=='W'){
                b=d[0];
                d[0]=d[2];
                d[2]=d[5];
                d[5]=d[3];
                d[3]=b;
            }
            if(a[i]=='N'){
                b=d[0];
                d[0]=d[1];
                d[1]=d[5];
                d[5]=d[4];
                d[4]=b;
            }
    }
    printf("%d\n", d[0]);
    
    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 main(void){
    // Your code here!
    int i,d[6],b;
    char a[101];
    
    for(i=0;i<6;i++){
        scanf("%d", &d[i]);
    }
    
    scanf("%s",a);
    
    for(i=0;a[i]!='\0';i++){

            if(a[i]=='S'){
                b=d[0];
                d[0]=d[4];
                d[4]=d[5];
                d[5]=d[1];
                d[1]=b;
            }
            if(a[i]=='E'){
                b=d[0];
                d[0]=d[3];
                d[3]=d[5];
                d[5]=d[2];
                d[2]=b;
            }
            if(a[i]=='W'){
                b=d[0];
                d[0]=d[2];
                d[2]=d[5];
                d[5]=d[3];
                d[3]=b;
            }
            if(a[i]=='N'){
                b=d[0];
                d[0]=d[1];
                d[1]=d[5];
                d[5]=d[4];
                d[4]=b;
            }
    }
    printf("%d\n", d[0]);
    
    return 0;
}

```

Assembly Code:

```assembly
	.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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %eax
	movl	(%rsp), %r12d
	testb	%al, %al
	je	.L4
	movl	12(%rsp), %edi
	movl	20(%rsp), %ecx
	movl	%r12d, %esi
	leaq	33(%rsp), %rdx
	movl	8(%rsp), %r8d
	movl	16(%rsp), %r11d
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movl	4(%rsp), %r10d
	xorl	%r9d, %r9d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L33:
	cmpb	$69, %al
	je	.L17
	cmpb	$87, %al
	jne	.L31
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%r8d, %esi
	movl	$1, %r9d
	movl	%ecx, %r8d
	movl	%edi, %ecx
	movl	%eax, %edi
.L5:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L32
.L6:
	cmpb	$83, %al
	jne	.L33
	movl	%esi, %eax
	addq	$1, %rdx
	movl	%r11d, %esi
	movl	%ecx, %r11d
	movl	%r10d, %ecx
	movl	%eax, %r10d
	movzbl	-1(%rdx), %eax
	movl	$1, %ebp
	movl	$1, %r9d
	testb	%al, %al
	jne	.L6
.L32:
	testb	%bl, %bl
	je	.L7
	movl	%r8d, 8(%rsp)
	movl	%edi, 12(%rsp)
.L7:
	testb	%bpl, %bpl
	je	.L8
	movl	%r10d, 4(%rsp)
	testb	%r9b, %r9b
	je	.L9
	movl	%ecx, 20(%rsp)
	movl	%r11d, 16(%rsp)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$78, %al
	jne	.L5
	movl	%esi, %eax
	movl	$1, %ebp
	movl	%r10d, %esi
	movl	$1, %r9d
	movl	%ecx, %r10d
	movl	%r11d, %ecx
	movl	%eax, %r11d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%edi, %esi
	movl	$1, %r9d
	movl	%ecx, %edi
	movl	%r8d, %ecx
	movl	%eax, %r8d
	jmp	.L5
.L9:
	movl	%r11d, 16(%rsp)
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$144, %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
.L8:
	.cfi_restore_state
	testb	%r9b, %r9b
	je	.L4
	movl	%ecx, 20(%rsp)
.L12:
	movl	%esi, (%rsp)
	movl	%esi, %r12d
	jmp	.L4
.L34:
	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:
```

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	"%s"
.LC2:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %eax
	movl	(%rsp), %r12d
	testb	%al, %al
	je	.L4
	movl	12(%rsp), %edi
	movl	20(%rsp), %ecx
	movl	%r12d, %esi
	leaq	33(%rsp), %rdx
	movl	8(%rsp), %r8d
	movl	16(%rsp), %r11d
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movl	4(%rsp), %r10d
	xorl	%r9d, %r9d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L33:
	cmpb	$69, %al
	je	.L17
	cmpb	$87, %al
	jne	.L31
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%r8d, %esi
	movl	$1, %r9d
	movl	%ecx, %r8d
	movl	%edi, %ecx
	movl	%eax, %edi
.L5:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L32
.L6:
	cmpb	$83, %al
	jne	.L33
	movl	%esi, %eax
	addq	$1, %rdx
	movl	%r11d, %esi
	movl	%ecx, %r11d
	movl	%r10d, %ecx
	movl	%eax, %r10d
	movzbl	-1(%rdx), %eax
	movl	$1, %ebp
	movl	$1, %r9d
	testb	%al, %al
	jne	.L6
.L32:
	testb	%bl, %bl
	je	.L7
	movl	%r8d, 8(%rsp)
	movl	%edi, 12(%rsp)
.L7:
	testb	%bpl, %bpl
	je	.L8
	movl	%r10d, 4(%rsp)
	testb	%r9b, %r9b
	je	.L9
	movl	%ecx, 20(%rsp)
	movl	%r11d, 16(%rsp)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$78, %al
	jne	.L5
	movl	%esi, %eax
	movl	$1, %ebp
	movl	%r10d, %esi
	movl	$1, %r9d
	movl	%ecx, %r10d
	movl	%r11d, %ecx
	movl	%eax, %r11d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%esi, %eax
	movl	$1, %ebx
	movl	%edi, %esi
	movl	$1, %r9d
	movl	%ecx, %edi
	movl	%r8d, %ecx
	movl	%eax, %r8d
	jmp	.L5
.L9:
	movl	%r11d, 16(%rsp)
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$144, %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
.L8:
	.cfi_restore_state
	testb	%r9b, %r9b
	je	.L4
	movl	%ecx, 20(%rsp)
.L12:
	movl	%esi, (%rsp)
	movl	%esi, %r12d
	jmp	.L4
.L34:
	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:
```