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>
#define abs(a) ((a)<0 ? -(a) : (a))
#define min(a, b) ((a)<(b) ? (a) : (b))

int main(){
  int n, h[100001], dp[100001] = {0};
  scanf("%d", &n);
  for(int i=0; i<n; i++) scanf("%d", &h[i]);

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

  printf("%d\n", dp[n-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:
.LFB0:
	.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	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400016(%rbp), %rax
	movl	$400004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-800044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800040(%rbp)
	jmp	.L2
.L3:
	leaq	-800032(%rbp), %rdx
	movl	-800040(%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, -800040(%rbp)
.L2:
	movl	-800044(%rbp), %eax
	cmpl	%eax, -800040(%rbp)
	jl	.L3
	movl	$0, -400016(%rbp)
	movl	-800028(%rbp), %eax
	movl	-800032(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400012(%rbp)
	movl	$2, -800036(%rbp)
	jmp	.L4
.L5:
	movl	-800036(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	-800036(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %edx
	movl	-800036(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-800032(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-800036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %esi
	movl	-800036(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %ecx
	movl	-800036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800032(%rbp,%rax,4), %edi
	movl	%ecx, %eax
	subl	%edi, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	addl	%esi, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-800036(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L4:
	movl	-800044(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L5
	movl	-800044(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.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	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	movl	$400004, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	400048(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	28(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L3
	movl	36(%rsp), %r12d
	movl	32(%rsp), %r13d
	movl	%r12d, %ecx
	subl	%r13d, %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	movl	%edx, 400052(%rsp)
	cmpl	$2, %eax
	jle	.L8
	leal	-5(%rax), %esi
	movl	%esi, 12(%rsp)
	cmpl	$8, %eax
	jle	.L10
	leaq	40(%rsp), %r10
	movl	$8, %r11d
	xorl	%ecx, %ecx
.L6:
	movl	(%r10), %esi
	movl	12(%r10), %r14d
	movl	%esi, %r8d
	subl	%r13d, %r8d
	movl	16(%r10), %r13d
	movl	%r8d, %edi
	negl	%edi
	cmovs	%r8d, %edi
	movl	%esi, %r8d
	subl	%r12d, %r8d
	addl	%ecx, %edi
	movl	%r8d, %ecx
	negl	%ecx
	cmovs	%r8d, %ecx
	movl	4(%r10), %r8d
	addl	%edx, %ecx
	cmpl	%ecx, %edi
	cmovg	%ecx, %edi
	movl	%r8d, %ecx
	subl	%r12d, %ecx
	movl	%ecx, %r9d
	movd	%edi, %xmm0
	negl	%r9d
	cmovs	%ecx, %r9d
	movl	%r8d, %ecx
	subl	%esi, %ecx
	addl	%edx, %r9d
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	movl	8(%r10), %ecx
	addl	%edi, %edx
	movl	%ecx, %r12d
	cmpl	%edx, %r9d
	cmovg	%edx, %r9d
	movl	%ecx, %edx
	subl	%esi, %edx
	movl	%edx, %esi
	movd	%r9d, %xmm1
	negl	%esi
	punpckldq	%xmm1, %xmm0
	cmovs	%edx, %esi
	subl	%r8d, %r12d
	movq	%xmm0, -24(%rbx,%r11,4)
	movl	%r12d, %edx
	addl	%edi, %esi
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r14d, %r12d
	addl	%r9d, %edx
	cmpl	%edx, %esi
	cmovg	%edx, %esi
	movl	%r14d, %edx
	subl	%r8d, %edx
	movl	%edx, %r8d
	movd	%esi, %xmm0
	negl	%r8d
	cmovs	%edx, %r8d
	subl	%ecx, %r12d
	movl	%r12d, %edx
	addl	%r9d, %r8d
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r13d, %r12d
	addl	%esi, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	movl	%r13d, %edx
	subl	%ecx, %edx
	movl	%edx, %ecx
	movd	%r8d, %xmm2
	negl	%ecx
	punpckldq	%xmm2, %xmm0
	cmovs	%edx, %ecx
	subl	%r14d, %r12d
	movq	%xmm0, -16(%rbx,%r11,4)
	movl	%r12d, %edx
	addl	%esi, %ecx
	negl	%edx
	movl	%r11d, %esi
	cmovs	%r12d, %edx
	movl	20(%r10), %r12d
	addl	%r8d, %edx
	movl	%r12d, %r15d
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	movl	%r12d, %edx
	subl	%r14d, %edx
	movl	%edx, %r14d
	movd	%ecx, %xmm0
	negl	%r14d
	cmovs	%edx, %r14d
	subl	%r13d, %r15d
	movl	%r15d, %edx
	addl	%r8d, %r14d
	negl	%edx
	cmovs	%r15d, %edx
	addl	%ecx, %edx
	cmpl	%edx, %r14d
	cmovle	%r14d, %edx
	addq	$24, %r10
	movd	%edx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, -8(%rbx,%r11,4)
	addq	$6, %r11
	leal	-5(%r11), %edi
	cmpl	%edi, 12(%rsp)
	jg	.L6
.L5:
	movslq	%esi, %rdx
	salq	$2, %rdx
	addq	%rdx, %rbx
	addq	%rdx, %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	movl	0(%rbp), %edi
	movl	%edi, %ecx
	subl	-4(%rbp), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	subl	-8(%rbp), %edi
	addl	-4(%rbx), %edx
	movl	%edi, %ecx
	negl	%ecx
	cmovs	%edi, %ecx
	addl	-8(%rbx), %ecx
	cmpl	%ecx, %edx
	cmovg	%ecx, %edx
	addl	$1, %esi
	addq	$4, %rbx
	addq	$4, %rbp
	movl	%edx, -4(%rbx)
	cmpl	%esi, %eax
	jg	.L7
.L8:
	subl	$1, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	cltq
	movl	400048(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$800072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	36(%rsp), %edx
	subl	32(%rsp), %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	movl	%edx, 400052(%rsp)
	jmp	.L8
.L10:
	movl	$2, %esi
	jmp	.L5
.L17:
	call	__stack_chk_fail@PLT
	.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	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	movl	$400004, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	400048(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	28(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L3
	movl	36(%rsp), %r12d
	movl	32(%rsp), %r13d
	movl	%r12d, %ecx
	subl	%r13d, %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	movl	%edx, 400052(%rsp)
	cmpl	$2, %eax
	jle	.L8
	leal	-5(%rax), %esi
	movl	%esi, 12(%rsp)
	cmpl	$8, %eax
	jle	.L10
	leaq	40(%rsp), %r10
	movl	$8, %r11d
	xorl	%ecx, %ecx
.L6:
	movl	(%r10), %esi
	movl	12(%r10), %r14d
	movl	%esi, %r8d
	subl	%r13d, %r8d
	movl	16(%r10), %r13d
	movl	%r8d, %edi
	negl	%edi
	cmovs	%r8d, %edi
	movl	%esi, %r8d
	subl	%r12d, %r8d
	addl	%ecx, %edi
	movl	%r8d, %ecx
	negl	%ecx
	cmovs	%r8d, %ecx
	movl	4(%r10), %r8d
	addl	%edx, %ecx
	cmpl	%ecx, %edi
	cmovg	%ecx, %edi
	movl	%r8d, %ecx
	subl	%r12d, %ecx
	movl	%ecx, %r9d
	movd	%edi, %xmm0
	negl	%r9d
	cmovs	%ecx, %r9d
	movl	%r8d, %ecx
	subl	%esi, %ecx
	addl	%edx, %r9d
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	movl	8(%r10), %ecx
	addl	%edi, %edx
	movl	%ecx, %r12d
	cmpl	%edx, %r9d
	cmovg	%edx, %r9d
	movl	%ecx, %edx
	subl	%esi, %edx
	movl	%edx, %esi
	movd	%r9d, %xmm1
	negl	%esi
	punpckldq	%xmm1, %xmm0
	cmovs	%edx, %esi
	subl	%r8d, %r12d
	movq	%xmm0, -24(%rbx,%r11,4)
	movl	%r12d, %edx
	addl	%edi, %esi
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r14d, %r12d
	addl	%r9d, %edx
	cmpl	%edx, %esi
	cmovg	%edx, %esi
	movl	%r14d, %edx
	subl	%r8d, %edx
	movl	%edx, %r8d
	movd	%esi, %xmm0
	negl	%r8d
	cmovs	%edx, %r8d
	subl	%ecx, %r12d
	movl	%r12d, %edx
	addl	%r9d, %r8d
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r13d, %r12d
	addl	%esi, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	movl	%r13d, %edx
	subl	%ecx, %edx
	movl	%edx, %ecx
	movd	%r8d, %xmm2
	negl	%ecx
	punpckldq	%xmm2, %xmm0
	cmovs	%edx, %ecx
	subl	%r14d, %r12d
	movq	%xmm0, -16(%rbx,%r11,4)
	movl	%r12d, %edx
	addl	%esi, %ecx
	negl	%edx
	movl	%r11d, %esi
	cmovs	%r12d, %edx
	movl	20(%r10), %r12d
	addl	%r8d, %edx
	movl	%r12d, %r15d
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	movl	%r12d, %edx
	subl	%r14d, %edx
	movl	%edx, %r14d
	movd	%ecx, %xmm0
	negl	%r14d
	cmovs	%edx, %r14d
	subl	%r13d, %r15d
	movl	%r15d, %edx
	addl	%r8d, %r14d
	negl	%edx
	cmovs	%r15d, %edx
	addl	%ecx, %edx
	cmpl	%edx, %r14d
	cmovle	%r14d, %edx
	addq	$24, %r10
	movd	%edx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, -8(%rbx,%r11,4)
	addq	$6, %r11
	leal	-5(%r11), %edi
	cmpl	%edi, 12(%rsp)
	jg	.L6
.L5:
	movslq	%esi, %rdx
	salq	$2, %rdx
	addq	%rdx, %rbx
	addq	%rdx, %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	movl	0(%rbp), %edi
	movl	%edi, %ecx
	subl	-4(%rbp), %ecx
	movl	%ecx, %edx
	negl	%edx
	cmovs	%ecx, %edx
	subl	-8(%rbp), %edi
	addl	-4(%rbx), %edx
	movl	%edi, %ecx
	negl	%ecx
	cmovs	%edi, %ecx
	addl	-8(%rbx), %ecx
	cmpl	%ecx, %edx
	cmovg	%ecx, %edx
	addl	$1, %esi
	addq	$4, %rbx
	addq	$4, %rbp
	movl	%edx, -4(%rbx)
	cmpl	%esi, %eax
	jg	.L7
.L8:
	subl	$1, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	cltq
	movl	400048(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$800072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	36(%rsp), %edx
	subl	32(%rsp), %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	movl	%edx, 400052(%rsp)
	jmp	.L8
.L10:
	movl	$2, %esi
	jmp	.L5
.L17:
	call	__stack_chk_fail@PLT
	.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>
#define abs(a) ((a)<0 ? -(a) : (a))
#define min(a, b) ((a)<(b) ? (a) : (b))

int main(){
  int n, h[100001], dp[100001] = {0};
  scanf("%d", &n);
  for(int i=0; i<n; i++) scanf("%d", &h[i]);

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

  printf("%d\n", dp[n-1]);
  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>
#define abs(a) ((a)<0 ? -(a) : (a))
#define min(a, b) ((a)<(b) ? (a) : (b))

int main(){
  int n, h[100001], dp[100001] = {0};
  scanf("%d", &n);
  for(int i=0; i<n; i++) scanf("%d", &h[i]);

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

  printf("%d\n", dp[n-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:
.LFB0:
	.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	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400016(%rbp), %rax
	movl	$400004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-800044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800040(%rbp)
	jmp	.L2
.L3:
	leaq	-800032(%rbp), %rdx
	movl	-800040(%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, -800040(%rbp)
.L2:
	movl	-800044(%rbp), %eax
	cmpl	%eax, -800040(%rbp)
	jl	.L3
	movl	$0, -400016(%rbp)
	movl	-800028(%rbp), %eax
	movl	-800032(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400012(%rbp)
	movl	$2, -800036(%rbp)
	jmp	.L4
.L5:
	movl	-800036(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	-800036(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %edx
	movl	-800036(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-800032(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-800036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %esi
	movl	-800036(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %ecx
	movl	-800036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800032(%rbp,%rax,4), %edi
	movl	%ecx, %eax
	subl	%edi, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	addl	%esi, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-800036(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L4:
	movl	-800044(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L5
	movl	-800044(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.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	"%d"
.LC1:
	.string	"%d\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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400016(%rbp), %rax
	movl	$400004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-800044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800040(%rbp)
	jmp	.L2
.L3:
	leaq	-800032(%rbp), %rdx
	movl	-800040(%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, -800040(%rbp)
.L2:
	movl	-800044(%rbp), %eax
	cmpl	%eax, -800040(%rbp)
	jl	.L3
	movl	$0, -400016(%rbp)
	movl	-800028(%rbp), %eax
	movl	-800032(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400012(%rbp)
	movl	$2, -800036(%rbp)
	jmp	.L4
.L5:
	movl	-800036(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	-800036(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %edx
	movl	-800036(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-800032(%rbp,%rax,4), %esi
	movl	%edx, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-800036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %esi
	movl	-800036(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %ecx
	movl	-800036(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800032(%rbp,%rax,4), %edi
	movl	%ecx, %eax
	subl	%edi, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	addl	%esi, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	-800036(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L4:
	movl	-800044(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L5
	movl	-800044(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.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:
