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 main() {
    char s1[1001];
    char s2[1001];
    int i, j, k;

    scanf("%s", s1);
    scanf("%s", s2);

    for (i = 0; strlen(s2) <= strlen(&s1[i]); i++) {
        for ( j = 0; j < strlen(s2); j++) {
            if(s2[j] == s1[i+j]) continue;
            else break;
        }
        if(j == strlen(s2)) printf("%d\n", i);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.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
	pushq	%rbx
	subq	$2056, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-2048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2056(%rbp)
	jmp	.L2
.L9:
	movl	$0, -2052(%rbp)
	jmp	.L3
.L7:
	movl	-2052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %edx
	movl	-2056(%rbp), %ecx
	movl	-2052(%rbp), %eax
	addl	%ecx, %eax
	cltq
	movzbl	-2048(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	nop
	addl	$1, -2052(%rbp)
.L3:
	movl	-2052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L7
	jmp	.L6
.L12:
	nop
.L6:
	movl	-2052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jne	.L8
	movl	-2056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	addl	$1, -2056(%rbp)
.L2:
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rbx
	leaq	-2048(%rbp), %rdx
	movl	-2056(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jbe	.L9
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$2032, %rsp
	.cfi_def_cfa_offset 2080
	movq	%fs:40, %rax
	movq	%rax, 2024(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	1008(%rsp), %r14
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	xorl	%r12d, %r12d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%rax, %rbx
	je	.L5
.L6:
	addl	$1, %r12d
	addq	$1, %rbp
.L2:
	movq	%r14, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	cmpq	%rax, %rbx
	ja	.L7
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	.L5
.L4:
	movzbl	0(%rbp,%rax), %ecx
	cmpb	%cl, (%r14,%rax)
	jne	.L3
	addq	$1, %rax
	cmpq	%rbx, %rax
	jne	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r12d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movq	2024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$2032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$2032, %rsp
	.cfi_def_cfa_offset 2080
	movq	%fs:40, %rax
	movq	%rax, 2024(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	1008(%rsp), %r14
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	xorl	%r12d, %r12d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%rax, %rbx
	je	.L5
.L6:
	addl	$1, %r12d
	addq	$1, %rbp
.L2:
	movq	%r14, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	cmpq	%rax, %rbx
	ja	.L7
	xorl	%eax, %eax
	testq	%rbx, %rbx
	je	.L5
.L4:
	movzbl	0(%rbp,%rax), %ecx
	cmpb	%cl, (%r14,%rax)
	jne	.L3
	addq	$1, %rax
	cmpq	%rbx, %rax
	jne	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r12d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movq	2024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$2032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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<string.h>

int main() {
    char s1[1001];
    char s2[1001];
    int i, j, k;

    scanf("%s", s1);
    scanf("%s", s2);

    for (i = 0; strlen(s2) <= strlen(&s1[i]); i++) {
        for ( j = 0; j < strlen(s2); j++) {
            if(s2[j] == s1[i+j]) continue;
            else break;
        }
        if(j == strlen(s2)) printf("%d\n", i);
    }

    return 0;
}
aaabaa
aa
 aabaaa
ba
 aaabaa
ba
 aab`aa
aa
 xyzy
yz
 aaaaba
aa
 abaaaa
aa
 abaaaa
ab
 aaacab
aa
 aaaaba
ba

0
1
4
 2
 3
 0
4
 1
 0
1
2
 2
3
4
 0
 0
1
 4

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 main() {
    char s1[1001];
    char s2[1001];
    int i, j, k;

    scanf("%s", s1);
    scanf("%s", s2);

    for (i = 0; strlen(s2) <= strlen(&s1[i]); i++) {
        for ( j = 0; j < strlen(s2); j++) {
            if(s2[j] == s1[i+j]) continue;
            else break;
        }
        if(j == strlen(s2)) printf("%d\n", i);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.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
	pushq	%rbx
	subq	$2056, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-2048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2056(%rbp)
	jmp	.L2
.L9:
	movl	$0, -2052(%rbp)
	jmp	.L3
.L7:
	movl	-2052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %edx
	movl	-2056(%rbp), %ecx
	movl	-2052(%rbp), %eax
	addl	%ecx, %eax
	cltq
	movzbl	-2048(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	nop
	addl	$1, -2052(%rbp)
.L3:
	movl	-2052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L7
	jmp	.L6
.L12:
	nop
.L6:
	movl	-2052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jne	.L8
	movl	-2056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	addl	$1, -2056(%rbp)
.L2:
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rbx
	leaq	-2048(%rbp), %rdx
	movl	-2056(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jbe	.L9
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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	"%d\n"
	.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
	pushq	%rbx
	subq	$2056, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-2048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2056(%rbp)
	jmp	.L2
.L9:
	movl	$0, -2052(%rbp)
	jmp	.L3
.L7:
	movl	-2052(%rbp), %eax
	cltq
	movzbl	-1040(%rbp,%rax), %edx
	movl	-2056(%rbp), %ecx
	movl	-2052(%rbp), %eax
	addl	%ecx, %eax
	cltq
	movzbl	-2048(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L12
	nop
	addl	$1, -2052(%rbp)
.L3:
	movl	-2052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L7
	jmp	.L6
.L12:
	nop
.L6:
	movl	-2052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jne	.L8
	movl	-2056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	addl	$1, -2056(%rbp)
.L2:
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rbx
	leaq	-2048(%rbp), %rdx
	movl	-2056(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jbe	.L9
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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:
