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,ans=0;
    scanf("%lld",&n);
    long long a[n+1];
    a[n]=0;
    for (long long i=0; i<n; i++){
        scanf("%lld",&a[i]);
    }
    if (n==1){
        if (a[0]==0){
            printf("0\n");
        } else {
            printf("-1\n");
        }
        return 0;
    }
    for (long long i=1; i<n; i++){
        if (a[i]>a[i-1]+1 || a[i]>i || a[0]!=0){
            printf("-1\n");
            return 0;
        } else if (a[i]>=a[i+1]){
            ans+=a[i];
        }
    }
    printf("%lld\n",ans); 
    return 0;   
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rcx
	leaq	23(,%rsi,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L21
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L22
.L4:
	leaq	7(%rsp), %r15
	movq	%r15, %r13
	andq	$-8, %r15
	movq	$0, (%r15,%rsi,8)
	shrq	$3, %r13
	testq	%rsi, %rsi
	jle	.L5
	movq	%r15, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	addq	$8, %r12
	cmpq	%rbx, %rsi
	jg	.L6
	cmpq	$1, %rsi
	je	.L7
.L5:
	cmpq	$1, %rsi
	jle	.L14
	movq	0(,%r13,8), %r8
	movl	$1, %edx
	movq	8(,%r13,8), %rcx
	leaq	1(%r8), %rax
	testq	%rax, %rax
	cmovg	%rdx, %rax
	cmpq	%rax, %rcx
	jg	.L9
	testq	%r8, %r8
	jne	.L9
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rax
	movq	%rcx, %rdx
	movq	(%r15,%rax,8), %rcx
	leaq	(%r8,%rdx), %rdi
	cmpq	%rcx, %rdx
	cmovge	%rdi, %r8
	cmpq	%rax, %rsi
	je	.L8
	movq	-8(%r15,%rax,8), %rbx
	leaq	1(%rbx), %rdx
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	cmpq	%rcx, %rdx
	jge	.L11
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L12:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L23
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L7:
	.cfi_restore_state
	cmpq	$0, 0(,%r13,8)
	jne	.L9
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	xorl	%r8d, %r8d
.L8:
	movq	%r8, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L23:
	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	"0"
.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rcx
	leaq	23(,%rsi,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L21
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L22
.L4:
	leaq	7(%rsp), %r15
	movq	%r15, %r13
	andq	$-8, %r15
	movq	$0, (%r15,%rsi,8)
	shrq	$3, %r13
	testq	%rsi, %rsi
	jle	.L5
	movq	%r15, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	addq	$8, %r12
	cmpq	%rbx, %rsi
	jg	.L6
	cmpq	$1, %rsi
	je	.L7
.L5:
	cmpq	$1, %rsi
	jle	.L14
	movq	0(,%r13,8), %r8
	movl	$1, %edx
	movq	8(,%r13,8), %rcx
	leaq	1(%r8), %rax
	testq	%rax, %rax
	cmovg	%rdx, %rax
	cmpq	%rax, %rcx
	jg	.L9
	testq	%r8, %r8
	jne	.L9
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rax
	movq	%rcx, %rdx
	movq	(%r15,%rax,8), %rcx
	leaq	(%r8,%rdx), %rdi
	cmpq	%rcx, %rdx
	cmovge	%rdi, %r8
	cmpq	%rax, %rsi
	je	.L8
	movq	-8(%r15,%rax,8), %rbx
	leaq	1(%rbx), %rdx
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	cmpq	%rcx, %rdx
	jge	.L11
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L12:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L23
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L7:
	.cfi_restore_state
	cmpq	$0, 0(,%r13,8)
	jne	.L9
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	xorl	%r8d, %r8d
.L8:
	movq	%r8, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L23:
	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	"0"
.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rcx
	leaq	23(,%rsi,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L21
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L22
.L4:
	leaq	7(%rsp), %r15
	movq	%r15, %r13
	andq	$-8, %r15
	movq	$0, (%r15,%rsi,8)
	shrq	$3, %r13
	testq	%rsi, %rsi
	jle	.L5
	movq	%r15, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	addq	$8, %r12
	cmpq	%rbx, %rsi
	jg	.L6
	cmpq	$1, %rsi
	je	.L7
.L5:
	cmpq	$1, %rsi
	jle	.L14
	movq	0(,%r13,8), %r8
	movl	$1, %edx
	movq	8(,%r13,8), %rcx
	leaq	1(%r8), %rax
	testq	%rax, %rax
	cmovg	%rdx, %rax
	cmpq	%rax, %rcx
	jg	.L9
	testq	%r8, %r8
	jne	.L9
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rax
	movq	%rcx, %rdx
	movq	(%r15,%rax,8), %rcx
	leaq	(%r8,%rdx), %rdi
	cmpq	%rcx, %rdx
	cmovge	%rdi, %r8
	cmpq	%rax, %rsi
	je	.L8
	movq	-8(%r15,%rax,8), %rbx
	leaq	1(%rbx), %rdx
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	cmpq	%rcx, %rdx
	jge	.L11
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L12:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L23
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L7:
	.cfi_restore_state
	cmpq	$0, 0(,%r13,8)
	jne	.L9
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	xorl	%r8d, %r8d
.L8:
	movq	%r8, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L23:
	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,ans=0;
    scanf("%lld",&n);
    long long a[n+1];
    a[n]=0;
    for (long long i=0; i<n; i++){
        scanf("%lld",&a[i]);
    }
    if (n==1){
        if (a[0]==0){
            printf("0\n");
        } else {
            printf("-1\n");
        }
        return 0;
    }
    for (long long i=1; i<n; i++){
        if (a[i]>a[i-1]+1 || a[i]>i || a[0]!=0){
            printf("-1\n");
            return 0;
        } else if (a[i]>=a[i+1]){
            ans+=a[i];
        }
    }
    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(void){
    long long n,ans=0;
    scanf("%lld",&n);
    long long a[n+1];
    a[n]=0;
    for (long long i=0; i<n; i++){
        scanf("%lld",&a[i]);
    }
    if (n==1){
        if (a[0]==0){
            printf("0\n");
        } else {
            printf("-1\n");
        }
        return 0;
    }
    for (long long i=1; i<n; i++){
        if (a[i]>a[i-1]+1 || a[i]>i || a[0]!=0){
            printf("-1\n");
            return 0;
        } else if (a[i]>=a[i+1]){
            ans+=a[i];
        }
    }
    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:

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 long n,ans=0;
    scanf("%lld",&n);
    long long a[n+1];
    a[n]=0;
    for (long long i=0; i<n; i++){
        scanf("%lld",&a[i]);
    }
    if (n==1){
        if (a[0]==0){
            printf("0\n");
        } else {
            printf("-1\n");
        }
        return 0;
    }
    for (long long i=1; i<n; i++){
        if (a[i]>a[i-1]+1 || a[i]>i || a[0]!=0){
            printf("-1\n");
            return 0;
        } else if (a[i]>=a[i+1]){
            ans+=a[i];
        }
    }
    printf("%lld\n",ans); 
    return 0;   
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rcx
	leaq	23(,%rsi,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L21
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L22
.L4:
	leaq	7(%rsp), %r15
	movq	%r15, %r13
	andq	$-8, %r15
	movq	$0, (%r15,%rsi,8)
	shrq	$3, %r13
	testq	%rsi, %rsi
	jle	.L5
	movq	%r15, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	addq	$8, %r12
	cmpq	%rbx, %rsi
	jg	.L6
	cmpq	$1, %rsi
	je	.L7
.L5:
	cmpq	$1, %rsi
	jle	.L14
	movq	0(,%r13,8), %r8
	movl	$1, %edx
	movq	8(,%r13,8), %rcx
	leaq	1(%r8), %rax
	testq	%rax, %rax
	cmovg	%rdx, %rax
	cmpq	%rax, %rcx
	jg	.L9
	testq	%r8, %r8
	jne	.L9
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rax
	movq	%rcx, %rdx
	movq	(%r15,%rax,8), %rcx
	leaq	(%r8,%rdx), %rdi
	cmpq	%rcx, %rdx
	cmovge	%rdi, %r8
	cmpq	%rax, %rsi
	je	.L8
	movq	-8(%r15,%rax,8), %rbx
	leaq	1(%rbx), %rdx
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	cmpq	%rcx, %rdx
	jge	.L11
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L12:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L23
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L7:
	.cfi_restore_state
	cmpq	$0, 0(,%r13,8)
	jne	.L9
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	xorl	%r8d, %r8d
.L8:
	movq	%r8, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L23:
	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	"0"
.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rcx
	leaq	23(,%rsi,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L21
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L22
.L4:
	leaq	7(%rsp), %r15
	movq	%r15, %r13
	andq	$-8, %r15
	movq	$0, (%r15,%rsi,8)
	shrq	$3, %r13
	testq	%rsi, %rsi
	jle	.L5
	movq	%r15, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	addq	$8, %r12
	cmpq	%rbx, %rsi
	jg	.L6
	cmpq	$1, %rsi
	je	.L7
.L5:
	cmpq	$1, %rsi
	jle	.L14
	movq	0(,%r13,8), %r8
	movl	$1, %edx
	movq	8(,%r13,8), %rcx
	leaq	1(%r8), %rax
	testq	%rax, %rax
	cmovg	%rdx, %rax
	cmpq	%rax, %rcx
	jg	.L9
	testq	%r8, %r8
	jne	.L9
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rax
	movq	%rcx, %rdx
	movq	(%r15,%rax,8), %rcx
	leaq	(%r8,%rdx), %rdi
	cmpq	%rcx, %rdx
	cmovge	%rdi, %r8
	cmpq	%rax, %rsi
	je	.L8
	movq	-8(%r15,%rax,8), %rbx
	leaq	1(%rbx), %rdx
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	cmpq	%rcx, %rdx
	jge	.L11
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L12:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L23
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L7:
	.cfi_restore_state
	cmpq	$0, 0(,%r13,8)
	jne	.L9
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L12
.L14:
	xorl	%r8d, %r8d
.L8:
	movq	%r8, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L23:
	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:
```