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>
#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;
}```

Assembly Code:

```assembly
	.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:
```

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	"%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
```assembly
	.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:
```
```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;
}```
Given the following C 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;
}```

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:

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 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;
}```

Assembly Code:

```assembly
	.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:
```

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	"%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:
```