Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AtCoder ARC065 C - Daydream
// 2019.8.27 bal4u

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

#define gc() getchar_unlocked()

int ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	char *p = s--;
	do *++s = gc();
	while (*s > ' ');
	*s = 0;
	return s - p;
}

int N;
char S[100005];
				
int main()
{
	int i;
	
	N = ins(S);	
	i = 0; while (i < N) {
//printf("i=%d, N=%d\n", i, N);
		if (memcmp(S+i, "dream", 5) == 0 && memcmp(S+i+5, "erase", 5) == 0) i += 5;
		else if (memcmp(S+i, "dreamer", 7) == 0) i += 7;
		else if (memcmp(S+i, "dream", 5) == 0) i += 5;
		else if (memcmp(S+i, "eraser", 6) == 0) i += 6;
		else if (memcmp(S+i, "erase", 5) == 0) i += 5;
		else { puts("NO"); return 0; }
	}
	puts("YES");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ins
	.type	ins, @function
ins:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movq	%rax, -8(%rbp)
.L2:
	call	getchar_unlocked@PLT
	addq	$1, -24(%rbp)
	movl	%eax, %edx
	movq	-24(%rbp), %rax
	movb	%dl, (%rax)
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L2
	movq	-24(%rbp), %rax
	movb	$0, (%rax)
	movq	-24(%rbp), %rax
	subq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ins, .-ins
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 100005
S:
	.zero	100005
	.section	.rodata
.LC0:
	.string	"dream"
.LC1:
	.string	"erase"
.LC2:
	.string	"dreamer"
.LC3:
	.string	"eraser"
.LC4:
	.string	"NO"
.LC5:
	.string	"YES"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	ins
	movl	%eax, N(%rip)
	movl	$0, -4(%rbp)
	jmp	.L5
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	5(%rax), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L6
	addl	$5, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$7, %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L7
	addl	$7, -4(%rbp)
	jmp	.L5
.L7:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L8
	addl	$5, -4(%rbp)
	jmp	.L5
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$6, %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L9
	addl	$6, -4(%rbp)
	jmp	.L5
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$5, -4(%rbp)
	jmp	.L5
.L10:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L11
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L12
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	ins
	.type	ins, @function
ins:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-1(%rdi), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	1(%rax), %rdx
	addq	$1, %rbx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, (%rbx)
	cmpb	$32, %al
	jle	.L4
.L5:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L2
	call	__uflow@PLT
	addq	$1, %rbx
	movb	%al, (%rbx)
	cmpb	$32, %al
	jg	.L5
.L4:
	movb	$0, (%rbx)
	movl	%ebx, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	subl	%ebp, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	ins, .-ins
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"dream"
.LC1:
	.string	"erase"
.LC2:
	.string	"eraser"
.LC3:
	.string	"NO"
.LC4:
	.string	"YES"
.LC5:
	.string	"dreamer"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	S(%rip), %rbx
	movq	%rbx, %rdi
	call	ins
	movl	%eax, N(%rip)
	testl	%eax, %eax
	jle	.L9
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%ecx, %rsi
	leaq	(%rbx,%rsi), %rdx
	cmpl	$1634038372, (%rdx)
	je	.L42
.L10:
	cmpl	$1634038372, (%rdx)
	je	.L43
.L29:
	cmpl	$1935766117, (%rdx)
	je	.L44
.L17:
	cmpl	$1935766117, (%rdx)
	je	.L45
.L20:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	.cfi_restore_state
	cmpb	$109, 4(%rdx)
	jne	.L10
	leaq	5(%rbx,%rsi), %rsi
	cmpl	$1935766117, (%rsi)
	je	.L46
	cmpl	$1634038372, (%rdx)
	je	.L47
.L25:
	addl	$5, %ecx
.L16:
	cmpl	%ecx, %eax
	jg	.L24
.L9:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	cmpb	$101, 4(%rsi)
	je	.L25
	cmpl	$1634038372, (%rdx)
	jne	.L25
.L47:
	cmpw	$25965, 4(%rdx)
	jne	.L25
	cmpb	$114, 6(%rdx)
	jne	.L25
.L27:
	addl	$7, %ecx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L43:
	cmpw	$25965, 4(%rdx)
	jne	.L29
	cmpb	$114, 6(%rdx)
	jne	.L29
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L44:
	cmpw	$29285, 4(%rdx)
	jne	.L17
	addl	$6, %ecx
	jmp	.L16
.L45:
	cmpb	$101, 4(%rdx)
	jne	.L20
	jmp	.L25
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 100005
S:
	.zero	100005
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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
	.p2align 4
	.globl	ins
	.type	ins, @function
ins:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	-1(%rdi), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	1(%rax), %rdx
	addq	$1, %rbx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	movb	%al, (%rbx)
	cmpb	$32, %al
	jle	.L4
.L5:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L2
	call	__uflow@PLT
	addq	$1, %rbx
	movb	%al, (%rbx)
	cmpb	$32, %al
	jg	.L5
.L4:
	movb	$0, (%rbx)
	movl	%ebx, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	subl	%ebp, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	ins, .-ins
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"dream"
.LC1:
	.string	"erase"
.LC2:
	.string	"eraser"
.LC3:
	.string	"NO"
.LC4:
	.string	"YES"
.LC5:
	.string	"dreamer"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	S(%rip), %rbx
	movq	%rbx, %rdi
	call	ins
	movl	%eax, N(%rip)
	testl	%eax, %eax
	jle	.L9
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%ecx, %rsi
	leaq	(%rbx,%rsi), %rdx
	cmpl	$1634038372, (%rdx)
	je	.L42
.L10:
	cmpl	$1634038372, (%rdx)
	je	.L43
.L29:
	cmpl	$1935766117, (%rdx)
	je	.L44
.L17:
	cmpl	$1935766117, (%rdx)
	je	.L45
.L20:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	.cfi_restore_state
	cmpb	$109, 4(%rdx)
	jne	.L10
	leaq	5(%rbx,%rsi), %rsi
	cmpl	$1935766117, (%rsi)
	je	.L46
	cmpl	$1634038372, (%rdx)
	je	.L47
.L25:
	addl	$5, %ecx
.L16:
	cmpl	%ecx, %eax
	jg	.L24
.L9:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	cmpb	$101, 4(%rsi)
	je	.L25
	cmpl	$1634038372, (%rdx)
	jne	.L25
.L47:
	cmpw	$25965, 4(%rdx)
	jne	.L25
	cmpb	$114, 6(%rdx)
	jne	.L25
.L27:
	addl	$7, %ecx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L43:
	cmpw	$25965, 4(%rdx)
	jne	.L29
	cmpb	$114, 6(%rdx)
	jne	.L29
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L44:
	cmpw	$29285, 4(%rdx)
	jne	.L17
	addl	$6, %ecx
	jmp	.L16
.L45:
	cmpb	$101, 4(%rdx)
	jne	.L20
	jmp	.L25
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 100005
S:
	.zero	100005
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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:

// AtCoder ARC065 C - Daydream
// 2019.8.27 bal4u

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

#define gc() getchar_unlocked()

int ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	char *p = s--;
	do *++s = gc();
	while (*s > ' ');
	*s = 0;
	return s - p;
}

