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>

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;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\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	-1048576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1048632(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -1048624(%rbp)
	jmp	.L2
.L3:
	leaq	-1048592(%rbp), %rdx
	movq	-1048624(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -1048624(%rbp)
.L2:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L3
	movq	$0, -1048600(%rbp)
	movq	$0, -1048616(%rbp)
	movq	$1, -1048624(%rbp)
	jmp	.L4
.L7:
	movq	-1048624(%rbp), %rax
	movq	-1048592(%rbp,%rax,8), %rax
	addq	%rax, -1048600(%rbp)
	movq	-1048624(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L5
	cmpq	$0, -1048600(%rbp)
	jg	.L5
	movl	$1, %eax
	subq	-1048600(%rbp), %rax
	addq	%rax, -1048616(%rbp)
	movq	$1, -1048600(%rbp)
.L5:
	movq	-1048624(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L6
	cmpq	$0, -1048600(%rbp)
	js	.L6
	movq	-1048600(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -1048616(%rbp)
	movq	$-1, -1048600(%rbp)
.L6:
	addq	$1, -1048624(%rbp)
.L4:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L7
	movq	$0, -1048600(%rbp)
	movq	$0, -1048608(%rbp)
	movq	$1, -1048624(%rbp)
	jmp	.L8
.L11:
	movq	-1048624(%rbp), %rax
	movq	-1048592(%rbp,%rax,8), %rax
	addq	%rax, -1048600(%rbp)
	movq	-1048624(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L9
	cmpq	$0, -1048600(%rbp)
	js	.L9
	movq	-1048600(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -1048608(%rbp)
	movq	$-1, -1048600(%rbp)
.L9:
	movq	-1048624(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L10
	cmpq	$0, -1048600(%rbp)
	jg	.L10
	movl	$1, %eax
	subq	-1048600(%rbp), %rax
	addq	%rax, -1048608(%rbp)
	movq	$1, -1048600(%rbp)
.L10:
	addq	$1, -1048624(%rbp)
.L8:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L11
	movq	-1048616(%rbp), %rax
	cmpq	-1048608(%rbp), %rax
	jge	.L12
	movq	-1048616(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movq	-1048608(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	"%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
	.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:

#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;
}
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>

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;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\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	-1048576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1048632(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -1048624(%rbp)
	jmp	.L2
.L3:
	leaq	-1048592(%rbp), %rdx
	movq	-1048624(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -1048624(%rbp)
.L2:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L3
	movq	$0, -1048600(%rbp)
	movq	$0, -1048616(%rbp)
	movq	$1, -1048624(%rbp)
	jmp	.L4
.L7:
	movq	-1048624(%rbp), %rax
	movq	-1048592(%rbp,%rax,8), %rax
	addq	%rax, -1048600(%rbp)
	movq	-1048624(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L5
	cmpq	$0, -1048600(%rbp)
	jg	.L5
	movl	$1, %eax
	subq	-1048600(%rbp), %rax
	addq	%rax, -1048616(%rbp)
	movq	$1, -1048600(%rbp)
.L5:
	movq	-1048624(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L6
	cmpq	$0, -1048600(%rbp)
	js	.L6
	movq	-1048600(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -1048616(%rbp)
	movq	$-1, -1048600(%rbp)
.L6:
	addq	$1, -1048624(%rbp)
.L4:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L7
	movq	$0, -1048600(%rbp)
	movq	$0, -1048608(%rbp)
	movq	$1, -1048624(%rbp)
	jmp	.L8
.L11:
	movq	-1048624(%rbp), %rax
	movq	-1048592(%rbp,%rax,8), %rax
	addq	%rax, -1048600(%rbp)
	movq	-1048624(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L9
	cmpq	$0, -1048600(%rbp)
	js	.L9
	movq	-1048600(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -1048608(%rbp)
	movq	$-1, -1048600(%rbp)
.L9:
	movq	-1048624(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L10
	cmpq	$0, -1048600(%rbp)
	jg	.L10
	movl	$1, %eax
	subq	-1048600(%rbp), %rax
	addq	%rax, -1048608(%rbp)
	movq	$1, -1048600(%rbp)
.L10:
	addq	$1, -1048624(%rbp)
.L8:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L11
	movq	-1048616(%rbp), %rax
	cmpq	-1048608(%rbp), %rax
	jge	.L12
	movq	-1048616(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movq	-1048608(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	"%lld"
.LC1:
	.string	"%lld\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	-1048576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1048632(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, -1048624(%rbp)
	jmp	.L2
.L3:
	leaq	-1048592(%rbp), %rdx
	movq	-1048624(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -1048624(%rbp)
.L2:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L3
	movq	$0, -1048600(%rbp)
	movq	$0, -1048616(%rbp)
	movq	$1, -1048624(%rbp)
	jmp	.L4
.L7:
	movq	-1048624(%rbp), %rax
	movq	-1048592(%rbp,%rax,8), %rax
	addq	%rax, -1048600(%rbp)
	movq	-1048624(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L5
	cmpq	$0, -1048600(%rbp)
	jg	.L5
	movl	$1, %eax
	subq	-1048600(%rbp), %rax
	addq	%rax, -1048616(%rbp)
	movq	$1, -1048600(%rbp)
.L5:
	movq	-1048624(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L6
	cmpq	$0, -1048600(%rbp)
	js	.L6
	movq	-1048600(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -1048616(%rbp)
	movq	$-1, -1048600(%rbp)
.L6:
	addq	$1, -1048624(%rbp)
.L4:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L7
	movq	$0, -1048600(%rbp)
	movq	$0, -1048608(%rbp)
	movq	$1, -1048624(%rbp)
	jmp	.L8
.L11:
	movq	-1048624(%rbp), %rax
	movq	-1048592(%rbp,%rax,8), %rax
	addq	%rax, -1048600(%rbp)
	movq	-1048624(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	jne	.L9
	cmpq	$0, -1048600(%rbp)
	js	.L9
	movq	-1048600(%rbp), %rax
	addq	$1, %rax
	addq	%rax, -1048608(%rbp)
	movq	$-1, -1048600(%rbp)
.L9:
	movq	-1048624(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L10
	cmpq	$0, -1048600(%rbp)
	jg	.L10
	movl	$1, %eax
	subq	-1048600(%rbp), %rax
	addq	%rax, -1048608(%rbp)
	movq	$1, -1048600(%rbp)
.L10:
	addq	$1, -1048624(%rbp)
.L8:
	movq	-1048632(%rbp), %rax
	cmpq	%rax, -1048624(%rbp)
	jle	.L11
	movq	-1048616(%rbp), %rax
	cmpq	-1048608(%rbp), %rax
	jge	.L12
	movq	-1048616(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movq	-1048608(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
