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 N, i;
int A[200000];
long long int ans;

int main(){
  scanf("%d", &N);
  for(i=0; i<N; i++){
    scanf("%d", A+i);
  }
  if(A[0] != 0){
    printf("-1\n");
    return 0;
  }
  for(i=0; i<N-1; i++){
    if(A[i]+1 < A[i+1]){
      printf("-1\n");
      return 0;
    }
  }
  for(i=1; i<N; i++){
    if(A[i-1]+1 == A[i]){
      ans++;
    }else{
      ans += A[i];
    }
  }
  printf("%lld\n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800000
A:
	.zero	800000
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %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
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	A(%rip), %eax
	testl	%eax, %eax
	je	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L5
.L4:
	movl	$0, i(%rip)
	jmp	.L6
.L8:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	i(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L5
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	N(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	$1, i(%rip)
	jmp	.L9
.L12:
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L10
	movq	ans(%rip), %rax
	addq	$1, %rax
	movq	%rax, ans(%rip)
	jmp	.L11
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	ans(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, ans(%rip)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movq	ans(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L5:
	popq	%rbp
	.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	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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
	leaq	.LC0(%rip), %r12
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ecx
	movl	$0, i(%rip)
	testl	%ecx, %ecx
	jle	.L2
	xorl	%eax, %eax
	leaq	A(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	cltq
	movq	%r12, %rdi
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %ecx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ecx, %eax
	jl	.L3
.L2:
	movl	A(%rip), %esi
	testl	%esi, %esi
	jne	.L8
	movl	$0, i(%rip)
	cmpl	$1, %ecx
	jle	.L6
	leal	-2(%rcx), %r8d
	xorl	%edx, %edx
	movl	$1, %eax
	xorl	%r9d, %r9d
	addq	$2, %r8
	leaq	A(%rip), %rbp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rax
	movl	$1, %r9d
	cmpq	%r8, %rax
	je	.L6
.L9:
	leal	1(%rdx), %edi
	movl	0(%rbp,%rax,4), %edx
	movl	%ebx, %r10d
	movl	%eax, %ebx
	cmpl	%edx, %edi
	jge	.L7
	testb	%r9b, %r9b
	je	.L8
	movl	%r10d, i(%rip)
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	movq	ans(%rip), %rax
	movl	$1, i(%rip)
	movq	%rax, %rdx
	cmpl	$1, %ecx
	jle	.L10
	leaq	4+A(%rip), %rdx
	leal	-2(%rcx), %edi
	leaq	4(%rdx), %r8
	leaq	(%r8,%rdi,4), %r10
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	(%rdx), %r9
	leal	1(%rsi), %r8d
	leaq	1(%rax), %rdi
	addq	%r9, %rax
	cmpl	%r8d, %r9d
	movq	%r9, %rsi
	cmove	%rdi, %rax
	addq	$4, %rdx
	cmpq	%r10, %rdx
	jne	.L13
	movq	%rax, ans(%rip)
	movq	%rax, %rdx
	movl	%ecx, i(%rip)
.L10:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800000
A:
	.zero	800000
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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
	leaq	.LC0(%rip), %r12
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ecx
	movl	$0, i(%rip)
	testl	%ecx, %ecx
	jle	.L2
	xorl	%eax, %eax
	leaq	A(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	cltq
	movq	%r12, %rdi
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %ecx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ecx, %eax
	jl	.L3
.L2:
	movl	A(%rip), %esi
	testl	%esi, %esi
	jne	.L8
	movl	$0, i(%rip)
	cmpl	$1, %ecx
	jle	.L6
	leal	-2(%rcx), %r8d
	xorl	%edx, %edx
	movl	$1, %eax
	xorl	%r9d, %r9d
	addq	$2, %r8
	leaq	A(%rip), %rbp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rax
	movl	$1, %r9d
	cmpq	%r8, %rax
	je	.L6
.L9:
	leal	1(%rdx), %edi
	movl	0(%rbp,%rax,4), %edx
	movl	%ebx, %r10d
	movl	%eax, %ebx
	cmpl	%edx, %edi
	jge	.L7
	testb	%r9b, %r9b
	je	.L8
	movl	%r10d, i(%rip)
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	movq	ans(%rip), %rax
	movl	$1, i(%rip)
	movq	%rax, %rdx
	cmpl	$1, %ecx
	jle	.L10
	leaq	4+A(%rip), %rdx
	leal	-2(%rcx), %edi
	leaq	4(%rdx), %r8
	leaq	(%r8,%rdi,4), %r10
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	(%rdx), %r9
	leal	1(%rsi), %r8d
	leaq	1(%rax), %rdi
	addq	%r9, %rax
	cmpl	%r8d, %r9d
	movq	%r9, %rsi
	cmove	%rdi, %rax
	addq	$4, %rdx
	cmpq	%r10, %rdx
	jne	.L13
	movq	%rax, ans(%rip)
	movq	%rax, %rdx
	movl	%ecx, i(%rip)
.L10:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800000
A:
	.zero	800000
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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 N, i;
int A[200000];
long long int ans;

int main(){
  scanf("%d", &N);
  for(i=0; i<N; i++){
    scanf("%d", A+i);
  }
  if(A[0] != 0){
    printf("-1\n");
    return 0;
  }
  for(i=0; i<N-1; i++){
    if(A[i]+1 < A[i+1]){
      printf("-1\n");
      return 0;
    }
  }
  for(i=1; i<N; i++){
    if(A[i-1]+1 == A[i]){
      ans++;
    }else{
      ans += A[i];
    }
  }
  printf("%lld\n", ans);
}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int N, i;
int A[200000];
long long int ans;

int main(){
  scanf("%d", &N);
  for(i=0; i<N; i++){
    scanf("%d", A+i);
  }
  if(A[0] != 0){
    printf("-1\n");
    return 0;
  }
  for(i=0; i<N-1; i++){
    if(A[i]+1 < A[i+1]){
      printf("-1\n");
      return 0;
    }
  }
  for(i=1; i<N; i++){
    if(A[i-1]+1 == A[i]){
      ans++;
    }else{
      ans += A[i];
    }
  }
  printf("%lld\n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800000
A:
	.zero	800000
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %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
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	A(%rip), %eax
	testl	%eax, %eax
	je	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L5
.L4:
	movl	$0, i(%rip)
	jmp	.L6
.L8:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	i(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L5
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	N(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	$1, i(%rip)
	jmp	.L9
.L12:
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L10
	movq	ans(%rip), %rax
	addq	$1, %rax
	movq	%rax, ans(%rip)
	jmp	.L11
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	ans(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, ans(%rip)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movq	ans(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L5:
	popq	%rbp
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 800000
A:
	.zero	800000
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %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
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	A(%rip), %eax
	testl	%eax, %eax
	je	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L5
.L4:
	movl	$0, i(%rip)
	jmp	.L6
.L8:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	i(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jge	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L5
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	N(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	$1, i(%rip)
	jmp	.L9
.L12:
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L10
	movq	ans(%rip), %rax
	addq	$1, %rax
	movq	%rax, ans(%rip)
	jmp	.L11
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	ans(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, ans(%rip)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movq	ans(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L5:
	popq	%rbp
	.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:
