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

```c
#include <stdio.h>
#include <stdlib.h>

#define INF 1010101010

int N;
int h[114514];

int satorina[114514];

int asumikana(int pos) {
	int kitaeri, kugyu;
	if (pos == N) return 0;
	if (pos > N) return INF;
	if (satorina[pos]) return ~satorina[pos];

	kitaeri = asumikana(pos + 1) + abs(h[pos] - h[pos + 1]);
	kugyu = asumikana(pos + 2) + abs(h[pos] - h[pos + 2]);
	if (kugyu < kitaeri) kitaeri = kugyu;

	return ~(satorina[pos] = ~kitaeri);
}

int main(void) {
	int i;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &h[i]) != 1) return 1;
	}
	printf("%d\n", asumikana(1));
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 458056
h:
	.zero	458056
	.globl	satorina
	.align 32
	.type	satorina, @object
	.size	satorina, 458056
satorina:
	.zero	458056
	.text
	.globl	asumikana
	.type	asumikana, @function
asumikana:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L4
	movl	$1010101010, %eax
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	notl	%eax
	jmp	.L3
.L5:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	asumikana
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%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
	addl	%esi, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	addl	$2, %eax
	movl	%eax, %edi
	call	asumikana
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%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
	addl	%esi, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L6
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	notl	%eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	notl	%eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asumikana, .-asumikana
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	movl	$1, -4(%rbp)
	jmp	.L10
.L12:
	movl	-4(%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
	cmpl	$1, %eax
	je	.L11
	movl	$1, %eax
	jmp	.L9
.L11:
	addl	$1, -4(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$1, %edi
	call	asumikana
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.type	asumikana.part.0, @function
asumikana.part.0:
.LFB41:
	.cfi_startproc
	movl	N(%rip), %ecx
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edi, %ebx
	addl	$1, %edi
	cmpl	%ecx, %edi
	je	.L6
	jg	.L7
	leaq	satorina(%rip), %r13
	movslq	%edi, %rbp
	movl	0(%r13,%rbp,4), %eax
	testl	%eax, %eax
	je	.L3
	notl	%eax
.L2:
	leaq	h(%rip), %r14
	movslq	%ebx, %r12
	leal	2(%rbx), %edi
	movl	(%r14,%r12,4), %edx
	movl	%edx, %esi
	subl	(%r14,%rbp,4), %esi
	movl	%esi, %ebp
	negl	%ebp
	cmovs	%esi, %ebp
	addl	%eax, %ebp
	cmpl	%ecx, %edi
	je	.L8
	jg	.L9
	movslq	%edi, %rbx
	movl	0(%r13,%rbx,4), %esi
	testl	%esi, %esi
	je	.L5
	notl	%esi
.L4:
	subl	(%r14,%rbx,4), %edx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	addl	%esi, %eax
	cmpl	%ebp, %eax
	cmovg	%ebp, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	movl	%eax, %edx
	notl	%edx
	movl	%edx, 0(%r13,%r12,4)
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	call	asumikana.part.0
	movl	N(%rip), %ecx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	call	asumikana.part.0
	movl	(%r14,%r12,4), %edx
	movl	%eax, %esi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%esi, %esi
	movslq	%ecx, %rbx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	leaq	satorina(%rip), %r13
	movslq	%ecx, %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$1010101010, %esi
	movslq	%edi, %rbx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$1010101010, %eax
	leaq	satorina(%rip), %r13
	movslq	%edi, %rbp
	jmp	.L2
	.cfi_endproc
.LFE41:
	.size	asumikana.part.0, .-asumikana.part.0
	.p2align 4
	.globl	asumikana
	.type	asumikana, @function
asumikana:
.LFB39:
	.cfi_startproc
	endbr64
	movl	N(%rip), %edx
	xorl	%eax, %eax
	cmpl	%edi, %edx
	je	.L26
	movl	$1010101010, %eax
	jl	.L26
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movslq	%edi, %r11
	movl	%edi, %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	satorina(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	(%rbx,%r11,4), %r9d
	testl	%r9d, %r9d
	je	.L14
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r9d, %eax
	notl	%eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	leal	1(%rdi), %edi
	cmpl	%edi, %edx
	je	.L21
	jl	.L22
	movslq	%edi, %r10
	movl	(%rbx,%r10,4), %ecx
	testl	%ecx, %ecx
	je	.L16
	notl	%ecx
.L15:
	leaq	h(%rip), %rbp
	leal	2(%r8), %edi
	movl	0(%rbp,%r11,4), %eax
	movslq	%edi, %r8
	movl	%eax, %esi
	subl	0(%rbp,%r10,4), %esi
	movl	%esi, %r10d
	negl	%r10d
	cmovs	%esi, %r10d
	addl	%ecx, %r10d
	cmpl	%edx, %edi
	je	.L17
	movl	$1010101010, %r9d
	jg	.L17
	movl	(%rbx,%r8,4), %r9d
	testl	%r9d, %r9d
	je	.L18
	notl	%r9d
.L17:
	subl	0(%rbp,%r8,4), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%r9d, %eax
	cmpl	%r10d, %eax
	cmovg	%r10d, %eax
	movl	%eax, %edx
	notl	%edx
	movl	%edx, (%rbx,%r11,4)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -24
	.cfi_offset 6, -16
	movl	$1010101010, %ecx
	movslq	%edi, %r10
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	call	asumikana.part.0
	movl	N(%rip), %edx
	movl	%eax, %ecx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L18:
	call	asumikana.part.0
	movl	%eax, %r9d
	movl	0(%rbp,%r11,4), %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%ecx, %ecx
	movslq	%edx, %r10
	jmp	.L15
	.cfi_endproc
.LFE39:
	.size	asumikana, .-asumikana
	.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:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L33
	cmpl	$0, N(%rip)
	jle	.L32
	movl	%eax, %ebx
	leaq	4+h(%rip), %rbp
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %ebx
	addq	$4, %rbp
	cmpl	%ebx, N(%rip)
	jl	.L32
.L34:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L37
.L33:
	movl	$1, %eax
.L29:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore_state
	movl	$1, %edi
	call	asumikana
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L29
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	satorina
	.bss
	.align 32
	.type	satorina, @object
	.size	satorina, 458056
satorina:
	.zero	458056
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 458056
h:
	.zero	458056
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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
	.type	asumikana.part.0, @function
asumikana.part.0:
.LFB41:
	.cfi_startproc
	movl	N(%rip), %ecx
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edi, %ebx
	addl	$1, %edi
	cmpl	%ecx, %edi
	je	.L6
	jg	.L7
	leaq	satorina(%rip), %r13
	movslq	%edi, %rbp
	movl	0(%r13,%rbp,4), %eax
	testl	%eax, %eax
	je	.L3
	notl	%eax
.L2:
	leaq	h(%rip), %r14
	movslq	%ebx, %r12
	leal	2(%rbx), %edi
	movl	(%r14,%r12,4), %edx
	movl	%edx, %esi
	subl	(%r14,%rbp,4), %esi
	movl	%esi, %ebp
	negl	%ebp
	cmovs	%esi, %ebp
	addl	%eax, %ebp
	cmpl	%ecx, %edi
	je	.L8
	jg	.L9
	movslq	%edi, %rbx
	movl	0(%r13,%rbx,4), %esi
	testl	%esi, %esi
	je	.L5
	notl	%esi
.L4:
	subl	(%r14,%rbx,4), %edx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	addl	%esi, %eax
	cmpl	%ebp, %eax
	cmovg	%ebp, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	movl	%eax, %edx
	notl	%edx
	movl	%edx, 0(%r13,%r12,4)
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	call	asumikana.part.0
	movl	N(%rip), %ecx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	call	asumikana.part.0
	movl	(%r14,%r12,4), %edx
	movl	%eax, %esi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%esi, %esi
	movslq	%ecx, %rbx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	leaq	satorina(%rip), %r13
	movslq	%ecx, %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$1010101010, %esi
	movslq	%edi, %rbx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$1010101010, %eax
	leaq	satorina(%rip), %r13
	movslq	%edi, %rbp
	jmp	.L2
	.cfi_endproc
.LFE41:
	.size	asumikana.part.0, .-asumikana.part.0
	.p2align 4
	.globl	asumikana
	.type	asumikana, @function
asumikana:
.LFB39:
	.cfi_startproc
	endbr64
	movl	N(%rip), %edx
	xorl	%eax, %eax
	cmpl	%edi, %edx
	je	.L26
	movl	$1010101010, %eax
	jl	.L26
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movslq	%edi, %r11
	movl	%edi, %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	satorina(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	(%rbx,%r11,4), %r9d
	testl	%r9d, %r9d
	je	.L14
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r9d, %eax
	notl	%eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	leal	1(%rdi), %edi
	cmpl	%edi, %edx
	je	.L21
	jl	.L22
	movslq	%edi, %r10
	movl	(%rbx,%r10,4), %ecx
	testl	%ecx, %ecx
	je	.L16
	notl	%ecx
.L15:
	leaq	h(%rip), %rbp
	leal	2(%r8), %edi
	movl	0(%rbp,%r11,4), %eax
	movslq	%edi, %r8
	movl	%eax, %esi
	subl	0(%rbp,%r10,4), %esi
	movl	%esi, %r10d
	negl	%r10d
	cmovs	%esi, %r10d
	addl	%ecx, %r10d
	cmpl	%edx, %edi
	je	.L17
	movl	$1010101010, %r9d
	jg	.L17
	movl	(%rbx,%r8,4), %r9d
	testl	%r9d, %r9d
	je	.L18
	notl	%r9d
.L17:
	subl	0(%rbp,%r8,4), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%r9d, %eax
	cmpl	%r10d, %eax
	cmovg	%r10d, %eax
	movl	%eax, %edx
	notl	%edx
	movl	%edx, (%rbx,%r11,4)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -24
	.cfi_offset 6, -16
	movl	$1010101010, %ecx
	movslq	%edi, %r10
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	call	asumikana.part.0
	movl	N(%rip), %edx
	movl	%eax, %ecx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L18:
	call	asumikana.part.0
	movl	%eax, %r9d
	movl	0(%rbp,%r11,4), %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%ecx, %ecx
	movslq	%edx, %r10
	jmp	.L15
	.cfi_endproc
.LFE39:
	.size	asumikana, .-asumikana
	.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:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L33
	cmpl	$0, N(%rip)
	jle	.L32
	movl	%eax, %ebx
	leaq	4+h(%rip), %rbp
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %ebx
	addq	$4, %rbp
	cmpl	%ebx, N(%rip)
	jl	.L32
.L34:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L37
.L33:
	movl	$1, %eax
.L29:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore_state
	movl	$1, %edi
	call	asumikana
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L29
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	satorina
	.bss
	.align 32
	.type	satorina, @object
	.size	satorina, 458056
satorina:
	.zero	458056
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 458056
h:
	.zero	458056
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>

#define INF 1010101010

int N;
int h[114514];

int satorina[114514];

int asumikana(int pos) {
	int kitaeri, kugyu;
	if (pos == N) return 0;
	if (pos > N) return INF;
	if (satorina[pos]) return ~satorina[pos];

	kitaeri = asumikana(pos + 1) + abs(h[pos] - h[pos + 1]);
	kugyu = asumikana(pos + 2) + abs(h[pos] - h[pos + 2]);
	if (kugyu < kitaeri) kitaeri = kugyu;

	return ~(satorina[pos] = ~kitaeri);
}

int main(void) {
	int i;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &h[i]) != 1) return 1;
	}
	printf("%d\n", asumikana(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>
#include <stdlib.h>

#define INF 1010101010

int N;
int h[114514];

int satorina[114514];

int asumikana(int pos) {
	int kitaeri, kugyu;
	if (pos == N) return 0;
	if (pos > N) return INF;
	if (satorina[pos]) return ~satorina[pos];

	kitaeri = asumikana(pos + 1) + abs(h[pos] - h[pos + 1]);
	kugyu = asumikana(pos + 2) + abs(h[pos] - h[pos + 2]);
	if (kugyu < kitaeri) kitaeri = kugyu;

	return ~(satorina[pos] = ~kitaeri);
}

int main(void) {
	int i;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &h[i]) != 1) return 1;
	}
	printf("%d\n", asumikana(1));
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 458056
h:
	.zero	458056
	.globl	satorina
	.align 32
	.type	satorina, @object
	.size	satorina, 458056
satorina:
	.zero	458056
	.text
	.globl	asumikana
	.type	asumikana, @function
asumikana:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L4
	movl	$1010101010, %eax
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	notl	%eax
	jmp	.L3
.L5:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	asumikana
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%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
	addl	%esi, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	addl	$2, %eax
	movl	%eax, %edi
	call	asumikana
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%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
	addl	%esi, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L6
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	notl	%eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	notl	%eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asumikana, .-asumikana
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	movl	$1, -4(%rbp)
	jmp	.L10
.L12:
	movl	-4(%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
	cmpl	$1, %eax
	je	.L11
	movl	$1, %eax
	jmp	.L9
.L11:
	addl	$1, -4(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$1, %edi
	call	asumikana
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 458056
h:
	.zero	458056
	.globl	satorina
	.align 32
	.type	satorina, @object
	.size	satorina, 458056
satorina:
	.zero	458056
	.text
	.globl	asumikana
	.type	asumikana, @function
asumikana:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L4
	movl	$1010101010, %eax
	jmp	.L3
.L4:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	notl	%eax
	jmp	.L3
.L5:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	asumikana
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%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
	addl	%esi, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	addl	$2, %eax
	movl	%eax, %edi
	call	asumikana
	movl	%eax, %esi
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%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
	addl	%esi, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L6
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	notl	%eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	satorina(%rip), %rax
	movl	(%rdx,%rax), %eax
	notl	%eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asumikana, .-asumikana
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	movl	$1, -4(%rbp)
	jmp	.L10
.L12:
	movl	-4(%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
	cmpl	$1, %eax
	je	.L11
	movl	$1, %eax
	jmp	.L9
.L11:
	addl	$1, -4(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$1, %edi
	call	asumikana
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
