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(){
	char S[100000];
	scanf("%s",S);
	int i,frag = 0;
	for(i = 0; S[i] != '\0'; i++){
		if(S[i] == 'd' && S[i + 1] == 'r' && S[i + 2] == 'e' && S[i + 3] == 'a' && S[i + 4] == 'm'){
			if(S[i + 5] == 'e' && S[i + 6] == 'r'){
				if(S[i + 7] == 'a' && S[i + 8] == 's' && S[i + 9] == 'e'){
					i+=4;
				} else {
					i+=6;
				}
			} else {
				i += 4;
			}
		} else if(S[i] == 'e' && S[i + 1] == 'r' && S[i + 2] == 'a' && S[i + 3] == 's' && S[i + 4] == 'e'){
			if(S[i + 5] == 'r'){
				i += 5;
			} else {
				i += 4;
			}
		} else /*if(S[i] == '\0' || S[i + 1] == '\0' || S[i + 2] == '\0' || S[i + 3] == '\0' || S[i + 4] == '\0'){
			break;
		} else */{
			frag++;
			break;
		}
	}
	if(frag == 0){
		printf("YES");
	} else {
		printf("NO");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -100020(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L13:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$100, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$4, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$109, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$5, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L4
	movl	-100024(%rbp), %eax
	addl	$6, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L4
	movl	-100024(%rbp), %eax
	addl	$7, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L5
	movl	-100024(%rbp), %eax
	addl	$8, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L5
	movl	-100024(%rbp), %eax
	addl	$9, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L5
	addl	$4, -100024(%rbp)
	jmp	.L7
.L5:
	addl	$6, -100024(%rbp)
	jmp	.L7
.L4:
	addl	$4, -100024(%rbp)
	jmp	.L8
.L7:
	jmp	.L8
.L3:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$4, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$5, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L10
	addl	$5, -100024(%rbp)
	jmp	.L8
.L10:
	addl	$4, -100024(%rbp)
	jmp	.L8
.L9:
	addl	$1, -100020(%rbp)
	jmp	.L12
.L8:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L13
.L12:
	cmpl	$0, -100020(%rbp)
	jne	.L14
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98312
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1720, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movzbl	(%rsp), %edx
	testb	%dl, %dl
	je	.L2
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$100, %dl
	je	.L22
	cmpb	$101, %dl
	jne	.L4
.L6:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L4
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L4
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$115, (%rsp,%rdx)
	jne	.L4
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L4
	leal	5(%rax), %ecx
	movslq	%ecx, %rdx
	movzbl	(%rsp,%rdx), %edx
	cmpb	$114, %dl
	je	.L23
.L14:
	movl	%ecx, %eax
.L5:
	testb	%dl, %dl
	jne	.L7
.L2:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	xorl	%eax, %eax
	addq	$100024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	addl	$6, %eax
	movslq	%eax, %rdx
	movzbl	(%rsp,%rdx), %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L22:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	je	.L25
.L4:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L25:
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L4
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L4
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$109, (%rsp,%rdx)
	jne	.L4
	leal	5(%rax), %ecx
	movslq	%ecx, %rdx
	movzbl	(%rsp,%rdx), %edx
	cmpb	$101, %dl
	jne	.L14
	leal	6(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	je	.L26
	movl	%ecx, %eax
	jmp	.L6
.L26:
	leal	7(%rax), %esi
	movslq	%esi, %rdx
	movzbl	(%rsp,%rdx), %edx
	cmpb	$97, %dl
	je	.L27
	movl	%esi, %eax
	jmp	.L5
.L27:
	leal	8(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$115, (%rsp,%rdx)
	jne	.L4
	addl	$9, %eax
	cltq
	cmpb	$101, (%rsp,%rax)
	jne	.L4
	movl	%ecx, %eax
	jmp	.L6
.L24:
	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	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98312
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1720, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movzbl	(%rsp), %edx
	testb	%dl, %dl
	je	.L2
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$100, %dl
	je	.L22
	cmpb	$101, %dl
	jne	.L4
.L6:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	jne	.L4
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L4
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$115, (%rsp,%rdx)
	jne	.L4
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L4
	leal	5(%rax), %ecx
	movslq	%ecx, %rdx
	movzbl	(%rsp,%rdx), %edx
	cmpb	$114, %dl
	je	.L23
.L14:
	movl	%ecx, %eax
.L5:
	testb	%dl, %dl
	jne	.L7
.L2:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	xorl	%eax, %eax
	addq	$100024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	addl	$6, %eax
	movslq	%eax, %rdx
	movzbl	(%rsp,%rdx), %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L22:
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	je	.L25
.L4:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L25:
	leal	2(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$101, (%rsp,%rdx)
	jne	.L4
	leal	3(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$97, (%rsp,%rdx)
	jne	.L4
	leal	4(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$109, (%rsp,%rdx)
	jne	.L4
	leal	5(%rax), %ecx
	movslq	%ecx, %rdx
	movzbl	(%rsp,%rdx), %edx
	cmpb	$101, %dl
	jne	.L14
	leal	6(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$114, (%rsp,%rdx)
	je	.L26
	movl	%ecx, %eax
	jmp	.L6
.L26:
	leal	7(%rax), %esi
	movslq	%esi, %rdx
	movzbl	(%rsp,%rdx), %edx
	cmpb	$97, %dl
	je	.L27
	movl	%esi, %eax
	jmp	.L5
.L27:
	leal	8(%rax), %edx
	movslq	%edx, %rdx
	cmpb	$115, (%rsp,%rdx)
	jne	.L4
	addl	$9, %eax
	cltq
	cmpb	$101, (%rsp,%rax)
	jne	.L4
	movl	%ecx, %eax
	jmp	.L6
.L24:
	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(){
	char S[100000];
	scanf("%s",S);
	int i,frag = 0;
	for(i = 0; S[i] != '\0'; i++){
		if(S[i] == 'd' && S[i + 1] == 'r' && S[i + 2] == 'e' && S[i + 3] == 'a' && S[i + 4] == 'm'){
			if(S[i + 5] == 'e' && S[i + 6] == 'r'){
				if(S[i + 7] == 'a' && S[i + 8] == 's' && S[i + 9] == 'e'){
					i+=4;
				} else {
					i+=6;
				}
			} else {
				i += 4;
			}
		} else if(S[i] == 'e' && S[i + 1] == 'r' && S[i + 2] == 'a' && S[i + 3] == 's' && S[i + 4] == 'e'){
			if(S[i + 5] == 'r'){
				i += 5;
			} else {
				i += 4;
			}
		} else /*if(S[i] == '\0' || S[i + 1] == '\0' || S[i + 2] == '\0' || S[i + 3] == '\0' || S[i + 4] == '\0'){
			break;
		} else */{
			frag++;
			break;
		}
	}
	if(frag == 0){
		printf("YES");
	} else {
		printf("NO");
	}
	return 0;
}
dre`merer
 maerdesare
 resaremaerd
 dre`meqer
 er`sedream
 ersaremaerd
 reqem`erd
 eq`sedream
 ersaremadrd
 reqem`erc

NO NO NO NO NO NO NO NO NO NO
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(){
	char S[100000];
	scanf("%s",S);
	int i,frag = 0;
	for(i = 0; S[i] != '\0'; i++){
		if(S[i] == 'd' && S[i + 1] == 'r' && S[i + 2] == 'e' && S[i + 3] == 'a' && S[i + 4] == 'm'){
			if(S[i + 5] == 'e' && S[i + 6] == 'r'){
				if(S[i + 7] == 'a' && S[i + 8] == 's' && S[i + 9] == 'e'){
					i+=4;
				} else {
					i+=6;
				}
			} else {
				i += 4;
			}
		} else if(S[i] == 'e' && S[i + 1] == 'r' && S[i + 2] == 'a' && S[i + 3] == 's' && S[i + 4] == 'e'){
			if(S[i + 5] == 'r'){
				i += 5;
			} else {
				i += 4;
			}
		} else /*if(S[i] == '\0' || S[i + 1] == '\0' || S[i + 2] == '\0' || S[i + 3] == '\0' || S[i + 4] == '\0'){
			break;
		} else */{
			frag++;
			break;
		}
	}
	if(frag == 0){
		printf("YES");
	} else {
		printf("NO");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -100020(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L13:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$100, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$4, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$109, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$5, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L4
	movl	-100024(%rbp), %eax
	addl	$6, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L4
	movl	-100024(%rbp), %eax
	addl	$7, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L5
	movl	-100024(%rbp), %eax
	addl	$8, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L5
	movl	-100024(%rbp), %eax
	addl	$9, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L5
	addl	$4, -100024(%rbp)
	jmp	.L7
.L5:
	addl	$6, -100024(%rbp)
	jmp	.L7
.L4:
	addl	$4, -100024(%rbp)
	jmp	.L8
.L7:
	jmp	.L8
.L3:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$4, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$5, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L10
	addl	$5, -100024(%rbp)
	jmp	.L8
.L10:
	addl	$4, -100024(%rbp)
	jmp	.L8
.L9:
	addl	$1, -100020(%rbp)
	jmp	.L12
.L8:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L13
.L12:
	cmpl	$0, -100020(%rbp)
	jne	.L14
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"YES"
.LC2:
	.string	"NO"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -100020(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L13:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$100, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$4, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$109, %al
	jne	.L3
	movl	-100024(%rbp), %eax
	addl	$5, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L4
	movl	-100024(%rbp), %eax
	addl	$6, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L4
	movl	-100024(%rbp), %eax
	addl	$7, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L5
	movl	-100024(%rbp), %eax
	addl	$8, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L5
	movl	-100024(%rbp), %eax
	addl	$9, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L5
	addl	$4, -100024(%rbp)
	jmp	.L7
.L5:
	addl	$6, -100024(%rbp)
	jmp	.L7
.L4:
	addl	$4, -100024(%rbp)
	jmp	.L8
.L7:
	jmp	.L8
.L3:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$97, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$3, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$115, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$4, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$101, %al
	jne	.L9
	movl	-100024(%rbp), %eax
	addl	$5, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$114, %al
	jne	.L10
	addl	$5, -100024(%rbp)
	jmp	.L8
.L10:
	addl	$4, -100024(%rbp)
	jmp	.L8
.L9:
	addl	$1, -100020(%rbp)
	jmp	.L12
.L8:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L13
.L12:
	cmpl	$0, -100020(%rbp)
	jne	.L14
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
