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 tmnmx int
tmnmx min(tmnmx p0,tmnmx p1){
  return(p0<p1?p0:p1);
}
tmnmx abs(tmnmx p){
  return(p<0?-p:p);
}

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

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.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)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.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)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	$1376, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800084(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800080(%rbp)
	jmp	.L6
.L7:
	leaq	-800064(%rbp), %rdx
	movl	-800080(%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, -800080(%rbp)
.L6:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800080(%rbp)
	jl	.L7
	movl	$0, -400032(%rbp)
	movl	-800064(%rbp), %eax
	movl	-800060(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400028(%rbp)
	movl	$2, -800080(%rbp)
	jmp	.L8
.L11:
	movl	$0, -800076(%rbp)
	jmp	.L9
.L10:
	movl	-800080(%rbp), %eax
	subl	-800076(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %edx
	movl	-800080(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800080(%rbp), %eax
	subl	-800076(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-800076(%rbp), %eax
	cltq
	movl	%edx, -800072(%rbp,%rax,4)
	addl	$1, -800076(%rbp)
.L9:
	cmpl	$1, -800076(%rbp)
	jle	.L10
	movl	-800068(%rbp), %edx
	movl	-800072(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	-800080(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400032(%rbp,%rdx,4)
	addl	$1, -800080(%rbp)
.L8:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800080(%rbp)
	jl	.L11
	movl	-800084(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	$1384, %rsp
	.cfi_def_cfa_offset 800160
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800088(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L5
	leaq	32(%rsp), %rax
	xorl	%ebx, %ebx
	movq	%rax, 8(%rsp)
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	addq	$4, %r12
	cmpl	%ebx, %edx
	jg	.L6
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r9d
	movl	$0, 400064(%rsp)
	movl	%r10d, %eax
	subl	%r9d, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovs	%eax, %ecx
	movl	%ecx, 400068(%rsp)
	cmpl	$2, %edx
	jle	.L11
	leal	-5(%rdx), %eax
	movl	%eax, 4(%rsp)
	cmpl	$8, %edx
	jle	.L13
	leaq	40(%rsp), %r12
	movl	$8, %r13d
	xorl	%esi, %esi
	leaq	400064(%rsp), %rax
.L9:
	movl	(%r12), %r11d
	movl	%r9d, %edi
	subl	%r11d, %edi
	movl	%edi, %r8d
	negl	%r8d
	cmovs	%edi, %r8d
	subl	%r11d, %r10d
	movl	%r10d, %edi
	addl	%ecx, %r8d
	negl	%edi
	cmovs	%r10d, %edi
	addl	%edi, %esi
	movl	%r11d, %edi
	cmpl	%esi, %r8d
	cmovg	%esi, %r8d
	movl	4(%r12), %esi
	subl	%esi, %edi
	movd	%r8d, %xmm0
	movl	%edi, %ebx
	negl	%ebx
	cmovs	%edi, %ebx
	subl	%esi, %r9d
	movl	%r9d, %edi
	addl	%r8d, %ebx
	negl	%edi
	cmovs	%r9d, %edi
	movl	8(%r12), %r9d
	addl	%edi, %ecx
	cmpl	%ecx, %ebx
	cmovg	%ecx, %ebx
	movl	%esi, %ecx
	subl	%r9d, %ecx
	movl	%ecx, %edi
	movd	%ebx, %xmm1
	negl	%edi
	punpckldq	%xmm1, %xmm0
	cmovs	%ecx, %edi
	movl	%r11d, %ecx
	movq	%xmm0, -24(%rax,%r13,4)
	subl	%r9d, %ecx
	movl	%ecx, %r10d
	addl	%ebx, %edi
	negl	%r10d
	cmovns	%r10d, %ecx
	movl	%r9d, %r10d
	addl	%r8d, %ecx
	cmpl	%ecx, %edi
	cmovg	%ecx, %edi
	movl	12(%r12), %ecx
	subl	%ecx, %r10d
	movl	%ecx, %r14d
	movd	%edi, %xmm0
	movl	%r10d, %r11d
	negl	%r11d
	cmovs	%r10d, %r11d
	subl	%ecx, %esi
	movl	%esi, %r10d
	addl	%edi, %r11d
	negl	%r10d
	cmovns	%r10d, %esi
	movl	16(%r12), %r10d
	addl	%ebx, %esi
	movl	%r10d, %r15d
	cmpl	%esi, %r11d
	cmovg	%esi, %r11d
	subl	%r10d, %r14d
	movl	%r14d, %esi
	negl	%esi
	movd	%r11d, %xmm2
	cmovs	%r14d, %esi
	subl	%r10d, %r9d
	punpckldq	%xmm2, %xmm0
	movl	%r9d, %r14d
	movq	%xmm0, -16(%rax,%r13,4)
	addl	%r11d, %esi
	negl	%r14d
	cmovns	%r14d, %r9d
	addl	%edi, %r9d
	movl	%r13d, %edi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	20(%r12), %r9d
	subl	%r9d, %r15d
	movd	%esi, %xmm0
	movl	%r15d, %r14d
	negl	%r14d
	cmovs	%r15d, %r14d
	subl	%r9d, %ecx
	movl	%ecx, %r15d
	addl	%esi, %r14d
	negl	%r15d
	cmovns	%r15d, %ecx
	addl	%r11d, %ecx
	cmpl	%ecx, %r14d
	cmovle	%r14d, %ecx
	addq	$24, %r12
	movd	%ecx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, -8(%rax,%r13,4)
	addq	$6, %r13
	leal	-5(%r13), %r8d
	cmpl	%r8d, 4(%rsp)
	jg	.L9
.L8:
	movq	8(%rsp), %r9
	movslq	%edi, %rcx
	salq	$2, %rcx
	addq	%rcx, %r9
	addq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	-8(%r9), %esi
	subl	(%r9), %esi
	movl	%esi, %ecx
	movl	-4(%r9), %r8d
	negl	%ecx
	cmovs	%esi, %ecx
	subl	(%r9), %r8d
	addl	-8(%rax), %ecx
	movl	%r8d, %esi
	negl	%esi
	cmovs	%r8d, %esi
	addl	-4(%rax), %esi
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	$1, %edi
	addq	$4, %r9
	addq	$4, %rax
	movl	%ecx, -4(%rax)
	cmpl	%edi, %edx
	jg	.L10
.L11:
	subl	$1, %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	movslq	%edx, %rdx
	movl	400064(%rsp,%rdx,4), %edx
	call	__printf_chk@PLT
	movq	800088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800104, %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
.L5:
	.cfi_restore_state
	movl	$0, 400064(%rsp)
	movl	32(%rsp), %eax
	subl	36(%rsp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	movl	%eax, 400068(%rsp)
	jmp	.L11
.L13:
	movl	$2, %edi
	leaq	400064(%rsp), %rax
	jmp	.L8
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	$1384, %rsp
	.cfi_def_cfa_offset 800160
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800088(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L5
	leaq	32(%rsp), %rax
	xorl	%ebx, %ebx
	movq	%rax, 8(%rsp)
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	addq	$4, %r12
	cmpl	%ebx, %edx
	jg	.L6
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r9d
	movl	$0, 400064(%rsp)
	movl	%r10d, %eax
	subl	%r9d, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovs	%eax, %ecx
	movl	%ecx, 400068(%rsp)
	cmpl	$2, %edx
	jle	.L11
	leal	-5(%rdx), %eax
	movl	%eax, 4(%rsp)
	cmpl	$8, %edx
	jle	.L13
	leaq	40(%rsp), %r12
	movl	$8, %r13d
	xorl	%esi, %esi
	leaq	400064(%rsp), %rax
.L9:
	movl	(%r12), %r11d
	movl	%r9d, %edi
	subl	%r11d, %edi
	movl	%edi, %r8d
	negl	%r8d
	cmovs	%edi, %r8d
	subl	%r11d, %r10d
	movl	%r10d, %edi
	addl	%ecx, %r8d
	negl	%edi
	cmovs	%r10d, %edi
	addl	%edi, %esi
	movl	%r11d, %edi
	cmpl	%esi, %r8d
	cmovg	%esi, %r8d
	movl	4(%r12), %esi
	subl	%esi, %edi
	movd	%r8d, %xmm0
	movl	%edi, %ebx
	negl	%ebx
	cmovs	%edi, %ebx
	subl	%esi, %r9d
	movl	%r9d, %edi
	addl	%r8d, %ebx
	negl	%edi
	cmovs	%r9d, %edi
	movl	8(%r12), %r9d
	addl	%edi, %ecx
	cmpl	%ecx, %ebx
	cmovg	%ecx, %ebx
	movl	%esi, %ecx
	subl	%r9d, %ecx
	movl	%ecx, %edi
	movd	%ebx, %xmm1
	negl	%edi
	punpckldq	%xmm1, %xmm0
	cmovs	%ecx, %edi
	movl	%r11d, %ecx
	movq	%xmm0, -24(%rax,%r13,4)
	subl	%r9d, %ecx
	movl	%ecx, %r10d
	addl	%ebx, %edi
	negl	%r10d
	cmovns	%r10d, %ecx
	movl	%r9d, %r10d
	addl	%r8d, %ecx
	cmpl	%ecx, %edi
	cmovg	%ecx, %edi
	movl	12(%r12), %ecx
	subl	%ecx, %r10d
	movl	%ecx, %r14d
	movd	%edi, %xmm0
	movl	%r10d, %r11d
	negl	%r11d
	cmovs	%r10d, %r11d
	subl	%ecx, %esi
	movl	%esi, %r10d
	addl	%edi, %r11d
	negl	%r10d
	cmovns	%r10d, %esi
	movl	16(%r12), %r10d
	addl	%ebx, %esi
	movl	%r10d, %r15d
	cmpl	%esi, %r11d
	cmovg	%esi, %r11d
	subl	%r10d, %r14d
	movl	%r14d, %esi
	negl	%esi
	movd	%r11d, %xmm2
	cmovs	%r14d, %esi
	subl	%r10d, %r9d
	punpckldq	%xmm2, %xmm0
	movl	%r9d, %r14d
	movq	%xmm0, -16(%rax,%r13,4)
	addl	%r11d, %esi
	negl	%r14d
	cmovns	%r14d, %r9d
	addl	%edi, %r9d
	movl	%r13d, %edi
	cmpl	%r9d, %esi
	cmovg	%r9d, %esi
	movl	20(%r12), %r9d
	subl	%r9d, %r15d
	movd	%esi, %xmm0
	movl	%r15d, %r14d
	negl	%r14d
	cmovs	%r15d, %r14d
	subl	%r9d, %ecx
	movl	%ecx, %r15d
	addl	%esi, %r14d
	negl	%r15d
	cmovns	%r15d, %ecx
	addl	%r11d, %ecx
	cmpl	%ecx, %r14d
	cmovle	%r14d, %ecx
	addq	$24, %r12
	movd	%ecx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, -8(%rax,%r13,4)
	addq	$6, %r13
	leal	-5(%r13), %r8d
	cmpl	%r8d, 4(%rsp)
	jg	.L9
.L8:
	movq	8(%rsp), %r9
	movslq	%edi, %rcx
	salq	$2, %rcx
	addq	%rcx, %r9
	addq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	-8(%r9), %esi
	subl	(%r9), %esi
	movl	%esi, %ecx
	movl	-4(%r9), %r8d
	negl	%ecx
	cmovs	%esi, %ecx
	subl	(%r9), %r8d
	addl	-8(%rax), %ecx
	movl	%r8d, %esi
	negl	%esi
	cmovs	%r8d, %esi
	addl	-4(%rax), %esi
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	$1, %edi
	addq	$4, %r9
	addq	$4, %rax
	movl	%ecx, -4(%rax)
	cmpl	%edi, %edx
	jg	.L10
.L11:
	subl	$1, %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	movslq	%edx, %rdx
	movl	400064(%rsp,%rdx,4), %edx
	call	__printf_chk@PLT
	movq	800088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800104, %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
.L5:
	.cfi_restore_state
	movl	$0, 400064(%rsp)
	movl	32(%rsp), %eax
	subl	36(%rsp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	movl	%eax, 400068(%rsp)
	jmp	.L11
.L13:
	movl	$2, %edi
	leaq	400064(%rsp), %rax
	jmp	.L8
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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 tmnmx int
tmnmx min(tmnmx p0,tmnmx p1){
  return(p0<p1?p0:p1);
}
tmnmx abs(tmnmx p){
  return(p<0?-p:p);
}

int main(){
  int n,i,j,h[100005],c[100005],a[2];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&h[i]);
  }
  c[0]=0;
  c[1]=abs(h[0]-h[1]);
  for(i=2;i<n;i++){
    for(j=0;j<2;j++){
      a[j]=abs(h[i-j-1]-h[i])+c[i-j-1];
    }
    c[i]=min(a[0],a[1]);
  }
  printf("%d",c[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 tmnmx int
tmnmx min(tmnmx p0,tmnmx p1){
  return(p0<p1?p0:p1);
}
tmnmx abs(tmnmx p){
  return(p<0?-p:p);
}

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

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.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)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.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)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	$1376, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800084(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800080(%rbp)
	jmp	.L6
.L7:
	leaq	-800064(%rbp), %rdx
	movl	-800080(%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, -800080(%rbp)
.L6:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800080(%rbp)
	jl	.L7
	movl	$0, -400032(%rbp)
	movl	-800064(%rbp), %eax
	movl	-800060(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400028(%rbp)
	movl	$2, -800080(%rbp)
	jmp	.L8
.L11:
	movl	$0, -800076(%rbp)
	jmp	.L9
.L10:
	movl	-800080(%rbp), %eax
	subl	-800076(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %edx
	movl	-800080(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800080(%rbp), %eax
	subl	-800076(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-800076(%rbp), %eax
	cltq
	movl	%edx, -800072(%rbp,%rax,4)
	addl	$1, -800076(%rbp)
.L9:
	cmpl	$1, -800076(%rbp)
	jle	.L10
	movl	-800068(%rbp), %edx
	movl	-800072(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	-800080(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400032(%rbp,%rdx,4)
	addl	$1, -800080(%rbp)
.L8:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800080(%rbp)
	jl	.L11
	movl	-800084(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.globl	min
	.type	min, @function
min:
.LFB0:
	.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)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.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)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	$1376, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800084(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800080(%rbp)
	jmp	.L6
.L7:
	leaq	-800064(%rbp), %rdx
	movl	-800080(%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, -800080(%rbp)
.L6:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800080(%rbp)
	jl	.L7
	movl	$0, -400032(%rbp)
	movl	-800064(%rbp), %eax
	movl	-800060(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -400028(%rbp)
	movl	$2, -800080(%rbp)
	jmp	.L8
.L11:
	movl	$0, -800076(%rbp)
	jmp	.L9
.L10:
	movl	-800080(%rbp), %eax
	subl	-800076(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %edx
	movl	-800080(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	-800080(%rbp), %eax
	subl	-800076(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-800076(%rbp), %eax
	cltq
	movl	%edx, -800072(%rbp,%rax,4)
	addl	$1, -800076(%rbp)
.L9:
	cmpl	$1, -800076(%rbp)
	jle	.L10
	movl	-800068(%rbp), %edx
	movl	-800072(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	-800080(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400032(%rbp,%rdx,4)
	addl	$1, -800080(%rbp)
.L8:
	movl	-800084(%rbp), %eax
	cmpl	%eax, -800080(%rbp)
	jl	.L11
	movl	-800084(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
