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<math.h>

int main(void)
{
    int n=1, i, j,k,x[1000],y[1000];
    double distance1 = 0,distance2=0,distance3=0,distance=0,max=0;

    scanf("%d", &n);

    for (i = 1;i <= n;i++)
    {
        scanf("%d", &x[i]);
    }

    for (j = 1;j <= n;j++)
    {
        scanf("%d", &y[j]);
    }
    
    for (k = 1;k <= n;k++)
    {
        distance1 = distance1 + sqrt(pow((x[k] - y[k]), 2));
        distance2 = distance2 + pow((x[k] - y[k]), 2);
        distance3 = distance3 + pow((fabs((x[k] - y[k]))),3);
        
        if (max < fabs(x[k] - y[k]))
        {
            max = fabs(x[k] - y[k]);
        }
    }
    
    printf("%.8f %.8f %.8f %.8f\n", distance1,sqrt(distance2),pow(distance3,0.333333333333),max);

    return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC1:
	.string	"%d"
.LC6:
	.string	"%.8f %.8f %.8f %.8f\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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3992, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$1, -8088(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8072(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8064(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8056(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8040(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8048(%rbp)
	leaq	-8088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8084(%rbp)
	jmp	.L2
.L3:
	leaq	-8032(%rbp), %rdx
	movl	-8084(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8084(%rbp)
.L2:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8084(%rbp)
	jle	.L3
	movl	$1, -8080(%rbp)
	jmp	.L4
.L5:
	leaq	-4032(%rbp), %rdx
	movl	-8080(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8080(%rbp)
.L4:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8080(%rbp)
	jle	.L5
	movl	$1, -8076(%rbp)
	jmp	.L6
.L9:
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%edx, %xmm4
	movq	%xmm4, %rax
	movsd	.LC2(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	-8072(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8072(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm5, %xmm5
	cvtsi2sdl	%edx, %xmm5
	movq	%xmm5, %rax
	movsd	.LC2(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-8064(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8064(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movsd	.LC4(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-8056(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8056(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	comisd	-8048(%rbp), %xmm0
	jbe	.L7
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movsd	%xmm0, -8048(%rbp)
.L7:
	addl	$1, -8076(%rbp)
.L6:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8076(%rbp)
	jle	.L9
	movsd	.LC5(%rip), %xmm0
	movq	-8056(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rbx
	movq	-8064(%rbp), %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rdx
	movsd	-8048(%rbp), %xmm0
	movq	-8072(%rbp), %rax
	movapd	%xmm0, %xmm3
	movq	%rbx, %xmm2
	movq	%rdx, %xmm1
	movq	%rax, %xmm0
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$4, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.align 16
.LC3:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 8
.LC4:
	.long	0
	.long	1074266112
	.align 8
.LC5:
	.long	1431649761
	.long	1070945621
	.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
.LC1:
	.string	"%d"
.LC5:
	.string	"%.8f %.8f %.8f %.8f\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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4136
	orq	$0, (%rsp)
	subq	$3992, %rsp
	.cfi_def_cfa_offset 8128
	leaq	.LC1(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8072(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rsi
	movl	$1, 60(%rsp)
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	68(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L5
	leaq	4068(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L4
	testl	%eax, %eax
	jle	.L5
	pxor	%xmm3, %xmm3
	leal	1(%rax), %r12d
	movl	$1, %ebx
	movapd	%xmm3, %xmm4
	movsd	%xmm3, (%rsp)
	leaq	64(%rsp), %r13
	leaq	4064(%rsp), %rbp
	movsd	%xmm3, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L11:
	movl	0(%r13,%rbx,4), %eax
	pxor	%xmm1, %xmm1
	subl	0(%rbp,%rbx,4), %eax
	pxor	%xmm5, %xmm5
	cvtsi2sdl	%eax, %xmm1
	movapd	%xmm1, %xmm2
	mulsd	%xmm1, %xmm2
	ucomisd	%xmm2, %xmm5
	ja	.L22
	movapd	%xmm2, %xmm0
	sqrtsd	%xmm0, %xmm0
.L8:
	addsd	(%rsp), %xmm2
	addsd	8(%rsp), %xmm0
	movsd	%xmm4, 32(%rsp)
	addq	$1, %rbx
	andpd	.LC2(%rip), %xmm1
	movq	.LC3(%rip), %rax
	movsd	%xmm3, 24(%rsp)
	movsd	%xmm2, (%rsp)
	movapd	%xmm1, %xmm2
	movq	%rax, %xmm1
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm2, %xmm0
	movsd	%xmm2, 16(%rsp)
	call	pow@PLT
	movsd	24(%rsp), %xmm3
	movsd	16(%rsp), %xmm2
	movsd	32(%rsp), %xmm4
	maxsd	%xmm3, %xmm2
	addsd	%xmm0, %xmm4
	movapd	%xmm2, %xmm3
	cmpq	%rbx, %r12
	jne	.L11
	movsd	.LC4(%rip), %xmm1
	movapd	%xmm4, %xmm0
	movsd	%xmm2, 16(%rsp)
	call	pow@PLT
	pxor	%xmm5, %xmm5
	ucomisd	(%rsp), %xmm5
	movsd	16(%rsp), %xmm3
	movapd	%xmm0, %xmm2
	ja	.L23
.L15:
	movsd	(%rsp), %xmm1
	sqrtsd	%xmm1, %xmm1
.L14:
	movsd	8(%rsp), %xmm0
	movl	$1, %edi
	movl	$4, %eax
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	movq	8072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$8088, %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
.L5:
	.cfi_restore_state
	pxor	%xmm3, %xmm3
	movsd	%xmm3, (%rsp)
	movapd	%xmm3, %xmm2
	movsd	%xmm3, 8(%rsp)
	jmp	.L15
.L22:
	movapd	%xmm2, %xmm0
	movsd	%xmm4, 40(%rsp)
	movsd	%xmm3, 32(%rsp)
	movsd	%xmm1, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	call	sqrt@PLT
	movsd	40(%rsp), %xmm4
	movsd	32(%rsp), %xmm3
	movsd	24(%rsp), %xmm1
	movsd	16(%rsp), %xmm2
	jmp	.L8
.L23:
	movsd	%xmm0, 16(%rsp)
	movsd	(%rsp), %xmm0
	movsd	%xmm3, 24(%rsp)
	call	sqrt@PLT
	movsd	24(%rsp), %xmm3
	movsd	16(%rsp), %xmm2
	movapd	%xmm0, %xmm1
	jmp	.L14
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1074266112
	.align 8
.LC4:
	.long	1431649761
	.long	1070945621
	.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
.LC1:
	.string	"%d"
.LC5:
	.string	"%.8f %.8f %.8f %.8f\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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4136
	orq	$0, (%rsp)
	subq	$3992, %rsp
	.cfi_def_cfa_offset 8128
	leaq	.LC1(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8072(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rsi
	movl	$1, 60(%rsp)
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	68(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L5
	leaq	4068(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L4
	testl	%eax, %eax
	jle	.L5
	pxor	%xmm3, %xmm3
	leal	1(%rax), %r12d
	movl	$1, %ebx
	movapd	%xmm3, %xmm4
	movsd	%xmm3, (%rsp)
	leaq	64(%rsp), %r13
	leaq	4064(%rsp), %rbp
	movsd	%xmm3, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L11:
	movl	0(%r13,%rbx,4), %eax
	pxor	%xmm1, %xmm1
	subl	0(%rbp,%rbx,4), %eax
	pxor	%xmm5, %xmm5
	cvtsi2sdl	%eax, %xmm1
	movapd	%xmm1, %xmm2
	mulsd	%xmm1, %xmm2
	ucomisd	%xmm2, %xmm5
	ja	.L22
	movapd	%xmm2, %xmm0
	sqrtsd	%xmm0, %xmm0
.L8:
	addsd	(%rsp), %xmm2
	addsd	8(%rsp), %xmm0
	movsd	%xmm4, 32(%rsp)
	addq	$1, %rbx
	andpd	.LC2(%rip), %xmm1
	movq	.LC3(%rip), %rax
	movsd	%xmm3, 24(%rsp)
	movsd	%xmm2, (%rsp)
	movapd	%xmm1, %xmm2
	movq	%rax, %xmm1
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm2, %xmm0
	movsd	%xmm2, 16(%rsp)
	call	pow@PLT
	movsd	24(%rsp), %xmm3
	movsd	16(%rsp), %xmm2
	movsd	32(%rsp), %xmm4
	maxsd	%xmm3, %xmm2
	addsd	%xmm0, %xmm4
	movapd	%xmm2, %xmm3
	cmpq	%rbx, %r12
	jne	.L11
	movsd	.LC4(%rip), %xmm1
	movapd	%xmm4, %xmm0
	movsd	%xmm2, 16(%rsp)
	call	pow@PLT
	pxor	%xmm5, %xmm5
	ucomisd	(%rsp), %xmm5
	movsd	16(%rsp), %xmm3
	movapd	%xmm0, %xmm2
	ja	.L23
.L15:
	movsd	(%rsp), %xmm1
	sqrtsd	%xmm1, %xmm1
.L14:
	movsd	8(%rsp), %xmm0
	movl	$1, %edi
	movl	$4, %eax
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	movq	8072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$8088, %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
.L5:
	.cfi_restore_state
	pxor	%xmm3, %xmm3
	movsd	%xmm3, (%rsp)
	movapd	%xmm3, %xmm2
	movsd	%xmm3, 8(%rsp)
	jmp	.L15
.L22:
	movapd	%xmm2, %xmm0
	movsd	%xmm4, 40(%rsp)
	movsd	%xmm3, 32(%rsp)
	movsd	%xmm1, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	call	sqrt@PLT
	movsd	40(%rsp), %xmm4
	movsd	32(%rsp), %xmm3
	movsd	24(%rsp), %xmm1
	movsd	16(%rsp), %xmm2
	jmp	.L8
.L23:
	movsd	%xmm0, 16(%rsp)
	movsd	(%rsp), %xmm0
	movsd	%xmm3, 24(%rsp)
	call	sqrt@PLT
	movsd	24(%rsp), %xmm3
	movsd	16(%rsp), %xmm2
	movapd	%xmm0, %xmm1
	jmp	.L14
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1074266112
	.align 8
.LC4:
	.long	1431649761
	.long	1070945621
	.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<math.h>

int main(void)
{
    int n=1, i, j,k,x[1000],y[1000];
    double distance1 = 0,distance2=0,distance3=0,distance=0,max=0;

    scanf("%d", &n);

    for (i = 1;i <= n;i++)
    {
        scanf("%d", &x[i]);
    }

    for (j = 1;j <= n;j++)
    {
        scanf("%d", &y[j]);
    }
    
    for (k = 1;k <= n;k++)
    {
        distance1 = distance1 + sqrt(pow((x[k] - y[k]), 2));
        distance2 = distance2 + pow((x[k] - y[k]), 2);
        distance3 = distance3 + pow((fabs((x[k] - y[k]))),3);
        
        if (max < fabs(x[k] - y[k]))
        {
            max = fabs(x[k] - y[k]);
        }
    }
    
    printf("%.8f %.8f %.8f %.8f\n", distance1,sqrt(distance2),pow(distance3,0.333333333333),max);

    return 0;

}

3
2 2 3
2 0 4
 3
2 2 3
2 -1 4
 3
2 4 5
2 -1 4
 3
3 4 5
2 -1 4
 3
6 4 5
2 -1 4
 3
6 5 5
2 -1 4
 3
6 5 5
2 -1 3
 3
6 5 8
2 -1 3
 3
6 5 8
3 -1 3
 3
6 7 8
3 -1 3

3.00000000 2.23606798 2.08008382 2.00000000
 4.00000000 3.16227766 3.03658897 3.00000000
 6.00000000 5.09901951 5.01329793 5.00000000
 7.00000000 5.19615242 5.02652570 5.00000000
 10.00000000 6.48074070 5.74889708 5.00000000
 11.00000000 7.28010989 6.54991162 6.00000000
 12.00000000 7.48331477 6.60385450 6.00000000
 15.00000000 8.77496439 7.39863622 6.00000000
 14.00000000 8.36660027 7.16609574 6.00000000
 16.00000000 9.89949494 8.72414134 8.00000000

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<math.h>

int main(void)
{
    int n=1, i, j,k,x[1000],y[1000];
    double distance1 = 0,distance2=0,distance3=0,distance=0,max=0;

    scanf("%d", &n);

    for (i = 1;i <= n;i++)
    {
        scanf("%d", &x[i]);
    }

    for (j = 1;j <= n;j++)
    {
        scanf("%d", &y[j]);
    }
    
    for (k = 1;k <= n;k++)
    {
        distance1 = distance1 + sqrt(pow((x[k] - y[k]), 2));
        distance2 = distance2 + pow((x[k] - y[k]), 2);
        distance3 = distance3 + pow((fabs((x[k] - y[k]))),3);
        
        if (max < fabs(x[k] - y[k]))
        {
            max = fabs(x[k] - y[k]);
        }
    }
    
    printf("%.8f %.8f %.8f %.8f\n", distance1,sqrt(distance2),pow(distance3,0.333333333333),max);

    return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC1:
	.string	"%d"
.LC6:
	.string	"%.8f %.8f %.8f %.8f\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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3992, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$1, -8088(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8072(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8064(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8056(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8040(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8048(%rbp)
	leaq	-8088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8084(%rbp)
	jmp	.L2
.L3:
	leaq	-8032(%rbp), %rdx
	movl	-8084(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8084(%rbp)
.L2:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8084(%rbp)
	jle	.L3
	movl	$1, -8080(%rbp)
	jmp	.L4
.L5:
	leaq	-4032(%rbp), %rdx
	movl	-8080(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8080(%rbp)
.L4:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8080(%rbp)
	jle	.L5
	movl	$1, -8076(%rbp)
	jmp	.L6
.L9:
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%edx, %xmm4
	movq	%xmm4, %rax
	movsd	.LC2(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	-8072(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8072(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm5, %xmm5
	cvtsi2sdl	%edx, %xmm5
	movq	%xmm5, %rax
	movsd	.LC2(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-8064(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8064(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movsd	.LC4(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-8056(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8056(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	comisd	-8048(%rbp), %xmm0
	jbe	.L7
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movsd	%xmm0, -8048(%rbp)
.L7:
	addl	$1, -8076(%rbp)
.L6:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8076(%rbp)
	jle	.L9
	movsd	.LC5(%rip), %xmm0
	movq	-8056(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rbx
	movq	-8064(%rbp), %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rdx
	movsd	-8048(%rbp), %xmm0
	movq	-8072(%rbp), %rax
	movapd	%xmm0, %xmm3
	movq	%rbx, %xmm2
	movq	%rdx, %xmm1
	movq	%rax, %xmm0
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$4, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.align 16
.LC3:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 8
.LC4:
	.long	0
	.long	1074266112
	.align 8
.LC5:
	.long	1431649761
	.long	1070945621
	.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
.LC1:
	.string	"%d"
.LC6:
	.string	"%.8f %.8f %.8f %.8f\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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3992, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$1, -8088(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8072(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8064(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8056(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8040(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -8048(%rbp)
	leaq	-8088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8084(%rbp)
	jmp	.L2
.L3:
	leaq	-8032(%rbp), %rdx
	movl	-8084(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8084(%rbp)
.L2:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8084(%rbp)
	jle	.L3
	movl	$1, -8080(%rbp)
	jmp	.L4
.L5:
	leaq	-4032(%rbp), %rdx
	movl	-8080(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8080(%rbp)
.L4:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8080(%rbp)
	jle	.L5
	movl	$1, -8076(%rbp)
	jmp	.L6
.L9:
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%edx, %xmm4
	movq	%xmm4, %rax
	movsd	.LC2(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	-8072(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8072(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm5, %xmm5
	cvtsi2sdl	%edx, %xmm5
	movq	%xmm5, %rax
	movsd	.LC2(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-8064(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8064(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movsd	.LC4(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-8056(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -8056(%rbp)
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	comisd	-8048(%rbp), %xmm0
	jbe	.L7
	movl	-8076(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %edx
	movl	-8076(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	subl	%eax, %edx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	movq	.LC3(%rip), %xmm1
	andpd	%xmm1, %xmm0
	movsd	%xmm0, -8048(%rbp)
.L7:
	addl	$1, -8076(%rbp)
.L6:
	movl	-8088(%rbp), %eax
	cmpl	%eax, -8076(%rbp)
	jle	.L9
	movsd	.LC5(%rip), %xmm0
	movq	-8056(%rbp), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rbx
	movq	-8064(%rbp), %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rdx
	movsd	-8048(%rbp), %xmm0
	movq	-8072(%rbp), %rax
	movapd	%xmm0, %xmm3
	movq	%rbx, %xmm2
	movq	%rdx, %xmm1
	movq	%rax, %xmm0
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$4, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.align 16
.LC3:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 8
.LC4:
	.long	0
	.long	1074266112
	.align 8
.LC5:
	.long	1431649761
	.long	1070945621
	.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:
