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>

int main(void) {

  long n,k;
  scanf("%ld %ld", &n, &k);
  long h[n];
  for (long i = 0; i < n; i++) {
    scanf("%ld", &h[i]);
  }
  long min[n];
  min[0] = 0;
  long cost;
  long current;
  for (long i = 1; i < n; i++) {
    current = -1;
    for (long j = i-k; j < i; j++) {
      if (j < 0) {
        j = 0;
      }
      cost = min[j]+labs(h[i]-h[j]);
      if (current == -1 || cost < current) {
        current = cost;
      }
    }
    min[i] = current;
  }
  printf("%ld\n", min[n-1]);

  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:
.LFB6:
	.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	$136, %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	-136(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-144(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%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
.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, -88(%rbp)
	movq	$0, -128(%rbp)
	jmp	.L5
.L6:
	movq	-128(%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, -128(%rbp)
.L5:
	movq	-144(%rbp), %rax
	cmpq	%rax, -128(%rbp)
	jl	.L6
	movq	-144(%rbp), %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
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	-72(%rbp), %rax
	movq	$0, (%rax)
	movq	$1, -112(%rbp)
	jmp	.L10
.L16:
	movq	$-1, -120(%rbp)
	movq	-136(%rbp), %rdx
	movq	-112(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -104(%rbp)
	jmp	.L11
.L15:
	cmpq	$0, -104(%rbp)
	jns	.L12
	movq	$0, -104(%rbp)
.L12:
	movq	-72(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-88(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-88(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	addq	%rsi, %rax
	movq	%rax, -64(%rbp)
	cmpq	$-1, -120(%rbp)
	je	.L13
	movq	-64(%rbp), %rax
	cmpq	-120(%rbp), %rax
	jge	.L14
.L13:
	movq	-64(%rbp), %rax
	movq	%rax, -120(%rbp)
.L14:
	addq	$1, -104(%rbp)
.L11:
	movq	-104(%rbp), %rax
	cmpq	-112(%rbp), %rax
	jl	.L15
	movq	-72(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	-120(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -112(%rbp)
.L10:
	movq	-144(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jl	.L16
	movq	-144(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	(%rax,%rdx,8), %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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%ld %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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	%r14
	pushq	%r13
	leaq	-48(%rbp), %rdx
	leaq	-56(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rdx
	movq	%rsp, %rsi
	leaq	15(,%rdx,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L44:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L44
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L45
.L4:
	movq	%rsp, %rbx
	testq	%rdx, %rdx
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %r9
	addq	$8, %r13
	cmpq	%r12, %r9
	jg	.L6
	leaq	15(,%r9,8), %rax
	movq	%rsp, %rcx
	leaq	-1(%r9), %r10
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L46
.L9:
	leaq	7(%rsp), %rdi
	movq	%rdi, %rax
	andq	$-8, %rdi
	shrq	$3, %rax
	movq	%rdi, %r11
	movq	$0, 0(,%rax,8)
	cmpq	$1, %r9
	jle	.L17
	movl	$1, %r8d
	movl	$1, %esi
	subq	-48(%rbp), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	$-1, %rcx
	cmpq	%rsi, %r8
	jge	.L12
	xorl	%edx, %edx
	testq	%r8, %r8
	movq	(%rbx,%rsi,8), %r12
	cmovns	%r8, %rdx
	movq	%r12, %rax
	subq	(%rbx,%rdx,8), %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovs	%rax, %rcx
	addq	(%rdi,%rdx,8), %rcx
	.p2align 4,,10
	.p2align 3
.L42:
	addq	$1, %rdx
	cmpq	%rdx, %rsi
	jle	.L12
.L15:
	movq	%r12, %r13
	subq	(%rbx,%rdx,8), %r13
	movq	%r13, %rax
	negq	%rax
	cmovs	%r13, %rax
	addq	(%rdi,%rdx,8), %rax
	cmpq	%rcx, %rax
	jl	.L23
	cmpq	$-1, %rcx
	jne	.L42
.L23:
	addq	$1, %rdx
	movq	%rax, %rcx
	cmpq	%rdx, %rsi
	jg	.L15
.L12:
	movq	%rcx, (%rdi,%rsi,8)
	addq	$1, %rsi
	addq	$1, %r8
	cmpq	%rsi, %r9
	jne	.L16
.L17:
	movq	(%r11,%r10,8), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L47
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L45:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L46:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L5:
	leaq	-1(%rdx), %r10
	leaq	15(,%rdx,8), %rdx
	movq	%rsp, %rcx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L19:
	cmpq	%rcx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	leaq	7(%rsp), %r11
	movq	%r11, %rax
	andq	$-8, %r11
	shrq	$3, %rax
	movq	$0, 0(,%rax,8)
	jmp	.L17
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
.LFB39:
	.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	%r14
	pushq	%r13
	leaq	-48(%rbp), %rdx
	leaq	-56(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rdx
	movq	%rsp, %rsi
	leaq	15(,%rdx,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L44:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L44
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L45
.L4:
	movq	%rsp, %rbx
	testq	%rdx, %rdx
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %r9
	addq	$8, %r13
	cmpq	%r12, %r9
	jg	.L6
	leaq	15(,%r9,8), %rax
	movq	%rsp, %rcx
	leaq	-1(%r9), %r10
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L46
.L9:
	leaq	7(%rsp), %rdi
	movq	%rdi, %rax
	andq	$-8, %rdi
	shrq	$3, %rax
	movq	%rdi, %r11
	movq	$0, 0(,%rax,8)
	cmpq	$1, %r9
	jle	.L17
	movl	$1, %r8d
	movl	$1, %esi
	subq	-48(%rbp), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movq	$-1, %rcx
	cmpq	%rsi, %r8
	jge	.L12
	xorl	%edx, %edx
	testq	%r8, %r8
	movq	(%rbx,%rsi,8), %r12
	cmovns	%r8, %rdx
	movq	%r12, %rax
	subq	(%rbx,%rdx,8), %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovs	%rax, %rcx
	addq	(%rdi,%rdx,8), %rcx
	.p2align 4,,10
	.p2align 3
.L42:
	addq	$1, %rdx
	cmpq	%rdx, %rsi
	jle	.L12
.L15:
	movq	%r12, %r13
	subq	(%rbx,%rdx,8), %r13
	movq	%r13, %rax
	negq	%rax
	cmovs	%r13, %rax
	addq	(%rdi,%rdx,8), %rax
	cmpq	%rcx, %rax
	jl	.L23
	cmpq	$-1, %rcx
	jne	.L42
.L23:
	addq	$1, %rdx
	movq	%rax, %rcx
	cmpq	%rdx, %rsi
	jg	.L15
.L12:
	movq	%rcx, (%rdi,%rsi,8)
	addq	$1, %rsi
	addq	$1, %r8
	cmpq	%rsi, %r9
	jne	.L16
.L17:
	movq	(%r11,%r10,8), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L47
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L45:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L46:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L5:
	leaq	-1(%rdx), %r10
	leaq	15(,%rdx,8), %rdx
	movq	%rsp, %rcx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L19:
	cmpq	%rcx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	leaq	7(%rsp), %r11
	movq	%r11, %rax
	andq	$-8, %r11
	shrq	$3, %rax
	movq	$0, 0(,%rax,8)
	jmp	.L17
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>
#include <stdlib.h>

int main(void) {

  long n,k;
  scanf("%ld %ld", &n, &k);
  long h[n];
  for (long i = 0; i < n; i++) {
    scanf("%ld", &h[i]);
  }
  long min[n];
  min[0] = 0;
  long cost;
  long current;
  for (long i = 1; i < n; i++) {
    current = -1;
    for (long j = i-k; j < i; j++) {
      if (j < 0) {
        j = 0;
      }
      cost = min[j]+labs(h[i]-h[j]);
      if (current == -1 || cost < current) {
        current = cost;
      }
    }
    min[i] = current;
  }
  printf("%ld\n", min[n-1]);

  return 0;
}
2 100
10 9
 5 3
10 30 40 50 24
 3 4
40 10 20 70 80 10 20 70 80 60
 3 1
0 20 10
 3 4
40 10 17 70 80 10 20 70 80 60
 2 100
7 10
 10 4
40 9 20 70 80 10 20 70 80 60
 3 1
9 20 10
 2 100
17 9
 3 4
40 10 34 70 80 10 20 70 80 60

1
 26
 20
 30
 23
 3
 40
 21
 8
 6

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>

int main(void) {

  long n,k;
  scanf("%ld %ld", &n, &k);
  long h[n];
  for (long i = 0; i < n; i++) {
    scanf("%ld", &h[i]);
  }
  long min[n];
  min[0] = 0;
  long cost;
  long current;
  for (long i = 1; i < n; i++) {
    current = -1;
    for (long j = i-k; j < i; j++) {
      if (j < 0) {
        j = 0;
      }
      cost = min[j]+labs(h[i]-h[j]);
      if (current == -1 || cost < current) {
        current = cost;
      }
    }
    min[i] = current;
  }
  printf("%ld\n", min[n-1]);

  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:
.LFB6:
	.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	$136, %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	-136(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-144(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%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
.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, -88(%rbp)
	movq	$0, -128(%rbp)
	jmp	.L5
.L6:
	movq	-128(%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, -128(%rbp)
.L5:
	movq	-144(%rbp), %rax
	cmpq	%rax, -128(%rbp)
	jl	.L6
	movq	-144(%rbp), %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
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	-72(%rbp), %rax
	movq	$0, (%rax)
	movq	$1, -112(%rbp)
	jmp	.L10
.L16:
	movq	$-1, -120(%rbp)
	movq	-136(%rbp), %rdx
	movq	-112(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -104(%rbp)
	jmp	.L11
.L15:
	cmpq	$0, -104(%rbp)
	jns	.L12
	movq	$0, -104(%rbp)
.L12:
	movq	-72(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-88(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-88(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	addq	%rsi, %rax
	movq	%rax, -64(%rbp)
	cmpq	$-1, -120(%rbp)
	je	.L13
	movq	-64(%rbp), %rax
	cmpq	-120(%rbp), %rax
	jge	.L14
.L13:
	movq	-64(%rbp), %rax
	movq	%rax, -120(%rbp)
.L14:
	addq	$1, -104(%rbp)
.L11:
	movq	-104(%rbp), %rax
	cmpq	-112(%rbp), %rax
	jl	.L15
	movq	-72(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	-120(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -112(%rbp)
.L10:
	movq	-144(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jl	.L16
	movq	-144(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	(%rax,%rdx,8), %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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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
	.section	.rodata
.LC0:
	.string	"%ld %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %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	-136(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-144(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -96(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%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
.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, -88(%rbp)
	movq	$0, -128(%rbp)
	jmp	.L5
.L6:
	movq	-128(%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, -128(%rbp)
.L5:
	movq	-144(%rbp), %rax
	cmpq	%rax, -128(%rbp)
	jl	.L6
	movq	-144(%rbp), %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
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	-72(%rbp), %rax
	movq	$0, (%rax)
	movq	$1, -112(%rbp)
	jmp	.L10
.L16:
	movq	$-1, -120(%rbp)
	movq	-136(%rbp), %rdx
	movq	-112(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -104(%rbp)
	jmp	.L11
.L15:
	cmpq	$0, -104(%rbp)
	jns	.L12
	movq	$0, -104(%rbp)
.L12:
	movq	-72(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-88(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-88(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	addq	%rsi, %rax
	movq	%rax, -64(%rbp)
	cmpq	$-1, -120(%rbp)
	je	.L13
	movq	-64(%rbp), %rax
	cmpq	-120(%rbp), %rax
	jge	.L14
.L13:
	movq	-64(%rbp), %rax
	movq	%rax, -120(%rbp)
.L14:
	addq	$1, -104(%rbp)
.L11:
	movq	-104(%rbp), %rax
	cmpq	-112(%rbp), %rax
	jl	.L15
	movq	-72(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	-120(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -112(%rbp)
.L10:
	movq	-144(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jl	.L16
	movq	-144(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-72(%rbp), %rax
	movq	(%rax,%rdx,8), %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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
