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>
long a[100000];

int main(int argc, char const *argv[]){
	long sum,bsum,ans=0,n,i,f=0,min=1;
	scanf("%ld",&n);
	scanf("%ld",&a[0]);
	if(a[0]==0){
		ans++;
		sum=1;
		f=1;
	}else sum=a[0];
	for(i=1;i<n;i++){
		scanf("%ld",&a[i]);
		bsum=sum;
		sum+=a[i];
		if(bsum>0){
			if(sum>=0){
				ans+=sum+1;
				sum=-1;
			}
		}else{
			if(sum<=0){
				ans+=1-sum;
				sum=1;
			}
		}
	}
		if(a[0]>=0){
			min=a[0]+1;
			sum=-1;
		}else{
			min=1-a[0];
			sum=1;
		}
		for(i=1;i<n;i++){
			bsum=sum;
			sum+=a[i];
			if(bsum>0){
				if(sum>=0){
					min+=sum+1;
					sum=-1;
				}
			}else{
				if(sum<=0){
					min+=1-sum;
					sum=1;
				}
			}
		}
		if(ans<min) printf("%ld\n",ans);
		else printf("%ld\n",min);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -48(%rbp)
	movq	$0, -24(%rbp)
	movq	$1, -32(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	a(%rip), %rax
	testq	%rax, %rax
	jne	.L2
	addq	$1, -48(%rbp)
	movq	$1, -56(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L3
.L2:
	movq	a(%rip), %rax
	movq	%rax, -56(%rbp)
.L3:
	movq	$1, -40(%rbp)
	jmp	.L4
.L7:
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L5
	cmpq	$0, -56(%rbp)
	js	.L6
	movq	-56(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -48(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L6
.L5:
	cmpq	$0, -56(%rbp)
	jg	.L6
	movl	$1, %eax
	subq	-56(%rbp), %rax
	addq	%rax, -48(%rbp)
	movq	$1, -56(%rbp)
.L6:
	addq	$1, -40(%rbp)
.L4:
	movq	-64(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L7
	movq	a(%rip), %rax
	testq	%rax, %rax
	js	.L8
	movq	a(%rip), %rax
	addq	$1, %rax
	movq	%rax, -32(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L9
.L8:
	movq	a(%rip), %rdx
	movl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	$1, -56(%rbp)
.L9:
	movq	$1, -40(%rbp)
	jmp	.L10
.L13:
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L11
	cmpq	$0, -56(%rbp)
	js	.L12
	movq	-56(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -32(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L12
.L11:
	cmpq	$0, -56(%rbp)
	jg	.L12
	movl	$1, %eax
	subq	-56(%rbp), %rax
	addq	%rax, -32(%rbp)
	movq	$1, -56(%rbp)
.L12:
	addq	$1, -40(%rbp)
.L10:
	movq	-64(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L13
	movq	-48(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jge	.L14
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"%ld"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	leaq	a(%rip), %r13
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	a(%rip), %rbx
	movq	(%rsp), %rsi
	testq	%rbx, %rbx
	je	.L2
	cmpq	$1, %rsi
	jle	.L20
	xorl	%r12d, %r12d
.L17:
	leaq	8+a(%rip), %rbp
	movl	$1, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L34:
	testq	%rax, %rax
	js	.L5
	leaq	1(%rax,%r12), %r12
	movq	$-1, %rbx
.L5:
	movq	(%rsp), %rsi
	addq	$1, %r15
	addq	$8, %rbp
	cmpq	%r15, %rsi
	jle	.L33
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movq	0(%rbp), %rax
	addq	%rbx, %rax
	testq	%rbx, %rbx
	movq	%rax, %rbx
	jg	.L34
	testq	%rax, %rax
	jg	.L5
	movl	$1, %eax
	subq	%rbx, %rax
	movl	$1, %ebx
	addq	%rax, %r12
	jmp	.L5
.L2:
	movl	$1, %r12d
	movl	$1, %ebx
	cmpq	$1, %rsi
	jg	.L17
	xorl	%edx, %edx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L33:
	movq	a(%rip), %rax
.L3:
	movq	%rax, %rdx
	testq	%rax, %rax
	js	.L7
.L16:
	addq	$1, %rdx
	orq	$-1, %rax
.L10:
	leaq	8+a(%rip), %rcx
	leaq	0(%r13,%rsi,8), %rdi
	movl	$1, %r8d
	cmpq	$1, %rsi
	jg	.L13
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L35:
	testq	%rsi, %rsi
	js	.L12
	leaq	1(%rsi,%rdx), %rdx
	movq	$-1, %rax
.L12:
	addq	$8, %rcx
	cmpq	%rdi, %rcx
	je	.L9
.L13:
	movq	(%rcx), %rsi
	addq	%rax, %rsi
	testq	%rax, %rax
	movq	%rsi, %rax
	jg	.L35
	testq	%rsi, %rsi
	jg	.L12
	movq	%r8, %rsi
	addq	$8, %rcx
	subq	%rax, %rsi
	movl	$1, %eax
	addq	%rsi, %rdx
	cmpq	%rdi, %rcx
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	cmpq	%r12, %rdx
	jle	.L14
	movq	%r12, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$24, %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
.L14:
	.cfi_restore_state
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L7:
	movl	$1, %edx
	subq	%rax, %rdx
	movl	$1, %eax
	jmp	.L10
.L20:
	movq	%rbx, %rax
	xorl	%r12d, %r12d
	jmp	.L3
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.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	"%ld"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	leaq	a(%rip), %r13
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	a(%rip), %rbx
	movq	(%rsp), %rsi
	testq	%rbx, %rbx
	je	.L2
	cmpq	$1, %rsi
	jle	.L20
	xorl	%r12d, %r12d
.L17:
	leaq	8+a(%rip), %rbp
	movl	$1, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L34:
	testq	%rax, %rax
	js	.L5
	leaq	1(%rax,%r12), %r12
	movq	$-1, %rbx
.L5:
	movq	(%rsp), %rsi
	addq	$1, %r15
	addq	$8, %rbp
	cmpq	%r15, %rsi
	jle	.L33
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movq	0(%rbp), %rax
	addq	%rbx, %rax
	testq	%rbx, %rbx
	movq	%rax, %rbx
	jg	.L34
	testq	%rax, %rax
	jg	.L5
	movl	$1, %eax
	subq	%rbx, %rax
	movl	$1, %ebx
	addq	%rax, %r12
	jmp	.L5
.L2:
	movl	$1, %r12d
	movl	$1, %ebx
	cmpq	$1, %rsi
	jg	.L17
	xorl	%edx, %edx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L33:
	movq	a(%rip), %rax
.L3:
	movq	%rax, %rdx
	testq	%rax, %rax
	js	.L7
.L16:
	addq	$1, %rdx
	orq	$-1, %rax
.L10:
	leaq	8+a(%rip), %rcx
	leaq	0(%r13,%rsi,8), %rdi
	movl	$1, %r8d
	cmpq	$1, %rsi
	jg	.L13
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L35:
	testq	%rsi, %rsi
	js	.L12
	leaq	1(%rsi,%rdx), %rdx
	movq	$-1, %rax
.L12:
	addq	$8, %rcx
	cmpq	%rdi, %rcx
	je	.L9
.L13:
	movq	(%rcx), %rsi
	addq	%rax, %rsi
	testq	%rax, %rax
	movq	%rsi, %rax
	jg	.L35
	testq	%rsi, %rsi
	jg	.L12
	movq	%r8, %rsi
	addq	$8, %rcx
	subq	%rax, %rsi
	movl	$1, %eax
	addq	%rsi, %rdx
	cmpq	%rdi, %rcx
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	cmpq	%r12, %rdx
	jle	.L14
	movq	%r12, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$24, %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
.L14:
	.cfi_restore_state
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L7:
	movl	$1, %edx
	subq	%rax, %rdx
	movl	$1, %eax
	jmp	.L10
.L20:
	movq	%rbx, %rax
	xorl	%r12d, %r12d
	jmp	.L3
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.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>
long a[100000];

int main(int argc, char const *argv[]){
	long sum,bsum,ans=0,n,i,f=0,min=1;
	scanf("%ld",&n);
	scanf("%ld",&a[0]);
	if(a[0]==0){
		ans++;
		sum=1;
		f=1;
	}else sum=a[0];
	for(i=1;i<n;i++){
		scanf("%ld",&a[i]);
		bsum=sum;
		sum+=a[i];
		if(bsum>0){
			if(sum>=0){
				ans+=sum+1;
				sum=-1;
			}
		}else{
			if(sum<=0){
				ans+=1-sum;
				sum=1;
			}
		}
	}
		if(a[0]>=0){
			min=a[0]+1;
			sum=-1;
		}else{
			min=1-a[0];
			sum=1;
		}
		for(i=1;i<n;i++){
			bsum=sum;
			sum+=a[i];
			if(bsum>0){
				if(sum>=0){
					min+=sum+1;
					sum=-1;
				}
			}else{
				if(sum<=0){
					min+=1-sum;
					sum=1;
				}
			}
		}
		if(ans<min) printf("%ld\n",ans);
		else printf("%ld\n",min);
	return 0;
}
4
1 -3 1 0

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>
long a[100000];

int main(int argc, char const *argv[]){
	long sum,bsum,ans=0,n,i,f=0,min=1;
	scanf("%ld",&n);
	scanf("%ld",&a[0]);
	if(a[0]==0){
		ans++;
		sum=1;
		f=1;
	}else sum=a[0];
	for(i=1;i<n;i++){
		scanf("%ld",&a[i]);
		bsum=sum;
		sum+=a[i];
		if(bsum>0){
			if(sum>=0){
				ans+=sum+1;
				sum=-1;
			}
		}else{
			if(sum<=0){
				ans+=1-sum;
				sum=1;
			}
		}
	}
		if(a[0]>=0){
			min=a[0]+1;
			sum=-1;
		}else{
			min=1-a[0];
			sum=1;
		}
		for(i=1;i<n;i++){
			bsum=sum;
			sum+=a[i];
			if(bsum>0){
				if(sum>=0){
					min+=sum+1;
					sum=-1;
				}
			}else{
				if(sum<=0){
					min+=1-sum;
					sum=1;
				}
			}
		}
		if(ans<min) printf("%ld\n",ans);
		else printf("%ld\n",min);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -48(%rbp)
	movq	$0, -24(%rbp)
	movq	$1, -32(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	a(%rip), %rax
	testq	%rax, %rax
	jne	.L2
	addq	$1, -48(%rbp)
	movq	$1, -56(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L3
.L2:
	movq	a(%rip), %rax
	movq	%rax, -56(%rbp)
.L3:
	movq	$1, -40(%rbp)
	jmp	.L4
.L7:
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L5
	cmpq	$0, -56(%rbp)
	js	.L6
	movq	-56(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -48(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L6
.L5:
	cmpq	$0, -56(%rbp)
	jg	.L6
	movl	$1, %eax
	subq	-56(%rbp), %rax
	addq	%rax, -48(%rbp)
	movq	$1, -56(%rbp)
.L6:
	addq	$1, -40(%rbp)
.L4:
	movq	-64(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L7
	movq	a(%rip), %rax
	testq	%rax, %rax
	js	.L8
	movq	a(%rip), %rax
	addq	$1, %rax
	movq	%rax, -32(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L9
.L8:
	movq	a(%rip), %rdx
	movl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	$1, -56(%rbp)
.L9:
	movq	$1, -40(%rbp)
	jmp	.L10
.L13:
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L11
	cmpq	$0, -56(%rbp)
	js	.L12
	movq	-56(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -32(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L12
.L11:
	cmpq	$0, -56(%rbp)
	jg	.L12
	movl	$1, %eax
	subq	-56(%rbp), %rax
	addq	%rax, -32(%rbp)
	movq	$1, -56(%rbp)
.L12:
	addq	$1, -40(%rbp)
.L10:
	movq	-64(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L13
	movq	-48(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jge	.L14
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -48(%rbp)
	movq	$0, -24(%rbp)
	movq	$1, -32(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	a(%rip), %rax
	testq	%rax, %rax
	jne	.L2
	addq	$1, -48(%rbp)
	movq	$1, -56(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L3
.L2:
	movq	a(%rip), %rax
	movq	%rax, -56(%rbp)
.L3:
	movq	$1, -40(%rbp)
	jmp	.L4
.L7:
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L5
	cmpq	$0, -56(%rbp)
	js	.L6
	movq	-56(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -48(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L6
.L5:
	cmpq	$0, -56(%rbp)
	jg	.L6
	movl	$1, %eax
	subq	-56(%rbp), %rax
	addq	%rax, -48(%rbp)
	movq	$1, -56(%rbp)
.L6:
	addq	$1, -40(%rbp)
.L4:
	movq	-64(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L7
	movq	a(%rip), %rax
	testq	%rax, %rax
	js	.L8
	movq	a(%rip), %rax
	addq	$1, %rax
	movq	%rax, -32(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L9
.L8:
	movq	a(%rip), %rdx
	movl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	$1, -56(%rbp)
.L9:
	movq	$1, -40(%rbp)
	jmp	.L10
.L13:
	movq	-56(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L11
	cmpq	$0, -56(%rbp)
	js	.L12
	movq	-56(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -32(%rbp)
	movq	$-1, -56(%rbp)
	jmp	.L12
.L11:
	cmpq	$0, -56(%rbp)
	jg	.L12
	movl	$1, %eax
	subq	-56(%rbp), %rax
	addq	%rax, -32(%rbp)
	movq	$1, -56(%rbp)
.L12:
	addq	$1, -40(%rbp)
.L10:
	movq	-64(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L13
	movq	-48(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jge	.L14
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
