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>
int dp[100001],h[100001];
int abs(int x);
int main(void)
{
  int i,j,n,a;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  for(i=0;i<n;i++) dp[i]=1000000000; 
  dp[0]=0;
  for(i=0;i<n-1;i++){
    if(abs(h[i]-h[i+1])+dp[i]<=dp[i+1]){
      dp[i+1]=abs(h[i]-h[i+1])+dp[i];
    }
    if(i<n-1){
      if(abs(h[i]-h[i+2])+dp[i]<=dp[i+2]){
        dp[i+2]=abs(h[i]-h[i+2])+dp[i];
       // printf("%d.",dp[i+2]);
      }
    }
  }
 // for(i=0;i<n;i++) printf(".%d.",dp[i]);
  printf("%d\n",dp[n-1]);
}

int abs(int x){
  if(x < 0) x = -x;
  return x;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 400004
dp:
	.zero	400004
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400004
h:
	.zero	400004
	.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
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L3
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	$0, dp(%rip)
	movl	$0, -12(%rbp)
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jg	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L7:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$2, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jg	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$2, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$2, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L8:
	addl	$1, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L9
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %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	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	abs
	.type	abs, @function
abs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L13
	negl	-4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leaq	dp(%rip), %r8
	leal	-1(%rax), %edi
	testl	%eax, %eax
	jle	.L2
	leaq	h(%rip), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L3
	leal	-1(%rax), %edi
	testl	%eax, %eax
	jle	.L31
	cmpl	$2, %edi
	jbe	.L20
	movl	%eax, %ecx
	leaq	dp(%rip), %r8
	movdqa	.LC1(%rip), %xmm0
	shrl	$2, %ecx
	leaq	16(%r8), %rsi
	movq	%r8, %rdx
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movaps	%xmm0, (%rdx)
	addq	$16, %rdx
	cmpq	%rcx, %rdx
	jne	.L5
	movl	%eax, %edx
	andl	$-4, %edx
	testb	$3, %al
	je	.L6
.L4:
	movslq	%edx, %rcx
	movl	$1000000000, (%r8,%rcx,4)
	leal	1(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L2
	movslq	%ecx, %rcx
	addl	$2, %edx
	movl	$1000000000, (%r8,%rcx,4)
	cmpl	%edx, %eax
	jle	.L6
	movslq	%edx, %rdx
	movl	$1000000000, (%r8,%rdx,4)
.L6:
	movl	$0, dp(%rip)
.L18:
	cmpl	$3, %eax
	jle	.L21
	subl	$4, %eax
	movl	4+h(%rip), %ecx
	xorl	%r9d, %r9d
	movl	h(%rip), %r10d
	shrl	%eax
	leaq	dp(%rip), %rdx
	leaq	4+h(%rip), %r12
	leal	2(%rax), %r11d
	movl	$2, %eax
	addq	%r11, %r11
.L14:
	movl	%r10d, %ebp
	subl	%ecx, %ebp
	movl	%ebp, %esi
	negl	%esi
	cmovs	%ebp, %esi
	addl	%r9d, %esi
	cmpl	4(%rdx), %esi
	jg	.L9
	movl	%esi, 4(%rdx)
	movl	(%rdx), %r9d
.L9:
	movl	(%rbx,%rax,4), %ebp
	movl	%eax, %esi
	subl	%ebp, %r10d
	movl	%r10d, %r13d
	negl	%r13d
	cmovns	%r13d, %r10d
	addl	%r10d, %r9d
	cmpl	8(%rdx), %r9d
	jg	.L10
	movl	%r9d, 8(%rdx)
.L10:
	movl	%ecx, %r10d
	movl	4(%rdx), %r13d
	subl	%ebp, %r10d
	movl	%r10d, %r9d
	negl	%r9d
	cmovs	%r10d, %r9d
	addl	%r13d, %r9d
	cmpl	8(%rdx), %r9d
	jg	.L11
	movl	%r9d, 8(%rdx)
.L11:
	movl	(%r12,%rax,4), %r10d
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	addl	%r13d, %ecx
	cmpl	12(%rdx), %ecx
	jle	.L32
.L12:
	addq	$2, %rax
	movl	8(%rdx), %r9d
	addq	$8, %rdx
	cmpq	%r11, %rax
	je	.L8
	movl	%r10d, %ecx
	movl	%ebp, %r10d
	jmp	.L14
.L32:
	movl	%ecx, 12(%rdx)
	jmp	.L12
.L21:
	xorl	%r9d, %r9d
	xorl	%esi, %esi
.L8:
	movslq	%esi, %rdx
	salq	$2, %rdx
	addq	%rdx, %rbx
	addq	%r8, %rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%rdx), %r9d
.L17:
	movl	(%rbx), %eax
	addl	$1, %esi
	movl	%eax, %r10d
	subl	4(%rbx), %r10d
	movl	%r10d, %ecx
	negl	%ecx
	cmovs	%r10d, %ecx
	addl	%r9d, %ecx
	cmpl	%ecx, 4(%rdx)
	jl	.L15
	movl	%ecx, 4(%rdx)
	movl	(%rdx), %r9d
.L15:
	subl	8(%rbx), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	addl	%r9d, %eax
	cmpl	8(%rdx), %eax
	jg	.L16
	movl	%eax, 8(%rdx)
.L16:
	addq	$4, %rbx
	addq	$4, %rdx
	cmpl	%edi, %esi
	jl	.L33
.L7:
	movslq	%edi, %rdi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	(%r8,%rdi,4), %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore_state
	leaq	dp(%rip), %r8
.L2:
	movl	$0, dp(%rip)
	testl	%edi, %edi
	jle	.L7
	leaq	h(%rip), %rbx
	jmp	.L18
.L20:
	xorl	%edx, %edx
	leaq	dp(%rip), %r8
	jmp	.L4
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	abs
	.type	abs, @function
abs:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	negl	%eax
	cmovs	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	abs, .-abs
	.globl	h
	.bss
	.align 32
	.type	h, @object
	.size	h, 400004
h:
	.zero	400004
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 400004
dp:
	.zero	400004
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leaq	dp(%rip), %r8
	leal	-1(%rax), %edi
	testl	%eax, %eax
	jle	.L2
	leaq	h(%rip), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L3
	leal	-1(%rax), %edi
	testl	%eax, %eax
	jle	.L31
	cmpl	$2, %edi
	jbe	.L20
	movl	%eax, %ecx
	leaq	dp(%rip), %r8
	movdqa	.LC1(%rip), %xmm0
	shrl	$2, %ecx
	leaq	16(%r8), %rsi
	movq	%r8, %rdx
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movaps	%xmm0, (%rdx)
	addq	$16, %rdx
	cmpq	%rcx, %rdx
	jne	.L5
	movl	%eax, %edx
	andl	$-4, %edx
	testb	$3, %al
	je	.L6
.L4:
	movslq	%edx, %rcx
	movl	$1000000000, (%r8,%rcx,4)
	leal	1(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L2
	movslq	%ecx, %rcx
	addl	$2, %edx
	movl	$1000000000, (%r8,%rcx,4)
	cmpl	%edx, %eax
	jle	.L6
	movslq	%edx, %rdx
	movl	$1000000000, (%r8,%rdx,4)
.L6:
	movl	$0, dp(%rip)
.L18:
	cmpl	$3, %eax
	jle	.L21
	subl	$4, %eax
	movl	4+h(%rip), %ecx
	xorl	%r9d, %r9d
	movl	h(%rip), %r10d
	shrl	%eax
	leaq	dp(%rip), %rdx
	leaq	4+h(%rip), %r12
	leal	2(%rax), %r11d
	movl	$2, %eax
	addq	%r11, %r11
.L14:
	movl	%r10d, %ebp
	subl	%ecx, %ebp
	movl	%ebp, %esi
	negl	%esi
	cmovs	%ebp, %esi
	addl	%r9d, %esi
	cmpl	4(%rdx), %esi
	jg	.L9
	movl	%esi, 4(%rdx)
	movl	(%rdx), %r9d
.L9:
	movl	(%rbx,%rax,4), %ebp
	movl	%eax, %esi
	subl	%ebp, %r10d
	movl	%r10d, %r13d
	negl	%r13d
	cmovns	%r13d, %r10d
	addl	%r10d, %r9d
	cmpl	8(%rdx), %r9d
	jg	.L10
	movl	%r9d, 8(%rdx)
.L10:
	movl	%ecx, %r10d
	movl	4(%rdx), %r13d
	subl	%ebp, %r10d
	movl	%r10d, %r9d
	negl	%r9d
	cmovs	%r10d, %r9d
	addl	%r13d, %r9d
	cmpl	8(%rdx), %r9d
	jg	.L11
	movl	%r9d, 8(%rdx)
.L11:
	movl	(%r12,%rax,4), %r10d
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	addl	%r13d, %ecx
	cmpl	12(%rdx), %ecx
	jle	.L32
.L12:
	addq	$2, %rax
	movl	8(%rdx), %r9d
	addq	$8, %rdx
	cmpq	%r11, %rax
	je	.L8
	movl	%r10d, %ecx
	movl	%ebp, %r10d
	jmp	.L14
.L32:
	movl	%ecx, 12(%rdx)
	jmp	.L12
.L21:
	xorl	%r9d, %r9d
	xorl	%esi, %esi
.L8:
	movslq	%esi, %rdx
	salq	$2, %rdx
	addq	%rdx, %rbx
	addq	%r8, %rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%rdx), %r9d
.L17:
	movl	(%rbx), %eax
	addl	$1, %esi
	movl	%eax, %r10d
	subl	4(%rbx), %r10d
	movl	%r10d, %ecx
	negl	%ecx
	cmovs	%r10d, %ecx
	addl	%r9d, %ecx
	cmpl	%ecx, 4(%rdx)
	jl	.L15
	movl	%ecx, 4(%rdx)
	movl	(%rdx), %r9d
.L15:
	subl	8(%rbx), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	addl	%r9d, %eax
	cmpl	8(%rdx), %eax
	jg	.L16
	movl	%eax, 8(%rdx)
.L16:
	addq	$4, %rbx
	addq	$4, %rdx
	cmpl	%edi, %esi
	jl	.L33
.L7:
	movslq	%edi, %rdi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	(%r8,%rdi,4), %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore_state
	leaq	dp(%rip), %r8
.L2:
	movl	$0, dp(%rip)
	testl	%edi, %edi
	jle	.L7
	leaq	h(%rip), %rbx
	jmp	.L18
.L20:
	xorl	%edx, %edx
	leaq	dp(%rip), %r8
	jmp	.L4
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	abs
	.type	abs, @function
abs:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	negl	%eax
	cmovs	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	abs, .-abs
	.globl	h
	.bss
	.align 32
	.type	h, @object
	.size	h, 400004
h:
	.zero	400004
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 400004
dp:
	.zero	400004
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.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>
int dp[100001],h[100001];
int abs(int x);
int main(void)
{
  int i,j,n,a;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  for(i=0;i<n;i++) dp[i]=1000000000; 
  dp[0]=0;
  for(i=0;i<n-1;i++){
    if(abs(h[i]-h[i+1])+dp[i]<=dp[i+1]){
      dp[i+1]=abs(h[i]-h[i+1])+dp[i];
    }
    if(i<n-1){
      if(abs(h[i]-h[i+2])+dp[i]<=dp[i+2]){
        dp[i+2]=abs(h[i]-h[i+2])+dp[i];
       // printf("%d.",dp[i+2]);
      }
    }
  }
 // for(i=0;i<n;i++) printf(".%d.",dp[i]);
  printf("%d\n",dp[n-1]);
}

int abs(int x){
  if(x < 0) x = -x;
  return x;
}
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>
int dp[100001],h[100001];
int abs(int x);
int main(void)
{
  int i,j,n,a;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  for(i=0;i<n;i++) dp[i]=1000000000; 
  dp[0]=0;
  for(i=0;i<n-1;i++){
    if(abs(h[i]-h[i+1])+dp[i]<=dp[i+1]){
      dp[i+1]=abs(h[i]-h[i+1])+dp[i];
    }
    if(i<n-1){
      if(abs(h[i]-h[i+2])+dp[i]<=dp[i+2]){
        dp[i+2]=abs(h[i]-h[i+2])+dp[i];
       // printf("%d.",dp[i+2]);
      }
    }
  }
 // for(i=0;i<n;i++) printf(".%d.",dp[i]);
  printf("%d\n",dp[n-1]);
}

int abs(int x){
  if(x < 0) x = -x;
  return x;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 400004
dp:
	.zero	400004
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400004
h:
	.zero	400004
	.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
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L3
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	$0, dp(%rip)
	movl	$0, -12(%rbp)
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jg	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L7:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$2, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jg	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$2, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$2, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L8:
	addl	$1, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L9
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %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	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	abs
	.type	abs, @function
abs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L13
	negl	-4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.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
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 400004
dp:
	.zero	400004
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400004
h:
	.zero	400004
	.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
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L3
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1000000000, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	$0, dp(%rip)
	movl	$0, -12(%rbp)
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jg	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L7:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$2, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jg	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	addl	$2, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$2, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L8:
	addl	$1, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L9
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %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	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	abs
	.type	abs, @function
abs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L13
	negl	-4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.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:
