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 int n;
    scanf("%ld\n",&n);
    long long int a[200005]={};
    for(int p=0;p<n;p++)scanf("%lld\n",&a[p]);
    long int pointer;
    long long int sum=0;
    long long int keep=0;
    if(a[0]!=0)
    {
        printf("-1");
        return 0;
    }
    for(pointer=1;pointer<n;pointer++)
    {
        if(a[pointer]-a[pointer-1]>=2)
        {
            printf("-1");
            return 0;
        }
    }
    for(pointer=n-1;pointer>=0;pointer--)
    {
        keep--;
        if(keep<a[pointer])
        {
            sum+=a[pointer];
            keep=a[pointer];
            //printf("##%lld##\n",a[pointer]);
        }
    }
    printf("%lld\n",sum);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld\n"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"-1"
	.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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2632, %rsp
	.cfi_def_cfa_offset 1600112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	$1600040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	8(%rsp), %rdx
	testq	%rdx, %rdx
	jle	.L2
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L3
.L2:
	movq	16(%rsp), %r8
	testq	%r8, %r8
	jne	.L4
	xorl	%ecx, %ecx
	movl	$1, %eax
	cmpq	$1, %rdx
	jg	.L5
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L25
.L5:
	movq	%rcx, %rdi
	movq	(%r12,%rax,8), %rcx
	movq	%rcx, %rsi
	subq	%rdi, %rsi
	cmpq	$1, %rsi
	jle	.L26
.L4:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	1600056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1600072, %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
.L25:
	.cfi_restore_state
	subq	$1, %rax
.L12:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%r12,%rax,8), %rcx
	subq	$1, %rdx
	cmpq	%rdx, %rcx
	jle	.L10
	addq	%rcx, %r8
	movq	%rcx, %rdx
.L10:
	subq	$1, %rax
	jnb	.L11
.L9:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L24:
	jne	.L9
	xorl	%eax, %eax
	jmp	.L12
.L27:
	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	"%ld\n"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"-1"
	.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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2632, %rsp
	.cfi_def_cfa_offset 1600112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	$1600040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	8(%rsp), %rdx
	testq	%rdx, %rdx
	jle	.L2
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L3
.L2:
	movq	16(%rsp), %r8
	testq	%r8, %r8
	jne	.L4
	xorl	%ecx, %ecx
	movl	$1, %eax
	cmpq	$1, %rdx
	jg	.L5
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L25
.L5:
	movq	%rcx, %rdi
	movq	(%r12,%rax,8), %rcx
	movq	%rcx, %rsi
	subq	%rdi, %rsi
	cmpq	$1, %rsi
	jle	.L26
.L4:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	1600056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1600072, %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
.L25:
	.cfi_restore_state
	subq	$1, %rax
.L12:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%r12,%rax,8), %rcx
	subq	$1, %rdx
	cmpq	%rdx, %rcx
	jle	.L10
	addq	%rcx, %r8
	movq	%rcx, %rdx
.L10:
	subq	$1, %rax
	jnb	.L11
.L9:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L24:
	jne	.L9
	xorl	%eax, %eax
	jmp	.L12
.L27:
	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	"%ld\n"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"-1"
	.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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2632, %rsp
	.cfi_def_cfa_offset 1600112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	$1600040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	8(%rsp), %rdx
	testq	%rdx, %rdx
	jle	.L2
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L3
.L2:
	movq	16(%rsp), %r8
	testq	%r8, %r8
	jne	.L4
	xorl	%ecx, %ecx
	movl	$1, %eax
	cmpq	$1, %rdx
	jg	.L5
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L25
.L5:
	movq	%rcx, %rdi
	movq	(%r12,%rax,8), %rcx
	movq	%rcx, %rsi
	subq	%rdi, %rsi
	cmpq	$1, %rsi
	jle	.L26
.L4:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	1600056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1600072, %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
.L25:
	.cfi_restore_state
	subq	$1, %rax
.L12:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%r12,%rax,8), %rcx
	subq	$1, %rdx
	cmpq	%rdx, %rcx
	jle	.L10
	addq	%rcx, %r8
	movq	%rcx, %rdx
.L10:
	subq	$1, %rax
	jnb	.L11
.L9:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L24:
	jne	.L9
	xorl	%eax, %eax
	jmp	.L12
.L27:
	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 int n;
    scanf("%ld\n",&n);
    long long int a[200005]={};
    for(int p=0;p<n;p++)scanf("%lld\n",&a[p]);
    long int pointer;
    long long int sum=0;
    long long int keep=0;
    if(a[0]!=0)
    {
        printf("-1");
        return 0;
    }
    for(pointer=1;pointer<n;pointer++)
    {
        if(a[pointer]-a[pointer-1]>=2)
        {
            printf("-1");
            return 0;
        }
    }
    for(pointer=n-1;pointer>=0;pointer--)
    {
        keep--;
        if(keep<a[pointer])
        {
            sum+=a[pointer];
            keep=a[pointer];
            //printf("##%lld##\n",a[pointer]);
        }
    }
    printf("%lld\n",sum);
    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 int n;
    scanf("%ld\n",&n);
    long long int a[200005]={};
    for(int p=0;p<n;p++)scanf("%lld\n",&a[p]);
    long int pointer;
    long long int sum=0;
    long long int keep=0;
    if(a[0]!=0)
    {
        printf("-1");
        return 0;
    }
    for(pointer=1;pointer<n;pointer++)
    {
        if(a[pointer]-a[pointer-1]>=2)
        {
            printf("-1");
            return 0;
        }
    }
    for(pointer=n-1;pointer>=0;pointer--)
    {
        keep--;
        if(keep<a[pointer])
        {
            sum+=a[pointer];
            keep=a[pointer];
            //printf("##%lld##\n",a[pointer]);
        }
    }
    printf("%lld\n",sum);
    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:

3
0
2
1
 4
0
0
1
2
 3
0
1
0
 3
0
0
0
 9
0
1
1
0
2
2
2
1
2
 3
0
2
2
 9
0
1
1
0
2
2
2
1
4
 4
0
0
0
2
 3
0
1
2
 9
0
1
1
0
2
2
2
1
3

-1 2
 1
 0
 -1 -1 -1 -1 2
 -1
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 int n;
    scanf("%ld\n",&n);
    long long int a[200005]={};
    for(int p=0;p<n;p++)scanf("%lld\n",&a[p]);
    long int pointer;
    long long int sum=0;
    long long int keep=0;
    if(a[0]!=0)
    {
        printf("-1");
        return 0;
    }
    for(pointer=1;pointer<n;pointer++)
    {
        if(a[pointer]-a[pointer-1]>=2)
        {
            printf("-1");
            return 0;
        }
    }
    for(pointer=n-1;pointer>=0;pointer--)
    {
        keep--;
        if(keep<a[pointer])
        {
            sum+=a[pointer];
            keep=a[pointer];
            //printf("##%lld##\n",a[pointer]);
        }
    }
    printf("%lld\n",sum);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld\n"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"-1"
	.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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2632, %rsp
	.cfi_def_cfa_offset 1600112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	$1600040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	8(%rsp), %rdx
	testq	%rdx, %rdx
	jle	.L2
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L3
.L2:
	movq	16(%rsp), %r8
	testq	%r8, %r8
	jne	.L4
	xorl	%ecx, %ecx
	movl	$1, %eax
	cmpq	$1, %rdx
	jg	.L5
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L25
.L5:
	movq	%rcx, %rdi
	movq	(%r12,%rax,8), %rcx
	movq	%rcx, %rsi
	subq	%rdi, %rsi
	cmpq	$1, %rsi
	jle	.L26
.L4:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	1600056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1600072, %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
.L25:
	.cfi_restore_state
	subq	$1, %rax
.L12:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%r12,%rax,8), %rcx
	subq	$1, %rdx
	cmpq	%rdx, %rcx
	jle	.L10
	addq	%rcx, %r8
	movq	%rcx, %rdx
.L10:
	subq	$1, %rax
	jnb	.L11
.L9:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L24:
	jne	.L9
	xorl	%eax, %eax
	jmp	.L12
.L27:
	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	"%ld\n"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"-1"
	.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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2632, %rsp
	.cfi_def_cfa_offset 1600112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1600056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	$1600040, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	8(%rsp), %rdx
	testq	%rdx, %rdx
	jle	.L2
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L3
.L2:
	movq	16(%rsp), %r8
	testq	%r8, %r8
	jne	.L4
	xorl	%ecx, %ecx
	movl	$1, %eax
	cmpq	$1, %rdx
	jg	.L5
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L25
.L5:
	movq	%rcx, %rdi
	movq	(%r12,%rax,8), %rcx
	movq	%rcx, %rsi
	subq	%rdi, %rsi
	cmpq	$1, %rsi
	jle	.L26
.L4:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	1600056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1600072, %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
.L25:
	.cfi_restore_state
	subq	$1, %rax
.L12:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%r12,%rax,8), %rcx
	subq	$1, %rdx
	cmpq	%rdx, %rcx
	jle	.L10
	addq	%rcx, %r8
	movq	%rcx, %rdx
.L10:
	subq	$1, %rax
	jnb	.L11
.L9:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L24:
	jne	.L9
	xorl	%eax, %eax
	jmp	.L12
.L27:
	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:
```