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 A[100001];
		scanf("%s",A);
		int i;
		int n = strlen(A);
		int flag = 0;
		if( n > 2)
		{
		
		for(i=0;i<n-2;++i)
		{
			if( A[i] == A[i+1] || A[i] == A[i+2] || A[i+1] == A[i+2])
			{
				printf("%d %d",i+1,i+3);
				flag = 1;
				break;
			}
			
		}
	       }
	    else
		{
			if( A[0] == A[1])
			{
				printf("1 2");
				flag = 1;
			}
		 } 
	
		if(flag == 0)
		{
			printf("-1 -1");
		}
		return 0;
	}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"1 2"
.LC3:
	.string	"-1 -1"
	.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	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100020(%rbp)
	movl	$0, -100024(%rbp)
	cmpl	$2, -100020(%rbp)
	jle	.L2
	movl	$0, -100028(%rbp)
	jmp	.L3
.L7:
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L5
.L4:
	movl	-100028(%rbp), %eax
	leal	3(%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -100024(%rbp)
	jmp	.L8
.L5:
	addl	$1, -100028(%rbp)
.L3:
	movl	-100020(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -100028(%rbp)
	jl	.L7
	jmp	.L8
.L2:
	movzbl	-100016(%rbp), %edx
	movzbl	-100015(%rbp), %eax
	cmpb	%al, %dl
	jne	.L8
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -100024(%rbp)
.L8:
	cmpl	$0, -100024(%rbp)
	jne	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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 %d"
.LC2:
	.string	"1 2"
.LC3:
	.string	"-1 -1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1712, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	$2, %rax
	jbe	.L15
	movzbl	(%rsp), %r9d
	movzbl	1(%rsp), %esi
	subl	$2, %eax
	xorl	%edx, %edx
	leaq	2(%rsp), %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edi, %esi
.L8:
	movl	%edx, %ecx
	addl	$1, %edx
	cmpb	%r9b, %sil
	je	.L4
	movzbl	(%r8), %edi
	addq	$1, %r8
	cmpb	%r9b, %dil
	je	.L4
	cmpb	%sil, %dil
	je	.L4
	movl	%esi, %r9d
	cmpl	%eax, %edx
	jl	.L11
.L9:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movzbl	1(%rsp), %eax
	cmpb	%al, (%rsp)
	jne	.L9
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L4:
	addl	$3, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L16:
	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 %d"
.LC2:
	.string	"1 2"
.LC3:
	.string	"-1 -1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1712, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	$2, %rax
	jbe	.L15
	movzbl	(%rsp), %r9d
	movzbl	1(%rsp), %esi
	subl	$2, %eax
	xorl	%edx, %edx
	leaq	2(%rsp), %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edi, %esi
.L8:
	movl	%edx, %ecx
	addl	$1, %edx
	cmpb	%r9b, %sil
	je	.L4
	movzbl	(%r8), %edi
	addq	$1, %r8
	cmpb	%r9b, %dil
	je	.L4
	cmpb	%sil, %dil
	je	.L4
	movl	%esi, %r9d
	cmpl	%eax, %edx
	jl	.L11
.L9:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movzbl	1(%rsp), %eax
	cmpb	%al, (%rsp)
	jne	.L9
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L4:
	addl	$3, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L16:
	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 A[100001];
		scanf("%s",A);
		int i;
		int n = strlen(A);
		int flag = 0;
		if( n > 2)
		{
		
		for(i=0;i<n-2;++i)
		{
			if( A[i] == A[i+1] || A[i] == A[i+2] || A[i+1] == A[i+2])
			{
				printf("%d %d",i+1,i+3);
				flag = 1;
				break;
			}
			
		}
	       }
	    else
		{
			if( A[0] == A[1])
			{
				printf("1 2");
				flag = 1;
			}
		 } 
	
		if(flag == 0)
		{
			printf("-1 -1");
		}
		return 0;
	}
deened
 aoctder
 aocteer
 aectepp
 defnfd
 ndeedd
 defned
 fedned
 aocueer
 efdned

1 3 -1 -1 4 6 5 7 3 5 2 4 -1 -1 -1 -1 4 6 -1 -1
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 A[100001];
		scanf("%s",A);
		int i;
		int n = strlen(A);
		int flag = 0;
		if( n > 2)
		{
		
		for(i=0;i<n-2;++i)
		{
			if( A[i] == A[i+1] || A[i] == A[i+2] || A[i+1] == A[i+2])
			{
				printf("%d %d",i+1,i+3);
				flag = 1;
				break;
			}
			
		}
	       }
	    else
		{
			if( A[0] == A[1])
			{
				printf("1 2");
				flag = 1;
			}
		 } 
	
		if(flag == 0)
		{
			printf("-1 -1");
		}
		return 0;
	}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"1 2"
.LC3:
	.string	"-1 -1"
	.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	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100020(%rbp)
	movl	$0, -100024(%rbp)
	cmpl	$2, -100020(%rbp)
	jle	.L2
	movl	$0, -100028(%rbp)
	jmp	.L3
.L7:
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L5
.L4:
	movl	-100028(%rbp), %eax
	leal	3(%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -100024(%rbp)
	jmp	.L8
.L5:
	addl	$1, -100028(%rbp)
.L3:
	movl	-100020(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -100028(%rbp)
	jl	.L7
	jmp	.L8
.L2:
	movzbl	-100016(%rbp), %edx
	movzbl	-100015(%rbp), %eax
	cmpb	%al, %dl
	jne	.L8
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -100024(%rbp)
.L8:
	cmpl	$0, -100024(%rbp)
	jne	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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 %d"
.LC2:
	.string	"1 2"
.LC3:
	.string	"-1 -1"
	.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	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100020(%rbp)
	movl	$0, -100024(%rbp)
	cmpl	$2, -100020(%rbp)
	jle	.L2
	movl	$0, -100028(%rbp)
	jmp	.L3
.L7:
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-100028(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$2, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L5
.L4:
	movl	-100028(%rbp), %eax
	leal	3(%rax), %edx
	movl	-100028(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -100024(%rbp)
	jmp	.L8
.L5:
	addl	$1, -100028(%rbp)
.L3:
	movl	-100020(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -100028(%rbp)
	jl	.L7
	jmp	.L8
.L2:
	movzbl	-100016(%rbp), %edx
	movzbl	-100015(%rbp), %eax
	cmpb	%al, %dl
	jne	.L8
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -100024(%rbp)
.L8:
	cmpl	$0, -100024(%rbp)
	jne	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