int N;
char S[100005];
				
int main()
{
	int i;
	
	N = ins(S);	
	i = 0; while (i < N) {
//printf("i=%d, N=%d\n", i, N);
		if (memcmp(S+i, "dream", 5) == 0 && memcmp(S+i+5, "erase", 5) == 0) i += 5;
		else if (memcmp(S+i, "dreamer", 7) == 0) i += 7;
		else if (memcmp(S+i, "dream", 5) == 0) i += 5;
		else if (memcmp(S+i, "eraser", 6) == 0) i += 6;
		else if (memcmp(S+i, "erase", 5) == 0) i += 5;
		else { puts("NO"); return 0; }
	}
	puts("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
// AtCoder ARC065 C - Daydream
// 2019.8.27 bal4u

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

#define gc() getchar_unlocked()

int ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	char *p = s--;
	do *++s = gc();
	while (*s > ' ');
	*s = 0;
	return s - p;
}

int N;
char S[100005];
				
int main()
{
	int i;
	
	N = ins(S);	
	i = 0; while (i < N) {
//printf("i=%d, N=%d\n", i, N);
		if (memcmp(S+i, "dream", 5) == 0 && memcmp(S+i+5, "erase", 5) == 0) i += 5;
		else if (memcmp(S+i, "dreamer", 7) == 0) i += 7;
		else if (memcmp(S+i, "dream", 5) == 0) i += 5;
		else if (memcmp(S+i, "eraser", 6) == 0) i += 6;
		else if (memcmp(S+i, "erase", 5) == 0) i += 5;
		else { puts("NO"); return 0; }
	}
	puts("YES");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ins
	.type	ins, @function
ins:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movq	%rax, -8(%rbp)
.L2:
	call	getchar_unlocked@PLT
	addq	$1, -24(%rbp)
	movl	%eax, %edx
	movq	-24(%rbp), %rax
	movb	%dl, (%rax)
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L2
	movq	-24(%rbp), %rax
	movb	$0, (%rax)
	movq	-24(%rbp), %rax
	subq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ins, .-ins
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 100005
S:
	.zero	100005
	.section	.rodata
.LC0:
	.string	"dream"
.LC1:
	.string	"erase"
.LC2:
	.string	"dreamer"
.LC3:
	.string	"eraser"
.LC4:
	.string	"NO"
.LC5:
	.string	"YES"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	ins
	movl	%eax, N(%rip)
	movl	$0, -4(%rbp)
	jmp	.L5
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	5(%rax), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L6
	addl	$5, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$7, %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L7
	addl	$7, -4(%rbp)
	jmp	.L5
.L7:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L8
	addl	$5, -4(%rbp)
	jmp	.L5
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$6, %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L9
	addl	$6, -4(%rbp)
	jmp	.L5
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$5, -4(%rbp)
	jmp	.L5
.L10:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L11
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L12
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.globl	ins
	.type	ins, @function
ins:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movq	%rax, -8(%rbp)
.L2:
	call	getchar_unlocked@PLT
	addq	$1, -24(%rbp)
	movl	%eax, %edx
	movq	-24(%rbp), %rax
	movb	%dl, (%rax)
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$32, %al
	jg	.L2
	movq	-24(%rbp), %rax
	movb	$0, (%rax)
	movq	-24(%rbp), %rax
	subq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ins, .-ins
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 100005
S:
	.zero	100005
	.section	.rodata
.LC0:
	.string	"dream"
.LC1:
	.string	"erase"
.LC2:
	.string	"dreamer"
.LC3:
	.string	"eraser"
.LC4:
	.string	"NO"
.LC5:
	.string	"YES"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	ins
	movl	%eax, N(%rip)
	movl	$0, -4(%rbp)
	jmp	.L5
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	cltq
	leaq	5(%rax), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L6
	addl	$5, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$7, %edx
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L7
	addl	$7, -4(%rbp)
	jmp	.L5
.L7:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L8
	addl	$5, -4(%rbp)
	jmp	.L5
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$6, %edx
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L9
	addl	$6, -4(%rbp)
	jmp	.L5
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	addq	%rdx, %rax
	movl	$5, %edx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcmp@PLT
	testl	%eax, %eax
	jne	.L10
	addl	$5, -4(%rbp)
	jmp	.L5
.L10:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L11
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L12
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
