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 10001
#define N2 1000001
int main(){
  char T[N2],P[N];
  int i,j,n,m,flag;
  
  scanf("%s",T);
  scanf("%s",P);
  
  n=strlen(T);
  m=strlen(P);
  
  for(i=0;i<n;i++) if(strncmp(&T[i],P,m)==0) 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
	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	-1007616(%rsp), %r11
	.cfi_def_cfa 11, 1007672
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2424, %rsp
	.cfi_def_cfa_offset 1010096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1010024(%rsp)
	xorl	%eax, %eax
	leaq	10016(%rsp), %r12
	movq	%rsp, %r13
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%r13, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	testq	%rbx, %rbx
	je	.L2
	movq	%rax, %rbp
	xorl	%r15d, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %r15
	cmpq	%r15, %rbx
	je	.L2
.L4:
	leaq	(%r12,%r15), %rdi
	movq	%rbp, %rdx
	movq	%r13, %rsi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	%r15d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r15
	call	__printf_chk@PLT
	cmpq	%r15, %rbx
	jne	.L4
.L2:
	movq	1010024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$1010040, %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
.L12:
	.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
	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	-1007616(%rsp), %r11
	.cfi_def_cfa 11, 1007672
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2424, %rsp
	.cfi_def_cfa_offset 1010096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1010024(%rsp)
	xorl	%eax, %eax
	leaq	10016(%rsp), %r12
	movq	%rsp, %r13
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%r13, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	testq	%rbx, %rbx
	je	.L2
	movq	%rax, %rbp
	xorl	%r15d, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %r15
	cmpq	%r15, %rbx
	je	.L2
.L4:
	leaq	(%r12,%r15), %rdi
	movq	%rbp, %rdx
	movq	%r13, %rsi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	%r15d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r15
	call	__printf_chk@PLT
	cmpq	%r15, %rbx
	jne	.L4
.L2:
	movq	1010024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$1010040, %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
.L12:
	.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
	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	-1007616(%rsp), %r11
	.cfi_def_cfa 11, 1007672
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2424, %rsp
	.cfi_def_cfa_offset 1010096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1010024(%rsp)
	xorl	%eax, %eax
	leaq	10016(%rsp), %r12
	movq	%rsp, %r13
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%r13, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	testq	%rbx, %rbx
	je	.L2
	movq	%rax, %rbp
	xorl	%r15d, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %r15
	cmpq	%r15, %rbx
	je	.L2
.L4:
	leaq	(%r12,%r15), %rdi
	movq	%rbp, %rdx
	movq	%r13, %rsi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	%r15d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r15
	call	__printf_chk@PLT
	cmpq	%r15, %rbx
	jne	.L4
.L2:
	movq	1010024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$1010040, %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
.L12:
	.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 10001
#define N2 1000001
int main(){
  char T[N2],P[N];
  int i,j,n,m,flag;
  
  scanf("%s",T);
  scanf("%s",P);
  
  n=strlen(T);
  m=strlen(P);
  
  for(i=0;i<n;i++) if(strncmp(&T[i],P,m)==0) 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 10001
#define N2 1000001
int main(){
  char T[N2],P[N];
  int i,j,n,m,flag;
  
  scanf("%s",T);
  scanf("%s",P);
  
  n=strlen(T);
  m=strlen(P);
  
  for(i=0;i<n;i++) if(strncmp(&T[i],P,m)==0) 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
 aabbaa
aa
 aabaab
aa
 aababb
aa
 aaabaa
ab
 aabba`
a`
 cbabaa
ba
 cbaaaa
ba
 dbaaba
ba
 dbaaba
ab

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

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 10001
#define N2 1000001
int main(){
  char T[N2],P[N];
  int i,j,n,m,flag;
  
  scanf("%s",T);
  scanf("%s",P);
  
  n=strlen(T);
  m=strlen(P);
  
  for(i=0;i<n;i++) if(strncmp(&T[i],P,m)==0) 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
	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	-1007616(%rsp), %r11
	.cfi_def_cfa 11, 1007672
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2424, %rsp
	.cfi_def_cfa_offset 1010096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1010024(%rsp)
	xorl	%eax, %eax
	leaq	10016(%rsp), %r12
	movq	%rsp, %r13
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%r13, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	testq	%rbx, %rbx
	je	.L2
	movq	%rax, %rbp
	xorl	%r15d, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %r15
	cmpq	%r15, %rbx
	je	.L2
.L4:
	leaq	(%r12,%r15), %rdi
	movq	%rbp, %rdx
	movq	%r13, %rsi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	%r15d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r15
	call	__printf_chk@PLT
	cmpq	%r15, %rbx
	jne	.L4
.L2:
	movq	1010024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$1010040, %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
.L12:
	.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
	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	-1007616(%rsp), %r11
	.cfi_def_cfa 11, 1007672
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2424, %rsp
	.cfi_def_cfa_offset 1010096
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1010024(%rsp)
	xorl	%eax, %eax
	leaq	10016(%rsp), %r12
	movq	%rsp, %r13
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%r13, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	testq	%rbx, %rbx
	je	.L2
	movq	%rax, %rbp
	xorl	%r15d, %r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %r15
	cmpq	%r15, %rbx
	je	.L2
.L4:
	leaq	(%r12,%r15), %rdi
	movq	%rbp, %rdx
	movq	%r13, %rsi
	call	strncmp@PLT
	testl	%eax, %eax
	jne	.L3
	movl	%r15d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r15
	call	__printf_chk@PLT
	cmpq	%r15, %rbx
	jne	.L4
.L2:
	movq	1010024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$1010040, %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
.L12:
	.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:
```