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>

int main(void){
	long long n,a[131072],r,i,c,d,s;
	scanf("%lld",&n);
	for(i = 1;i <= n;i++){scanf("%lld",&a[i]);}
	s=0;c=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s <= 0){c+=(1-s);s=1;}
		if(i%2 == 0 && s >= 0){c+=(s-(-1));s=-1;}
	}
	s=0;d=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s >= 0){d+=(s-(-1));s=-1;}
		if(i%2 == 0 && s <= 0){d+=(1-s);s=1;}
	}
	if(c<d){printf("%lld\n",c);}else{printf("%lld\n",d);}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-1048576(%rsp), %r11
	.cfi_def_cfa 11, 1048608
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$32, %rsp
	.cfi_def_cfa_offset 1048640
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1048600(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	leaq	24(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jge	.L3
	testq	%rax, %rax
	jle	.L2
	leaq	1(%rax), %rcx
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	movl	$1, %eax
	leaq	16(%rsp), %rdi
	movl	$1, %r10d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	testq	%rdx, %rdx
	js	.L7
	leaq	1(%r9,%rdx), %r9
	movq	$-1, %rdx
.L7:
	leaq	1(%rax), %rsi
	cmpq	%rsi, %rcx
	je	.L28
.L18:
	movq	%rsi, %rax
.L8:
	movq	%rax, %rsi
	addq	(%rdi,%rax,8), %rdx
	andl	$1, %esi
	je	.L4
	testq	%rdx, %rdx
	jg	.L7
	movq	%r10, %r8
	subq	%rdx, %r8
	movq	%rsi, %rdx
	leaq	1(%rax), %rsi
	addq	%r8, %r9
	cmpq	%rsi, %rcx
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %edx
	movl	$1, %r10d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	testq	%rcx, %rcx
	jg	.L12
	movq	%r10, %rsi
	subq	%rcx, %rsi
	movl	$1, %ecx
	addq	%rsi, %r8
.L12:
	leaq	1(%rdx), %rsi
	cmpq	%rax, %rdx
	je	.L29
.L20:
	movq	%rsi, %rdx
.L13:
	addq	(%rdi,%rdx,8), %rcx
	testb	$1, %dl
	je	.L9
	testq	%rcx, %rcx
	js	.L12
	leaq	1(%r8,%rcx), %r8
	leaq	1(%rdx), %rsi
	movq	$-1, %rcx
	cmpq	%rax, %rdx
	jne	.L20
.L29:
	cmpq	%r9, %r8
	jle	.L14
	movq	%r9, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	1048600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$1048608, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L14:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-1048576(%rsp), %r11
	.cfi_def_cfa 11, 1048608
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$32, %rsp
	.cfi_def_cfa_offset 1048640
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1048600(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	leaq	24(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jge	.L3
	testq	%rax, %rax
	jle	.L2
	leaq	1(%rax), %rcx
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	movl	$1, %eax
	leaq	16(%rsp), %rdi
	movl	$1, %r10d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	testq	%rdx, %rdx
	js	.L7
	leaq	1(%r9,%rdx), %r9
	movq	$-1, %rdx
.L7:
	leaq	1(%rax), %rsi
	cmpq	%rsi, %rcx
	je	.L28
.L18:
	movq	%rsi, %rax
.L8:
	movq	%rax, %rsi
	addq	(%rdi,%rax,8), %rdx
	andl	$1, %esi
	je	.L4
	testq	%rdx, %rdx
	jg	.L7
	movq	%r10, %r8
	subq	%rdx, %r8
	movq	%rsi, %rdx
	leaq	1(%rax), %rsi
	addq	%r8, %r9
	cmpq	%rsi, %rcx
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %edx
	movl	$1, %r10d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	testq	%rcx, %rcx
	jg	.L12
	movq	%r10, %rsi
	subq	%rcx, %rsi
	movl	$1, %ecx
	addq	%rsi, %r8
.L12:
	leaq	1(%rdx), %rsi
	cmpq	%rax, %rdx
	je	.L29
.L20:
	movq	%rsi, %rdx
.L13:
	addq	(%rdi,%rdx,8), %rcx
	testb	$1, %dl
	je	.L9
	testq	%rcx, %rcx
	js	.L12
	leaq	1(%r8,%rcx), %r8
	leaq	1(%rdx), %rsi
	movq	$-1, %rcx
	cmpq	%rax, %rdx
	jne	.L20
.L29:
	cmpq	%r9, %r8
	jle	.L14
	movq	%r9, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	1048600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$1048608, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L14:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-1048576(%rsp), %r11
	.cfi_def_cfa 11, 1048608
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$32, %rsp
	.cfi_def_cfa_offset 1048640
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1048600(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	leaq	24(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jge	.L3
	testq	%rax, %rax
	jle	.L2
	leaq	1(%rax), %rcx
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	movl	$1, %eax
	leaq	16(%rsp), %rdi
	movl	$1, %r10d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	testq	%rdx, %rdx
	js	.L7
	leaq	1(%r9,%rdx), %r9
	movq	$-1, %rdx
.L7:
	leaq	1(%rax), %rsi
	cmpq	%rsi, %rcx
	je	.L28
.L18:
	movq	%rsi, %rax
.L8:
	movq	%rax, %rsi
	addq	(%rdi,%rax,8), %rdx
	andl	$1, %esi
	je	.L4
	testq	%rdx, %rdx
	jg	.L7
	movq	%r10, %r8
	subq	%rdx, %r8
	movq	%rsi, %rdx
	leaq	1(%rax), %rsi
	addq	%r8, %r9
	cmpq	%rsi, %rcx
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %edx
	movl	$1, %r10d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	testq	%rcx, %rcx
	jg	.L12
	movq	%r10, %rsi
	subq	%rcx, %rsi
	movl	$1, %ecx
	addq	%rsi, %r8
.L12:
	leaq	1(%rdx), %rsi
	cmpq	%rax, %rdx
	je	.L29
.L20:
	movq	%rsi, %rdx
.L13:
	addq	(%rdi,%rdx,8), %rcx
	testb	$1, %dl
	je	.L9
	testq	%rcx, %rcx
	js	.L12
	leaq	1(%r8,%rcx), %r8
	leaq	1(%rdx), %rsi
	movq	$-1, %rcx
	cmpq	%rax, %rdx
	jne	.L20
.L29:
	cmpq	%r9, %r8
	jle	.L14
	movq	%r9, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	1048600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$1048608, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L14:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main(void){
	long long n,a[131072],r,i,c,d,s;
	scanf("%lld",&n);
	for(i = 1;i <= n;i++){scanf("%lld",&a[i]);}
	s=0;c=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s <= 0){c+=(1-s);s=1;}
		if(i%2 == 0 && s >= 0){c+=(s-(-1));s=-1;}
	}
	s=0;d=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s >= 0){d+=(s-(-1));s=-1;}
		if(i%2 == 0 && s <= 0){d+=(1-s);s=1;}
	}
	if(c<d){printf("%lld\n",c);}else{printf("%lld\n",d);}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(void){
	long long n,a[131072],r,i,c,d,s;
	scanf("%lld",&n);
	for(i = 1;i <= n;i++){scanf("%lld",&a[i]);}
	s=0;c=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s <= 0){c+=(1-s);s=1;}
		if(i%2 == 0 && s >= 0){c+=(s-(-1));s=-1;}
	}
	s=0;d=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s >= 0){d+=(s-(-1));s=-1;}
		if(i%2 == 0 && s <= 0){d+=(1-s);s=1;}
	}
	if(c<d){printf("%lld\n",c);}else{printf("%lld\n",d);}
	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:

4
1 -3 1 0

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>

int main(void){
	long long n,a[131072],r,i,c,d,s;
	scanf("%lld",&n);
	for(i = 1;i <= n;i++){scanf("%lld",&a[i]);}
	s=0;c=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s <= 0){c+=(1-s);s=1;}
		if(i%2 == 0 && s >= 0){c+=(s-(-1));s=-1;}
	}
	s=0;d=0;
	for(i = 1;i <= n;i++){
		s+=a[i];
		if(i%2 == 1 && s >= 0){d+=(s-(-1));s=-1;}
		if(i%2 == 0 && s <= 0){d+=(1-s);s=1;}
	}
	if(c<d){printf("%lld\n",c);}else{printf("%lld\n",d);}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-1048576(%rsp), %r11
	.cfi_def_cfa 11, 1048608
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$32, %rsp
	.cfi_def_cfa_offset 1048640
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1048600(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	leaq	24(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jge	.L3
	testq	%rax, %rax
	jle	.L2
	leaq	1(%rax), %rcx
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	movl	$1, %eax
	leaq	16(%rsp), %rdi
	movl	$1, %r10d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	testq	%rdx, %rdx
	js	.L7
	leaq	1(%r9,%rdx), %r9
	movq	$-1, %rdx
.L7:
	leaq	1(%rax), %rsi
	cmpq	%rsi, %rcx
	je	.L28
.L18:
	movq	%rsi, %rax
.L8:
	movq	%rax, %rsi
	addq	(%rdi,%rax,8), %rdx
	andl	$1, %esi
	je	.L4
	testq	%rdx, %rdx
	jg	.L7
	movq	%r10, %r8
	subq	%rdx, %r8
	movq	%rsi, %rdx
	leaq	1(%rax), %rsi
	addq	%r8, %r9
	cmpq	%rsi, %rcx
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %edx
	movl	$1, %r10d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	testq	%rcx, %rcx
	jg	.L12
	movq	%r10, %rsi
	subq	%rcx, %rsi
	movl	$1, %ecx
	addq	%rsi, %r8
.L12:
	leaq	1(%rdx), %rsi
	cmpq	%rax, %rdx
	je	.L29
.L20:
	movq	%rsi, %rdx
.L13:
	addq	(%rdi,%rdx,8), %rcx
	testb	$1, %dl
	je	.L9
	testq	%rcx, %rcx
	js	.L12
	leaq	1(%r8,%rcx), %r8
	leaq	1(%rdx), %rsi
	movq	$-1, %rcx
	cmpq	%rax, %rdx
	jne	.L20
.L29:
	cmpq	%r9, %r8
	jle	.L14
	movq	%r9, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	1048600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$1048608, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L14:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-1048576(%rsp), %r11
	.cfi_def_cfa 11, 1048608
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$32, %rsp
	.cfi_def_cfa_offset 1048640
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1048600(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	leaq	24(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jge	.L3
	testq	%rax, %rax
	jle	.L2
	leaq	1(%rax), %rcx
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	movl	$1, %eax
	leaq	16(%rsp), %rdi
	movl	$1, %r10d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	testq	%rdx, %rdx
	js	.L7
	leaq	1(%r9,%rdx), %r9
	movq	$-1, %rdx
.L7:
	leaq	1(%rax), %rsi
	cmpq	%rsi, %rcx
	je	.L28
.L18:
	movq	%rsi, %rax
.L8:
	movq	%rax, %rsi
	addq	(%rdi,%rax,8), %rdx
	andl	$1, %esi
	je	.L4
	testq	%rdx, %rdx
	jg	.L7
	movq	%r10, %r8
	subq	%rdx, %r8
	movq	%rsi, %rdx
	leaq	1(%rax), %rsi
	addq	%r8, %r9
	cmpq	%rsi, %rcx
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %edx
	movl	$1, %r10d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	testq	%rcx, %rcx
	jg	.L12
	movq	%r10, %rsi
	subq	%rcx, %rsi
	movl	$1, %ecx
	addq	%rsi, %r8
.L12:
	leaq	1(%rdx), %rsi
	cmpq	%rax, %rdx
	je	.L29
.L20:
	movq	%rsi, %rdx
.L13:
	addq	(%rdi,%rdx,8), %rcx
	testb	$1, %dl
	je	.L9
	testq	%rcx, %rcx
	js	.L12
	leaq	1(%r8,%rcx), %r8
	leaq	1(%rdx), %rsi
	movq	$-1, %rcx
	cmpq	%rax, %rdx
	jne	.L20
.L29:
	cmpq	%r9, %r8
	jle	.L14
	movq	%r9, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	1048600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$1048608, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L14:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```