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>
 
typedef long long ll;
 
  int a[200008];
  int v[200008];
 
int main(){
  ll k;
  int n;
  int i,j;
  int t;
  int sum1 = 0;
  int sum2 = 0;
  int now;
 
  scanf("%d %lld", &n, &k);
 
  for(i = 1;i <= 200000;i++) v[i] = 0;
 
  for(i = 1;i <= n;i++) scanf("%d", &a[i]);
 
  now = 1;
 
  while(1){
    if(v[now] == 1){
      t = now;
      break;
    }
 
    else{
      v[now] = 1;
      now = a[now];
      sum1++;
    }
  }

  if(k < sum1){
    now = 1;
    while(k){
      now = a[now];
      k--;
    }

    printf("%d\n", now);
    return 0;
  }
 
  now = 1;
  while(now != t){
    now = a[now];
    sum2++;
  }
 
  sum1 = sum1 - sum2;
 
  k = (k - sum2) % sum1;
 
  now = t;
  while(k > 0){
    now = a[now];
    k--;
  }
 
  printf("%d\n", now);
 
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800032
a:
	.zero	800032
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 800032
v:
	.zero	800032
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	leaq	-16(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$200000, -36(%rbp)
	jle	.L3
	movl	$1, -36(%rbp)
	jmp	.L4
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L5
	movl	$1, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L6
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	nop
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L9
	jmp	.L19
.L6:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	addl	$1, -32(%rbp)
	jmp	.L8
.L19:
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L10:
	movq	-16(%rbp), %rax
	testq	%rax, %rax
	jne	.L11
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L17
.L9:
	movl	$1, -24(%rbp)
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	addl	$1, -28(%rbp)
.L13:
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L14
	movl	-28(%rbp), %eax
	subl	%eax, -32(%rbp)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L15:
	movq	-16(%rbp), %rax
	testq	%rax, %rax
	jg	.L16
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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	"%d %lld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\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), %rdi
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	4+a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	$1, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$800000, %edx
	xorl	%esi, %esi
	leaq	4+v(%rip), %rdi
	call	memset@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 12(%rsp)
	jge	.L5
.L6:
	movslq	4+v(%rip), %r8
	movq	16(%rsp), %rax
	cmpl	$1, %r8d
	je	.L3
	xorl	%edi, %edi
	leaq	v(%rip), %r9
	movl	$1, %edx
	leaq	a(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, (%r9,%rdx,4)
	movslq	(%rcx,%rdx,4), %rdx
	addl	$1, %edi
	movslq	(%r9,%rdx,4), %r8
	movq	%rdx, %rsi
	cmpl	$1, %r8d
	jne	.L4
	movslq	%edi, %rdx
	cmpq	%rax, %rdx
	jg	.L9
	xorl	%edx, %edx
	cmpl	$1, %esi
	je	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	(%rcx,%r8,4), %r8
	addl	$1, %edx
	cmpl	%r8d, %esi
	jne	.L10
.L8:
	movslq	%edx, %rcx
	subl	%edx, %edi
	subq	%rcx, %rax
	movslq	%edi, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, 16(%rsp)
	testq	%rdx, %rdx
	jle	.L15
	leaq	a(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	(%rcx,%r8,4), %r8
	subq	$1, %rdx
	jne	.L16
.L29:
	movq	$0, 16(%rsp)
.L15:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$32, %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
.L9:
	.cfi_restore_state
	testq	%rax, %rax
	je	.L15
.L7:
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	(%rcx,%r8,4), %r8
	subq	$1, %rax
	jne	.L13
	jmp	.L29
.L3:
	leaq	a(%rip), %rcx
	testq	%rax, %rax
	js	.L7
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	.L8
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	v
	.bss
	.align 32
	.type	v, @object
	.size	v, 800032
v:
	.zero	800032
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800032
a:
	.zero	800032
	.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 %lld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\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), %rdi
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	4+a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	$1, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$800000, %edx
	xorl	%esi, %esi
	leaq	4+v(%rip), %rdi
	call	memset@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 12(%rsp)
	jge	.L5
.L6:
	movslq	4+v(%rip), %r8
	movq	16(%rsp), %rax
	cmpl	$1, %r8d
	je	.L3
	xorl	%edi, %edi
	leaq	v(%rip), %r9
	movl	$1, %edx
	leaq	a(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, (%r9,%rdx,4)
	movslq	(%rcx,%rdx,4), %rdx
	addl	$1, %edi
	movslq	(%r9,%rdx,4), %r8
	movq	%rdx, %rsi
	cmpl	$1, %r8d
	jne	.L4
	movslq	%edi, %rdx
	cmpq	%rax, %rdx
	jg	.L9
	xorl	%edx, %edx
	cmpl	$1, %esi
	je	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	(%rcx,%r8,4), %r8
	addl	$1, %edx
	cmpl	%r8d, %esi
	jne	.L10
.L8:
	movslq	%edx, %rcx
	subl	%edx, %edi
	subq	%rcx, %rax
	movslq	%edi, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, 16(%rsp)
	testq	%rdx, %rdx
	jle	.L15
	leaq	a(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	(%rcx,%r8,4), %r8
	subq	$1, %rdx
	jne	.L16
.L29:
	movq	$0, 16(%rsp)
.L15:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$32, %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
.L9:
	.cfi_restore_state
	testq	%rax, %rax
	je	.L15
.L7:
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	(%rcx,%r8,4), %r8
	subq	$1, %rax
	jne	.L13
	jmp	.L29
.L3:
	leaq	a(%rip), %rcx
	testq	%rax, %rax
	js	.L7
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	.L8
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	v
	.bss
	.align 32
	.type	v, @object
	.size	v, 800032
v:
	.zero	800032
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800032
a:
	.zero	800032
	.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>
 
typedef long long ll;
 
  int a[200008];
  int v[200008];
 
int main(){
  ll k;
  int n;
  int i,j;
  int t;
  int sum1 = 0;
  int sum2 = 0;
  int now;
 
  scanf("%d %lld", &n, &k);
 
  for(i = 1;i <= 200000;i++) v[i] = 0;
 
  for(i = 1;i <= n;i++) scanf("%d", &a[i]);
 
  now = 1;
 
  while(1){
    if(v[now] == 1){
      t = now;
      break;
    }
 
    else{
      v[now] = 1;
      now = a[now];
      sum1++;
    }
  }

  if(k < sum1){
    now = 1;
    while(k){
      now = a[now];
      k--;
    }

    printf("%d\n", now);
    return 0;
  }
 
  now = 1;
  while(now != t){
    now = a[now];
    sum2++;
  }
 
  sum1 = sum1 - sum2;
 
  k = (k - sum2) % sum1;
 
  now = t;
  while(k > 0){
    now = a[now];
    k--;
  }
 
  printf("%d\n", now);
 
  return 0;
}
6 727202214173249351
6 5 1 5 3 2
 4 9
3 2 4 1
 6 1007784494318310970
6 5 2 5 3 2
 6 237500909755776657
6 4 1 5 3 2
 6 727202214173249351
4 5 2 5 3 2
 6 165759462200935729
4 5 2 5 3 2
 6 727202214173249351
6 4 1 5 3 2
 4 0
3 2 4 1
 6 727202214173249351
6 4 1 1 3 2
 6 237500909755776657
2 4 1 5 3 2

6
 1
 3
 4
 5
 2
 3
 1
 4
 4

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>
 
typedef long long ll;
 
  int a[200008];
  int v[200008];
 
int main(){
  ll k;
  int n;
  int i,j;
  int t;
  int sum1 = 0;
  int sum2 = 0;
  int now;
 
  scanf("%d %lld", &n, &k);
 
  for(i = 1;i <= 200000;i++) v[i] = 0;
 
  for(i = 1;i <= n;i++) scanf("%d", &a[i]);
 
  now = 1;
 
  while(1){
    if(v[now] == 1){
      t = now;
      break;
    }
 
    else{
      v[now] = 1;
      now = a[now];
      sum1++;
    }
  }

  if(k < sum1){
    now = 1;
    while(k){
      now = a[now];
      k--;
    }

    printf("%d\n", now);
    return 0;
  }
 
  now = 1;
  while(now != t){
    now = a[now];
    sum2++;
  }
 
  sum1 = sum1 - sum2;
 
  k = (k - sum2) % sum1;
 
  now = t;
  while(k > 0){
    now = a[now];
    k--;
  }
 
  printf("%d\n", now);
 
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800032
a:
	.zero	800032
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 800032
v:
	.zero	800032
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	leaq	-16(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$200000, -36(%rbp)
	jle	.L3
	movl	$1, -36(%rbp)
	jmp	.L4
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L5
	movl	$1, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L6
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	nop
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L9
	jmp	.L19
.L6:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	addl	$1, -32(%rbp)
	jmp	.L8
.L19:
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L10:
	movq	-16(%rbp), %rax
	testq	%rax, %rax
	jne	.L11
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L17
.L9:
	movl	$1, -24(%rbp)
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	addl	$1, -28(%rbp)
.L13:
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L14
	movl	-28(%rbp), %eax
	subl	%eax, -32(%rbp)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L15:
	movq	-16(%rbp), %rax
	testq	%rax, %rax
	jg	.L16
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800032
a:
	.zero	800032
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 800032
v:
	.zero	800032
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	leaq	-16(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$200000, -36(%rbp)
	jle	.L3
	movl	$1, -36(%rbp)
	jmp	.L4
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L5
	movl	$1, -24(%rbp)
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L6
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	nop
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L9
	jmp	.L19
.L6:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	addl	$1, -32(%rbp)
	jmp	.L8
.L19:
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L10:
	movq	-16(%rbp), %rax
	testq	%rax, %rax
	jne	.L11
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L17
.L9:
	movl	$1, -24(%rbp)
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	addl	$1, -28(%rbp)
.L13:
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L14
	movl	-28(%rbp), %eax
	subl	%eax, -32(%rbp)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -16(%rbp)
.L15:
	movq	-16(%rbp), %rax
	testq	%rax, %rax
	jg	.L16
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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:
