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>
#define N 1001

int main(void){
        char T[N],P[N];
        int i,j;
        scanf("%s",T);
        scanf("%s",P);

        for(i=0;i<(int)strlen(T)-(int)strlen(P)+1;i++){
                for(j=0;j<strlen(P);j++){
                        if(T[i+j]!=P[j]) break;
                }
                if(j==strlen(P)) printf("%d\n",i);
        }
        return 0;
}```

Assembly Code:

```assembly
	.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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2040, %rsp
	.cfi_def_cfa_offset 2096
	movq	%fs:40, %rax
	movq	%rax, 2024(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	1008(%rsp), %rbp
	movq	%rbx, %rsi
	movq	%rbx, %r14
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	subl	%eax, %r13d
	cmpl	%r15d, %r13d
	jl	.L5
	movl	$1, %edx
	leaq	1007(%rsp), %rsi
	testq	%rax, %rax
	jne	.L4
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rdx), %rcx
	cmpq	%rdx, %rax
	je	.L6
	movq	%rcx, %rdx
.L4:
	movzbl	(%rsi,%rdx), %edi
	cmpb	%dil, -1(%r14,%rdx)
	je	.L13
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r15d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	movq	2024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$2040, %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
.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:
```

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	"%s"
.LC1:
	.string	"%d\n"
	.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
	xorl	%r15d, %r15d
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2040, %rsp
	.cfi_def_cfa_offset 2096
	movq	%fs:40, %rax
	movq	%rax, 2024(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	1008(%rsp), %rbp
	movq	%rbx, %rsi
	movq	%rbx, %r14
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	subl	%eax, %r13d
	cmpl	%r15d, %r13d
	jl	.L5
	movl	$1, %edx
	leaq	1007(%rsp), %rsi
	testq	%rax, %rax
	jne	.L4
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rdx), %rcx
	cmpq	%rdx, %rax
	je	.L6
	movq	%rcx, %rdx
.L4:
	movzbl	(%rsi,%rdx), %edi
	cmpb	%dil, -1(%r14,%rdx)
	je	.L13
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r15d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	movq	2024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$2040, %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
.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
```assembly
	.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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2040, %rsp
	.cfi_def_cfa_offset 2096
	movq	%fs:40, %rax
	movq	%rax, 2024(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	1008(%rsp), %rbp
	movq	%rbx, %rsi
	movq	%rbx, %r14
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	subl	%eax, %r13d
	cmpl	%r15d, %r13d
	jl	.L5
	movl	$1, %edx
	leaq	1007(%rsp), %rsi
	testq	%rax, %rax
	jne	.L4
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rdx), %rcx
	cmpq	%rdx, %rax
	je	.L6
	movq	%rcx, %rdx
.L4:
	movzbl	(%rsi,%rdx), %edi
	cmpb	%dil, -1(%r14,%rdx)
	je	.L13
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r15d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	movq	2024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$2040, %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
.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:
```
```c
#include <stdio.h>
#include <string.h>
#define N 1001

int main(void){
        char T[N],P[N];
        int i,j;
        scanf("%s",T);
        scanf("%s",P);

        for(i=0;i<(int)strlen(T)-(int)strlen(P)+1;i++){
                for(j=0;j<strlen(P);j++){
                        if(T[i+j]!=P[j]) break;
                }
                if(j==strlen(P)) printf("%d\n",i);
        }
        return 0;
}```
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>
#define N 1001

int main(void){
        char T[N],P[N];
        int i,j;
        scanf("%s",T);
        scanf("%s",P);

        for(i=0;i<(int)strlen(T)-(int)strlen(P)+1;i++){
                for(j=0;j<strlen(P);j++){
                        if(T[i+j]!=P[j]) break;
                }
                if(j==strlen(P)) printf("%d\n",i);
        }
        return 0;
}```

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:

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

```c
#include <stdio.h>
#include <string.h>
#define N 1001

int main(void){
        char T[N],P[N];
        int i,j;
        scanf("%s",T);
        scanf("%s",P);

        for(i=0;i<(int)strlen(T)-(int)strlen(P)+1;i++){
                for(j=0;j<strlen(P);j++){
                        if(T[i+j]!=P[j]) break;
                }
                if(j==strlen(P)) printf("%d\n",i);
        }
        return 0;
}```

Assembly Code:

```assembly
	.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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2040, %rsp
	.cfi_def_cfa_offset 2096
	movq	%fs:40, %rax
	movq	%rax, 2024(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	1008(%rsp), %rbp
	movq	%rbx, %rsi
	movq	%rbx, %r14
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	subl	%eax, %r13d
	cmpl	%r15d, %r13d
	jl	.L5
	movl	$1, %edx
	leaq	1007(%rsp), %rsi
	testq	%rax, %rax
	jne	.L4
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rdx), %rcx
	cmpq	%rdx, %rax
	je	.L6
	movq	%rcx, %rdx
.L4:
	movzbl	(%rsi,%rdx), %edi
	cmpb	%dil, -1(%r14,%rdx)
	je	.L13
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r15d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	movq	2024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$2040, %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
.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:
```

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	"%s"
.LC1:
	.string	"%d\n"
	.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
	xorl	%r15d, %r15d
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2040, %rsp
	.cfi_def_cfa_offset 2096
	movq	%fs:40, %rax
	movq	%rax, 2024(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	1008(%rsp), %rbp
	movq	%rbx, %rsi
	movq	%rbx, %r14
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	subl	%eax, %r13d
	cmpl	%r15d, %r13d
	jl	.L5
	movl	$1, %edx
	leaq	1007(%rsp), %rsi
	testq	%rax, %rax
	jne	.L4
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rdx), %rcx
	cmpq	%rdx, %rax
	je	.L6
	movq	%rcx, %rdx
.L4:
	movzbl	(%rsi,%rdx), %edi
	cmpb	%dil, -1(%r14,%rdx)
	je	.L13
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r15d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %r15d
	addq	$1, %r14
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	movq	2024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$2040, %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
.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:
```