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 <string.h>
#include <stdlib.h>
#include <unistd.h>

#define lli long long int
#define ABS(X) (( (X)>=0 )?(X):(-1 * (X)))
typedef struct s_cell
{
	lli h;
	lli cost;
	lli number;
}	t_cell;


int	main(void)
{
	lli n;
	scanf("%lld", &n);

	t_cell cells[n];
	lli index = 0;

	while (index < n)
	{
		scanf("%lld", &(cells[index].h));
		cells[index].number = index;
		index++;
	}

	cells[0].cost = 0;
	cells[1].cost = ABS(cells[0].h - cells[1].h);
	index = 2;
	lli v = 0;
	lli w = 0;
	while (index < n)
	{
		v = ABS(cells[index-1].h - cells[index].h) + cells[index-1].cost;
		w = ABS(cells[index-2].h - cells[index].h) + cells[index-2].cost;
		cells[index].cost = (v<w)?(v):(w);
		index++;
	}

	printf("%lld",cells[n-1].cost);
	return(0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
	.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	$72, %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	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-104(%rbp), %rcx
	leaq	-1(%rcx), %rax
	movq	%rax, -88(%rbp)
	movq	%rcx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rcx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %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, -80(%rbp)
	movq	$0, -96(%rbp)
	jmp	.L5
.L6:
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rcx
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	16(%rax), %rdx
	movq	-96(%rbp), %rax
	movq	%rax, (%rdx)
	addq	$1, -96(%rbp)
.L5:
	movq	-104(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L6
	movq	-80(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-80(%rbp), %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	24(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, 32(%rax)
	movq	$2, -96(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	jmp	.L7
.L8:
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, %rcx
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rsi
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -72(%rbp)
	movq	-96(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, %rcx
	movq	-96(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-80(%rbp), %rsi
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rdx
	movq	-72(%rbp), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	%rdx, (%rax)
	addq	$1, -96(%rbp)
.L7:
	movq	-104(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movq	-104(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC0(%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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB63:
	.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
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	leaq	.LC0(%rip), %r12
	pushq	%rbx
	movq	%r12, %rdi
	subq	$24, %rsp
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rdi
	movq	%rsp, %rcx
	leaq	(%rdi,%rdi,2), %rax
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L23:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L23
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L24
.L4:
	leaq	7(%rsp), %rbx
	movq	%rbx, %r14
	andq	$-8, %rbx
	shrq	$3, %r14
	testq	%rdi, %rdi
	jle	.L5
	movq	%rbx, %r15
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$24, %r15
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rdi
	movq	%r13, -8(%r15)
	addq	$1, %r13
	cmpq	%r13, %rdi
	jg	.L6
	movq	0(,%r14,8), %r10
	movq	24(,%r14,8), %r11
	movq	$0, 8(,%r14,8)
	movq	%r10, %rdx
	subq	%r11, %rdx
	movq	%rdx, %rax
	negq	%rax
	cmovs	%rdx, %rax
	movq	%rax, 32(,%r14,8)
	cmpq	$2, %rdi
	jle	.L11
	leaq	-5(%rdi), %r9
	cmpq	$8, %rdi
	jle	.L13
	leaq	48(%rbx), %rsi
	xorl	%ecx, %ecx
	movl	$2, %r8d
.L9:
	movq	(%rsi), %rdx
	movq	%r11, %r14
	subq	%rdx, %r14
	movq	%r14, %r13
	negq	%r13
	cmovs	%r14, %r13
	subq	%rdx, %r10
	movq	%r10, %r14
	addq	%rax, %r13
	negq	%r14
	cmovns	%r14, %r10
	movq	%rdx, %r14
	addq	%r10, %rcx
	cmpq	%rcx, %r13
	cmovg	%rcx, %r13
	movq	24(%rsi), %rcx
	subq	%rcx, %r14
	movq	%r13, 8(%rsi)
	movq	%r14, %r10
	negq	%r10
	cmovs	%r14, %r10
	subq	%rcx, %r11
	movq	%r11, %r14
	addq	%r13, %r10
	negq	%r14
	cmovns	%r14, %r11
	movq	%rcx, %r14
	addq	%r11, %rax
	cmpq	%rax, %r10
	cmovg	%rax, %r10
	movq	48(%rsi), %rax
	subq	%rax, %r14
	movq	%r10, 32(%rsi)
	movq	%r14, %r11
	negq	%r11
	cmovs	%r14, %r11
	subq	%rax, %rdx
	movq	%rdx, %r14
	addq	%r10, %r11
	negq	%r14
	cmovns	%r14, %rdx
	movq	%rax, %r14
	addq	%r13, %rdx
	cmpq	%rdx, %r11
	cmovg	%rdx, %r11
	movq	72(%rsi), %rdx
	subq	%rdx, %r14
	movq	%r11, 56(%rsi)
	movq	%r14, %r13
	negq	%r13
	cmovs	%r14, %r13
	subq	%rdx, %rcx
	movq	%rcx, %r14
	addq	%r11, %r13
	negq	%r14
	cmovns	%r14, %rcx
	movq	%rdx, %r14
	addq	%r10, %rcx
	movq	96(%rsi), %r10
	cmpq	%rcx, %r13
	cmovg	%rcx, %r13
	subq	%r10, %r14
	movq	%r14, %rcx
	negq	%rcx
	movq	%r13, 80(%rsi)
	cmovs	%r14, %rcx
	subq	%r10, %rax
	movq	%rax, %r14
	addq	%r13, %rcx
	negq	%r14
	cmovns	%r14, %rax
	addq	%r11, %rax
	movq	120(%rsi), %r11
	cmpq	%rax, %rcx
	cmovg	%rax, %rcx
	movq	%r10, %rax
	subq	%r11, %rax
	movq	%rax, %r14
	movq	%rcx, 104(%rsi)
	negq	%r14
	cmovs	%rax, %r14
	subq	%r11, %rdx
	movq	%rdx, %rax
	addq	%rcx, %r14
	negq	%rax
	cmovs	%rdx, %rax
	movq	%r8, %rdx
	addq	%r13, %rax
	cmpq	%rax, %r14
	cmovle	%r14, %rax
	addq	$7, %rdx
	addq	$6, %r8
	addq	$144, %rsi
	movq	%rax, -16(%rsi)
	cmpq	%rdx, %r9
	jg	.L9
.L8:
	imulq	$24, %r8, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	-24(%rdx), %rcx
	subq	(%rdx), %rcx
	movq	%rcx, %rax
	movq	-48(%rdx), %rsi
	negq	%rax
	cmovs	%rcx, %rax
	subq	(%rdx), %rsi
	addq	-16(%rdx), %rax
	movq	%rsi, %rcx
	negq	%rcx
	cmovs	%rsi, %rcx
	addq	-40(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$1, %r8
	addq	$24, %rdx
	movq	%rax, -16(%rdx)
	cmpq	%r8, %rdi
	jg	.L10
.L11:
	leaq	-3(%rdi,%rdi,2), %rax
	movq	%r12, %rsi
	movl	$1, %edi
	movq	8(%rbx,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L25
	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
.L24:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	movq	0(,%r14,8), %rax
	subq	24(,%r14,8), %rax
	movq	$0, 8(,%r14,8)
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, 32(,%r14,8)
	jmp	.L11
.L13:
	movl	$2, %r8d
	jmp	.L8
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE63:
	.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	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB63:
	.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
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	leaq	.LC0(%rip), %r12
	pushq	%rbx
	movq	%r12, %rdi
	subq	$24, %rsp
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rdi
	movq	%rsp, %rcx
	leaq	(%rdi,%rdi,2), %rax
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L23:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L23
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L24
.L4:
	leaq	7(%rsp), %rbx
	movq	%rbx, %r14
	andq	$-8, %rbx
	shrq	$3, %r14
	testq	%rdi, %rdi
	jle	.L5
	movq	%rbx, %r15
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$24, %r15
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rdi
	movq	%r13, -8(%r15)
	addq	$1, %r13
	cmpq	%r13, %rdi
	jg	.L6
	movq	0(,%r14,8), %r10
	movq	24(,%r14,8), %r11
	movq	$0, 8(,%r14,8)
	movq	%r10, %rdx
	subq	%r11, %rdx
	movq	%rdx, %rax
	negq	%rax
	cmovs	%rdx, %rax
	movq	%rax, 32(,%r14,8)
	cmpq	$2, %rdi
	jle	.L11
	leaq	-5(%rdi), %r9
	cmpq	$8, %rdi
	jle	.L13
	leaq	48(%rbx), %rsi
	xorl	%ecx, %ecx
	movl	$2, %r8d
.L9:
	movq	(%rsi), %rdx
	movq	%r11, %r14
	subq	%rdx, %r14
	movq	%r14, %r13
	negq	%r13
	cmovs	%r14, %r13
	subq	%rdx, %r10
	movq	%r10, %r14
	addq	%rax, %r13
	negq	%r14
	cmovns	%r14, %r10
	movq	%rdx, %r14
	addq	%r10, %rcx
	cmpq	%rcx, %r13
	cmovg	%rcx, %r13
	movq	24(%rsi), %rcx
	subq	%rcx, %r14
	movq	%r13, 8(%rsi)
	movq	%r14, %r10
	negq	%r10
	cmovs	%r14, %r10
	subq	%rcx, %r11
	movq	%r11, %r14
	addq	%r13, %r10
	negq	%r14
	cmovns	%r14, %r11
	movq	%rcx, %r14
	addq	%r11, %rax
	cmpq	%rax, %r10
	cmovg	%rax, %r10
	movq	48(%rsi), %rax
	subq	%rax, %r14
	movq	%r10, 32(%rsi)
	movq	%r14, %r11
	negq	%r11
	cmovs	%r14, %r11
	subq	%rax, %rdx
	movq	%rdx, %r14
	addq	%r10, %r11
	negq	%r14
	cmovns	%r14, %rdx
	movq	%rax, %r14
	addq	%r13, %rdx
	cmpq	%rdx, %r11
	cmovg	%rdx, %r11
	movq	72(%rsi), %rdx
	subq	%rdx, %r14
	movq	%r11, 56(%rsi)
	movq	%r14, %r13
	negq	%r13
	cmovs	%r14, %r13
	subq	%rdx, %rcx
	movq	%rcx, %r14
	addq	%r11, %r13
	negq	%r14
	cmovns	%r14, %rcx
	movq	%rdx, %r14
	addq	%r10, %rcx
	movq	96(%rsi), %r10
	cmpq	%rcx, %r13
	cmovg	%rcx, %r13
	subq	%r10, %r14
	movq	%r14, %rcx
	negq	%rcx
	movq	%r13, 80(%rsi)
	cmovs	%r14, %rcx
	subq	%r10, %rax
	movq	%rax, %r14
	addq	%r13, %rcx
	negq	%r14
	cmovns	%r14, %rax
	addq	%r11, %rax
	movq	120(%rsi), %r11
	cmpq	%rax, %rcx
	cmovg	%rax, %rcx
	movq	%r10, %rax
	subq	%r11, %rax
	movq	%rax, %r14
	movq	%rcx, 104(%rsi)
	negq	%r14
	cmovs	%rax, %r14
	subq	%r11, %rdx
	movq	%rdx, %rax
	addq	%rcx, %r14
	negq	%rax
	cmovs	%rdx, %rax
	movq	%r8, %rdx
	addq	%r13, %rax
	cmpq	%rax, %r14
	cmovle	%r14, %rax
	addq	$7, %rdx
	addq	$6, %r8
	addq	$144, %rsi
	movq	%rax, -16(%rsi)
	cmpq	%rdx, %r9
	jg	.L9
.L8:
	imulq	$24, %r8, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	-24(%rdx), %rcx
	subq	(%rdx), %rcx
	movq	%rcx, %rax
	movq	-48(%rdx), %rsi
	negq	%rax
	cmovs	%rcx, %rax
	subq	(%rdx), %rsi
	addq	-16(%rdx), %rax
	movq	%rsi, %rcx
	negq	%rcx
	cmovs	%rsi, %rcx
	addq	-40(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$1, %r8
	addq	$24, %rdx
	movq	%rax, -16(%rdx)
	cmpq	%r8, %rdi
	jg	.L10
.L11:
	leaq	-3(%rdi,%rdi,2), %rax
	movq	%r12, %rsi
	movl	$1, %edi
	movq	8(%rbx,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L25
	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
.L24:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	movq	0(,%r14,8), %rax
	subq	24(,%r14,8), %rax
	movq	$0, 8(,%r14,8)
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, 32(,%r14,8)
	jmp	.L11
.L13:
	movl	$2, %r8d
	jmp	.L8
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE63:
	.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 <string.h>
#include <stdlib.h>
#include <unistd.h>

#define lli long long int
#define ABS(X) (( (X)>=0 )?(X):(-1 * (X)))
typedef struct s_cell
{
	lli h;
	lli cost;
	lli number;
}	t_cell;


int	main(void)
{
	lli n;
	scanf("%lld", &n);

	t_cell cells[n];
	lli index = 0;

	while (index < n)
	{
		scanf("%lld", &(cells[index].h));
		cells[index].number = index;
		index++;
	}

	cells[0].cost = 0;
	cells[1].cost = ABS(cells[0].h - cells[1].h);
	index = 2;
	lli v = 0;
	lli w = 0;
	while (index < n)
	{
		v = ABS(cells[index-1].h - cells[index].h) + cells[index-1].cost;
		w = ABS(cells[index-2].h - cells[index].h) + cells[index-2].cost;
		cells[index].cost = (v<w)?(v):(w);
		index++;
	}

	printf("%lld",cells[n-1].cost);
	return(0);
}

6
30 10 60 10 60 57
 4
10 14 40 20
 2
18 10
 4
5 14 40 20
 2
33 10
 6
30 12 60 10 60 9
 2
9 10
 6
30 12 60 17 60 9
 2
9 18
 6
30 12 60 33 60 9

33 10 8 15 23 21 1 31 9 63
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 <string.h>
#include <stdlib.h>
#include <unistd.h>

#define lli long long int
#define ABS(X) (( (X)>=0 )?(X):(-1 * (X)))
typedef struct s_cell
{
	lli h;
	lli cost;
	lli number;
}	t_cell;


int	main(void)
{
	lli n;
	scanf("%lld", &n);

	t_cell cells[n];
	lli index = 0;

	while (index < n)
	{
		scanf("%lld", &(cells[index].h));
		cells[index].number = index;
		index++;
	}

	cells[0].cost = 0;
	cells[1].cost = ABS(cells[0].h - cells[1].h);
	index = 2;
	lli v = 0;
	lli w = 0;
	while (index < n)
	{
		v = ABS(cells[index-1].h - cells[index].h) + cells[index-1].cost;
		w = ABS(cells[index-2].h - cells[index].h) + cells[index-2].cost;
		cells[index].cost = (v<w)?(v):(w);
		index++;
	}

	printf("%lld",cells[n-1].cost);
	return(0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
	.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	$72, %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	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-104(%rbp), %rcx
	leaq	-1(%rcx), %rax
	movq	%rax, -88(%rbp)
	movq	%rcx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rcx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %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, -80(%rbp)
	movq	$0, -96(%rbp)
	jmp	.L5
.L6:
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rcx
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	16(%rax), %rdx
	movq	-96(%rbp), %rax
	movq	%rax, (%rdx)
	addq	$1, -96(%rbp)
.L5:
	movq	-104(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L6
	movq	-80(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-80(%rbp), %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	24(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, 32(%rax)
	movq	$2, -96(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	jmp	.L7
.L8:
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, %rcx
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rsi
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -72(%rbp)
	movq	-96(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, %rcx
	movq	-96(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-80(%rbp), %rsi
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rdx
	movq	-72(%rbp), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	%rdx, (%rax)
	addq	$1, -96(%rbp)
.L7:
	movq	-104(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movq	-104(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC0(%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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	"%lld"
	.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	$72, %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	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-104(%rbp), %rcx
	leaq	-1(%rcx), %rax
	movq	%rax, -88(%rbp)
	movq	%rcx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rcx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %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, -80(%rbp)
	movq	$0, -96(%rbp)
	jmp	.L5
.L6:
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rcx
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	16(%rax), %rdx
	movq	-96(%rbp), %rax
	movq	%rax, (%rdx)
	addq	$1, -96(%rbp)
.L5:
	movq	-104(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L6
	movq	-80(%rbp), %rax
	movq	$0, 8(%rax)
	movq	-80(%rbp), %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	movq	24(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, 32(%rax)
	movq	$2, -96(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	jmp	.L7
.L8:
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, %rcx
	movq	-96(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rsi
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -72(%rbp)
	movq	-96(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	movq	%rax, %rcx
	movq	-96(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-80(%rbp), %rsi
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rdx
	movq	-72(%rbp), %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$8, %rax
	movq	%rdx, (%rax)
	addq	$1, -96(%rbp)
.L7:
	movq	-104(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movq	-104(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-80(%rbp), %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$8, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC0(%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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
