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

char S[114514];

char Sriv[114514];

int main(void) {
	int i, l;
	if (scanf("%114513s", S) != 1) return 1;
	l = (int)strlen(S);
	for (i = 0; i < l; i++) {
		Sriv[l - 1 - i] = S[i];
	}
	Sriv[l] = '\0';
	for (i = 0; Sriv[i] != '\0';) {
		if (strncmp(Sriv + i, "maerd", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "remaerd", 7) == 0) i += 7;
		else if (strncmp(Sriv + i, "esare", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "resare", 6) == 0) i += 6;
		else {
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}

/*
maerd
remaerd
esare
resare

こうすると多分いい
*/
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%114513s"
.LC1:
	.string	"maerd"
.LC2:
	.string	"remaerd"
.LC3:
	.string	"esare"
.LC4:
	.string	"resare"
.LC5:
	.string	"NO"
.LC6:
	.string	"YES"
	.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
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	S(%rip), %rbx
	movq	%rbx, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$1, %r8d
	jne	.L1
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L20
	movslq	%eax, %rdi
	leal	-1(%rax), %esi
	leaq	Sriv(%rip), %rbp
	movq	%rbx, %rdx
	leaq	1(%rbx), %rax
	leaq	-1(%rbp,%rdi), %rcx
	addq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	subq	$1, %rcx
	movb	%al, 1(%rcx)
	cmpq	%rsi, %rdx
	jne	.L6
.L7:
	movb	$0, 0(%rbp,%rdi)
	cmpb	$0, Sriv(%rip)
	je	.L5
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r13
	leaq	.LC3(%rip), %r14
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$7, %edx
	movq	%r13, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$7, %ebx
.L9:
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	je	.L5
.L4:
	leaq	0(%rbp,%rdi), %r15
	movl	$5, %edx
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L8
.L18:
	addl	$5, %ebx
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	jne	.L4
.L5:
	leaq	.LC6(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	movl	$5, %edx
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L18
	movl	$6, %edx
	leaq	.LC4(%rip), %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L12
	addl	$6, %ebx
	jmp	.L9
.L20:
	leaq	Sriv(%rip), %rbp
	xorl	%edi, %edi
	jmp	.L7
.L12:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	Sriv
	.bss
	.align 32
	.type	Sriv, @object
	.size	Sriv, 114514
Sriv:
	.zero	114514
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.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	"%114513s"
.LC1:
	.string	"maerd"
.LC2:
	.string	"remaerd"
.LC3:
	.string	"esare"
.LC4:
	.string	"resare"
.LC5:
	.string	"NO"
.LC6:
	.string	"YES"
	.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
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	S(%rip), %rbx
	movq	%rbx, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$1, %r8d
	jne	.L1
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L20
	movslq	%eax, %rdi
	leal	-1(%rax), %esi
	leaq	Sriv(%rip), %rbp
	movq	%rbx, %rdx
	leaq	1(%rbx), %rax
	leaq	-1(%rbp,%rdi), %rcx
	addq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	subq	$1, %rcx
	movb	%al, 1(%rcx)
	cmpq	%rsi, %rdx
	jne	.L6
.L7:
	movb	$0, 0(%rbp,%rdi)
	cmpb	$0, Sriv(%rip)
	je	.L5
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r13
	leaq	.LC3(%rip), %r14
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$7, %edx
	movq	%r13, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$7, %ebx
.L9:
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	je	.L5
.L4:
	leaq	0(%rbp,%rdi), %r15
	movl	$5, %edx
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L8
.L18:
	addl	$5, %ebx
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	jne	.L4
.L5:
	leaq	.LC6(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	movl	$5, %edx
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L18
	movl	$6, %edx
	leaq	.LC4(%rip), %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L12
	addl	$6, %ebx
	jmp	.L9
.L20:
	leaq	Sriv(%rip), %rbp
	xorl	%edi, %edi
	jmp	.L7
.L12:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	Sriv
	.bss
	.align 32
	.type	Sriv, @object
	.size	Sriv, 114514
Sriv:
	.zero	114514
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.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	"%114513s"
.LC1:
	.string	"maerd"
.LC2:
	.string	"remaerd"
.LC3:
	.string	"esare"
.LC4:
	.string	"resare"
.LC5:
	.string	"NO"
.LC6:
	.string	"YES"
	.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
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	S(%rip), %rbx
	movq	%rbx, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$1, %r8d
	jne	.L1
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L20
	movslq	%eax, %rdi
	leal	-1(%rax), %esi
	leaq	Sriv(%rip), %rbp
	movq	%rbx, %rdx
	leaq	1(%rbx), %rax
	leaq	-1(%rbp,%rdi), %rcx
	addq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	subq	$1, %rcx
	movb	%al, 1(%rcx)
	cmpq	%rsi, %rdx
	jne	.L6
.L7:
	movb	$0, 0(%rbp,%rdi)
	cmpb	$0, Sriv(%rip)
	je	.L5
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r13
	leaq	.LC3(%rip), %r14
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$7, %edx
	movq	%r13, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$7, %ebx
.L9:
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	je	.L5
.L4:
	leaq	0(%rbp,%rdi), %r15
	movl	$5, %edx
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L8
.L18:
	addl	$5, %ebx
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	jne	.L4
.L5:
	leaq	.LC6(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	movl	$5, %edx
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L18
	movl	$6, %edx
	leaq	.LC4(%rip), %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L12
	addl	$6, %ebx
	jmp	.L9
.L20:
	leaq	Sriv(%rip), %rbp
	xorl	%edi, %edi
	jmp	.L7
.L12:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	Sriv
	.bss
	.align 32
	.type	Sriv, @object
	.size	Sriv, 114514
Sriv:
	.zero	114514
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.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>
#include <string.h>

char S[114514];

char Sriv[114514];

int main(void) {
	int i, l;
	if (scanf("%114513s", S) != 1) return 1;
	l = (int)strlen(S);
	for (i = 0; i < l; i++) {
		Sriv[l - 1 - i] = S[i];
	}
	Sriv[l] = '\0';
	for (i = 0; Sriv[i] != '\0';) {
		if (strncmp(Sriv + i, "maerd", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "remaerd", 7) == 0) i += 7;
		else if (strncmp(Sriv + i, "esare", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "resare", 6) == 0) i += 6;
		else {
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}

/*
maerd
remaerd
esare
resare

こうすると多分いい
*/
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

char S[114514];

char Sriv[114514];

int main(void) {
	int i, l;
	if (scanf("%114513s", S) != 1) return 1;
	l = (int)strlen(S);
	for (i = 0; i < l; i++) {
		Sriv[l - 1 - i] = S[i];
	}
	Sriv[l] = '\0';
	for (i = 0; Sriv[i] != '\0';) {
		if (strncmp(Sriv + i, "maerd", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "remaerd", 7) == 0) i += 7;
		else if (strncmp(Sriv + i, "esare", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "resare", 6) == 0) i += 6;
		else {
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}

/*
maerd
remaerd
esare
resare

こうすると多分いい
*/
```

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:

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

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

char S[114514];

char Sriv[114514];

int main(void) {
	int i, l;
	if (scanf("%114513s", S) != 1) return 1;
	l = (int)strlen(S);
	for (i = 0; i < l; i++) {
		Sriv[l - 1 - i] = S[i];
	}
	Sriv[l] = '\0';
	for (i = 0; Sriv[i] != '\0';) {
		if (strncmp(Sriv + i, "maerd", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "remaerd", 7) == 0) i += 7;
		else if (strncmp(Sriv + i, "esare", 5) == 0) i += 5;
		else if (strncmp(Sriv + i, "resare", 6) == 0) i += 6;
		else {
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}

/*
maerd
remaerd
esare
resare

こうすると多分いい
*/
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%114513s"
.LC1:
	.string	"maerd"
.LC2:
	.string	"remaerd"
.LC3:
	.string	"esare"
.LC4:
	.string	"resare"
.LC5:
	.string	"NO"
.LC6:
	.string	"YES"
	.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
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	S(%rip), %rbx
	movq	%rbx, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$1, %r8d
	jne	.L1
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L20
	movslq	%eax, %rdi
	leal	-1(%rax), %esi
	leaq	Sriv(%rip), %rbp
	movq	%rbx, %rdx
	leaq	1(%rbx), %rax
	leaq	-1(%rbp,%rdi), %rcx
	addq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	subq	$1, %rcx
	movb	%al, 1(%rcx)
	cmpq	%rsi, %rdx
	jne	.L6
.L7:
	movb	$0, 0(%rbp,%rdi)
	cmpb	$0, Sriv(%rip)
	je	.L5
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r13
	leaq	.LC3(%rip), %r14
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$7, %edx
	movq	%r13, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$7, %ebx
.L9:
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	je	.L5
.L4:
	leaq	0(%rbp,%rdi), %r15
	movl	$5, %edx
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L8
.L18:
	addl	$5, %ebx
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	jne	.L4
.L5:
	leaq	.LC6(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	movl	$5, %edx
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L18
	movl	$6, %edx
	leaq	.LC4(%rip), %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L12
	addl	$6, %ebx
	jmp	.L9
.L20:
	leaq	Sriv(%rip), %rbp
	xorl	%edi, %edi
	jmp	.L7
.L12:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	Sriv
	.bss
	.align 32
	.type	Sriv, @object
	.size	Sriv, 114514
Sriv:
	.zero	114514
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.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	"%114513s"
.LC1:
	.string	"maerd"
.LC2:
	.string	"remaerd"
.LC3:
	.string	"esare"
.LC4:
	.string	"resare"
.LC5:
	.string	"NO"
.LC6:
	.string	"YES"
	.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
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	S(%rip), %rbx
	movq	%rbx, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$1, %r8d
	jne	.L1
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L20
	movslq	%eax, %rdi
	leal	-1(%rax), %esi
	leaq	Sriv(%rip), %rbp
	movq	%rbx, %rdx
	leaq	1(%rbx), %rax
	leaq	-1(%rbp,%rdi), %rcx
	addq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	subq	$1, %rcx
	movb	%al, 1(%rcx)
	cmpq	%rsi, %rdx
	jne	.L6
.L7:
	movb	$0, 0(%rbp,%rdi)
	cmpb	$0, Sriv(%rip)
	je	.L5
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r13
	leaq	.LC3(%rip), %r14
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$7, %edx
	movq	%r13, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$7, %ebx
.L9:
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	je	.L5
.L4:
	leaq	0(%rbp,%rdi), %r15
	movl	$5, %edx
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L8
.L18:
	addl	$5, %ebx
	movslq	%ebx, %rdi
	cmpb	$0, 0(%rbp,%rdi)
	jne	.L4
.L5:
	leaq	.LC6(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	movl	$5, %edx
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	je	.L18
	movl	$6, %edx
	leaq	.LC4(%rip), %rsi
	movq	%r15, %rdi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L12
	addl	$6, %ebx
	jmp	.L9
.L20:
	leaq	Sriv(%rip), %rbp
	xorl	%edi, %edi
	jmp	.L7
.L12:
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	Sriv
	.bss
	.align 32
	.type	Sriv, @object
	.size	Sriv, 114514
Sriv:
	.zero	114514
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 114514
S:
	.zero	114514
	.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:
```