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>
char s[100005];
int main()
{
	scanf("%s",s);
	int n=__builtin_strlen(s);
	int is_sym=1;
	for (int i=1;i<n;++i) if (s[i-1]!=s[n-i-1]) is_sym=0;
	if (s[0]=='0' || s[n-1]=='1' || !is_sym) return (int)puts("-1")*0;
	int prev=n-1;
	for (int v=n-2;0<=v;--v)
	{
		printf("%d %d\n",v+1,prev+1);
		if (s[v]=='1') prev=v;
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d %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
	subq	$32, %rsp
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-4(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	je	.L3
	movl	$0, -20(%rbp)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L4
	movzbl	s(%rip), %eax
	cmpb	$48, %al
	je	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	je	.L5
	cmpl	$0, -20(%rbp)
	jne	.L6
.L5:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L7
.L6:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-4(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L10:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	jne	.L9
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	subl	$1, -8(%rbp)
.L8:
	cmpl	$0, -8(%rbp)
	jns	.L10
	movl	$0, %eax
.L7:
	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	"-1"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	s(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	$1, %rax
	jbe	.L12
	leaq	1(%rbp), %rsi
	movslq	%eax, %rcx
	leal	-2(%rax), %edi
	movq	%rbp, %rdx
	addq	%rsi, %rdi
	addq	%rbp, %rcx
	movl	$1, %esi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	-2(%rcx), %ebx
	cmpb	%bl, (%rdx)
	cmovne	%r8d, %esi
	addq	$1, %rdx
	subq	$1, %rcx
	cmpq	%rdi, %rdx
	jne	.L4
.L2:
	cmpb	$48, s(%rip)
	je	.L5
	leal	-1(%rax), %r12d
	movslq	%r12d, %rdx
	cmpb	$49, 0(%rbp,%rdx)
	je	.L5
	andl	$1, %esi
	je	.L5
	subl	$2, %eax
	js	.L8
	movslq	%eax, %rbx
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L11:
	leal	1(%r12), %ecx
	leal	1(%rbx), %edx
	xorl	%eax, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpb	$49, 0(%rbp,%rbx)
	cmove	%ebx, %r12d
	subq	$1, %rbx
	testl	%ebx, %ebx
	jns	.L11
	jmp	.L8
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L8:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	movl	$1, %esi
	jmp	.L2
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.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	"-1"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	s(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	$1, %rax
	jbe	.L12
	leaq	1(%rbp), %rsi
	movslq	%eax, %rcx
	leal	-2(%rax), %edi
	movq	%rbp, %rdx
	addq	%rsi, %rdi
	addq	%rbp, %rcx
	movl	$1, %esi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	-2(%rcx), %ebx
	cmpb	%bl, (%rdx)
	cmovne	%r8d, %esi
	addq	$1, %rdx
	subq	$1, %rcx
	cmpq	%rdi, %rdx
	jne	.L4
.L2:
	cmpb	$48, s(%rip)
	je	.L5
	leal	-1(%rax), %r12d
	movslq	%r12d, %rdx
	cmpb	$49, 0(%rbp,%rdx)
	je	.L5
	andl	$1, %esi
	je	.L5
	subl	$2, %eax
	js	.L8
	movslq	%eax, %rbx
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L11:
	leal	1(%r12), %ecx
	leal	1(%rbx), %edx
	xorl	%eax, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpb	$49, 0(%rbp,%rbx)
	cmove	%ebx, %r12d
	subq	$1, %rbx
	testl	%ebx, %ebx
	jns	.L11
	jmp	.L8
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L8:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	movl	$1, %esi
	jmp	.L2
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.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>
char s[100005];
int main()
{
	scanf("%s",s);
	int n=__builtin_strlen(s);
	int is_sym=1;
	for (int i=1;i<n;++i) if (s[i-1]!=s[n-i-1]) is_sym=0;
	if (s[0]=='0' || s[n-1]=='1' || !is_sym) return (int)puts("-1")*0;
	int prev=n-1;
	for (int v=n-2;0<=v;--v)
	{
		printf("%d %d\n",v+1,prev+1);
		if (s[v]=='1') prev=v;
	}
	return 0;
}
1011
 0111
 1000
 1100
 0011
 1001
 0100
 0110
 0001
 0101

-1
 -1
 -1
 -1
 -1
 -1
 -1
 -1
 -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>
char s[100005];
int main()
{
	scanf("%s",s);
	int n=__builtin_strlen(s);
	int is_sym=1;
	for (int i=1;i<n;++i) if (s[i-1]!=s[n-i-1]) is_sym=0;
	if (s[0]=='0' || s[n-1]=='1' || !is_sym) return (int)puts("-1")*0;
	int prev=n-1;
	for (int v=n-2;0<=v;--v)
	{
		printf("%d %d\n",v+1,prev+1);
		if (s[v]=='1') prev=v;
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d %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
	subq	$32, %rsp
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-4(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	je	.L3
	movl	$0, -20(%rbp)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L4
	movzbl	s(%rip), %eax
	cmpb	$48, %al
	je	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	je	.L5
	cmpl	$0, -20(%rbp)
	jne	.L6
.L5:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L7
.L6:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-4(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L10:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	jne	.L9
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	subl	$1, -8(%rbp)
.L8:
	cmpl	$0, -8(%rbp)
	jns	.L10
	movl	$0, %eax
.L7:
	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
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d %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
	subq	$32, %rsp
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-4(%rbp), %eax
	subl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	je	.L3
	movl	$0, -20(%rbp)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L4
	movzbl	s(%rip), %eax
	cmpb	$48, %al
	je	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	je	.L5
	cmpl	$0, -20(%rbp)
	jne	.L6
.L5:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L7
.L6:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-4(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L10:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$49, %al
	jne	.L9
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	subl	$1, -8(%rbp)
.L8:
	cmpl	$0, -8(%rbp)
	jns	.L10
	movl	$0, %eax
.L7:
	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:
