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() {
	int n;
	int i;
	int cnt;
	char s[100][3];
	int a[100];
 
	while(scanf("%d",&n),n){
		for(i = 0;i < n;i++){
			scanf("%s",s[i]);
		}
		cnt = 0;
 
		for(i = 0;i < n;i++){
			switch(s[i][0]){
				case 'l':
					if(s[i][1] == 'u'){
						a[i] = 0;
					}else if(s[i][1] == 'd'){
						a[i] = 2;
					}
					break;
				case 'r':
					if(s[i][1] == 'u'){
						a[i] = 1;
					}else if(s[i][1] == 'd'){
						a[i] = 3;
					}
					break;
			}
		}

		for(i = 0;i < n-1;i++){
			if(a[i] == 0 && a[i+1] == 1 || a[i] == 1 && a[i+1] == 0
			 ||a[i] == 2 && a[i+1] == 3 || a[i] == 3 && a[i+1] == 2)cnt++;
		}
		
		printf("%d\n",cnt);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	subq	$736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L21:
	movl	$0, -728(%rbp)
	jmp	.L3
.L4:
	leaq	-720(%rbp), %rcx
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -728(%rbp)
.L3:
	movl	-732(%rbp), %eax
	cmpl	%eax, -728(%rbp)
	jl	.L4
	movl	$0, -724(%rbp)
	movl	$0, -728(%rbp)
	jmp	.L5
.L13:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$720, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$108, %eax
	je	.L6
	cmpl	$114, %eax
	je	.L7
	jmp	.L8
.L6:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$117, %al
	jne	.L9
	movl	-728(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	jmp	.L24
.L9:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$100, %al
	jne	.L24
	movl	-728(%rbp), %eax
	cltq
	movl	$2, -416(%rbp,%rax,4)
	jmp	.L24
.L7:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$117, %al
	jne	.L11
	movl	-728(%rbp), %eax
	cltq
	movl	$1, -416(%rbp,%rax,4)
	jmp	.L25
.L11:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$100, %al
	jne	.L25
	movl	-728(%rbp), %eax
	cltq
	movl	$3, -416(%rbp,%rax,4)
	jmp	.L25
.L24:
	nop
	jmp	.L8
.L25:
	nop
.L8:
	addl	$1, -728(%rbp)
.L5:
	movl	-732(%rbp), %eax
	cmpl	%eax, -728(%rbp)
	jl	.L13
	movl	$0, -728(%rbp)
	jmp	.L14
.L20:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L16
.L15:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
.L17:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L18
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	je	.L16
.L18:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	jne	.L19
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L19
.L16:
	addl	$1, -724(%rbp)
.L19:
	addl	$1, -728(%rbp)
.L14:
	movl	-732(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -728(%rbp)
	jl	.L20
	movl	-724(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-732(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-732(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$760, %rsp
	.cfi_def_cfa_offset 816
	movq	%fs:40, %rax
	movq	%rax, 744(%rsp)
	xorl	%eax, %eax
	leaq	340(%rsp), %rax
	leaq	28(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	344(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	testl	%esi, %esi
	je	.L17
	leaq	32(%rsp), %r15
	movl	$0, %r14d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	addq	$3, %r15
	cmpl	%r14d, %esi
	jg	.L3
	testl	%esi, %esi
	jle	.L22
	movq	(%rsp), %rdi
	leal	-1(%rsi), %ecx
	leaq	33(%rsp), %rax
	leaq	336(%rsp), %rdx
	leaq	(%rdi,%rcx,4), %rdi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	cmpb	$114, %cl
	jne	.L7
	movzbl	(%rax), %ecx
	cmpb	$117, %cl
	je	.L29
	cmpb	$100, %cl
	jne	.L7
	movl	$3, (%rdx)
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$4, %rdx
	addq	$3, %rax
	cmpq	%rdi, %rdx
	je	.L19
.L10:
	movzbl	-1(%rax), %ecx
	cmpb	$108, %cl
	jne	.L30
	movzbl	(%rax), %ecx
	cmpb	$117, %cl
	je	.L31
	cmpb	$100, %cl
	jne	.L7
	movl	$2, (%rdx)
	addq	$4, %rdx
	addq	$3, %rax
	cmpq	%rdi, %rdx
	jne	.L10
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$1, %esi
	jle	.L22
	movq	8(%rsp), %rdi
	leal	-2(%rsi), %edx
	leaq	340(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	(%rdi,%rdx,4), %rcx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L32:
	cmpl	$1, (%rax)
	je	.L12
.L13:
	addq	$4, %rax
	cmpq	%rax, %rcx
	je	.L4
.L16:
	movl	-4(%rax), %edx
	testl	%edx, %edx
	je	.L32
	cmpl	$1, %edx
	jne	.L14
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	.L13
.L12:
	addq	$4, %rax
	addl	$1, %r8d
	cmpq	%rax, %rcx
	jne	.L16
.L4:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$2, %edx
	jne	.L15
	cmpl	$3, (%rax)
	jne	.L13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	$3, %edx
	jne	.L13
	cmpl	$2, (%rax)
	jne	.L13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movl	$0, (%rdx)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L29:
	movl	$1, (%rdx)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	movq	744(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$760, %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
.L22:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L33:
	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	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$760, %rsp
	.cfi_def_cfa_offset 816
	movq	%fs:40, %rax
	movq	%rax, 744(%rsp)
	xorl	%eax, %eax
	leaq	340(%rsp), %rax
	leaq	28(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	344(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	testl	%esi, %esi
	je	.L17
	leaq	32(%rsp), %r15
	movl	$0, %r14d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %esi
	addq	$3, %r15
	cmpl	%r14d, %esi
	jg	.L3
	testl	%esi, %esi
	jle	.L22
	movq	(%rsp), %rdi
	leal	-1(%rsi), %ecx
	leaq	33(%rsp), %rax
	leaq	336(%rsp), %rdx
	leaq	(%rdi,%rcx,4), %rdi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	cmpb	$114, %cl
	jne	.L7
	movzbl	(%rax), %ecx
	cmpb	$117, %cl
	je	.L29
	cmpb	$100, %cl
	jne	.L7
	movl	$3, (%rdx)
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$4, %rdx
	addq	$3, %rax
	cmpq	%rdi, %rdx
	je	.L19
.L10:
	movzbl	-1(%rax), %ecx
	cmpb	$108, %cl
	jne	.L30
	movzbl	(%rax), %ecx
	cmpb	$117, %cl
	je	.L31
	cmpb	$100, %cl
	jne	.L7
	movl	$2, (%rdx)
	addq	$4, %rdx
	addq	$3, %rax
	cmpq	%rdi, %rdx
	jne	.L10
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$1, %esi
	jle	.L22
	movq	8(%rsp), %rdi
	leal	-2(%rsi), %edx
	leaq	340(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	(%rdi,%rdx,4), %rcx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L32:
	cmpl	$1, (%rax)
	je	.L12
.L13:
	addq	$4, %rax
	cmpq	%rax, %rcx
	je	.L4
.L16:
	movl	-4(%rax), %edx
	testl	%edx, %edx
	je	.L32
	cmpl	$1, %edx
	jne	.L14
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	.L13
.L12:
	addq	$4, %rax
	addl	$1, %r8d
	cmpq	%rax, %rcx
	jne	.L16
.L4:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$2, %edx
	jne	.L15
	cmpl	$3, (%rax)
	jne	.L13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	$3, %edx
	jne	.L13
	cmpl	$2, (%rax)
	jne	.L13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movl	$0, (%rdx)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L29:
	movl	$1, (%rdx)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	movq	744(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$760, %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
.L22:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L33:
	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() {
	int n;
	int i;
	int cnt;
	char s[100][3];
	int a[100];
 
	while(scanf("%d",&n),n){
		for(i = 0;i < n;i++){
			scanf("%s",s[i]);
		}
		cnt = 0;
 
		for(i = 0;i < n;i++){
			switch(s[i][0]){
				case 'l':
					if(s[i][1] == 'u'){
						a[i] = 0;
					}else if(s[i][1] == 'd'){
						a[i] = 2;
					}
					break;
				case 'r':
					if(s[i][1] == 'u'){
						a[i] = 1;
					}else if(s[i][1] == 'd'){
						a[i] = 3;
					}
					break;
			}
		}

		for(i = 0;i < n-1;i++){
			if(a[i] == 0 && a[i+1] == 1 || a[i] == 1 && a[i+1] == 0
			 ||a[i] == 2 && a[i+1] == 3 || a[i] == 3 && a[i+1] == 2)cnt++;
		}
		
		printf("%d\n",cnt);
	}
	return 0;
}
4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd ru rd ru lu rd ld
0
 4
lu ru ld rd
0
lu ld lu ru
0
ul
10
vr lu ld rd rv rd ru lu rc kd
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd ru rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd su rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd su rd ru lu sd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt dr ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld dr su rd ru lu sd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt dr ru lu rd dl
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd ru rd ru lu rc ld
0

2
1
 2
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1
 2
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() {
	int n;
	int i;
	int cnt;
	char s[100][3];
	int a[100];
 
	while(scanf("%d",&n),n){
		for(i = 0;i < n;i++){
			scanf("%s",s[i]);
		}
		cnt = 0;
 
		for(i = 0;i < n;i++){
			switch(s[i][0]){
				case 'l':
					if(s[i][1] == 'u'){
						a[i] = 0;
					}else if(s[i][1] == 'd'){
						a[i] = 2;
					}
					break;
				case 'r':
					if(s[i][1] == 'u'){
						a[i] = 1;
					}else if(s[i][1] == 'd'){
						a[i] = 3;
					}
					break;
			}
		}

		for(i = 0;i < n-1;i++){
			if(a[i] == 0 && a[i+1] == 1 || a[i] == 1 && a[i+1] == 0
			 ||a[i] == 2 && a[i+1] == 3 || a[i] == 3 && a[i+1] == 2)cnt++;
		}
		
		printf("%d\n",cnt);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	subq	$736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L21:
	movl	$0, -728(%rbp)
	jmp	.L3
.L4:
	leaq	-720(%rbp), %rcx
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -728(%rbp)
.L3:
	movl	-732(%rbp), %eax
	cmpl	%eax, -728(%rbp)
	jl	.L4
	movl	$0, -724(%rbp)
	movl	$0, -728(%rbp)
	jmp	.L5
.L13:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$720, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$108, %eax
	je	.L6
	cmpl	$114, %eax
	je	.L7
	jmp	.L8
.L6:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$117, %al
	jne	.L9
	movl	-728(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	jmp	.L24
.L9:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$100, %al
	jne	.L24
	movl	-728(%rbp), %eax
	cltq
	movl	$2, -416(%rbp,%rax,4)
	jmp	.L24
.L7:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$117, %al
	jne	.L11
	movl	-728(%rbp), %eax
	cltq
	movl	$1, -416(%rbp,%rax,4)
	jmp	.L25
.L11:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$100, %al
	jne	.L25
	movl	-728(%rbp), %eax
	cltq
	movl	$3, -416(%rbp,%rax,4)
	jmp	.L25
.L24:
	nop
	jmp	.L8
.L25:
	nop
.L8:
	addl	$1, -728(%rbp)
.L5:
	movl	-732(%rbp), %eax
	cmpl	%eax, -728(%rbp)
	jl	.L13
	movl	$0, -728(%rbp)
	jmp	.L14
.L20:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L16
.L15:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
.L17:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L18
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	je	.L16
.L18:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	jne	.L19
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L19
.L16:
	addl	$1, -724(%rbp)
.L19:
	addl	$1, -728(%rbp)
.L14:
	movl	-732(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -728(%rbp)
	jl	.L20
	movl	-724(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-732(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-732(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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
	subq	$736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L21:
	movl	$0, -728(%rbp)
	jmp	.L3
.L4:
	leaq	-720(%rbp), %rcx
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -728(%rbp)
.L3:
	movl	-732(%rbp), %eax
	cmpl	%eax, -728(%rbp)
	jl	.L4
	movl	$0, -724(%rbp)
	movl	$0, -728(%rbp)
	jmp	.L5
.L13:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$720, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$108, %eax
	je	.L6
	cmpl	$114, %eax
	je	.L7
	jmp	.L8
.L6:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$117, %al
	jne	.L9
	movl	-728(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	jmp	.L24
.L9:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$100, %al
	jne	.L24
	movl	-728(%rbp), %eax
	cltq
	movl	$2, -416(%rbp,%rax,4)
	jmp	.L24
.L7:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$117, %al
	jne	.L11
	movl	-728(%rbp), %eax
	cltq
	movl	$1, -416(%rbp,%rax,4)
	jmp	.L25
.L11:
	movl	-728(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$719, %rax
	movzbl	(%rax), %eax
	cmpb	$100, %al
	jne	.L25
	movl	-728(%rbp), %eax
	cltq
	movl	$3, -416(%rbp,%rax,4)
	jmp	.L25
.L24:
	nop
	jmp	.L8
.L25:
	nop
.L8:
	addl	$1, -728(%rbp)
.L5:
	movl	-732(%rbp), %eax
	cmpl	%eax, -728(%rbp)
	jl	.L13
	movl	$0, -728(%rbp)
	jmp	.L14
.L20:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L16
.L15:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
.L17:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L18
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	je	.L16
.L18:
	movl	-728(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	jne	.L19
	movl	-728(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L19
.L16:
	addl	$1, -724(%rbp)
.L19:
	addl	$1, -728(%rbp)
.L14:
	movl	-732(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -728(%rbp)
	jl	.L20
	movl	-724(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-732(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-732(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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:
