Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define SIZE 100010

int main() {
	int i, n, a[SIZE], d[SIZE], c = 0;
	scanf("%d", &n);
	a[0] = 0; a[n + 1] = 0;
	for (i = 1; i <= n; i++)scanf("%d", &a[i]);
	for (i = 0; i <= n; i++) {
		d[i] = abs(a[i + 1] - a[i]);
		c += d[i];
	}
	for (i = 1; i <= n; i++) {
		printf("%d\n", c - d[i] - d[i - 1] + abs(a[i - 1] - a[i + 1]));
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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	$1392, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -800100(%rbp)
	leaq	-800108(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800096(%rbp)
	movl	-800108(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$0, -800096(%rbp,%rax,4)
	movl	$1, -800104(%rbp)
	jmp	.L2
.L3:
	leaq	-800096(%rbp), %rdx
	movl	-800104(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800104(%rbp)
.L2:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L3
	movl	$0, -800104(%rbp)
	jmp	.L4
.L5:
	movl	-800104(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %edx
	movl	-800104(%rbp), %eax
	cltq
	movl	-800096(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800104(%rbp), %eax
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	movl	-800104(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	addl	%eax, -800100(%rbp)
	addl	$1, -800104(%rbp)
.L4:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L5
	movl	$1, -800104(%rbp)
	jmp	.L6
.L7:
	movl	-800104(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %ecx
	movl	-800100(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-800104(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-800104(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %edx
	movl	-800104(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%esi, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800104(%rbp)
.L6:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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	$1392, %rsp
	.cfi_def_cfa_offset 800160
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ebp
	movl	$0, 16(%rsp)
	leal	1(%rbp), %eax
	cltq
	movl	$0, 16(%rsp,%rax,4)
	testl	%ebp, %ebp
	jle	.L2
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L3
	testl	%eax, %eax
	js	.L4
	leal	1(%rax), %edi
	cmpl	$2, %eax
	jle	.L15
	movl	%edi, %esi
	leaq	16(%rsp), %r13
	leaq	400064(%rsp), %rcx
	shrl	$2, %esi
	movq	%r13, %rdx
	pxor	%xmm1, %xmm1
	subl	$1, %esi
	salq	$4, %rsi
	leaq	400080(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	4(%rdx), %xmm0
	psubd	(%rdx), %xmm0
	addq	$16, %rcx
	addq	$16, %rdx
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movaps	%xmm0, -16(%rcx)
	paddd	%xmm0, %xmm1
	cmpq	%rsi, %rcx
	jne	.L6
	movdqa	%xmm1, %xmm0
	movl	%edi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	andl	$3, %edi
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %ebp
	je	.L9
.L5:
	movslq	%edx, %rsi
	leal	1(%rdx), %ecx
	leaq	0(%r13,%rsi,4), %rdi
	cmpl	%ecx, %eax
	jle	.L10
	cmpl	%edx, %eax
	jl	.L10
	leal	2(%rdx), %ecx
	movl	(%rdi), %r9d
	leaq	400064(%rsp), %r14
	movslq	%ecx, %rcx
.L11:
	movl	-4(%r13,%rcx,4), %edi
	movl	%edi, %edx
	subl	%r9d, %edx
	movl	0(%r13,%rcx,4), %r9d
	movl	%edx, %esi
	negl	%esi
	movl	%r9d, %r8d
	cmovs	%edx, %esi
	subl	%edi, %r8d
	movl	%ecx, %edx
	movl	%r8d, %edi
	addl	%esi, %ebp
	negl	%edi
	movd	%esi, %xmm0
	cmovs	%r8d, %edi
	movd	%edi, %xmm3
	addl	%edi, %ebp
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, -8(%r14,%rcx,4)
	addq	$2, %rcx
	leal	-1(%rcx), %esi
	cmpl	%esi, %eax
	jg	.L11
	movslq	%edx, %rsi
	leal	1(%rdx), %ecx
.L10:
	movslq	%ecx, %r9
	movl	16(%rsp,%r9,4), %r10d
	movl	%r10d, %r8d
	subl	16(%rsp,%rsi,4), %r8d
	movl	%r8d, %edi
	negl	%edi
	cmovs	%r8d, %edi
	movl	%edi, 400064(%rsp,%rsi,4)
	addl	%edi, %ebp
	cmpl	%eax, %ecx
	jg	.L9
	leal	2(%rdx), %r8d
	movslq	%r8d, %rdi
	movl	16(%rsp,%rdi,4), %r11d
	movl	%r11d, %esi
	subl	%r10d, %esi
	movl	%esi, %ecx
	negl	%ecx
	cmovs	%esi, %ecx
	movl	%ecx, 400064(%rsp,%r9,4)
	addl	%ecx, %ebp
	cmpl	%eax, %r8d
	jg	.L8
	addl	$3, %edx
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %eax
	subl	%r11d, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, 400064(%rsp,%rdi,4)
	addl	%eax, %ebp
	jmp	.L8
.L9:
	testl	%eax, %eax
	jle	.L4
.L8:
	movl	$1, %ebx
	leaq	400064(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	-4(%r13,%rbx,4), %eax
	subl	4(%r13,%rbx,4), %eax
	movl	%ebp, %edx
	movq	%r12, %rsi
	movl	%eax, %ecx
	subl	(%r14,%rbx,4), %edx
	subl	-4(%r14,%rbx,4), %edx
	movl	$1, %edi
	negl	%ecx
	cmovns	%ecx, %eax
	addq	$1, %rbx
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jge	.L13
.L4:
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$800112, %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
	jne	.L4
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%esi, %esi
	movl	$1, %ecx
	jmp	.L10
.L31:
	call	__stack_chk_fail@PLT
.L15:
	xorl	%ebp, %ebp
	xorl	%edx, %edx
	leaq	16(%rsp), %r13
	jmp	.L5
	.cfi_endproc
.LFE51:
	.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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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	$1392, %rsp
	.cfi_def_cfa_offset 800160
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ebp
	movl	$0, 16(%rsp)
	leal	1(%rbp), %eax
	cltq
	movl	$0, 16(%rsp,%rax,4)
	testl	%ebp, %ebp
	jle	.L2
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L3
	testl	%eax, %eax
	js	.L4
	leal	1(%rax), %edi
	cmpl	$2, %eax
	jle	.L15
	movl	%edi, %esi
	leaq	16(%rsp), %r13
	leaq	400064(%rsp), %rcx
	shrl	$2, %esi
	movq	%r13, %rdx
	pxor	%xmm1, %xmm1
	subl	$1, %esi
	salq	$4, %rsi
	leaq	400080(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	4(%rdx), %xmm0
	psubd	(%rdx), %xmm0
	addq	$16, %rcx
	addq	$16, %rdx
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movaps	%xmm0, -16(%rcx)
	paddd	%xmm0, %xmm1
	cmpq	%rsi, %rcx
	jne	.L6
	movdqa	%xmm1, %xmm0
	movl	%edi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	andl	$3, %edi
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %ebp
	je	.L9
.L5:
	movslq	%edx, %rsi
	leal	1(%rdx), %ecx
	leaq	0(%r13,%rsi,4), %rdi
	cmpl	%ecx, %eax
	jle	.L10
	cmpl	%edx, %eax
	jl	.L10
	leal	2(%rdx), %ecx
	movl	(%rdi), %r9d
	leaq	400064(%rsp), %r14
	movslq	%ecx, %rcx
.L11:
	movl	-4(%r13,%rcx,4), %edi
	movl	%edi, %edx
	subl	%r9d, %edx
	movl	0(%r13,%rcx,4), %r9d
	movl	%edx, %esi
	negl	%esi
	movl	%r9d, %r8d
	cmovs	%edx, %esi
	subl	%edi, %r8d
	movl	%ecx, %edx
	movl	%r8d, %edi
	addl	%esi, %ebp
	negl	%edi
	movd	%esi, %xmm0
	cmovs	%r8d, %edi
	movd	%edi, %xmm3
	addl	%edi, %ebp
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, -8(%r14,%rcx,4)
	addq	$2, %rcx
	leal	-1(%rcx), %esi
	cmpl	%esi, %eax
	jg	.L11
	movslq	%edx, %rsi
	leal	1(%rdx), %ecx
.L10:
	movslq	%ecx, %r9
	movl	16(%rsp,%r9,4), %r10d
	movl	%r10d, %r8d
	subl	16(%rsp,%rsi,4), %r8d
	movl	%r8d, %edi
	negl	%edi
	cmovs	%r8d, %edi
	movl	%edi, 400064(%rsp,%rsi,4)
	addl	%edi, %ebp
	cmpl	%eax, %ecx
	jg	.L9
	leal	2(%rdx), %r8d
	movslq	%r8d, %rdi
	movl	16(%rsp,%rdi,4), %r11d
	movl	%r11d, %esi
	subl	%r10d, %esi
	movl	%esi, %ecx
	negl	%ecx
	cmovs	%esi, %ecx
	movl	%ecx, 400064(%rsp,%r9,4)
	addl	%ecx, %ebp
	cmpl	%eax, %r8d
	jg	.L8
	addl	$3, %edx
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %eax
	subl	%r11d, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, 400064(%rsp,%rdi,4)
	addl	%eax, %ebp
	jmp	.L8
.L9:
	testl	%eax, %eax
	jle	.L4
.L8:
	movl	$1, %ebx
	leaq	400064(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	-4(%r13,%rbx,4), %eax
	subl	4(%r13,%rbx,4), %eax
	movl	%ebp, %edx
	movq	%r12, %rsi
	movl	%eax, %ecx
	subl	(%r14,%rbx,4), %edx
	subl	-4(%r14,%rbx,4), %edx
	movl	$1, %edi
	negl	%ecx
	cmovns	%ecx, %eax
	addq	$1, %rbx
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jge	.L13
.L4:
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$800112, %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
	jne	.L4
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%esi, %esi
	movl	$1, %ecx
	jmp	.L10
.L31:
	call	__stack_chk_fail@PLT
.L15:
	xorl	%ebp, %ebp
	xorl	%edx, %edx
	leaq	16(%rsp), %r13
	jmp	.L5
	.cfi_endproc
.LFE51:
	.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>
#include <string.h>
#include <math.h>
#define SIZE 100010

int main() {
	int i, n, a[SIZE], d[SIZE], c = 0;
	scanf("%d", &n);
	a[0] = 0; a[n + 1] = 0;
	for (i = 1; i <= n; i++)scanf("%d", &a[i]);
	for (i = 0; i <= n; i++) {
		d[i] = abs(a[i + 1] - a[i]);
		c += d[i];
	}
	for (i = 1; i <= n; i++) {
		printf("%d\n", c - d[i] - d[i - 1] + abs(a[i - 1] - a[i + 1]));
	}
	return 0;
}
3
3 5 -1

12
8
10

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define SIZE 100010

int main() {
	int i, n, a[SIZE], d[SIZE], c = 0;
	scanf("%d", &n);
	a[0] = 0; a[n + 1] = 0;
	for (i = 1; i <= n; i++)scanf("%d", &a[i]);
	for (i = 0; i <= n; i++) {
		d[i] = abs(a[i + 1] - a[i]);
		c += d[i];
	}
	for (i = 1; i <= n; i++) {
		printf("%d\n", c - d[i] - d[i - 1] + abs(a[i - 1] - a[i + 1]));
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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	$1392, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -800100(%rbp)
	leaq	-800108(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800096(%rbp)
	movl	-800108(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$0, -800096(%rbp,%rax,4)
	movl	$1, -800104(%rbp)
	jmp	.L2
.L3:
	leaq	-800096(%rbp), %rdx
	movl	-800104(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800104(%rbp)
.L2:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L3
	movl	$0, -800104(%rbp)
	jmp	.L4
.L5:
	movl	-800104(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %edx
	movl	-800104(%rbp), %eax
	cltq
	movl	-800096(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800104(%rbp), %eax
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	movl	-800104(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	addl	%eax, -800100(%rbp)
	addl	$1, -800104(%rbp)
.L4:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L5
	movl	$1, -800104(%rbp)
	jmp	.L6
.L7:
	movl	-800104(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %ecx
	movl	-800100(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-800104(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-800104(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %edx
	movl	-800104(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%esi, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800104(%rbp)
.L6:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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"
.LC1:
	.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	$1392, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -800100(%rbp)
	leaq	-800108(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800096(%rbp)
	movl	-800108(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$0, -800096(%rbp,%rax,4)
	movl	$1, -800104(%rbp)
	jmp	.L2
.L3:
	leaq	-800096(%rbp), %rdx
	movl	-800104(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800104(%rbp)
.L2:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L3
	movl	$0, -800104(%rbp)
	jmp	.L4
.L5:
	movl	-800104(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %edx
	movl	-800104(%rbp), %eax
	cltq
	movl	-800096(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800104(%rbp), %eax
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	movl	-800104(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	addl	%eax, -800100(%rbp)
	addl	$1, -800104(%rbp)
.L4:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L5
	movl	$1, -800104(%rbp)
	jmp	.L6
.L7:
	movl	-800104(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %ecx
	movl	-800100(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-800104(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-800104(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %edx
	movl	-800104(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-800096(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%esi, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800104(%rbp)
.L6:
	movl	-800108(%rbp), %eax
	cmpl	%eax, -800104(%rbp)
	jle	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
