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>
#include <string.h>

int main(){

  int dice[6];

  int a,up,down,n[4];

  char str[150];

  for(a=0;a<=5;a++){

    scanf("%d ",&dice[a]);

    }
 
  scanf("%s",&str);

  int b;

  up=dice[0];
  n[0]=dice[4];
  n[1]=dice[3];
  n[2]=dice[1];
  n[3]=dice[2];
  down=dice[5];

  int sub;

  for(b=0;b<=strlen(str)-1;b++){

    if(str[b]=='N'){

      sub=n[0];
      n[0]=up;
      up=n[2];
      n[2]=down;
      down=sub;

    }else if(str[b]=='S'){

      sub=n[2];
      n[2]=up;
      up=n[0];
      n[0]=down;
      down=sub;

    }else if(str[b]=='W'){

      sub=n[1];
      n[1]=up;
      up=n[3];
      n[3]=down;
      down=sub;

    }else{

      sub=n[3];
      n[3]=up;
      up=n[1];
      n[1]=down;
      down=sub;

    }

  }

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

  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	%rbx
	subq	$248, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -244(%rbp)
	jmp	.L2
.L3:
	leaq	-208(%rbp), %rdx
	movl	-244(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -244(%rbp)
.L2:
	cmpl	$5, -244(%rbp)
	jle	.L3
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-208(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-192(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-196(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-204(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-200(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-188(%rbp), %eax
	movl	%eax, -236(%rbp)
	movl	$0, -232(%rbp)
	jmp	.L4
.L9:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$78, %al
	jne	.L5
	movl	-224(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-216(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L5:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L7
	movl	-216(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-224(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L7:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L8
	movl	-220(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-212(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L8:
	movl	-212(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-220(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
.L6:
	addl	$1, -232(%rbp)
.L4:
	movl	-232(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-176(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	cmpq	%rax, %rbx
	jbe	.L9
	movl	-240(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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 "
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	40(%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	48(%rsp), %rbx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	movq	%rbx, %rdi
	movl	36(%rsp), %ebp
	movl	16(%rsp), %r12d
	movl	32(%rsp), %r14d
	movl	20(%rsp), %r13d
	movl	24(%rsp), %r15d
	movl	%esi, 12(%rsp)
	call	strlen@PLT
	movl	12(%rsp), %esi
	movq	%rbx, %rdx
	addq	%rbx, %rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L15:
	cmpb	$83, %cl
	je	.L7
	cmpb	$87, %cl
	movl	%r12d, %ecx
	je	.L13
	movl	%esi, %r12d
	movl	%ebp, %esi
	movl	%r15d, %ebp
	movl	%ecx, %r15d
.L3:
	addq	$1, %rdx
	cmpq	%rdx, %rax
	je	.L14
.L4:
	movzbl	(%rdx), %ecx
	cmpb	$78, %cl
	jne	.L15
	movl	%r12d, %ecx
	addq	$1, %rdx
	movl	%r13d, %r12d
	movl	%ebp, %r13d
	movl	%r14d, %ebp
	movl	%ecx, %r14d
	cmpq	%rdx, %rax
	jne	.L4
.L14:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$216, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movl	%r12d, %ecx
	movl	%r14d, %r12d
	movl	%ebp, %r14d
	movl	%r13d, %ebp
	movl	%ecx, %r13d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r15d, %r12d
	movl	%ebp, %r15d
	movl	%esi, %ebp
	movl	%ecx, %esi
	jmp	.L3
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	40(%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	48(%rsp), %rbx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	movq	%rbx, %rdi
	movl	36(%rsp), %ebp
	movl	16(%rsp), %r12d
	movl	32(%rsp), %r14d
	movl	20(%rsp), %r13d
	movl	24(%rsp), %r15d
	movl	%esi, 12(%rsp)
	call	strlen@PLT
	movl	12(%rsp), %esi
	movq	%rbx, %rdx
	addq	%rbx, %rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L15:
	cmpb	$83, %cl
	je	.L7
	cmpb	$87, %cl
	movl	%r12d, %ecx
	je	.L13
	movl	%esi, %r12d
	movl	%ebp, %esi
	movl	%r15d, %ebp
	movl	%ecx, %r15d
.L3:
	addq	$1, %rdx
	cmpq	%rdx, %rax
	je	.L14
.L4:
	movzbl	(%rdx), %ecx
	cmpb	$78, %cl
	jne	.L15
	movl	%r12d, %ecx
	addq	$1, %rdx
	movl	%r13d, %r12d
	movl	%ebp, %r13d
	movl	%r14d, %ebp
	movl	%ecx, %r14d
	cmpq	%rdx, %rax
	jne	.L4
.L14:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$216, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	movl	%r12d, %ecx
	movl	%r14d, %r12d
	movl	%ebp, %r14d
	movl	%r13d, %ebp
	movl	%ecx, %r13d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r15d, %r12d
	movl	%ebp, %r15d
	movl	%esi, %ebp
	movl	%ecx, %esi
	jmp	.L3
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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>
#include <string.h>

int main(){

  int dice[6];

  int a,up,down,n[4];

  char str[150];

  for(a=0;a<=5;a++){

    scanf("%d ",&dice[a]);

    }
 
  scanf("%s",&str);

  int b;

  up=dice[0];
  n[0]=dice[4];
  n[1]=dice[3];
  n[2]=dice[1];
  n[3]=dice[2];
  down=dice[5];

  int sub;

  for(b=0;b<=strlen(str)-1;b++){

    if(str[b]=='N'){

      sub=n[0];
      n[0]=up;
      up=n[2];
      n[2]=down;
      down=sub;

    }else if(str[b]=='S'){

      sub=n[2];
      n[2]=up;
      up=n[0];
      n[0]=down;
      down=sub;

    }else if(str[b]=='W'){

      sub=n[1];
      n[1]=up;
      up=n[3];
      n[3]=down;
      down=sub;

    }else{

      sub=n[3];
      n[3]=up;
      up=n[1];
      n[1]=down;
      down=sub;

    }

  }

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

  return 0;

}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>

int main(){

  int dice[6];

  int a,up,down,n[4];

  char str[150];

  for(a=0;a<=5;a++){

    scanf("%d ",&dice[a]);

    }
 
  scanf("%s",&str);

  int b;

  up=dice[0];
  n[0]=dice[4];
  n[1]=dice[3];
  n[2]=dice[1];
  n[3]=dice[2];
  down=dice[5];

  int sub;

  for(b=0;b<=strlen(str)-1;b++){

    if(str[b]=='N'){

      sub=n[0];
      n[0]=up;
      up=n[2];
      n[2]=down;
      down=sub;

    }else if(str[b]=='S'){

      sub=n[2];
      n[2]=up;
      up=n[0];
      n[0]=down;
      down=sub;

    }else if(str[b]=='W'){

      sub=n[1];
      n[1]=up;
      up=n[3];
      n[3]=down;
      down=sub;

    }else{

      sub=n[3];
      n[3]=up;
      up=n[1];
      n[1]=down;
      down=sub;

    }

  }

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

  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	%rbx
	subq	$248, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -244(%rbp)
	jmp	.L2
.L3:
	leaq	-208(%rbp), %rdx
	movl	-244(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -244(%rbp)
.L2:
	cmpl	$5, -244(%rbp)
	jle	.L3
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-208(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-192(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-196(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-204(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-200(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-188(%rbp), %eax
	movl	%eax, -236(%rbp)
	movl	$0, -232(%rbp)
	jmp	.L4
.L9:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$78, %al
	jne	.L5
	movl	-224(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-216(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L5:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L7
	movl	-216(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-224(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L7:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L8
	movl	-220(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-212(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L8:
	movl	-212(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-220(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
.L6:
	addl	$1, -232(%rbp)
.L4:
	movl	-232(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-176(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	cmpq	%rax, %rbx
	jbe	.L9
	movl	-240(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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	"%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	%rbx
	subq	$248, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -244(%rbp)
	jmp	.L2
.L3:
	leaq	-208(%rbp), %rdx
	movl	-244(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -244(%rbp)
.L2:
	cmpl	$5, -244(%rbp)
	jle	.L3
	leaq	-176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-208(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-192(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-196(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-204(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-200(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-188(%rbp), %eax
	movl	%eax, -236(%rbp)
	movl	$0, -232(%rbp)
	jmp	.L4
.L9:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$78, %al
	jne	.L5
	movl	-224(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-216(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L5:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L7
	movl	-216(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	-224(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -224(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L7:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-176(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L8
	movl	-220(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-212(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
	jmp	.L6
.L8:
	movl	-212(%rbp), %eax
	movl	%eax, -228(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -212(%rbp)
	movl	-220(%rbp), %eax
	movl	%eax, -240(%rbp)
	movl	-236(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-228(%rbp), %eax
	movl	%eax, -236(%rbp)
.L6:
	addl	$1, -232(%rbp)
.L4:
	movl	-232(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-176(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	cmpq	%rax, %rbx
	jbe	.L9
	movl	-240(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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:
