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 main(void) {

  long n,k,cur,move,first,loop,score,max,score_first,max_first,score_loop,set,ans;
  scanf("%ld %ld", &n, &k);
  long p[n+1],c[n+1],list[n+1];
  for (long i = 1; i <= n; i++) {
    scanf("%ld", &p[i]);
  }
  for (long i = 1; i <= n; i++) {
    scanf("%ld", &c[i]);
  }
  for (long start = 1; start <= n; start++) {
    for (long i = 1; i <= n; i++) {
      list[i] = -1;
    }
    list[start] = 0;
    cur = start;
    move = 0;
    while (1) {
      cur = p[cur];
      move++;
      if (list[cur] == -1 ) {
        list[cur] = move;
      } else {
        first = list[cur];
        break;
      }
    }
    loop = move-first;
    move = k;
    if (move <= first) {
      cur = start;
      score = 0;
      for (long i = 1; i <= move; i++) {
        cur = p[cur];
        score += c[cur];
        if (i == 1 || score > max) {
          max = score;
        }
      }
    } else {
      if (first == 0) {
        first = 1;
      }
      cur = start;
      score_first = 0;
      for (long i = 1; i <= first; i++) {
        cur = p[cur];
        score_first += c[cur];
        if (i == 1 || score_first > max_first) {
          max_first = score_first;
        }
      }
      score_loop = 0;
      for (long i = 1; i <= loop; i++) {
        cur = p[cur];
        score_loop += c[cur];
      }
      move -= first;
      if (score_loop > 0) {
        set = move/loop-1;
        if (set < 0) {
          set = 0;
        }
        move -= loop*set;
        score = score_first+score_loop*set;
        max = score;
        for (long i = 1; i <= move; i++) {
          cur = p[cur];
          score += c[cur];
          if (score > max) {
            max = score;
          }
        }
      } else {
        score = score_first;
        max = score;
        if (move > loop) {
          move = loop;
        }
        for (long i = 1; i <= move; i++) {
          cur = p[cur];
          score += c[cur];
          if (score > max) {
            max = score;
          }
        }
      }
      if (max_first > max) {
        max = max_first;
      }
    }
    if (start == 1 || max > ans) {
      ans = max;
    }
  }
  printf("%ld\n", ans);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$312, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-272(%rbp), %rax
	leaq	-280(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -112(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -320(%rbp)
	movq	$0, -312(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -104(%rbp)
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -352(%rbp)
	movq	$0, -344(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -80(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	$1, -184(%rbp)
	jmp	.L11
.L12:
	movq	-184(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -184(%rbp)
.L11:
	movq	-280(%rbp), %rax
	cmpq	%rax, -184(%rbp)
	jle	.L12
	movq	$1, -176(%rbp)
	jmp	.L13
.L14:
	movq	-176(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -176(%rbp)
.L13:
	movq	-280(%rbp), %rax
	cmpq	%rax, -176(%rbp)
	jle	.L14
	movq	$1, -168(%rbp)
	jmp	.L15
.L47:
	movq	$1, -160(%rbp)
	jmp	.L16
.L17:
	movq	-72(%rbp), %rax
	movq	-160(%rbp), %rdx
	movq	$-1, (%rax,%rdx,8)
	addq	$1, -160(%rbp)
.L16:
	movq	-280(%rbp), %rax
	cmpq	%rax, -160(%rbp)
	jle	.L17
	movq	-72(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -256(%rbp)
.L21:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	addq	$1, -256(%rbp)
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	$-1, %rax
	jne	.L18
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	-256(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L21
.L18:
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -248(%rbp)
	nop
	movq	-256(%rbp), %rax
	subq	-248(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	-272(%rbp), %rax
	movq	%rax, -256(%rbp)
	movq	-256(%rbp), %rax
	cmpq	-248(%rbp), %rax
	jg	.L22
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -240(%rbp)
	movq	$1, -152(%rbp)
	jmp	.L23
.L26:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	cmpq	$1, -152(%rbp)
	je	.L24
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L25
.L24:
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L25:
	addq	$1, -152(%rbp)
.L23:
	movq	-152(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L26
	jmp	.L27
.L22:
	cmpq	$0, -248(%rbp)
	jne	.L28
	movq	$1, -248(%rbp)
.L28:
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -224(%rbp)
	movq	$1, -144(%rbp)
	jmp	.L29
.L32:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -224(%rbp)
	cmpq	$1, -144(%rbp)
	je	.L30
	movq	-224(%rbp), %rax
	cmpq	-216(%rbp), %rax
	jle	.L31
.L30:
	movq	-224(%rbp), %rax
	movq	%rax, -216(%rbp)
.L31:
	addq	$1, -144(%rbp)
.L29:
	movq	-144(%rbp), %rax
	cmpq	-248(%rbp), %rax
	jle	.L32
	movq	$0, -208(%rbp)
	movq	$1, -136(%rbp)
	jmp	.L33
.L34:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -208(%rbp)
	addq	$1, -136(%rbp)
.L33:
	movq	-136(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jle	.L34
	movq	-248(%rbp), %rax
	subq	%rax, -256(%rbp)
	cmpq	$0, -208(%rbp)
	jle	.L35
	movq	-256(%rbp), %rax
	cqto
	idivq	-64(%rbp)
	subq	$1, %rax
	movq	%rax, -200(%rbp)
	cmpq	$0, -200(%rbp)
	jns	.L36
	movq	$0, -200(%rbp)
.L36:
	movq	-64(%rbp), %rax
	imulq	-200(%rbp), %rax
	subq	%rax, -256(%rbp)
	movq	-208(%rbp), %rax
	imulq	-200(%rbp), %rax
	movq	%rax, %rdx
	movq	-224(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
	movq	$1, -128(%rbp)
	jmp	.L37
.L39:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L38
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L38:
	addq	$1, -128(%rbp)
.L37:
	movq	-128(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L39
	jmp	.L40
.L35:
	movq	-224(%rbp), %rax
	movq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
	movq	-256(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jle	.L41
	movq	-64(%rbp), %rax
	movq	%rax, -256(%rbp)
.L41:
	movq	$1, -120(%rbp)
	jmp	.L42
.L44:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L43
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L43:
	addq	$1, -120(%rbp)
.L42:
	movq	-120(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L44
.L40:
	movq	-216(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L27
	movq	-216(%rbp), %rax
	movq	%rax, -232(%rbp)
.L27:
	cmpq	$1, -168(%rbp)
	je	.L45
	movq	-232(%rbp), %rax
	cmpq	-192(%rbp), %rax
	jle	.L46
.L45:
	movq	-232(%rbp), %rax
	movq	%rax, -192(%rbp)
.L46:
	addq	$1, -168(%rbp)
.L15:
	movq	-280(%rbp), %rax
	cmpq	%rax, -168(%rbp)
	jle	.L47
	movq	-192(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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	"%ld %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rdx
	leaq	-72(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%r8, -88(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %rcx
	movq	%rsp, %rsi
	movq	-88(%rbp), %r8
	leaq	23(,%rcx,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L72:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L72
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L73
.L4:
	movq	%rax, %rdi
	movq	%rax, %rdx
	movq	%rsp, %rsi
	movq	%rsp, %r12
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L73:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L74
.L7:
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%rsp, %r14
	andq	$-16, %rdx
	subq	%rax, %rsi
.L8:
	cmpq	%rsi, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L74:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r13
	testq	%rcx, %rcx
	jle	.L34
	movq	%r8, -96(%rbp)
	leaq	8(%r12), %rcx
	movl	$1, %edx
	leaq	.LC1(%rip), %r15
	movq	%rbx, -88(%rbp)
	movq	%rdx, %rbx
	movq	%r12, -112(%rbp)
	movq	%rcx, %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %rax
	addq	$8, %r12
	cmpq	%rbx, %rax
	jge	.L12
	testq	%rax, %rax
	jle	.L34
	leaq	8(%r14), %rcx
	movl	$1, %ebx
	movq	%rcx, %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %rax
	addq	$8, %r12
	cmpq	%rbx, %rax
	jge	.L13
	movq	-88(%rbp), %rbx
	movq	-96(%rbp), %r8
	movq	-112(%rbp), %r12
	testq	%rax, %rax
	jle	.L34
	leaq	1(%rax), %rdi
	salq	$3, %rax
	movq	-64(%rbp), %r9
	leaq	8(%r13), %r10
	movl	$1, %r15d
	movq	%rdi, -112(%rbp)
	movq	%rax, -120(%rbp)
	movq	%r15, %rax
	movq	%r8, %r15
	movq	%rax, %r8
	.p2align 4,,10
	.p2align 3
.L33:
	movq	-120(%rbp), %rdx
	movq	%r10, %rdi
	movl	$255, %esi
	movq	%r8, -96(%rbp)
	movq	%r9, -88(%rbp)
	call	memset@PLT
	movq	-96(%rbp), %r8
	movq	-88(%rbp), %r9
	movq	%rax, %r10
	movq	$0, 0(%r13,%r8,8)
	movq	(%r12,%r8,8), %rcx
	movq	0(%r13,%rcx,8), %rax
	cmpq	$-1, %rax
	jne	.L38
	movq	%rcx, %rdx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rsi, 0(%r13,%rdx,8)
	movq	(%r12,%rdx,8), %rdx
	addq	$1, %rsi
	movq	0(%r13,%rdx,8), %rax
	cmpq	$-1, %rax
	je	.L16
.L15:
	cmpq	%rax, %r9
	jg	.L17
	testq	%r9, %r9
	jle	.L19
	movq	(%r14,%rcx,8), %rax
	leaq	1(%r9), %rsi
	movl	$2, %edx
	movq	%rax, %rbx
	cmpq	$1, %r9
	je	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rax
	cmpq	%rax, %rbx
	cmovl	%rax, %rbx
	addq	$1, %rdx
	cmpq	%rsi, %rdx
	jne	.L20
.L19:
	cmpq	$1, %r8
	je	.L44
.L76:
	cmpq	-104(%rbp), %rbx
	jg	.L44
.L31:
	addq	$1, %r8
	cmpq	-112(%rbp), %r8
	jne	.L33
.L34:
	movq	-104(%rbp), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L75
	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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	testq	%rax, %rax
	jne	.L21
	movq	(%r14,%rcx,8), %r15
	movl	$1, %edx
	movq	%r15, %rdi
.L22:
	leaq	1(%rsi), %rbx
	movl	$1, %eax
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L27:
	movq	(%r12,%rcx,8), %rcx
	addq	$1, %rax
	addq	(%r14,%rcx,8), %r11
	cmpq	%rax, %rbx
	jne	.L27
	movq	%r9, %rbx
	subq	%rdx, %rbx
	testq	%r11, %r11
	jle	.L28
	movq	%rbx, %rax
	cqto
	idivq	%rsi
	movl	$0, %edx
	subq	$1, %rax
	cmovs	%rdx, %rax
	imulq	%rax, %rsi
	imulq	%r11, %rax
	subq	%rsi, %rbx
	addq	%rdi, %rax
	testq	%rbx, %rbx
	jle	.L42
	addq	$1, %rbx
	movq	%rax, %r11
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rax
	cmpq	%rax, %r11
	cmovl	%rax, %r11
	addq	$1, %rdx
	cmpq	%rdx, %rbx
	jne	.L29
.L26:
	cmpq	%r15, %r11
	movq	%r11, %rbx
	cmovl	%r15, %rbx
.L77:
	cmpq	$1, %r8
	jne	.L76
.L44:
	movq	%rbx, -104(%rbp)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L21:
	jle	.L39
	movq	(%r14,%rcx,8), %rdi
	cmpq	$1, %rax
	je	.L40
	leaq	1(%rax), %r11
	movq	%rdi, %r15
	movl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rdi
	cmpq	%rdi, %r15
	cmovl	%rdi, %r15
	addq	$1, %rdx
	cmpq	%r11, %rdx
	jne	.L25
	movq	%rax, %rdx
.L23:
	subq	%rax, %rsi
	movq	%rdi, %r11
	testq	%rsi, %rsi
	jg	.L22
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L28:
	cmpq	%rsi, %rbx
	cmovg	%rsi, %rbx
	testq	%rbx, %rbx
	jle	.L43
	addq	$1, %rbx
	movq	%rdi, %r11
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L30:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rdi
	cmpq	%rdi, %r11
	cmovl	%rdi, %r11
	addq	$1, %rax
	cmpq	%rax, %rbx
	jne	.L30
	cmpq	%r15, %r11
	movq	%r11, %rbx
	cmovl	%r15, %rbx
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L38:
	movl	$1, %esi
	jmp	.L15
.L39:
	movq	%rax, %rdx
	movq	%r8, %rcx
	xorl	%edi, %edi
	jmp	.L23
.L42:
	movq	%rax, %r11
	jmp	.L26
.L40:
	movl	$1, %edx
	movq	%rdi, %r15
	jmp	.L23
.L75:
	call	__stack_chk_fail@PLT
.L43:
	movq	%rdi, %r11
	jmp	.L26
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rdx
	leaq	-72(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%r8, -88(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %rcx
	movq	%rsp, %rsi
	movq	-88(%rbp), %r8
	leaq	23(,%rcx,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L72:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L72
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L73
.L4:
	movq	%rax, %rdi
	movq	%rax, %rdx
	movq	%rsp, %rsi
	movq	%rsp, %r12
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L73:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L74
.L7:
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%rsp, %r14
	andq	$-16, %rdx
	subq	%rax, %rsi
.L8:
	cmpq	%rsi, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L74:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r13
	testq	%rcx, %rcx
	jle	.L34
	movq	%r8, -96(%rbp)
	leaq	8(%r12), %rcx
	movl	$1, %edx
	leaq	.LC1(%rip), %r15
	movq	%rbx, -88(%rbp)
	movq	%rdx, %rbx
	movq	%r12, -112(%rbp)
	movq	%rcx, %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %rax
	addq	$8, %r12
	cmpq	%rbx, %rax
	jge	.L12
	testq	%rax, %rax
	jle	.L34
	leaq	8(%r14), %rcx
	movl	$1, %ebx
	movq	%rcx, %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-72(%rbp), %rax
	addq	$8, %r12
	cmpq	%rbx, %rax
	jge	.L13
	movq	-88(%rbp), %rbx
	movq	-96(%rbp), %r8
	movq	-112(%rbp), %r12
	testq	%rax, %rax
	jle	.L34
	leaq	1(%rax), %rdi
	salq	$3, %rax
	movq	-64(%rbp), %r9
	leaq	8(%r13), %r10
	movl	$1, %r15d
	movq	%rdi, -112(%rbp)
	movq	%rax, -120(%rbp)
	movq	%r15, %rax
	movq	%r8, %r15
	movq	%rax, %r8
	.p2align 4,,10
	.p2align 3
.L33:
	movq	-120(%rbp), %rdx
	movq	%r10, %rdi
	movl	$255, %esi
	movq	%r8, -96(%rbp)
	movq	%r9, -88(%rbp)
	call	memset@PLT
	movq	-96(%rbp), %r8
	movq	-88(%rbp), %r9
	movq	%rax, %r10
	movq	$0, 0(%r13,%r8,8)
	movq	(%r12,%r8,8), %rcx
	movq	0(%r13,%rcx,8), %rax
	cmpq	$-1, %rax
	jne	.L38
	movq	%rcx, %rdx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rsi, 0(%r13,%rdx,8)
	movq	(%r12,%rdx,8), %rdx
	addq	$1, %rsi
	movq	0(%r13,%rdx,8), %rax
	cmpq	$-1, %rax
	je	.L16
.L15:
	cmpq	%rax, %r9
	jg	.L17
	testq	%r9, %r9
	jle	.L19
	movq	(%r14,%rcx,8), %rax
	leaq	1(%r9), %rsi
	movl	$2, %edx
	movq	%rax, %rbx
	cmpq	$1, %r9
	je	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rax
	cmpq	%rax, %rbx
	cmovl	%rax, %rbx
	addq	$1, %rdx
	cmpq	%rsi, %rdx
	jne	.L20
.L19:
	cmpq	$1, %r8
	je	.L44
.L76:
	cmpq	-104(%rbp), %rbx
	jg	.L44
.L31:
	addq	$1, %r8
	cmpq	-112(%rbp), %r8
	jne	.L33
.L34:
	movq	-104(%rbp), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L75
	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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	testq	%rax, %rax
	jne	.L21
	movq	(%r14,%rcx,8), %r15
	movl	$1, %edx
	movq	%r15, %rdi
.L22:
	leaq	1(%rsi), %rbx
	movl	$1, %eax
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L27:
	movq	(%r12,%rcx,8), %rcx
	addq	$1, %rax
	addq	(%r14,%rcx,8), %r11
	cmpq	%rax, %rbx
	jne	.L27
	movq	%r9, %rbx
	subq	%rdx, %rbx
	testq	%r11, %r11
	jle	.L28
	movq	%rbx, %rax
	cqto
	idivq	%rsi
	movl	$0, %edx
	subq	$1, %rax
	cmovs	%rdx, %rax
	imulq	%rax, %rsi
	imulq	%r11, %rax
	subq	%rsi, %rbx
	addq	%rdi, %rax
	testq	%rbx, %rbx
	jle	.L42
	addq	$1, %rbx
	movq	%rax, %r11
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rax
	cmpq	%rax, %r11
	cmovl	%rax, %r11
	addq	$1, %rdx
	cmpq	%rdx, %rbx
	jne	.L29
.L26:
	cmpq	%r15, %r11
	movq	%r11, %rbx
	cmovl	%r15, %rbx
.L77:
	cmpq	$1, %r8
	jne	.L76
.L44:
	movq	%rbx, -104(%rbp)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L21:
	jle	.L39
	movq	(%r14,%rcx,8), %rdi
	cmpq	$1, %rax
	je	.L40
	leaq	1(%rax), %r11
	movq	%rdi, %r15
	movl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rdi
	cmpq	%rdi, %r15
	cmovl	%rdi, %r15
	addq	$1, %rdx
	cmpq	%r11, %rdx
	jne	.L25
	movq	%rax, %rdx
.L23:
	subq	%rax, %rsi
	movq	%rdi, %r11
	testq	%rsi, %rsi
	jg	.L22
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L28:
	cmpq	%rsi, %rbx
	cmovg	%rsi, %rbx
	testq	%rbx, %rbx
	jle	.L43
	addq	$1, %rbx
	movq	%rdi, %r11
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L30:
	movq	(%r12,%rcx,8), %rcx
	addq	(%r14,%rcx,8), %rdi
	cmpq	%rdi, %r11
	cmovl	%rdi, %r11
	addq	$1, %rax
	cmpq	%rax, %rbx
	jne	.L30
	cmpq	%r15, %r11
	movq	%r11, %rbx
	cmovl	%r15, %rbx
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L38:
	movl	$1, %esi
	jmp	.L15
.L39:
	movq	%rax, %rdx
	movq	%r8, %rcx
	xorl	%edi, %edi
	jmp	.L23
.L42:
	movq	%rax, %r11
	jmp	.L26
.L40:
	movl	$1, %edx
	movq	%rdi, %r15
	jmp	.L23
.L75:
	call	__stack_chk_fail@PLT
.L43:
	movq	%rdi, %r11
	jmp	.L26
	.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:

#include <stdio.h>

int main(void) {

  long n,k,cur,move,first,loop,score,max,score_first,max_first,score_loop,set,ans;
  scanf("%ld %ld", &n, &k);
  long p[n+1],c[n+1],list[n+1];
  for (long i = 1; i <= n; i++) {
    scanf("%ld", &p[i]);
  }
  for (long i = 1; i <= n; i++) {
    scanf("%ld", &c[i]);
  }
  for (long start = 1; start <= n; start++) {
    for (long i = 1; i <= n; i++) {
      list[i] = -1;
    }
    list[start] = 0;
    cur = start;
    move = 0;
    while (1) {
      cur = p[cur];
      move++;
      if (list[cur] == -1 ) {
        list[cur] = move;
      } else {
        first = list[cur];
        break;
      }
    }
    loop = move-first;
    move = k;
    if (move <= first) {
      cur = start;
      score = 0;
      for (long i = 1; i <= move; i++) {
        cur = p[cur];
        score += c[cur];
        if (i == 1 || score > max) {
          max = score;
        }
      }
    } else {
      if (first == 0) {
        first = 1;
      }
      cur = start;
      score_first = 0;
      for (long i = 1; i <= first; i++) {
        cur = p[cur];
        score_first += c[cur];
        if (i == 1 || score_first > max_first) {
          max_first = score_first;
        }
      }
      score_loop = 0;
      for (long i = 1; i <= loop; i++) {
        cur = p[cur];
        score_loop += c[cur];
      }
      move -= first;
      if (score_loop > 0) {
        set = move/loop-1;
        if (set < 0) {
          set = 0;
        }
        move -= loop*set;
        score = score_first+score_loop*set;
        max = score;
        for (long i = 1; i <= move; i++) {
          cur = p[cur];
          score += c[cur];
          if (score > max) {
            max = score;
          }
        }
      } else {
        score = score_first;
        max = score;
        if (move > loop) {
          move = loop;
        }
        for (long i = 1; i <= move; i++) {
          cur = p[cur];
          score += c[cur];
          if (score > max) {
            max = score;
          }
        }
      }
      if (max_first > max) {
        max = max_first;
      }
    }
    if (start == 1 || max > ans) {
      ans = max;
    }
  }
  printf("%ld\n", ans);

  return 0;
}
10 58
9 1 6 7 8 4 3 2 10 5
695279662 988782657 -119067776 382975538 -151885171 -243968758 -169777795 37619092 389386780 980092719
 10 58
9 1 6 7 8 4 3 2 10 5
1020768626 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719
 3 3
3 1 2
-1000 -2000 -3052
 10 58
9 1 6 7 8 4 3 2 10 5
695279662 903489508 -119067776 382975538 -151885171 -243968758 -169777795 37619092 389386780 980092719
 10 58
9 1 6 7 8 4 3 2 10 5
97711577 988782657 -119067776 382975538 -151885171 -269784707 -169777795 37619092 389386780 980092719
 10 58
9 1 6 7 8 4 3 2 10 5
1020768626 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 333701688 980092719
 10 58
9 1 6 7 8 4 3 2 10 5
97711577 988782657 -119067776 382975538 -151885171 -269784707 -169777795 37619092 389386780 607177473
 3 3
3 1 2
-653 -2000 -3000
 2 3
2 1
10 -13
 10 58
9 1 6 7 8 4 3 2 10 5
695279662 988782657 -119067776 382975538 -151885171 -243968758 -169777795 37619092 737953331 980092719

29507023469
 32761913109
 -1000
 28654091979
 23531342619
 32205062189
 19802190159
 -653
 10
 32992688979

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 main(void) {

  long n,k,cur,move,first,loop,score,max,score_first,max_first,score_loop,set,ans;
  scanf("%ld %ld", &n, &k);
  long p[n+1],c[n+1],list[n+1];
  for (long i = 1; i <= n; i++) {
    scanf("%ld", &p[i]);
  }
  for (long i = 1; i <= n; i++) {
    scanf("%ld", &c[i]);
  }
  for (long start = 1; start <= n; start++) {
    for (long i = 1; i <= n; i++) {
      list[i] = -1;
    }
    list[start] = 0;
    cur = start;
    move = 0;
    while (1) {
      cur = p[cur];
      move++;
      if (list[cur] == -1 ) {
        list[cur] = move;
      } else {
        first = list[cur];
        break;
      }
    }
    loop = move-first;
    move = k;
    if (move <= first) {
      cur = start;
      score = 0;
      for (long i = 1; i <= move; i++) {
        cur = p[cur];
        score += c[cur];
        if (i == 1 || score > max) {
          max = score;
        }
      }
    } else {
      if (first == 0) {
        first = 1;
      }
      cur = start;
      score_first = 0;
      for (long i = 1; i <= first; i++) {
        cur = p[cur];
        score_first += c[cur];
        if (i == 1 || score_first > max_first) {
          max_first = score_first;
        }
      }
      score_loop = 0;
      for (long i = 1; i <= loop; i++) {
        cur = p[cur];
        score_loop += c[cur];
      }
      move -= first;
      if (score_loop > 0) {
        set = move/loop-1;
        if (set < 0) {
          set = 0;
        }
        move -= loop*set;
        score = score_first+score_loop*set;
        max = score;
        for (long i = 1; i <= move; i++) {
          cur = p[cur];
          score += c[cur];
          if (score > max) {
            max = score;
          }
        }
      } else {
        score = score_first;
        max = score;
        if (move > loop) {
          move = loop;
        }
        for (long i = 1; i <= move; i++) {
          cur = p[cur];
          score += c[cur];
          if (score > max) {
            max = score;
          }
        }
      }
      if (max_first > max) {
        max = max_first;
      }
    }
    if (start == 1 || max > ans) {
      ans = max;
    }
  }
  printf("%ld\n", ans);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$312, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-272(%rbp), %rax
	leaq	-280(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -112(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -320(%rbp)
	movq	$0, -312(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -104(%rbp)
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -352(%rbp)
	movq	$0, -344(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -80(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	$1, -184(%rbp)
	jmp	.L11
.L12:
	movq	-184(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -184(%rbp)
.L11:
	movq	-280(%rbp), %rax
	cmpq	%rax, -184(%rbp)
	jle	.L12
	movq	$1, -176(%rbp)
	jmp	.L13
.L14:
	movq	-176(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -176(%rbp)
.L13:
	movq	-280(%rbp), %rax
	cmpq	%rax, -176(%rbp)
	jle	.L14
	movq	$1, -168(%rbp)
	jmp	.L15
.L47:
	movq	$1, -160(%rbp)
	jmp	.L16
.L17:
	movq	-72(%rbp), %rax
	movq	-160(%rbp), %rdx
	movq	$-1, (%rax,%rdx,8)
	addq	$1, -160(%rbp)
.L16:
	movq	-280(%rbp), %rax
	cmpq	%rax, -160(%rbp)
	jle	.L17
	movq	-72(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -256(%rbp)
.L21:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	addq	$1, -256(%rbp)
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	$-1, %rax
	jne	.L18
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	-256(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L21
.L18:
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -248(%rbp)
	nop
	movq	-256(%rbp), %rax
	subq	-248(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	-272(%rbp), %rax
	movq	%rax, -256(%rbp)
	movq	-256(%rbp), %rax
	cmpq	-248(%rbp), %rax
	jg	.L22
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -240(%rbp)
	movq	$1, -152(%rbp)
	jmp	.L23
.L26:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	cmpq	$1, -152(%rbp)
	je	.L24
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L25
.L24:
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L25:
	addq	$1, -152(%rbp)
.L23:
	movq	-152(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L26
	jmp	.L27
.L22:
	cmpq	$0, -248(%rbp)
	jne	.L28
	movq	$1, -248(%rbp)
.L28:
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -224(%rbp)
	movq	$1, -144(%rbp)
	jmp	.L29
.L32:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -224(%rbp)
	cmpq	$1, -144(%rbp)
	je	.L30
	movq	-224(%rbp), %rax
	cmpq	-216(%rbp), %rax
	jle	.L31
.L30:
	movq	-224(%rbp), %rax
	movq	%rax, -216(%rbp)
.L31:
	addq	$1, -144(%rbp)
.L29:
	movq	-144(%rbp), %rax
	cmpq	-248(%rbp), %rax
	jle	.L32
	movq	$0, -208(%rbp)
	movq	$1, -136(%rbp)
	jmp	.L33
.L34:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -208(%rbp)
	addq	$1, -136(%rbp)
.L33:
	movq	-136(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jle	.L34
	movq	-248(%rbp), %rax
	subq	%rax, -256(%rbp)
	cmpq	$0, -208(%rbp)
	jle	.L35
	movq	-256(%rbp), %rax
	cqto
	idivq	-64(%rbp)
	subq	$1, %rax
	movq	%rax, -200(%rbp)
	cmpq	$0, -200(%rbp)
	jns	.L36
	movq	$0, -200(%rbp)
.L36:
	movq	-64(%rbp), %rax
	imulq	-200(%rbp), %rax
	subq	%rax, -256(%rbp)
	movq	-208(%rbp), %rax
	imulq	-200(%rbp), %rax
	movq	%rax, %rdx
	movq	-224(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
	movq	$1, -128(%rbp)
	jmp	.L37
.L39:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L38
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L38:
	addq	$1, -128(%rbp)
.L37:
	movq	-128(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L39
	jmp	.L40
.L35:
	movq	-224(%rbp), %rax
	movq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
	movq	-256(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jle	.L41
	movq	-64(%rbp), %rax
	movq	%rax, -256(%rbp)
.L41:
	movq	$1, -120(%rbp)
	jmp	.L42
.L44:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L43
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L43:
	addq	$1, -120(%rbp)
.L42:
	movq	-120(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L44
.L40:
	movq	-216(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L27
	movq	-216(%rbp), %rax
	movq	%rax, -232(%rbp)
.L27:
	cmpq	$1, -168(%rbp)
	je	.L45
	movq	-232(%rbp), %rax
	cmpq	-192(%rbp), %rax
	jle	.L46
.L45:
	movq	-232(%rbp), %rax
	movq	%rax, -192(%rbp)
.L46:
	addq	$1, -168(%rbp)
.L15:
	movq	-280(%rbp), %rax
	cmpq	%rax, -168(%rbp)
	jle	.L47
	movq	-192(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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
	.section	.rodata
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$312, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-272(%rbp), %rax
	leaq	-280(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -112(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -304(%rbp)
	movq	$0, -296(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -320(%rbp)
	movq	$0, -312(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -104(%rbp)
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -336(%rbp)
	movq	$0, -328(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -352(%rbp)
	movq	$0, -344(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -88(%rbp)
	movq	-280(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -80(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	$1, -184(%rbp)
	jmp	.L11
.L12:
	movq	-184(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -184(%rbp)
.L11:
	movq	-280(%rbp), %rax
	cmpq	%rax, -184(%rbp)
	jle	.L12
	movq	$1, -176(%rbp)
	jmp	.L13
.L14:
	movq	-176(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -176(%rbp)
.L13:
	movq	-280(%rbp), %rax
	cmpq	%rax, -176(%rbp)
	jle	.L14
	movq	$1, -168(%rbp)
	jmp	.L15
.L47:
	movq	$1, -160(%rbp)
	jmp	.L16
.L17:
	movq	-72(%rbp), %rax
	movq	-160(%rbp), %rdx
	movq	$-1, (%rax,%rdx,8)
	addq	$1, -160(%rbp)
.L16:
	movq	-280(%rbp), %rax
	cmpq	%rax, -160(%rbp)
	jle	.L17
	movq	-72(%rbp), %rax
	movq	-168(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -256(%rbp)
.L21:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	addq	$1, -256(%rbp)
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	$-1, %rax
	jne	.L18
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	-256(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L21
.L18:
	movq	-72(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -248(%rbp)
	nop
	movq	-256(%rbp), %rax
	subq	-248(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	-272(%rbp), %rax
	movq	%rax, -256(%rbp)
	movq	-256(%rbp), %rax
	cmpq	-248(%rbp), %rax
	jg	.L22
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -240(%rbp)
	movq	$1, -152(%rbp)
	jmp	.L23
.L26:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	cmpq	$1, -152(%rbp)
	je	.L24
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L25
.L24:
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L25:
	addq	$1, -152(%rbp)
.L23:
	movq	-152(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L26
	jmp	.L27
.L22:
	cmpq	$0, -248(%rbp)
	jne	.L28
	movq	$1, -248(%rbp)
.L28:
	movq	-168(%rbp), %rax
	movq	%rax, -264(%rbp)
	movq	$0, -224(%rbp)
	movq	$1, -144(%rbp)
	jmp	.L29
.L32:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -224(%rbp)
	cmpq	$1, -144(%rbp)
	je	.L30
	movq	-224(%rbp), %rax
	cmpq	-216(%rbp), %rax
	jle	.L31
.L30:
	movq	-224(%rbp), %rax
	movq	%rax, -216(%rbp)
.L31:
	addq	$1, -144(%rbp)
.L29:
	movq	-144(%rbp), %rax
	cmpq	-248(%rbp), %rax
	jle	.L32
	movq	$0, -208(%rbp)
	movq	$1, -136(%rbp)
	jmp	.L33
.L34:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -208(%rbp)
	addq	$1, -136(%rbp)
.L33:
	movq	-136(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jle	.L34
	movq	-248(%rbp), %rax
	subq	%rax, -256(%rbp)
	cmpq	$0, -208(%rbp)
	jle	.L35
	movq	-256(%rbp), %rax
	cqto
	idivq	-64(%rbp)
	subq	$1, %rax
	movq	%rax, -200(%rbp)
	cmpq	$0, -200(%rbp)
	jns	.L36
	movq	$0, -200(%rbp)
.L36:
	movq	-64(%rbp), %rax
	imulq	-200(%rbp), %rax
	subq	%rax, -256(%rbp)
	movq	-208(%rbp), %rax
	imulq	-200(%rbp), %rax
	movq	%rax, %rdx
	movq	-224(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
	movq	$1, -128(%rbp)
	jmp	.L37
.L39:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L38
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L38:
	addq	$1, -128(%rbp)
.L37:
	movq	-128(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L39
	jmp	.L40
.L35:
	movq	-224(%rbp), %rax
	movq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
	movq	-256(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jle	.L41
	movq	-64(%rbp), %rax
	movq	%rax, -256(%rbp)
.L41:
	movq	$1, -120(%rbp)
	jmp	.L42
.L44:
	movq	-104(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -264(%rbp)
	movq	-88(%rbp), %rax
	movq	-264(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -240(%rbp)
	movq	-240(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L43
	movq	-240(%rbp), %rax
	movq	%rax, -232(%rbp)
.L43:
	addq	$1, -120(%rbp)
.L42:
	movq	-120(%rbp), %rax
	cmpq	-256(%rbp), %rax
	jle	.L44
.L40:
	movq	-216(%rbp), %rax
	cmpq	-232(%rbp), %rax
	jle	.L27
	movq	-216(%rbp), %rax
	movq	%rax, -232(%rbp)
.L27:
	cmpq	$1, -168(%rbp)
	je	.L45
	movq	-232(%rbp), %rax
	cmpq	-192(%rbp), %rax
	jle	.L46
.L45:
	movq	-232(%rbp), %rax
	movq	%rax, -192(%rbp)
.L46:
	addq	$1, -168(%rbp)
.L15:
	movq	-280(%rbp), %rax
	cmpq	%rax, -168(%rbp)
	jle	.L47
	movq	-192(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	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:
