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

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }

    return flag;
}

int main(){
    char s[100010];
    int dp[100010] = {0};
    char t[4][8]={"dream","dreamer","erase","eraser"};

    scanf("%s", s);

    dp[0] = 1;
    for(int i = 0; i < strlen(s); ++i){
        if(dp[i] == 0) continue;
        for(int j = 0; j < 4; ++j){
            if(is_substr(s, t[j], i) == 1) dp[i + strlen(t[j])] = 1;
        }
    }

    puts(dp[strlen(s)] ? "YES" : "NO");

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	is_substr
	.type	is_substr, @function
is_substr:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	$1, -24(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L2
	movl	$0, -24(%rbp)
.L2:
	movl	$0, -20(%rbp)
	jmp	.L3
.L6:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	$0, -24(%rbp)
	jmp	.L5
.L4:
	addl	$1, -20(%rbp)
	addl	$1, -52(%rbp)
.L3:
	movl	-20(%rbp), %eax
	movslq	%eax, %rbx
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L6
.L5:
	movl	-24(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	is_substr, .-is_substr
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.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
	pushq	%rbx
	leaq	-499712(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$424, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-500096(%rbp), %rax
	movl	$400040, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movabsq	$469785473636, %rax
	movq	%rax, -500128(%rbp)
	movabsq	$32199667804893796, %rax
	movq	%rax, -500120(%rbp)
	movabsq	$435727463013, %rax
	movq	%rax, -500112(%rbp)
	movabsq	$125780053029477, %rax
	movq	%rax, -500104(%rbp)
	leaq	-100048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -500096(%rbp)
	movl	$0, -500136(%rbp)
	jmp	.L9
.L15:
	movl	-500136(%rbp), %eax
	cltq
	movl	-500096(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, -500132(%rbp)
	jmp	.L12
.L14:
	leaq	-500128(%rbp), %rdx
	movl	-500132(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	(%rdx,%rax), %rcx
	movl	-500136(%rbp), %edx
	leaq	-100048(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	is_substr
	cmpl	$1, %eax
	jne	.L13
	movl	-500136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-500128(%rbp), %rdx
	movl	-500132(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addq	%rbx, %rax
	movl	$1, -500096(%rbp,%rax,4)
.L13:
	addl	$1, -500132(%rbp)
.L12:
	cmpl	$3, -500132(%rbp)
	jle	.L14
	jmp	.L11
.L20:
	nop
.L11:
	addl	$1, -500136(%rbp)
.L9:
	movl	-500136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-100048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L15
	leaq	-100048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	-500096(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
	leaq	.LC1(%rip), %rax
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rax
.L17:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	movq	-8(%rbp), %rbx
	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	is_substr
	.type	is_substr, @function
is_substr:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	movq	%rsi, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rsi, %rbx
	call	strlen@PLT
	movslq	%ebp, %rdx
	xorl	%ecx, %ecx
	leaq	(%r12,%rdx), %rsi
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	(%rsi,%rcx), %r8d
	addq	$1, %rcx
	cmpb	-1(%rbx,%rcx), %r8b
	jne	.L5
.L2:
	cmpq	%rcx, %rax
	jne	.L4
	xorl	%eax, %eax
	cmpb	$0, (%r12,%rdx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	setne	%al
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	is_substr, .-is_substr
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC4:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	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	-499712(%rsp), %r11
	.cfi_def_cfa 11, 499768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$408, %rsp
	.cfi_def_cfa_offset 500176
	movl	$400040, %edx
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	movq	%fs:40, %rax
	movq	%rax, 500104(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	400080(%rsp), %r12
	movq	%rbp, %rdi
	movq	%r12, %r15
	call	memset@PLT
	movdqa	.LC2(%rip), %xmm0
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rdi
	movaps	%xmm0, (%rsp)
	movdqa	.LC3(%rip), %xmm0
	movaps	%xmm0, 16(%rsp)
	call	__isoc99_scanf@PLT
	movl	$1, 32(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rbx
	addq	$1, %r15
.L9:
	movq	%r12, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L24
	movl	0(%rbp,%rbx,4), %edx
	testl	%edx, %edx
	je	.L10
	movzbl	(%r15), %r13d
	movq	%rsp, %r14
.L14:
	movq	%r14, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	movzbl	(%r15,%rdx), %ecx
	addq	$1, %rdx
	cmpb	-1(%r14,%rdx), %cl
	jne	.L12
.L11:
	cmpq	%rdx, %rax
	jne	.L13
	testb	%r13b, %r13b
	je	.L12
	addq	%rbx, %rax
	movl	$1, 32(%rsp,%rax,4)
.L12:
	addq	$8, %r14
	cmpq	%rbp, %r14
	jne	.L14
	jmp	.L10
.L24:
	movl	32(%rsp,%rax,4), %eax
	leaq	.LC0(%rip), %rdi
	testl	%eax, %eax
	leaq	.LC1(%rip), %rax
	cmove	%rax, %rdi
	call	puts@PLT
	movq	500104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$500120, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	469785473636
	.quad	32199667804893796
	.align 16
.LC3:
	.quad	435727463013
	.quad	125780053029477
	.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	is_substr
	.type	is_substr, @function
is_substr:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r12
	movq	%rsi, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rsi, %rbx
	call	strlen@PLT
	movslq	%ebp, %rdx
	xorl	%ecx, %ecx
	leaq	(%r12,%rdx), %rsi
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	(%rsi,%rcx), %r8d
	addq	$1, %rcx
	cmpb	-1(%rbx,%rcx), %r8b
	jne	.L5
.L2:
	cmpq	%rcx, %rax
	jne	.L4
	xorl	%eax, %eax
	cmpb	$0, (%r12,%rdx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	setne	%al
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	is_substr, .-is_substr
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"YES"
.LC1:
	.string	"NO"
.LC4:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	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	-499712(%rsp), %r11
	.cfi_def_cfa 11, 499768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$408, %rsp
	.cfi_def_cfa_offset 500176
	movl	$400040, %edx
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	movq	%fs:40, %rax
	movq	%rax, 500104(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	400080(%rsp), %r12
	movq	%rbp, %rdi
	movq	%r12, %r15
	call	memset@PLT
	movdqa	.LC2(%rip), %xmm0
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rdi
	movaps	%xmm0, (%rsp)
	movdqa	.LC3(%rip), %xmm0
	movaps	%xmm0, 16(%rsp)
	call	__isoc99_scanf@PLT
	movl	$1, 32(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rbx
	addq	$1, %r15
.L9:
	movq	%r12, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L24
	movl	0(%rbp,%rbx,4), %edx
	testl	%edx, %edx
	je	.L10
	movzbl	(%r15), %r13d
	movq	%rsp, %r14
.L14:
	movq	%r14, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	movzbl	(%r15,%rdx), %ecx
	addq	$1, %rdx
	cmpb	-1(%r14,%rdx), %cl
	jne	.L12
.L11:
	cmpq	%rdx, %rax
	jne	.L13
	testb	%r13b, %r13b
	je	.L12
	addq	%rbx, %rax
	movl	$1, 32(%rsp,%rax,4)
.L12:
	addq	$8, %r14
	cmpq	%rbp, %r14
	jne	.L14
	jmp	.L10
.L24:
	movl	32(%rsp,%rax,4), %eax
	leaq	.LC0(%rip), %rdi
	testl	%eax, %eax
	leaq	.LC1(%rip), %rax
	cmove	%rax, %rdi
	call	puts@PLT
	movq	500104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$500120, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	469785473636
	.quad	32199667804893796
	.align 16
.LC3:
	.quad	435727463013
	.quad	125780053029477
	.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 <string.h>

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }

    return flag;
}

int main(){
    char s[100010];
    int dp[100010] = {0};
    char t[4][8]={"dream","dreamer","erase","eraser"};

    scanf("%s", s);

    dp[0] = 1;
    for(int i = 0; i < strlen(s); ++i){
        if(dp[i] == 0) continue;
        for(int j = 0; j < 4; ++j){
            if(is_substr(s, t[j], i) == 1) dp[i + strlen(t[j])] = 1;
        }
    }

    puts(dp[strlen(s)] ? "YES" : "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>
#include <string.h>

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }

    return flag;
}

int main(){
    char s[100010];
    int dp[100010] = {0};
    char t[4][8]={"dream","dreamer","erase","eraser"};

    scanf("%s", s);

    dp[0] = 1;
    for(int i = 0; i < strlen(s); ++i){
        if(dp[i] == 0) continue;
        for(int j = 0; j < 4; ++j){
            if(is_substr(s, t[j], i) == 1) dp[i + strlen(t[j])] = 1;
        }
    }

    puts(dp[strlen(s)] ? "YES" : "NO");

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	is_substr
	.type	is_substr, @function
is_substr:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	$1, -24(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L2
	movl	$0, -24(%rbp)
.L2:
	movl	$0, -20(%rbp)
	jmp	.L3
.L6:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	$0, -24(%rbp)
	jmp	.L5
.L4:
	addl	$1, -20(%rbp)
	addl	$1, -52(%rbp)
.L3:
	movl	-20(%rbp), %eax
	movslq	%eax, %rbx
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L6
.L5:
	movl	-24(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	is_substr, .-is_substr
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.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
	pushq	%rbx
	leaq	-499712(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$424, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-500096(%rbp), %rax
	movl	$400040, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movabsq	$469785473636, %rax
	movq	%rax, -500128(%rbp)
	movabsq	$32199667804893796, %rax
	movq	%rax, -500120(%rbp)
	movabsq	$435727463013, %rax
	movq	%rax, -500112(%rbp)
	movabsq	$125780053029477, %rax
	movq	%rax, -500104(%rbp)
	leaq	-100048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -500096(%rbp)
	movl	$0, -500136(%rbp)
	jmp	.L9
.L15:
	movl	-500136(%rbp), %eax
	cltq
	movl	-500096(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, -500132(%rbp)
	jmp	.L12
.L14:
	leaq	-500128(%rbp), %rdx
	movl	-500132(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	(%rdx,%rax), %rcx
	movl	-500136(%rbp), %edx
	leaq	-100048(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	is_substr
	cmpl	$1, %eax
	jne	.L13
	movl	-500136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-500128(%rbp), %rdx
	movl	-500132(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addq	%rbx, %rax
	movl	$1, -500096(%rbp,%rax,4)
.L13:
	addl	$1, -500132(%rbp)
.L12:
	cmpl	$3, -500132(%rbp)
	jle	.L14
	jmp	.L11
.L20:
	nop
.L11:
	addl	$1, -500136(%rbp)
.L9:
	movl	-500136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-100048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L15
	leaq	-100048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	-500096(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
	leaq	.LC1(%rip), %rax
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rax
.L17:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	movq	-8(%rbp), %rbx
	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	is_substr
	.type	is_substr, @function
is_substr:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	$1, -24(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L2
	movl	$0, -24(%rbp)
.L2:
	movl	$0, -20(%rbp)
	jmp	.L3
.L6:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	$0, -24(%rbp)
	jmp	.L5
.L4:
	addl	$1, -20(%rbp)
	addl	$1, -52(%rbp)
.L3:
	movl	-20(%rbp), %eax
	movslq	%eax, %rbx
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L6
.L5:
	movl	-24(%rbp), %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	is_substr, .-is_substr
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.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
	pushq	%rbx
	leaq	-499712(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$424, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-500096(%rbp), %rax
	movl	$400040, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movabsq	$469785473636, %rax
	movq	%rax, -500128(%rbp)
	movabsq	$32199667804893796, %rax
	movq	%rax, -500120(%rbp)
	movabsq	$435727463013, %rax
	movq	%rax, -500112(%rbp)
	movabsq	$125780053029477, %rax
	movq	%rax, -500104(%rbp)
	leaq	-100048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -500096(%rbp)
	movl	$0, -500136(%rbp)
	jmp	.L9
.L15:
	movl	-500136(%rbp), %eax
	cltq
	movl	-500096(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, -500132(%rbp)
	jmp	.L12
.L14:
	leaq	-500128(%rbp), %rdx
	movl	-500132(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	(%rdx,%rax), %rcx
	movl	-500136(%rbp), %edx
	leaq	-100048(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	is_substr
	cmpl	$1, %eax
	jne	.L13
	movl	-500136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-500128(%rbp), %rdx
	movl	-500132(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	addq	%rbx, %rax
	movl	$1, -500096(%rbp,%rax,4)
.L13:
	addl	$1, -500132(%rbp)
.L12:
	cmpl	$3, -500132(%rbp)
	jle	.L14
	jmp	.L11
.L20:
	nop
.L11:
	addl	$1, -500136(%rbp)
.L9:
	movl	-500136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-100048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L15
	leaq	-100048(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	-500096(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
	leaq	.LC1(%rip), %rax
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rax
.L17:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	movq	-8(%rbp), %rbx
	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:
