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()
{
	int n;
	scanf("%d", &n);
	int i;
	long long int a[100005];
	for (i = 0; i <= n; i++)
		scanf("%lld", &a[i]);
	long long int max[100005], min[100005];
	max[n] = min[n] = a[n];
	for (i = n - 1; i >= 0; i--)
	{
		max[i] = max[i + 1] + a[i];
		min[i] = (min[i + 1] + 1) / 2 + a[i];
	}
	if (min[0] > 1)
	{
		printf("-1\n");
		return 0;
	}
	long long int ans = 0;
	long long int p = 1;
	for (i = 0; i <= n; i++)
	{
		ans += p;
		p = (p - a[i]) * 2;
		if (p > max[i + 1])
			p = max[i + 1];
	}
	printf("%lld\n", ans);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.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	-2396160(%rsp), %r11
	.cfi_def_cfa 11, 2396192
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4000, %rsp
	.cfi_def_cfa_offset 2400192
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2400152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %rbp
	cmpl	%ebx, %esi
	jge	.L3
.L2:
	movslq	%esi, %rdx
	movq	16(%rsp,%rdx,8), %rax
	movq	%rax, 1600112(%rsp,%rdx,8)
	movq	%rax, 800064(%rsp,%rdx,8)
	movl	%esi, %eax
	subl	$1, %eax
	js	.L4
	leaq	0(,%rdx,8), %rcx
	cltq
	leaq	16(%rsp), %r8
	movq	1600112(%rsp,%rcx), %rdx
	movq	800064(%rsp,%rcx), %rdi
	leaq	800064(%rsp), %r10
	leaq	1600112(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rdx
	addq	(%r8,%rax,8), %rdi
	movq	%rdx, %rcx
	movq	%rdi, (%r10,%rax,8)
	shrq	$63, %rcx
	addq	%rcx, %rdx
	sarq	%rdx
	addq	(%r8,%rax,8), %rdx
	movq	%rdx, (%r9,%rax,8)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L5
.L4:
	cmpq	$1, 1600112(%rsp)
	jg	.L6
	xorl	%r9d, %r9d
	testl	%esi, %esi
	js	.L8
	addl	$1, %esi
	xorl	%edx, %edx
	movl	$1, %eax
	xorl	%r9d, %r9d
	movslq	%esi, %rsi
	leaq	16(%rsp), %r8
	leaq	800072(%rsp), %rdi
	salq	$3, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movq	(%rdi,%rdx), %rcx
	addq	%rax, %r9
	subq	(%r8,%rdx), %rax
	addq	%rax, %rax
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	cmpq	%rdx, %rsi
	jne	.L10
.L8:
	movq	%r9, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	2400152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$2400160, %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
.L6:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L17:
	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	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.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	-2396160(%rsp), %r11
	.cfi_def_cfa 11, 2396192
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4000, %rsp
	.cfi_def_cfa_offset 2400192
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2400152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %rbp
	cmpl	%ebx, %esi
	jge	.L3
.L2:
	movslq	%esi, %rdx
	movq	16(%rsp,%rdx,8), %rax
	movq	%rax, 1600112(%rsp,%rdx,8)
	movq	%rax, 800064(%rsp,%rdx,8)
	movl	%esi, %eax
	subl	$1, %eax
	js	.L4
	leaq	0(,%rdx,8), %rcx
	cltq
	leaq	16(%rsp), %r8
	movq	1600112(%rsp,%rcx), %rdx
	movq	800064(%rsp,%rcx), %rdi
	leaq	800064(%rsp), %r10
	leaq	1600112(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rdx
	addq	(%r8,%rax,8), %rdi
	movq	%rdx, %rcx
	movq	%rdi, (%r10,%rax,8)
	shrq	$63, %rcx
	addq	%rcx, %rdx
	sarq	%rdx
	addq	(%r8,%rax,8), %rdx
	movq	%rdx, (%r9,%rax,8)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L5
.L4:
	cmpq	$1, 1600112(%rsp)
	jg	.L6
	xorl	%r9d, %r9d
	testl	%esi, %esi
	js	.L8
	addl	$1, %esi
	xorl	%edx, %edx
	movl	$1, %eax
	xorl	%r9d, %r9d
	movslq	%esi, %rsi
	leaq	16(%rsp), %r8
	leaq	800072(%rsp), %rdi
	salq	$3, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movq	(%rdi,%rdx), %rcx
	addq	%rax, %r9
	subq	(%r8,%rdx), %rax
	addq	%rax, %rax
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	cmpq	%rdx, %rsi
	jne	.L10
.L8:
	movq	%r9, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	2400152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$2400160, %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
.L6:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L17:
	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	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.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	-2396160(%rsp), %r11
	.cfi_def_cfa 11, 2396192
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4000, %rsp
	.cfi_def_cfa_offset 2400192
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2400152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %rbp
	cmpl	%ebx, %esi
	jge	.L3
.L2:
	movslq	%esi, %rdx
	movq	16(%rsp,%rdx,8), %rax
	movq	%rax, 1600112(%rsp,%rdx,8)
	movq	%rax, 800064(%rsp,%rdx,8)
	movl	%esi, %eax
	subl	$1, %eax
	js	.L4
	leaq	0(,%rdx,8), %rcx
	cltq
	leaq	16(%rsp), %r8
	movq	1600112(%rsp,%rcx), %rdx
	movq	800064(%rsp,%rcx), %rdi
	leaq	800064(%rsp), %r10
	leaq	1600112(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rdx
	addq	(%r8,%rax,8), %rdi
	movq	%rdx, %rcx
	movq	%rdi, (%r10,%rax,8)
	shrq	$63, %rcx
	addq	%rcx, %rdx
	sarq	%rdx
	addq	(%r8,%rax,8), %rdx
	movq	%rdx, (%r9,%rax,8)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L5
.L4:
	cmpq	$1, 1600112(%rsp)
	jg	.L6
	xorl	%r9d, %r9d
	testl	%esi, %esi
	js	.L8
	addl	$1, %esi
	xorl	%edx, %edx
	movl	$1, %eax
	xorl	%r9d, %r9d
	movslq	%esi, %rsi
	leaq	16(%rsp), %r8
	leaq	800072(%rsp), %rdi
	salq	$3, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movq	(%rdi,%rdx), %rcx
	addq	%rax, %r9
	subq	(%r8,%rdx), %rax
	addq	%rax, %rax
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	cmpq	%rdx, %rsi
	jne	.L10
.L8:
	movq	%r9, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	2400152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$2400160, %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
.L6:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L17:
	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()
{
	int n;
	scanf("%d", &n);
	int i;
	long long int a[100005];
	for (i = 0; i <= n; i++)
		scanf("%lld", &a[i]);
	long long int max[100005], min[100005];
	max[n] = min[n] = a[n];
	for (i = n - 1; i >= 0; i--)
	{
		max[i] = max[i + 1] + a[i];
		min[i] = (min[i + 1] + 1) / 2 + a[i];
	}
	if (min[0] > 1)
	{
		printf("-1\n");
		return 0;
	}
	long long int ans = 0;
	long long int p = 1;
	for (i = 0; i <= n; i++)
	{
		ans += p;
		p = (p - a[i]) * 2;
		if (p > max[i + 1])
			p = max[i + 1];
	}
	printf("%lld\n", ans);
	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()
{
	int n;
	scanf("%d", &n);
	int i;
	long long int a[100005];
	for (i = 0; i <= n; i++)
		scanf("%lld", &a[i]);
	long long int max[100005], min[100005];
	max[n] = min[n] = a[n];
	for (i = n - 1; i >= 0; i--)
	{
		max[i] = max[i + 1] + a[i];
		min[i] = (min[i + 1] + 1) / 2 + a[i];
	}
	if (min[0] > 1)
	{
		printf("-1\n");
		return 0;
	}
	long long int ans = 0;
	long long int p = 1;
	for (i = 0; i <= n; i++)
	{
		ans += p;
		p = (p - a[i]) * 2;
		if (p > max[i + 1])
			p = max[i + 1];
	}
	printf("%lld\n", ans);
	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
0 0 0 0 2
 3
0 1 1 1
 10
0 0 1 0 2 3 5 8 13 21 34
 2
0 3 2
 10
0 0 1 0 2 3 5 8 13 23 34
 10
0 0 1 0 3 3 5 8 13 23 34
 2
-1 3 2
 10
0 0 1 1 3 3 5 8 13 23 34
 2
-2 3 2
 4
0 1 0 1 2

9
 6
 294
 -1
 298
 284
 7
 236
 8
 10

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()
{
	int n;
	scanf("%d", &n);
	int i;
	long long int a[100005];
	for (i = 0; i <= n; i++)
		scanf("%lld", &a[i]);
	long long int max[100005], min[100005];
	max[n] = min[n] = a[n];
	for (i = n - 1; i >= 0; i--)
	{
		max[i] = max[i + 1] + a[i];
		min[i] = (min[i + 1] + 1) / 2 + a[i];
	}
	if (min[0] > 1)
	{
		printf("-1\n");
		return 0;
	}
	long long int ans = 0;
	long long int p = 1;
	for (i = 0; i <= n; i++)
	{
		ans += p;
		p = (p - a[i]) * 2;
		if (p > max[i + 1])
			p = max[i + 1];
	}
	printf("%lld\n", ans);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.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	-2396160(%rsp), %r11
	.cfi_def_cfa 11, 2396192
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4000, %rsp
	.cfi_def_cfa_offset 2400192
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2400152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %rbp
	cmpl	%ebx, %esi
	jge	.L3
.L2:
	movslq	%esi, %rdx
	movq	16(%rsp,%rdx,8), %rax
	movq	%rax, 1600112(%rsp,%rdx,8)
	movq	%rax, 800064(%rsp,%rdx,8)
	movl	%esi, %eax
	subl	$1, %eax
	js	.L4
	leaq	0(,%rdx,8), %rcx
	cltq
	leaq	16(%rsp), %r8
	movq	1600112(%rsp,%rcx), %rdx
	movq	800064(%rsp,%rcx), %rdi
	leaq	800064(%rsp), %r10
	leaq	1600112(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rdx
	addq	(%r8,%rax,8), %rdi
	movq	%rdx, %rcx
	movq	%rdi, (%r10,%rax,8)
	shrq	$63, %rcx
	addq	%rcx, %rdx
	sarq	%rdx
	addq	(%r8,%rax,8), %rdx
	movq	%rdx, (%r9,%rax,8)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L5
.L4:
	cmpq	$1, 1600112(%rsp)
	jg	.L6
	xorl	%r9d, %r9d
	testl	%esi, %esi
	js	.L8
	addl	$1, %esi
	xorl	%edx, %edx
	movl	$1, %eax
	xorl	%r9d, %r9d
	movslq	%esi, %rsi
	leaq	16(%rsp), %r8
	leaq	800072(%rsp), %rdi
	salq	$3, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movq	(%rdi,%rdx), %rcx
	addq	%rax, %r9
	subq	(%r8,%rdx), %rax
	addq	%rax, %rax
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	cmpq	%rdx, %rsi
	jne	.L10
.L8:
	movq	%r9, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	2400152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$2400160, %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
.L6:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L17:
	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	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"-1"
.LC3:
	.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	-2396160(%rsp), %r11
	.cfi_def_cfa 11, 2396192
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4000, %rsp
	.cfi_def_cfa_offset 2400192
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2400152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %rbp
	cmpl	%ebx, %esi
	jge	.L3
.L2:
	movslq	%esi, %rdx
	movq	16(%rsp,%rdx,8), %rax
	movq	%rax, 1600112(%rsp,%rdx,8)
	movq	%rax, 800064(%rsp,%rdx,8)
	movl	%esi, %eax
	subl	$1, %eax
	js	.L4
	leaq	0(,%rdx,8), %rcx
	cltq
	leaq	16(%rsp), %r8
	movq	1600112(%rsp,%rcx), %rdx
	movq	800064(%rsp,%rcx), %rdi
	leaq	800064(%rsp), %r10
	leaq	1600112(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rdx
	addq	(%r8,%rax,8), %rdi
	movq	%rdx, %rcx
	movq	%rdi, (%r10,%rax,8)
	shrq	$63, %rcx
	addq	%rcx, %rdx
	sarq	%rdx
	addq	(%r8,%rax,8), %rdx
	movq	%rdx, (%r9,%rax,8)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L5
.L4:
	cmpq	$1, 1600112(%rsp)
	jg	.L6
	xorl	%r9d, %r9d
	testl	%esi, %esi
	js	.L8
	addl	$1, %esi
	xorl	%edx, %edx
	movl	$1, %eax
	xorl	%r9d, %r9d
	movslq	%esi, %rsi
	leaq	16(%rsp), %r8
	leaq	800072(%rsp), %rdi
	salq	$3, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movq	(%rdi,%rdx), %rcx
	addq	%rax, %r9
	subq	(%r8,%rdx), %rax
	addq	%rax, %rax
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$8, %rdx
	cmpq	%rdx, %rsi
	jne	.L10
.L8:
	movq	%r9, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	2400152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$2400160, %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
.L6:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L17:
	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:
```