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

```c
N,i,M;double X[30],Y[30],Z[30],cx,cy,cz,d,m;
#define Q(x)(x)*(x)
double D(i){return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz));}
int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
main(t){for(;scanf("%d",&N),N;printf("%f\n",D(L()))){
	for(i=0;i<N;i++)scanf("%lf%lf%lf",X+i,Y+i,Z+i);
	for(cx=cy=cz=d=0.5;d>1e-8;d/=2)for(t=0;t<100;t++)i=L(),cx+=(X[i]-cx)*d,cy+=(Y[i]-cy)*d,cz+=(Z[i]-cz)*d;
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	X
	.align 32
	.type	X, @object
	.size	X, 240
X:
	.zero	240
	.globl	Y
	.align 32
	.type	Y, @object
	.size	Y, 240
Y:
	.zero	240
	.globl	Z
	.align 32
	.type	Z, @object
	.size	Z, 240
Z:
	.zero	240
	.globl	cx
	.align 8
	.type	cx, @object
	.size	cx, 8
cx:
	.zero	8
	.globl	cy
	.align 8
	.type	cy, @object
	.size	cy, 8
cy:
	.zero	8
	.globl	cz
	.align 8
	.type	cz, @object
	.size	cz, 8
cz:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	m
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.text
	.globl	D
	.type	D, @function
D:
.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
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.globl	L
	.type	L, @function
L:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, i(%rip)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, m(%rip)
	jmp	.L4
.L7:
	movl	i(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movsd	m(%rip), %xmm0
	movq	%rax, %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L5
	movl	i(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movq	%rax, m(%rip)
	movl	i(%rip), %eax
	movl	%eax, M(%rip)
.L5:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	M(%rip), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	L, .-L
	.section	.rodata
.LC1:
	.string	"%lf%lf%lf"
.LC5:
	.string	"%f\n"
.LC6:
	.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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L11
.L18:
	movl	$0, i(%rip)
	jmp	.L12
.L13:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	X(%rip), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, d(%rip)
	movsd	d(%rip), %xmm0
	movsd	%xmm0, cz(%rip)
	movsd	cz(%rip), %xmm0
	movsd	%xmm0, cy(%rip)
	movsd	cy(%rip), %xmm0
	movsd	%xmm0, cx(%rip)
	jmp	.L14
.L17:
	movl	$0, -4(%rbp)
	jmp	.L15
.L16:
	movl	$0, %eax
	call	L
	movl	%eax, i(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cx(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cx(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cy(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cy(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cz(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cz(%rip)
	addl	$1, -4(%rbp)
.L15:
	cmpl	$99, -4(%rbp)
	jle	.L16
	movsd	d(%rip), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, d(%rip)
.L14:
	movsd	d(%rip), %xmm0
	comisd	.LC4(%rip), %xmm0
	ja	.L17
	movl	$0, %eax
	call	L
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
.L11:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	-500134854
	.long	1044740494
	.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	D
	.type	D, @function
D:
.LFB0:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	X(%rip), %rax
	movsd	(%rax,%rdi,8), %xmm0
	leaq	Y(%rip), %rax
	subsd	cx(%rip), %xmm0
	movsd	(%rax,%rdi,8), %xmm2
	subsd	cy(%rip), %xmm2
	leaq	Z(%rip), %rax
	movsd	(%rax,%rdi,8), %xmm1
	subsd	cz(%rip), %xmm1
	mulsd	%xmm0, %xmm0
	mulsd	%xmm2, %xmm2
	mulsd	%xmm1, %xmm1
	addsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	.L10
	sqrtsd	%xmm0, %xmm0
	ret
.L10:
	jmp	sqrt@PLT
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.p2align 4
	.globl	L
	.type	L, @function
L:
.LFB1:
	.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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movslq	N(%rip), %r12
	movl	$0, i(%rip)
	movq	$0x000000000, m(%rip)
	testl	%r12d, %r12d
	jle	.L19
	pxor	%xmm3, %xmm3
	movsd	cx(%rip), %xmm6
	xorl	%ebx, %ebx
	movsd	cy(%rip), %xmm5
	movsd	cz(%rip), %xmm4
	movapd	%xmm3, %xmm7
	leaq	X(%rip), %rax
	leaq	Y(%rip), %r15
	leaq	Z(%rip), %r14
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %ebp
	addq	$1, %rbx
	movl	%ebp, i(%rip)
	cmpq	%rbx, %r12
	je	.L19
.L18:
	movsd	(%rax,%rbx,8), %xmm1
	movsd	(%r15,%rbx,8), %xmm2
	movl	%ebx, %ebp
	movl	%ebx, %r13d
	movsd	(%r14,%rbx,8), %xmm0
	subsd	%xmm6, %xmm1
	subsd	%xmm5, %xmm2
	subsd	%xmm4, %xmm0
	mulsd	%xmm1, %xmm1
	mulsd	%xmm2, %xmm2
	mulsd	%xmm0, %xmm0
	addsd	%xmm2, %xmm1
	addsd	%xmm0, %xmm1
	ucomisd	%xmm1, %xmm3
	ja	.L23
	sqrtsd	%xmm1, %xmm1
	comisd	%xmm7, %xmm1
	jbe	.L16
.L15:
	movl	%r13d, M(%rip)
	movapd	%xmm1, %xmm7
	movsd	%xmm1, m(%rip)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L19:
	movl	M(%rip), %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L23:
	.cfi_restore_state
	movapd	%xmm1, %xmm0
	movsd	%xmm4, 40(%rsp)
	movsd	%xmm5, 32(%rsp)
	movsd	%xmm6, 24(%rsp)
	movsd	%xmm7, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm7
	pxor	%xmm3, %xmm3
	movsd	8(%rsp), %xmm1
	movsd	24(%rsp), %xmm6
	movsd	32(%rsp), %xmm5
	leaq	X(%rip), %rax
	comisd	%xmm7, %xmm0
	movsd	40(%rsp), %xmm4
	jbe	.L16
	movapd	%xmm1, %xmm0
	movsd	%xmm4, 24(%rsp)
	movsd	%xmm5, 16(%rsp)
	movsd	%xmm6, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm6
	movsd	16(%rsp), %xmm5
	pxor	%xmm3, %xmm3
	movsd	24(%rsp), %xmm4
	movapd	%xmm0, %xmm1
	leaq	X(%rip), %rax
	jmp	.L15
	.cfi_endproc
.LFE1:
	.size	L, .-L
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%lf%lf%lf"
.LC3:
	.string	"%f\n"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	leaq	Z(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	Y(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
.L26:
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	call	scanf@PLT
	movl	N(%rip), %r13d
	pxor	%xmm5, %xmm5
	testl	%r13d, %r13d
	je	.L56
	movl	$0, i(%rip)
	leaq	X(%rip), %r15
	jle	.L27
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rbx
.L28:
	cltq
	movq	%rbx, %rdi
	salq	$3, %rax
	leaq	(%r12,%rax), %rcx
	leaq	0(%rbp,%rax), %rdx
	leaq	(%r15,%rax), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %r13d
	pxor	%xmm5, %xmm5
	addl	$1, %eax
	cmpl	%r13d, %eax
	movl	%eax, i(%rip)
	jl	.L28
.L27:
	movsd	.LC1(%rip), %xmm7
	movl	$26, 64(%rsp)
	movslq	%r13d, %rdx
	movsd	%xmm7, d(%rip)
	movapd	%xmm7, %xmm4
	movapd	%xmm7, %xmm3
	movapd	%xmm7, %xmm2
	movsd	%xmm7, cz(%rip)
	movapd	%xmm7, %xmm6
	movsd	%xmm7, cy(%rip)
	movsd	%xmm7, cx(%rip)
.L39:
	movl	$100, %ecx
	.p2align 4,,10
	.p2align 3
.L30:
	movl	$0, i(%rip)
	xorl	%ebx, %ebx
	movapd	%xmm5, %xmm8
	movq	$0x000000000, m(%rip)
	testl	%r13d, %r13d
	jg	.L37
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L35:
	addl	$1, %r14d
	addq	$1, %rbx
	movl	%r14d, i(%rip)
	cmpq	%rdx, %rbx
	je	.L38
.L37:
	movsd	(%r15,%rbx,8), %xmm1
	movsd	0(%rbp,%rbx,8), %xmm9
	movl	%ebx, %r14d
	movl	%ebx, %eax
	movsd	(%r12,%rbx,8), %xmm0
	subsd	%xmm2, %xmm1
	subsd	%xmm3, %xmm9
	subsd	%xmm4, %xmm0
	mulsd	%xmm1, %xmm1
	mulsd	%xmm9, %xmm9
	mulsd	%xmm0, %xmm0
	addsd	%xmm9, %xmm1
	addsd	%xmm0, %xmm1
	ucomisd	%xmm1, %xmm5
	ja	.L53
	sqrtsd	%xmm1, %xmm1
	comisd	%xmm8, %xmm1
	jbe	.L35
.L34:
	movl	%eax, M(%rip)
	movapd	%xmm1, %xmm8
	movsd	%xmm1, m(%rip)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	M(%rip), %rax
	movsd	(%r15,%rax,8), %xmm0
	movl	%eax, i(%rip)
	subsd	%xmm2, %xmm0
	mulsd	%xmm6, %xmm0
	addsd	%xmm0, %xmm2
	movsd	0(%rbp,%rax,8), %xmm0
	subsd	%xmm3, %xmm0
	movsd	%xmm2, cx(%rip)
	mulsd	%xmm6, %xmm0
	addsd	%xmm0, %xmm3
	movsd	(%r12,%rax,8), %xmm0
	subsd	%xmm4, %xmm0
	movsd	%xmm3, cy(%rip)
	mulsd	%xmm6, %xmm0
	addsd	%xmm0, %xmm4
	movsd	%xmm4, cz(%rip)
	subl	$1, %ecx
	jne	.L30
	mulsd	%xmm7, %xmm6
	subl	$1, 64(%rsp)
	movsd	%xmm6, d(%rip)
	jne	.L39
	xorl	%eax, %eax
	call	L
	pxor	%xmm5, %xmm5
	cltq
	movsd	(%r15,%rax,8), %xmm0
	movsd	0(%rbp,%rax,8), %xmm2
	subsd	cx(%rip), %xmm0
	subsd	cy(%rip), %xmm2
	movsd	(%r12,%rax,8), %xmm1
	subsd	cz(%rip), %xmm1
	mulsd	%xmm0, %xmm0
	mulsd	%xmm2, %xmm2
	mulsd	%xmm1, %xmm1
	addsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	ucomisd	%xmm0, %xmm5
	ja	.L54
	sqrtsd	%xmm0, %xmm0
.L42:
	leaq	.LC3(%rip), %rdi
	movl	$1, %eax
	call	printf@PLT
	jmp	.L26
.L53:
	movapd	%xmm1, %xmm0
	movl	%ecx, 68(%rsp)
	movq	%rdx, 56(%rsp)
	movsd	%xmm8, 72(%rsp)
	movsd	%xmm6, 40(%rsp)
	movsd	%xmm4, 32(%rsp)
	movsd	%xmm3, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	movl	%ebx, 48(%rsp)
	call	sqrt@PLT
	movsd	72(%rsp), %xmm8
	movl	48(%rsp), %eax
	pxor	%xmm5, %xmm5
	movq	.LC1(%rip), %rsi
	movsd	8(%rsp), %xmm1
	comisd	%xmm8, %xmm0
	movsd	16(%rsp), %xmm2
	movl	68(%rsp), %ecx
	movsd	24(%rsp), %xmm3
	movsd	32(%rsp), %xmm4
	movq	%rsi, %xmm7
	movsd	40(%rsp), %xmm6
	movq	56(%rsp), %rdx
	jbe	.L35
	movapd	%xmm1, %xmm0
	movl	%ecx, 56(%rsp)
	movq	%rdx, 48(%rsp)
	movl	%eax, 40(%rsp)
	movsd	%xmm6, 32(%rsp)
	movsd	%xmm4, 24(%rsp)
	movsd	%xmm3, 16(%rsp)
	movsd	%xmm2, 8(%rsp)
	call	sqrt@PLT
	movq	.LC1(%rip), %rsi
	movl	40(%rsp), %eax
	pxor	%xmm5, %xmm5
	movsd	8(%rsp), %xmm2
	movsd	16(%rsp), %xmm3
	movapd	%xmm0, %xmm1
	movsd	24(%rsp), %xmm4
	movsd	32(%rsp), %xmm6
	movq	%rsi, %xmm7
	movq	48(%rsp), %rdx
	movl	56(%rsp), %ecx
	jmp	.L34
.L56:
	xorl	%edi, %edi
	call	exit@PLT
.L54:
	call	sqrt@PLT
	jmp	.L42
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	m
	.bss
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	cz
	.align 8
	.type	cz, @object
	.size	cz, 8
cz:
	.zero	8
	.globl	cy
	.align 8
	.type	cy, @object
	.size	cy, 8
cy:
	.zero	8
	.globl	cx
	.align 8
	.type	cx, @object
	.size	cx, 8
cx:
	.zero	8
	.globl	Z
	.align 32
	.type	Z, @object
	.size	Z, 240
Z:
	.zero	240
	.globl	Y
	.align 32
	.type	Y, @object
	.size	Y, 240
Y:
	.zero	240
	.globl	X
	.align 32
	.type	X, @object
	.size	X, 240
X:
	.zero	240
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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	D
	.type	D, @function
D:
.LFB0:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	X(%rip), %rax
	movsd	(%rax,%rdi,8), %xmm0
	leaq	Y(%rip), %rax
	subsd	cx(%rip), %xmm0
	movsd	(%rax,%rdi,8), %xmm2
	subsd	cy(%rip), %xmm2
	leaq	Z(%rip), %rax
	movsd	(%rax,%rdi,8), %xmm1
	subsd	cz(%rip), %xmm1
	mulsd	%xmm0, %xmm0
	mulsd	%xmm2, %xmm2
	mulsd	%xmm1, %xmm1
	addsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	.L10
	sqrtsd	%xmm0, %xmm0
	ret
.L10:
	jmp	sqrt@PLT
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.p2align 4
	.globl	L
	.type	L, @function
L:
.LFB1:
	.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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movslq	N(%rip), %r12
	movl	$0, i(%rip)
	movq	$0x000000000, m(%rip)
	testl	%r12d, %r12d
	jle	.L19
	pxor	%xmm3, %xmm3
	movsd	cx(%rip), %xmm6
	xorl	%ebx, %ebx
	movsd	cy(%rip), %xmm5
	movsd	cz(%rip), %xmm4
	movapd	%xmm3, %xmm7
	leaq	X(%rip), %rax
	leaq	Y(%rip), %r15
	leaq	Z(%rip), %r14
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %ebp
	addq	$1, %rbx
	movl	%ebp, i(%rip)
	cmpq	%rbx, %r12
	je	.L19
.L18:
	movsd	(%rax,%rbx,8), %xmm1
	movsd	(%r15,%rbx,8), %xmm2
	movl	%ebx, %ebp
	movl	%ebx, %r13d
	movsd	(%r14,%rbx,8), %xmm0
	subsd	%xmm6, %xmm1
	subsd	%xmm5, %xmm2
	subsd	%xmm4, %xmm0
	mulsd	%xmm1, %xmm1
	mulsd	%xmm2, %xmm2
	mulsd	%xmm0, %xmm0
	addsd	%xmm2, %xmm1
	addsd	%xmm0, %xmm1
	ucomisd	%xmm1, %xmm3
	ja	.L23
	sqrtsd	%xmm1, %xmm1
	comisd	%xmm7, %xmm1
	jbe	.L16
.L15:
	movl	%r13d, M(%rip)
	movapd	%xmm1, %xmm7
	movsd	%xmm1, m(%rip)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L19:
	movl	M(%rip), %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L23:
	.cfi_restore_state
	movapd	%xmm1, %xmm0
	movsd	%xmm4, 40(%rsp)
	movsd	%xmm5, 32(%rsp)
	movsd	%xmm6, 24(%rsp)
	movsd	%xmm7, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm7
	pxor	%xmm3, %xmm3
	movsd	8(%rsp), %xmm1
	movsd	24(%rsp), %xmm6
	movsd	32(%rsp), %xmm5
	leaq	X(%rip), %rax
	comisd	%xmm7, %xmm0
	movsd	40(%rsp), %xmm4
	jbe	.L16
	movapd	%xmm1, %xmm0
	movsd	%xmm4, 24(%rsp)
	movsd	%xmm5, 16(%rsp)
	movsd	%xmm6, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm6
	movsd	16(%rsp), %xmm5
	pxor	%xmm3, %xmm3
	movsd	24(%rsp), %xmm4
	movapd	%xmm0, %xmm1
	leaq	X(%rip), %rax
	jmp	.L15
	.cfi_endproc
.LFE1:
	.size	L, .-L
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%lf%lf%lf"
.LC3:
	.string	"%f\n"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	leaq	Z(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	Y(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
.L26:
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	call	scanf@PLT
	movl	N(%rip), %r13d
	pxor	%xmm5, %xmm5
	testl	%r13d, %r13d
	je	.L56
	movl	$0, i(%rip)
	leaq	X(%rip), %r15
	jle	.L27
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rbx
.L28:
	cltq
	movq	%rbx, %rdi
	salq	$3, %rax
	leaq	(%r12,%rax), %rcx
	leaq	0(%rbp,%rax), %rdx
	leaq	(%r15,%rax), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %r13d
	pxor	%xmm5, %xmm5
	addl	$1, %eax
	cmpl	%r13d, %eax
	movl	%eax, i(%rip)
	jl	.L28
.L27:
	movsd	.LC1(%rip), %xmm7
	movl	$26, 64(%rsp)
	movslq	%r13d, %rdx
	movsd	%xmm7, d(%rip)
	movapd	%xmm7, %xmm4
	movapd	%xmm7, %xmm3
	movapd	%xmm7, %xmm2
	movsd	%xmm7, cz(%rip)
	movapd	%xmm7, %xmm6
	movsd	%xmm7, cy(%rip)
	movsd	%xmm7, cx(%rip)
.L39:
	movl	$100, %ecx
	.p2align 4,,10
	.p2align 3
.L30:
	movl	$0, i(%rip)
	xorl	%ebx, %ebx
	movapd	%xmm5, %xmm8
	movq	$0x000000000, m(%rip)
	testl	%r13d, %r13d
	jg	.L37
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L35:
	addl	$1, %r14d
	addq	$1, %rbx
	movl	%r14d, i(%rip)
	cmpq	%rdx, %rbx
	je	.L38
.L37:
	movsd	(%r15,%rbx,8), %xmm1
	movsd	0(%rbp,%rbx,8), %xmm9
	movl	%ebx, %r14d
	movl	%ebx, %eax
	movsd	(%r12,%rbx,8), %xmm0
	subsd	%xmm2, %xmm1
	subsd	%xmm3, %xmm9
	subsd	%xmm4, %xmm0
	mulsd	%xmm1, %xmm1
	mulsd	%xmm9, %xmm9
	mulsd	%xmm0, %xmm0
	addsd	%xmm9, %xmm1
	addsd	%xmm0, %xmm1
	ucomisd	%xmm1, %xmm5
	ja	.L53
	sqrtsd	%xmm1, %xmm1
	comisd	%xmm8, %xmm1
	jbe	.L35
.L34:
	movl	%eax, M(%rip)
	movapd	%xmm1, %xmm8
	movsd	%xmm1, m(%rip)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	M(%rip), %rax
	movsd	(%r15,%rax,8), %xmm0
	movl	%eax, i(%rip)
	subsd	%xmm2, %xmm0
	mulsd	%xmm6, %xmm0
	addsd	%xmm0, %xmm2
	movsd	0(%rbp,%rax,8), %xmm0
	subsd	%xmm3, %xmm0
	movsd	%xmm2, cx(%rip)
	mulsd	%xmm6, %xmm0
	addsd	%xmm0, %xmm3
	movsd	(%r12,%rax,8), %xmm0
	subsd	%xmm4, %xmm0
	movsd	%xmm3, cy(%rip)
	mulsd	%xmm6, %xmm0
	addsd	%xmm0, %xmm4
	movsd	%xmm4, cz(%rip)
	subl	$1, %ecx
	jne	.L30
	mulsd	%xmm7, %xmm6
	subl	$1, 64(%rsp)
	movsd	%xmm6, d(%rip)
	jne	.L39
	xorl	%eax, %eax
	call	L
	pxor	%xmm5, %xmm5
	cltq
	movsd	(%r15,%rax,8), %xmm0
	movsd	0(%rbp,%rax,8), %xmm2
	subsd	cx(%rip), %xmm0
	subsd	cy(%rip), %xmm2
	movsd	(%r12,%rax,8), %xmm1
	subsd	cz(%rip), %xmm1
	mulsd	%xmm0, %xmm0
	mulsd	%xmm2, %xmm2
	mulsd	%xmm1, %xmm1
	addsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	ucomisd	%xmm0, %xmm5
	ja	.L54
	sqrtsd	%xmm0, %xmm0
.L42:
	leaq	.LC3(%rip), %rdi
	movl	$1, %eax
	call	printf@PLT
	jmp	.L26
.L53:
	movapd	%xmm1, %xmm0
	movl	%ecx, 68(%rsp)
	movq	%rdx, 56(%rsp)
	movsd	%xmm8, 72(%rsp)
	movsd	%xmm6, 40(%rsp)
	movsd	%xmm4, 32(%rsp)
	movsd	%xmm3, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	movl	%ebx, 48(%rsp)
	call	sqrt@PLT
	movsd	72(%rsp), %xmm8
	movl	48(%rsp), %eax
	pxor	%xmm5, %xmm5
	movq	.LC1(%rip), %rsi
	movsd	8(%rsp), %xmm1
	comisd	%xmm8, %xmm0
	movsd	16(%rsp), %xmm2
	movl	68(%rsp), %ecx
	movsd	24(%rsp), %xmm3
	movsd	32(%rsp), %xmm4
	movq	%rsi, %xmm7
	movsd	40(%rsp), %xmm6
	movq	56(%rsp), %rdx
	jbe	.L35
	movapd	%xmm1, %xmm0
	movl	%ecx, 56(%rsp)
	movq	%rdx, 48(%rsp)
	movl	%eax, 40(%rsp)
	movsd	%xmm6, 32(%rsp)
	movsd	%xmm4, 24(%rsp)
	movsd	%xmm3, 16(%rsp)
	movsd	%xmm2, 8(%rsp)
	call	sqrt@PLT
	movq	.LC1(%rip), %rsi
	movl	40(%rsp), %eax
	pxor	%xmm5, %xmm5
	movsd	8(%rsp), %xmm2
	movsd	16(%rsp), %xmm3
	movapd	%xmm0, %xmm1
	movsd	24(%rsp), %xmm4
	movsd	32(%rsp), %xmm6
	movq	%rsi, %xmm7
	movq	48(%rsp), %rdx
	movl	56(%rsp), %ecx
	jmp	.L34
.L56:
	xorl	%edi, %edi
	call	exit@PLT
.L54:
	call	sqrt@PLT
	jmp	.L42
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	m
	.bss
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	cz
	.align 8
	.type	cz, @object
	.size	cz, 8
cz:
	.zero	8
	.globl	cy
	.align 8
	.type	cy, @object
	.size	cy, 8
cy:
	.zero	8
	.globl	cx
	.align 8
	.type	cx, @object
	.size	cx, 8
cx:
	.zero	8
	.globl	Z
	.align 32
	.type	Z, @object
	.size	Z, 240
Z:
	.zero	240
	.globl	Y
	.align 32
	.type	Y, @object
	.size	Y, 240
Y:
	.zero	240
	.globl	X
	.align 32
	.type	X, @object
	.size	X, 240
X:
	.zero	240
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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:

N,i,M;double X[30],Y[30],Z[30],cx,cy,cz,d,m;
#define Q(x)(x)*(x)
double D(i){return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz));}
int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
main(t){for(;scanf("%d",&N),N;printf("%f\n",D(L()))){
	for(i=0;i<N;i++)scanf("%lf%lf%lf",X+i,Y+i,Z+i);
	for(cx=cy=cz=d=0.5;d>1e-8;d/=2)for(t=0;t<100;t++)i=L(),cx+=(X[i]-cx)*d,cy+=(Y[i]-cy)*d,cz+=(Z[i]-cz)*d;
}exit(0);}
4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.00000 10.00000
10.00000 20.00000 10.00000
4
10.00000 10.063097698119668 10.00000
10.00000 50.00000 50.00000
50.00000 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.00000 10.00000
10.00000 20.00000 10.00000
4
10.00000 10.063097698119668 10.00000
10.00000 50.00000 50.70404839090845
50.00000 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.00000 10.00000
10.00000 20.00000 10.00000
4
10.00000 10.063097698119668 10.00000
10.00000 50.00000 50.70404839090845
50.76544467856901 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.00000 10.00000
10.00000 20.00000 10.00000
4
10.699117333378593 10.063097698119668 10.00000
10.00000 50.00000 50.70404839090845
50.76544467856901 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.733652859881403 10.00000
10.00000 20.00000 10.00000
4
10.699117333378593 10.063097698119668 10.00000
10.00000 50.00000 50.70404839090845
50.76544467856901 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.733652859881403 10.00000
10.00000 20.00000 10.00000
4
10.699117333378593 10.879748232123 10.00000
10.00000 50.00000 50.70404839090845
50.76544467856901 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.733652859881403 10.00000
10.00000 20.00000 10.00000
4
11.03531062521475 10.879748232123 10.00000
10.00000 50.00000 50.70404839090845
50.76544467856901 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.733652859881403 10.00000
10.00000 20.00000 10.00000
4
11.03531062521475 10.879748232123 10.00000
10.00000 50.71023844636662 50.70404839090845
50.76544467856901 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.733652859881403 10.00000
10.00000 20.00000 10.00000
4
11.03531062521475 10.879748232123 10.00000
10.00000 51.12714506944212 50.70404839090845
50.76544467856901 10.00000 50.00000
50.00000 50.00000 10.00000
0
 4
10.00000 10.00000 10.00000
20.00000 10.00000 10.00000
20.00000 20.733652859881403 10.00000
10.00000 20.00000 10.00000
4
11.03531062521475 10.879748232123 10.00000
10.00000 51.12714506944212 50.70404839090845
50.76544467856901 10.00000 50.303499161049125
50.00000 50.00000 10.00000
0

7.071068
34.631926
 7.071068
34.735589
 7.071068
34.847332
 7.071068
34.749027
 7.335041
34.749027
 7.335041
34.635882
 7.335041
34.590402
 7.335041
34.697096
 7.335041
34.761707
 7.335041
34.804294

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

```c
N,i,M;double X[30],Y[30],Z[30],cx,cy,cz,d,m;
#define Q(x)(x)*(x)
double D(i){return sqrt(Q(X[i]-cx)+Q(Y[i]-cy)+Q(Z[i]-cz));}
int L(){for(m=i=0;i<N;i++)if(D(i)>m)m=D(i),M=i;return M;}
main(t){for(;scanf("%d",&N),N;printf("%f\n",D(L()))){
	for(i=0;i<N;i++)scanf("%lf%lf%lf",X+i,Y+i,Z+i);
	for(cx=cy=cz=d=0.5;d>1e-8;d/=2)for(t=0;t<100;t++)i=L(),cx+=(X[i]-cx)*d,cy+=(Y[i]-cy)*d,cz+=(Z[i]-cz)*d;
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	X
	.align 32
	.type	X, @object
	.size	X, 240
X:
	.zero	240
	.globl	Y
	.align 32
	.type	Y, @object
	.size	Y, 240
Y:
	.zero	240
	.globl	Z
	.align 32
	.type	Z, @object
	.size	Z, 240
Z:
	.zero	240
	.globl	cx
	.align 8
	.type	cx, @object
	.size	cx, 8
cx:
	.zero	8
	.globl	cy
	.align 8
	.type	cy, @object
	.size	cy, 8
cy:
	.zero	8
	.globl	cz
	.align 8
	.type	cz, @object
	.size	cz, 8
cz:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	m
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.text
	.globl	D
	.type	D, @function
D:
.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
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.globl	L
	.type	L, @function
L:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, i(%rip)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, m(%rip)
	jmp	.L4
.L7:
	movl	i(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movsd	m(%rip), %xmm0
	movq	%rax, %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L5
	movl	i(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movq	%rax, m(%rip)
	movl	i(%rip), %eax
	movl	%eax, M(%rip)
.L5:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	M(%rip), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	L, .-L
	.section	.rodata
.LC1:
	.string	"%lf%lf%lf"
.LC5:
	.string	"%f\n"
.LC6:
	.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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L11
.L18:
	movl	$0, i(%rip)
	jmp	.L12
.L13:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	X(%rip), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, d(%rip)
	movsd	d(%rip), %xmm0
	movsd	%xmm0, cz(%rip)
	movsd	cz(%rip), %xmm0
	movsd	%xmm0, cy(%rip)
	movsd	cy(%rip), %xmm0
	movsd	%xmm0, cx(%rip)
	jmp	.L14
.L17:
	movl	$0, -4(%rbp)
	jmp	.L15
.L16:
	movl	$0, %eax
	call	L
	movl	%eax, i(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cx(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cx(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cy(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cy(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cz(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cz(%rip)
	addl	$1, -4(%rbp)
.L15:
	cmpl	$99, -4(%rbp)
	jle	.L16
	movsd	d(%rip), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, d(%rip)
.L14:
	movsd	d(%rip), %xmm0
	comisd	.LC4(%rip), %xmm0
	ja	.L17
	movl	$0, %eax
	call	L
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
.L11:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	-500134854
	.long	1044740494
	.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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	X
	.align 32
	.type	X, @object
	.size	X, 240
X:
	.zero	240
	.globl	Y
	.align 32
	.type	Y, @object
	.size	Y, 240
Y:
	.zero	240
	.globl	Z
	.align 32
	.type	Z, @object
	.size	Z, 240
Z:
	.zero	240
	.globl	cx
	.align 8
	.type	cx, @object
	.size	cx, 8
cx:
	.zero	8
	.globl	cy
	.align 8
	.type	cy, @object
	.size	cy, 8
cy:
	.zero	8
	.globl	cz
	.align 8
	.type	cz, @object
	.size	cz, 8
cz:
	.zero	8
	.globl	d
	.align 8
	.type	d, @object
	.size	d, 8
d:
	.zero	8
	.globl	m
	.align 8
	.type	m, @object
	.size	m, 8
m:
	.zero	8
	.text
	.globl	D
	.type	D, @function
D:
.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
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	subsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm3
	movapd	%xmm0, %xmm2
	subsd	%xmm3, %xmm2
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm3
	subsd	%xmm3, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.globl	L
	.type	L, @function
L:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, i(%rip)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, m(%rip)
	jmp	.L4
.L7:
	movl	i(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movsd	m(%rip), %xmm0
	movq	%rax, %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L5
	movl	i(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movq	%rax, m(%rip)
	movl	i(%rip), %eax
	movl	%eax, M(%rip)
.L5:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	M(%rip), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	L, .-L
	.section	.rodata
.LC1:
	.string	"%lf%lf%lf"
.LC5:
	.string	"%f\n"
.LC6:
	.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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L11
.L18:
	movl	$0, i(%rip)
	jmp	.L12
.L13:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	X(%rip), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, d(%rip)
	movsd	d(%rip), %xmm0
	movsd	%xmm0, cz(%rip)
	movsd	cz(%rip), %xmm0
	movsd	%xmm0, cy(%rip)
	movsd	cy(%rip), %xmm0
	movsd	%xmm0, cx(%rip)
	jmp	.L14
.L17:
	movl	$0, -4(%rbp)
	jmp	.L15
.L16:
	movl	$0, %eax
	call	L
	movl	%eax, i(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	X(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cx(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cx(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cx(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Y(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cy(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cy(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cy(%rip)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	Z(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movsd	cz(%rip), %xmm2
	movapd	%xmm0, %xmm1
	subsd	%xmm2, %xmm1
	movsd	d(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movsd	cz(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	%xmm0, cz(%rip)
	addl	$1, -4(%rbp)
.L15:
	cmpl	$99, -4(%rbp)
	jle	.L16
	movsd	d(%rip), %xmm0
	movsd	.LC3(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, d(%rip)
.L14:
	movsd	d(%rip), %xmm0
	comisd	.LC4(%rip), %xmm0
	ja	.L17
	movl	$0, %eax
	call	L
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
.L11:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1071644672
	.align 8
.LC3:
	.long	0
	.long	1073741824
	.align 8
.LC4:
	.long	-500134854
	.long	1044740494
	.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:
