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 indata[1000000],load[10000];
    int i,j,in,ln,state;
    
    scanf("%s",indata);
    scanf("%s",load);
    in=strlen(indata);
    ln=strlen(load);
    
    //printf("in = %d , ln = %d\n",in,ln);
    for(i=0;i<in;i++){
        state=1;
        if(indata[i]==load[0]){
            state=0;
            for(j=0;j<ln;j++){
                if(indata[i+j]!=load[j]){
                    state=1;
                    break;
                }
            }
        }
        if(state==0)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
	leaq	-1007616(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1000016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1010016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1010024(%rbp)
	leaq	-1010016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1010020(%rbp)
	movl	$0, -1010036(%rbp)
	jmp	.L2
.L8:
	movl	$1, -1010028(%rbp)
	movl	-1010036(%rbp), %eax
	cltq
	movzbl	-1000016(%rbp,%rax), %edx
	movzbl	-1010016(%rbp), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	$0, -1010028(%rbp)
	movl	$0, -1010032(%rbp)
	jmp	.L4
.L6:
	movl	-1010036(%rbp), %edx
	movl	-1010032(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-1000016(%rbp,%rax), %edx
	movl	-1010032(%rbp), %eax
	cltq
	movzbl	-1010016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	$1, -1010028(%rbp)
	jmp	.L3
.L5:
	addl	$1, -1010032(%rbp)
.L4:
	movl	-1010032(%rbp), %eax
	cmpl	-1010020(%rbp), %eax
	jl	.L6
.L3:
	cmpl	$0, -1010028(%rbp)
	jne	.L7
	movl	-1010036(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	addl	$1, -1010036(%rbp)
.L2:
	movl	-1010036(%rbp), %eax
	cmpl	-1010024(%rbp), %eax
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	%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	$2408, %rsp
	.cfi_def_cfa_offset 1010080
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1010008(%rsp)
	xorl	%eax, %eax
	leaq	10000(%rsp), %rbx
	movq	%rsp, %r12
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%r12, %rdi
	movq	%rax, %rbp
	movl	%eax, %r14d
	call	strlen@PLT
	testq	%rbp, %rbp
	je	.L2
	movq	%rax, %r12
	xorl	%ebp, %ebp
	leaq	-1(%rsp), %r13
	leaq	.LC1(%rip), %r15
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %ebp
	addq	$1, %rbx
	cmpl	%ebp, %r14d
	je	.L2
.L7:
	movzbl	(%rsp), %eax
	cmpb	%al, (%rbx)
	jne	.L3
	movl	$1, %eax
	testq	%r12, %r12
	jne	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rbx,%rax), %edx
	addq	$1, %rax
	cmpb	0(%r13,%rax), %dl
	jne	.L3
.L4:
	cmpq	%rax, %r12
	jne	.L6
.L5:
	movl	%ebp, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	movq	1010008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$1010024, %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
.L18:
	.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	%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	$2408, %rsp
	.cfi_def_cfa_offset 1010080
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1010008(%rsp)
	xorl	%eax, %eax
	leaq	10000(%rsp), %rbx
	movq	%rsp, %r12
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%r12, %rdi
	movq	%rax, %rbp
	movl	%eax, %r14d
	call	strlen@PLT
	testq	%rbp, %rbp
	je	.L2
	movq	%rax, %r12
	xorl	%ebp, %ebp
	leaq	-1(%rsp), %r13
	leaq	.LC1(%rip), %r15
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %ebp
	addq	$1, %rbx
	cmpl	%ebp, %r14d
	je	.L2
.L7:
	movzbl	(%rsp), %eax
	cmpb	%al, (%rbx)
	jne	.L3
	movl	$1, %eax
	testq	%r12, %r12
	jne	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	(%rbx,%rax), %edx
	addq	$1, %rax
	cmpb	0(%r13,%rax), %dl
	jne	.L3
.L4:
	cmpq	%rax, %r12
	jne	.L6
.L5:
	movl	%ebp, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	movq	1010008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$1010024, %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
.L18:
	.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 indata[1000000],load[10000];
    int i,j,in,ln,state;
    
    scanf("%s",indata);
    scanf("%s",load);
    in=strlen(indata);
    ln=strlen(load);
    
    //printf("in = %d , ln = %d\n",in,ln);
    for(i=0;i<in;i++){
        state=1;
        if(indata[i]==load[0]){
            state=0;
            for(j=0;j<ln;j++){
                if(indata[i+j]!=load[j]){
                    state=1;
                    break;
                }
            }
        }
        if(state==0)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 indata[1000000],load[10000];
    int i,j,in,ln,state;
    
    scanf("%s",indata);
    scanf("%s",load);
    in=strlen(indata);
    ln=strlen(load);
    
    //printf("in = %d , ln = %d\n",in,ln);
    for(i=0;i<in;i++){
        state=1;
        if(indata[i]==load[0]){
            state=0;
            for(j=0;j<ln;j++){
                if(indata[i+j]!=load[j]){
                    state=1;
                    break;
                }
            }
        }
        if(state==0)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
	leaq	-1007616(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1000016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1010016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1010024(%rbp)
	leaq	-1010016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1010020(%rbp)
	movl	$0, -1010036(%rbp)
	jmp	.L2
.L8:
	movl	$1, -1010028(%rbp)
	movl	-1010036(%rbp), %eax
	cltq
	movzbl	-1000016(%rbp,%rax), %edx
	movzbl	-1010016(%rbp), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	$0, -1010028(%rbp)
	movl	$0, -1010032(%rbp)
	jmp	.L4
.L6:
	movl	-1010036(%rbp), %edx
	movl	-1010032(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-1000016(%rbp,%rax), %edx
	movl	-1010032(%rbp), %eax
	cltq
	movzbl	-1010016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	$1, -1010028(%rbp)
	jmp	.L3
.L5:
	addl	$1, -1010032(%rbp)
.L4:
	movl	-1010032(%rbp), %eax
	cmpl	-1010020(%rbp), %eax
	jl	.L6
.L3:
	cmpl	$0, -1010028(%rbp)
	jne	.L7
	movl	-1010036(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	addl	$1, -1010036(%rbp)
.L2:
	movl	-1010036(%rbp), %eax
	cmpl	-1010024(%rbp), %eax
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
	leaq	-1007616(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1000016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1010016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1000016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1010024(%rbp)
	leaq	-1010016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -1010020(%rbp)
	movl	$0, -1010036(%rbp)
	jmp	.L2
.L8:
	movl	$1, -1010028(%rbp)
	movl	-1010036(%rbp), %eax
	cltq
	movzbl	-1000016(%rbp,%rax), %edx
	movzbl	-1010016(%rbp), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	$0, -1010028(%rbp)
	movl	$0, -1010032(%rbp)
	jmp	.L4
.L6:
	movl	-1010036(%rbp), %edx
	movl	-1010032(%rbp), %eax
	addl	%edx, %eax
	cltq
	movzbl	-1000016(%rbp,%rax), %edx
	movl	-1010032(%rbp), %eax
	cltq
	movzbl	-1010016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	$1, -1010028(%rbp)
	jmp	.L3
.L5:
	addl	$1, -1010032(%rbp)
.L4:
	movl	-1010032(%rbp), %eax
	cmpl	-1010020(%rbp), %eax
	jl	.L6
.L3:
	cmpl	$0, -1010028(%rbp)
	jne	.L7
	movl	-1010036(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	addl	$1, -1010036(%rbp)
.L2:
	movl	-1010036(%rbp), %eax
	cmpl	-1010024(%rbp), %eax
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
