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>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define INF 100100100

int main(void)
{
    int n, k, h[100100];
    scanf("%d%d", &n, &k);
    rep(i, n)
        scanf("%d", &h[i]);

    int dp[100100] = {0};
    dp[1] = abs(h[1] - h[0]);
    for (int i = 2; i < n; i++)
    {
        dp[i] = dp[i - 1] + abs(h[i] - h[i - 1]);
        for (int j = 2; j <= k; j++)
            if (i - j >= 0)
                dp[i] = min(dp[i], abs(h[i] - h[i - j]) + dp[i - j]);
    }

    printf("%d\n", dp[n - 1]);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800832(%rbp), %rdx
	leaq	-800836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800828(%rbp)
	jmp	.L2
.L3:
	leaq	-800816(%rbp), %rdx
	movl	-800828(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800828(%rbp)
.L2:
	movl	-800836(%rbp), %eax
	cmpl	%eax, -800828(%rbp)
	jl	.L3
	leaq	-400416(%rbp), %rax
	movl	$400400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-800812(%rbp), %eax
	movl	-800816(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400412(%rbp)
	movl	$2, -800824(%rbp)
	jmp	.L4
.L8:
	movl	-800824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400416(%rbp,%rax,4), %ecx
	movl	-800824(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %edx
	movl	-800824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800816(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	%edx, -400416(%rbp,%rax,4)
	movl	$2, -800820(%rbp)
	jmp	.L5
.L7:
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	testl	%eax, %eax
	js	.L6
	movl	-800824(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %edx
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	%edx, -400416(%rbp,%rax,4)
.L6:
	addl	$1, -800820(%rbp)
.L5:
	movl	-800832(%rbp), %eax
	cmpl	%eax, -800820(%rbp)
	jle	.L7
	addl	$1, -800824(%rbp)
.L4:
	movl	-800836(%rbp), %eax
	cmpl	%eax, -800824(%rbp)
	jl	.L8
	movl	-800836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2112, %rsp
	.cfi_def_cfa_offset 800880
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ebp
	addq	$4, %r13
	cmpl	%r12d, %ebp
	jg	.L3
	leaq	400416(%rsp), %r9
	movl	$400400, %edx
	xorl	%esi, %esi
	movq	%r9, %rdi
	call	memset@PLT
	movq	%rax, %r9
	movl	20(%rsp), %eax
	subl	16(%rsp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, 400420(%rsp)
	cmpl	$2, %ebp
	jle	.L9
	movl	12(%rsp), %r11d
	movl	$2, %eax
	leal	-2(%rbp), %r12d
	xorl	%r8d, %r8d
	leaq	400424(%rsp), %rsi
	leal	-2(%r11), %edx
	subq	%rdx, %rax
	leaq	-12(,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L8:
	movl	8(%rbx,%r8,4), %r10d
	movl	%r8d, %ecx
	movl	%r10d, %edx
	subl	4(%rbx,%r8,4), %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	addl	-4(%rsi), %eax
	movl	%eax, (%rsi)
	cmpl	$1, %r11d
	jle	.L5
	leaq	0(,%r8,4), %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%ecx, %ecx
	js	.L6
	movl	%r10d, %r13d
	subl	(%rbx,%rdx), %r13d
	movl	%r13d, %eax
	negl	%eax
	cmovs	%r13d, %eax
	movl	(%rsi), %r13d
	addl	(%r9,%rdx), %eax
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	movl	%eax, (%rsi)
.L6:
	subq	$4, %rdx
	subl	$1, %ecx
	cmpq	%rdx, %rdi
	jne	.L7
.L5:
	addq	$1, %r8
	addq	$4, %rdi
	addq	$4, %rsi
	cmpq	%r12, %r8
	jne	.L8
.L9:
	leal	-1(%rbp), %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	cltq
	movl	400416(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	800824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$800832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	$400400, %edx
	xorl	%esi, %esi
	leaq	400416(%rsp), %rdi
	call	memset@PLT
	movl	20(%rsp), %eax
	subl	16(%rsp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, 400420(%rsp)
	jmp	.L9
.L17:
	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	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2112, %rsp
	.cfi_def_cfa_offset 800880
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ebp
	addq	$4, %r13
	cmpl	%r12d, %ebp
	jg	.L3
	leaq	400416(%rsp), %r9
	movl	$400400, %edx
	xorl	%esi, %esi
	movq	%r9, %rdi
	call	memset@PLT
	movq	%rax, %r9
	movl	20(%rsp), %eax
	subl	16(%rsp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, 400420(%rsp)
	cmpl	$2, %ebp
	jle	.L9
	movl	12(%rsp), %r11d
	movl	$2, %eax
	leal	-2(%rbp), %r12d
	xorl	%r8d, %r8d
	leaq	400424(%rsp), %rsi
	leal	-2(%r11), %edx
	subq	%rdx, %rax
	leaq	-12(,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L8:
	movl	8(%rbx,%r8,4), %r10d
	movl	%r8d, %ecx
	movl	%r10d, %edx
	subl	4(%rbx,%r8,4), %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	addl	-4(%rsi), %eax
	movl	%eax, (%rsi)
	cmpl	$1, %r11d
	jle	.L5
	leaq	0(,%r8,4), %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%ecx, %ecx
	js	.L6
	movl	%r10d, %r13d
	subl	(%rbx,%rdx), %r13d
	movl	%r13d, %eax
	negl	%eax
	cmovs	%r13d, %eax
	movl	(%rsi), %r13d
	addl	(%r9,%rdx), %eax
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	movl	%eax, (%rsi)
.L6:
	subq	$4, %rdx
	subl	$1, %ecx
	cmpq	%rdx, %rdi
	jne	.L7
.L5:
	addq	$1, %r8
	addq	$4, %rdi
	addq	$4, %rsi
	cmpq	%r12, %r8
	jne	.L8
.L9:
	leal	-1(%rbp), %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	cltq
	movl	400416(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	800824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$800832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	$400400, %edx
	xorl	%esi, %esi
	leaq	400416(%rsp), %rdi
	call	memset@PLT
	movl	20(%rsp), %eax
	subl	16(%rsp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, 400420(%rsp)
	jmp	.L9
.L17:
	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>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define INF 100100100

int main(void)
{
    int n, k, h[100100];
    scanf("%d%d", &n, &k);
    rep(i, n)
        scanf("%d", &h[i]);

    int dp[100100] = {0};
    dp[1] = abs(h[1] - h[0]);
    for (int i = 2; i < n; i++)
    {
        dp[i] = dp[i - 1] + abs(h[i] - h[i - 1]);
        for (int j = 2; j <= k; j++)
            if (i - j >= 0)
                dp[i] = min(dp[i], abs(h[i] - h[i - j]) + dp[i - j]);
    }

    printf("%d\n", dp[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>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define INF 100100100

int main(void)
{
    int n, k, h[100100];
    scanf("%d%d", &n, &k);
    rep(i, n)
        scanf("%d", &h[i]);

    int dp[100100] = {0};
    dp[1] = abs(h[1] - h[0]);
    for (int i = 2; i < n; i++)
    {
        dp[i] = dp[i - 1] + abs(h[i] - h[i - 1]);
        for (int j = 2; j <= k; j++)
            if (i - j >= 0)
                dp[i] = min(dp[i], abs(h[i] - h[i - j]) + dp[i - j]);
    }

    printf("%d\n", dp[n - 1]);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800832(%rbp), %rdx
	leaq	-800836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800828(%rbp)
	jmp	.L2
.L3:
	leaq	-800816(%rbp), %rdx
	movl	-800828(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800828(%rbp)
.L2:
	movl	-800836(%rbp), %eax
	cmpl	%eax, -800828(%rbp)
	jl	.L3
	leaq	-400416(%rbp), %rax
	movl	$400400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-800812(%rbp), %eax
	movl	-800816(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400412(%rbp)
	movl	$2, -800824(%rbp)
	jmp	.L4
.L8:
	movl	-800824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400416(%rbp,%rax,4), %ecx
	movl	-800824(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %edx
	movl	-800824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800816(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	%edx, -400416(%rbp,%rax,4)
	movl	$2, -800820(%rbp)
	jmp	.L5
.L7:
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	testl	%eax, %eax
	js	.L6
	movl	-800824(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %edx
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	%edx, -400416(%rbp,%rax,4)
.L6:
	addl	$1, -800820(%rbp)
.L5:
	movl	-800832(%rbp), %eax
	cmpl	%eax, -800820(%rbp)
	jle	.L7
	addl	$1, -800824(%rbp)
.L4:
	movl	-800836(%rbp), %eax
	cmpl	%eax, -800824(%rbp)
	jl	.L8
	movl	-800836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
	.section	.rodata
.LC0:
	.string	"%d%d"
.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800832(%rbp), %rdx
	leaq	-800836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800828(%rbp)
	jmp	.L2
.L3:
	leaq	-800816(%rbp), %rdx
	movl	-800828(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800828(%rbp)
.L2:
	movl	-800836(%rbp), %eax
	cmpl	%eax, -800828(%rbp)
	jl	.L3
	leaq	-400416(%rbp), %rax
	movl	$400400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-800812(%rbp), %eax
	movl	-800816(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400412(%rbp)
	movl	$2, -800824(%rbp)
	jmp	.L4
.L8:
	movl	-800824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400416(%rbp,%rax,4), %ecx
	movl	-800824(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %edx
	movl	-800824(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800816(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	%edx, -400416(%rbp,%rax,4)
	movl	$2, -800820(%rbp)
	jmp	.L5
.L7:
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	testl	%eax, %eax
	js	.L6
	movl	-800824(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %edx
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	cltq
	movl	-800816(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800824(%rbp), %eax
	subl	-800820(%rbp), %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-800824(%rbp), %eax
	cltq
	movl	%edx, -400416(%rbp,%rax,4)
.L6:
	addl	$1, -800820(%rbp)
.L5:
	movl	-800832(%rbp), %eax
	cmpl	%eax, -800820(%rbp)
	jle	.L7
	addl	$1, -800824(%rbp)
.L4:
	movl	-800836(%rbp), %eax
	cmpl	%eax, -800824(%rbp)
	jl	.L8
	movl	-800836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
