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>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long int

ll n;
ll a[200001];
int yoso[200001]={};


int main(){
  scanf("%lld",&n);
  ll sum=0;
  for(ll i=1;i<=n;i++){
    scanf("%lld",&a[i]);}
  for(ll i=n;i>=1;i--){
    if(i+a[i]<=200000){
      sum+=yoso[i+a[i]];}
    if(i-a[i]>0){
      yoso[i-a[i]]++;}}
  printf("%lld\n",sum);


  //printf("%lld %lld\n",a,b);
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600008
a:
	.zero	1600008
	.globl	yoso
	.align 32
	.type	yoso, @object
	.size	yoso, 800004
yoso:
	.zero	800004
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -24(%rbp)
	movq	$1, -16(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %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
	addq	$1, -16(%rbp)
.L2:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jle	.L3
	movq	n(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L7:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	cmpq	$200000, %rax
	jg	.L5
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -24(%rbp)
.L5:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L6
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rcx
	movl	(%rdx,%rcx), %edx
	leal	1(%rdx), %ecx
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L6:
	subq	$1, -8(%rbp)
.L4:
	cmpq	$0, -8(%rbp)
	jg	.L7
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	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
	cmpq	$0, n(%rip)
	jle	.L2
	leaq	8+a(%rip), %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	n(%rip), %rax
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jge	.L3
	testq	%rax, %rax
	jle	.L2
	xorl	%r8d, %r8d
	leaq	a(%rip), %rdi
	leaq	yoso(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rdi,%rax,8), %rcx
	leaq	(%rcx,%rax), %rdx
	cmpq	$200000, %rdx
	jg	.L4
	movslq	(%rsi,%rdx,4), %rdx
	addq	%rdx, %r8
.L4:
	movq	%rax, %rdx
	subq	%rcx, %rdx
	testq	%rdx, %rdx
	jle	.L5
	addl	$1, (%rsi,%rdx,4)
.L5:
	subq	$1, %rax
	jne	.L6
.L7:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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
.L2:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	yoso
	.bss
	.align 32
	.type	yoso, @object
	.size	yoso, 800004
yoso:
	.zero	800004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600008
a:
	.zero	1600008
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	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
	cmpq	$0, n(%rip)
	jle	.L2
	leaq	8+a(%rip), %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	n(%rip), %rax
	addq	$8, %rbp
	cmpq	%rbx, %rax
	jge	.L3
	testq	%rax, %rax
	jle	.L2
	xorl	%r8d, %r8d
	leaq	a(%rip), %rdi
	leaq	yoso(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rdi,%rax,8), %rcx
	leaq	(%rcx,%rax), %rdx
	cmpq	$200000, %rdx
	jg	.L4
	movslq	(%rsi,%rdx,4), %rdx
	addq	%rdx, %r8
.L4:
	movq	%rax, %rdx
	subq	%rcx, %rdx
	testq	%rdx, %rdx
	jle	.L5
	addl	$1, (%rsi,%rdx,4)
.L5:
	subq	$1, %rax
	jne	.L6
.L7:
	movq	%r8, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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
.L2:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	yoso
	.bss
	.align 32
	.type	yoso, @object
	.size	yoso, 800004
yoso:
	.zero	800004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600008
a:
	.zero	1600008
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long int

ll n;
ll a[200001];
int yoso[200001]={};


int main(){
  scanf("%lld",&n);
  ll sum=0;
  for(ll i=1;i<=n;i++){
    scanf("%lld",&a[i]);}
  for(ll i=n;i>=1;i--){
    if(i+a[i]<=200000){
      sum+=yoso[i+a[i]];}
    if(i-a[i]>0){
      yoso[i-a[i]]++;}}
  printf("%lld\n",sum);


  //printf("%lld %lld\n",a,b);
  
  return 0;
}

32
3 1 4 1 5 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5
 32
3 1 4 1 5 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 5
 32
3 1 4 1 5 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 32
3 1 4 1 5 9 4 12 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 6
2 3 6 1 3 1
 32
3 1 4 1 8 9 4 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 32
3 1 4 1 5 9 4 12 5 3 5 8 9 7 9 3 2 4 8 4 6 2 6 4 3 3 8 3 2 7 2 8
 32
2 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 17 5
 32
2 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 4 7 17 5
 32
3 1 4 1 8 11 8 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 3 7 2 14

23
 24
 25
 27
 3
 26
 28
 21
 19
 20

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>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long int

ll n;
ll a[200001];
int yoso[200001]={};


int main(){
  scanf("%lld",&n);
  ll sum=0;
  for(ll i=1;i<=n;i++){
    scanf("%lld",&a[i]);}
  for(ll i=n;i>=1;i--){
    if(i+a[i]<=200000){
      sum+=yoso[i+a[i]];}
    if(i-a[i]>0){
      yoso[i-a[i]]++;}}
  printf("%lld\n",sum);


  //printf("%lld %lld\n",a,b);
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600008
a:
	.zero	1600008
	.globl	yoso
	.align 32
	.type	yoso, @object
	.size	yoso, 800004
yoso:
	.zero	800004
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -24(%rbp)
	movq	$1, -16(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %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
	addq	$1, -16(%rbp)
.L2:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jle	.L3
	movq	n(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L7:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	cmpq	$200000, %rax
	jg	.L5
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -24(%rbp)
.L5:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L6
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rcx
	movl	(%rdx,%rcx), %edx
	leal	1(%rdx), %ecx
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L6:
	subq	$1, -8(%rbp)
.L4:
	cmpq	$0, -8(%rbp)
	jg	.L7
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600008
a:
	.zero	1600008
	.globl	yoso
	.align 32
	.type	yoso, @object
	.size	yoso, 800004
yoso:
	.zero	800004
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -24(%rbp)
	movq	$1, -16(%rbp)
	jmp	.L2
.L3:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %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
	addq	$1, -16(%rbp)
.L2:
	movq	n(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jle	.L3
	movq	n(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L7:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	cmpq	$200000, %rax
	jg	.L5
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -24(%rbp)
.L5:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L6
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rcx
	movl	(%rdx,%rcx), %edx
	leal	1(%rdx), %ecx
	leaq	0(,%rax,4), %rdx
	leaq	yoso(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L6:
	subq	$1, -8(%rbp)
.L4:
	cmpq	$0, -8(%rbp)
	jg	.L7
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
