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


int main() {
	char S[1000000];
	
	scanf("%s", S);
	int i;
	for(i = 0; i < strlen(S); i++) {
		if (S[i] == 'd') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'm') {
				printf("NO");
				return 0;
			}
			if(S[i+1] == 'e') {
				if(S[i+2] == 'r') {
					if(S[i+3] != 'a') {
						i += 2;
					}
				}
			}
		} else if (S[i] == 'e') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 's') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[i + 1] == 'r')
					i++;
		} else {
			printf("NO");
			return 0;
		}
	}
	printf("YES");
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$616, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-1000032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1000036(%rbp)
	jmp	.L2
.L15:
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$100, %al
	jne	.L3
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	je	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L4:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	je	.L6
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L6:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L7:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$109, %al
	je	.L8
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L8:
	movl	-1000036(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-1000036(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	movl	-1000036(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L9
	addl	$2, -1000036(%rbp)
	jmp	.L9
.L3:
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L10
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	je	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L11:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L12:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$115, %al
	je	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L13:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	je	.L14
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L14:
	movl	-1000036(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	addl	$1, -1000036(%rbp)
	jmp	.L9
.L10:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L9:
	addl	$1, -1000036(%rbp)
.L2:
	movl	-1000036(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1000032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L15
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L16:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"NO"
.LC2:
	.string	"YES"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$592, %rsp
	.cfi_def_cfa_offset 1000032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, %rsi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L2:
	cmpq	%rsi, %rdx
	jnb	.L16
.L8:
	movzbl	(%rsp,%rdx), %edx
	cmpb	$100, %dl
	je	.L17
	cmpb	$101, %dl
	jne	.L6
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L6
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L6
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$115, (%rsp,%rdx)
	jne	.L6
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L6
	leal	5(%rax), %ecx
	movslq	%ecx, %rdx
	cmpb	$114, (%rsp,%rdx)
	je	.L18
	movl	%ecx, %eax
	cmpq	%rsi, %rdx
	jb	.L8
.L16:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L6
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L6
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L6
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$109, (%rsp,%rdx)
	jne	.L6
	leal	5(%rax), %edi
	movslq	%edi, %rcx
	cmpb	$101, (%rsp,%rcx)
	je	.L19
.L12:
	movl	%edi, %eax
	movq	%rcx, %rdx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$6, %eax
	movslq	%eax, %rdx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	leal	6(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L12
	addl	$7, %eax
	movslq	%eax, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L2
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L5:
	movq	1000008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$1000016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"NO"
.LC2:
	.string	"YES"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$592, %rsp
	.cfi_def_cfa_offset 1000032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, %rsi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L2:
	cmpq	%rsi, %rdx
	jnb	.L16
.L8:
	movzbl	(%rsp,%rdx), %edx
	cmpb	$100, %dl
	je	.L17
	cmpb	$101, %dl
	jne	.L6
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L6
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L6
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$115, (%rsp,%rdx)
	jne	.L6
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L6
	leal	5(%rax), %ecx
	movslq	%ecx, %rdx
	cmpb	$114, (%rsp,%rdx)
	je	.L18
	movl	%ecx, %eax
	cmpq	%rsi, %rdx
	jb	.L8
.L16:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L6
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L6
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L6
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$109, (%rsp,%rdx)
	jne	.L6
	leal	5(%rax), %edi
	movslq	%edi, %rcx
	cmpb	$101, (%rsp,%rcx)
	je	.L19
.L12:
	movl	%edi, %eax
	movq	%rcx, %rdx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$6, %eax
	movslq	%eax, %rdx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	leal	6(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L12
	addl	$7, %eax
	movslq	%eax, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L2
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L5:
	movq	1000008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$1000016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 <stdlib.h>
#include <string.h>


int main() {
	char S[1000000];
	
	scanf("%s", S);
	int i;
	for(i = 0; i < strlen(S); i++) {
		if (S[i] == 'd') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'm') {
				printf("NO");
				return 0;
			}
			if(S[i+1] == 'e') {
				if(S[i+2] == 'r') {
					if(S[i+3] != 'a') {
						i += 2;
					}
				}
			}
		} else if (S[i] == 'e') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 's') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[i + 1] == 'r')
					i++;
		} else {
			printf("NO");
			return 0;
		}
	}
	printf("YES");
	
	return 0;
}
erasedream

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


int main() {
	char S[1000000];
	
	scanf("%s", S);
	int i;
	for(i = 0; i < strlen(S); i++) {
		if (S[i] == 'd') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'm') {
				printf("NO");
				return 0;
			}
			if(S[i+1] == 'e') {
				if(S[i+2] == 'r') {
					if(S[i+3] != 'a') {
						i += 2;
					}
				}
			}
		} else if (S[i] == 'e') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 's') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[i + 1] == 'r')
					i++;
		} else {
			printf("NO");
			return 0;
		}
	}
	printf("YES");
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"NO"
.LC2:
	.string	"YES"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$616, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-1000032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1000036(%rbp)
	jmp	.L2
.L15:
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$100, %al
	jne	.L3
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	je	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L4:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	je	.L6
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L6:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L7:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$109, %al
	je	.L8
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L8:
	movl	-1000036(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-1000036(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	movl	-1000036(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L9
	addl	$2, -1000036(%rbp)
	jmp	.L9
.L3:
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L10
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	je	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L11:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L12:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$115, %al
	je	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L13:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	je	.L14
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L14:
	movl	-1000036(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	addl	$1, -1000036(%rbp)
	jmp	.L9
.L10:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L9:
	addl	$1, -1000036(%rbp)
.L2:
	movl	-1000036(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1000032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L15
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L16:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"NO"
.LC2:
	.string	"YES"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-999424(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$616, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-1000032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1000036(%rbp)
	jmp	.L2
.L15:
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$100, %al
	jne	.L3
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	je	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L4:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	je	.L6
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L6:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L7:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$109, %al
	je	.L8
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L8:
	movl	-1000036(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-1000036(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	movl	-1000036(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L9
	addl	$2, -1000036(%rbp)
	jmp	.L9
.L3:
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L10
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	je	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L11:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$97, %al
	je	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L12:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$115, %al
	je	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L13:
	addl	$1, -1000036(%rbp)
	movl	-1000036(%rbp), %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$101, %al
	je	.L14
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L14:
	movl	-1000036(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-1000032(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	addl	$1, -1000036(%rbp)
	jmp	.L9
.L10:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L16
.L9:
	addl	$1, -1000036(%rbp)
.L2:
	movl	-1000036(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1000032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L15
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L16:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
