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

```c
double p[333][333][333];
n;c[4];i,j,k;
main(a){
	for(;~scanf("%d",&a);)!n?n=a:c[a]++;
	//for(;k<=n;k++)for(j=-1;j++<n;)for(i=-1;i++<n;)
	//for(;k<=n;k++)for(i=j=0;i>n?i=0,j++<n:1;i++)
	for(;i>n?i=0,j++<n?:(j=0,k++<n):1;i++)
	//for(k=0;k<=n;k++)for(j=0;j<=n;j++)for(i=0;i<=n;i++)
	{
		p[i][j][k]=i+j+k?(i*p[i?i-1:i][j][k]+j*p[i+1][j?j-1:j][k]+k*p[i][j+1][k?k-1:k]+n)/(i+j+k):0;
	}
	printf("%.9f",p[c[1]][c[2]][c[3]]);
}
//#define r(i)for(i=-1;i++<n;);r(k)r(j)r(i)
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 295408296
p:
	.zero	295408296
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"%.9f"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L4:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movl	%eax, n(%rip)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L4
	jmp	.L5
.L18:
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	addl	%eax, %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	movl	i(%rip), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L7
	movl	i(%rip), %eax
	subl	$1, %eax
	jmp	.L8
.L7:
	movl	i(%rip), %eax
.L8:
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm0, %xmm1
	movl	j(%rip), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	i(%rip), %eax
	leal	1(%rax), %ecx
	movl	j(%rip), %eax
	testl	%eax, %eax
	je	.L9
	movl	j(%rip), %eax
	subl	$1, %eax
	jmp	.L10
.L9:
	movl	j(%rip), %eax
.L10:
	movl	k(%rip), %edx
	movslq	%edx, %rsi
	movslq	%ecx, %rcx
	movslq	%eax, %rdx
	imulq	$110889, %rcx, %rcx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	k(%rip), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	leal	1(%rax), %ecx
	movl	k(%rip), %eax
	testl	%eax, %eax
	je	.L11
	movl	k(%rip), %eax
	subl	$1, %eax
	jmp	.L12
.L11:
	movl	k(%rip), %eax
.L12:
	movslq	%eax, %rsi
	movslq	%edx, %rax
	movslq	%ecx, %rdx
	imulq	$110889, %rax, %rcx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	n(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	addsd	%xmm1, %xmm0
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	addl	%eax, %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	jmp	.L13
.L6:
	pxor	%xmm0, %xmm0
.L13:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	$0, i(%rip)
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	testl	%eax, %eax
	je	.L15
	testl	%eax, %eax
	setne	%al
	jmp	.L17
.L15:
	movl	$0, j(%rip)
	movl	k(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, k(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	jmp	.L17
.L14:
	movl	$1, %eax
.L17:
	testb	%al, %al
	jne	.L18
	movl	4+c(%rip), %eax
	movl	8+c(%rip), %edx
	movl	12+c(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %xmm0
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%.9f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	c(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L24
	movl	n(%rip), %edx
	movslq	12(%rsp), %rax
	testl	%edx, %edx
	jne	.L3
	movl	%eax, n(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, (%r12,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	movl	j(%rip), %esi
	movl	n(%rip), %r9d
	xorl	%r11d, %r11d
	leaq	p(%rip), %r8
	movl	k(%rip), %edi
	movl	i(%rip), %ecx
	pxor	%xmm2, %xmm2
	leal	1(%rsi), %r10d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L26:
	cmpl	%esi, %r9d
	jg	.L12
	leal	1(%rdi), %eax
	cmpl	%edi, %r9d
	jle	.L25
	movl	%eax, %edi
	movl	$1, %r13d
	xorl	%esi, %esi
	testl	%eax, %eax
	jne	.L19
.L27:
	movl	$1, %ecx
	movapd	%xmm2, %xmm0
	movslq	%edi, %rbx
	movslq	%esi, %rdx
	xorl	%eax, %eax
	leal	1(%rsi), %r10d
.L7:
	imulq	$110889, %rax, %rax
	leaq	(%rdx,%rdx,8), %rbp
	leaq	(%rdx,%rbp,4), %rdx
	leaq	(%rdx,%rdx,8), %rdx
	addq	%rdx, %rax
	addq	%rbx, %rax
	movsd	%xmm0, (%r8,%rax,8)
.L6:
	cmpl	%ecx, %r9d
	jl	.L26
	leal	(%rcx,%rsi), %r12d
	leal	1(%rcx), %edx
	addl	%edi, %r12d
	je	.L14
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	testl	%ecx, %ecx
	je	.L15
	leal	-1(%rcx), %ebp
	movslq	%ecx, %rax
	movl	%r10d, %r13d
	movl	%edx, %ecx
.L8:
	movslq	%esi, %rdx
	movslq	%ebp, %rbp
	movslq	%edi, %rbx
	movslq	%r13d, %r13
	imulq	$110889, %rbp, %rbp
	leaq	(%rdx,%rdx,8), %r14
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%esi, %xmm1
	leaq	(%rdx,%r14,4), %r14
	leaq	(%r14,%r14,8), %r14
	addq	%r14, %rbp
	leal	-1(%rsi), %r14d
	addq	%rbx, %rbp
	testl	%esi, %esi
	mulsd	(%r8,%rbp,8), %xmm0
	cmove	%r11d, %r14d
	movslq	%ecx, %rbp
	imulq	$110889, %rbp, %rbp
	movslq	%r14d, %r14
	leaq	(%r14,%r14,8), %r15
	leaq	(%r14,%r15,4), %r14
	leaq	0(%r13,%r13,8), %r15
	leaq	(%r14,%r14,8), %r14
	leaq	0(%r13,%r15,4), %r13
	addq	%r14, %rbp
	leal	-1(%rdi), %r14d
	leaq	0(%r13,%r13,8), %r13
	addq	%rbx, %rbp
	testl	%edi, %edi
	mulsd	(%r8,%rbp,8), %xmm1
	cmove	%r11d, %r14d
	imulq	$110889, %rax, %rbp
	movslq	%r14d, %r14
	addq	%r13, %rbp
	addsd	%xmm0, %xmm1
	addq	%r14, %rbp
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm0
	mulsd	(%r8,%rbp,8), %xmm0
	addsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r9d, %xmm1
	addsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r12d, %xmm1
	divsd	%xmm1, %xmm0
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rdi,%r10), %eax
	leal	2(%rsi), %r13d
	movl	%r10d, %esi
	testl	%eax, %eax
	je	.L27
.L19:
	movl	%eax, %r12d
	movl	$1, %ecx
	movapd	%xmm2, %xmm0
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	leal	1(%rsi), %r10d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%ecx, %rax
	movapd	%xmm2, %xmm0
	movl	%edx, %ecx
	movslq	%edi, %rbx
	movslq	%esi, %rdx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L25:
	movslq	8+c(%rip), %rdx
	movl	%eax, k(%rip)
	leaq	.LC2(%rip), %rdi
	movslq	4+c(%rip), %rax
	movslq	12+c(%rip), %rcx
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	leaq	(%rdx,%rdx,8), %rsi
	imulq	$110889, %rax, %rax
	leaq	(%rdx,%rsi,4), %rdx
	leaq	(%rdx,%rdx,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	movsd	(%r8,%rax,8), %xmm0
	movl	$1, %eax
	call	printf@PLT
	addq	$24, %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
.L15:
	.cfi_restore_state
	movl	%r10d, %r13d
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	movl	$1, %ecx
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 295408296
p:
	.zero	295408296
	.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"
.LC2:
	.string	"%.9f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	c(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L24
	movl	n(%rip), %edx
	movslq	12(%rsp), %rax
	testl	%edx, %edx
	jne	.L3
	movl	%eax, n(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, (%r12,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	movl	j(%rip), %esi
	movl	n(%rip), %r9d
	xorl	%r11d, %r11d
	leaq	p(%rip), %r8
	movl	k(%rip), %edi
	movl	i(%rip), %ecx
	pxor	%xmm2, %xmm2
	leal	1(%rsi), %r10d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L26:
	cmpl	%esi, %r9d
	jg	.L12
	leal	1(%rdi), %eax
	cmpl	%edi, %r9d
	jle	.L25
	movl	%eax, %edi
	movl	$1, %r13d
	xorl	%esi, %esi
	testl	%eax, %eax
	jne	.L19
.L27:
	movl	$1, %ecx
	movapd	%xmm2, %xmm0
	movslq	%edi, %rbx
	movslq	%esi, %rdx
	xorl	%eax, %eax
	leal	1(%rsi), %r10d
.L7:
	imulq	$110889, %rax, %rax
	leaq	(%rdx,%rdx,8), %rbp
	leaq	(%rdx,%rbp,4), %rdx
	leaq	(%rdx,%rdx,8), %rdx
	addq	%rdx, %rax
	addq	%rbx, %rax
	movsd	%xmm0, (%r8,%rax,8)
.L6:
	cmpl	%ecx, %r9d
	jl	.L26
	leal	(%rcx,%rsi), %r12d
	leal	1(%rcx), %edx
	addl	%edi, %r12d
	je	.L14
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	testl	%ecx, %ecx
	je	.L15
	leal	-1(%rcx), %ebp
	movslq	%ecx, %rax
	movl	%r10d, %r13d
	movl	%edx, %ecx
.L8:
	movslq	%esi, %rdx
	movslq	%ebp, %rbp
	movslq	%edi, %rbx
	movslq	%r13d, %r13
	imulq	$110889, %rbp, %rbp
	leaq	(%rdx,%rdx,8), %r14
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%esi, %xmm1
	leaq	(%rdx,%r14,4), %r14
	leaq	(%r14,%r14,8), %r14
	addq	%r14, %rbp
	leal	-1(%rsi), %r14d
	addq	%rbx, %rbp
	testl	%esi, %esi
	mulsd	(%r8,%rbp,8), %xmm0
	cmove	%r11d, %r14d
	movslq	%ecx, %rbp
	imulq	$110889, %rbp, %rbp
	movslq	%r14d, %r14
	leaq	(%r14,%r14,8), %r15
	leaq	(%r14,%r15,4), %r14
	leaq	0(%r13,%r13,8), %r15
	leaq	(%r14,%r14,8), %r14
	leaq	0(%r13,%r15,4), %r13
	addq	%r14, %rbp
	leal	-1(%rdi), %r14d
	leaq	0(%r13,%r13,8), %r13
	addq	%rbx, %rbp
	testl	%edi, %edi
	mulsd	(%r8,%rbp,8), %xmm1
	cmove	%r11d, %r14d
	imulq	$110889, %rax, %rbp
	movslq	%r14d, %r14
	addq	%r13, %rbp
	addsd	%xmm0, %xmm1
	addq	%r14, %rbp
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm0
	mulsd	(%r8,%rbp,8), %xmm0
	addsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r9d, %xmm1
	addsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r12d, %xmm1
	divsd	%xmm1, %xmm0
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rdi,%r10), %eax
	leal	2(%rsi), %r13d
	movl	%r10d, %esi
	testl	%eax, %eax
	je	.L27
.L19:
	movl	%eax, %r12d
	movl	$1, %ecx
	movapd	%xmm2, %xmm0
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	leal	1(%rsi), %r10d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%ecx, %rax
	movapd	%xmm2, %xmm0
	movl	%edx, %ecx
	movslq	%edi, %rbx
	movslq	%esi, %rdx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L25:
	movslq	8+c(%rip), %rdx
	movl	%eax, k(%rip)
	leaq	.LC2(%rip), %rdi
	movslq	4+c(%rip), %rax
	movslq	12+c(%rip), %rcx
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	leaq	(%rdx,%rdx,8), %rsi
	imulq	$110889, %rax, %rax
	leaq	(%rdx,%rsi,4), %rdx
	leaq	(%rdx,%rdx,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	movsd	(%r8,%rax,8), %xmm0
	movl	$1, %eax
	call	printf@PLT
	addq	$24, %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
.L15:
	.cfi_restore_state
	movl	%r10d, %r13d
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	movl	$1, %ecx
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 295408296
p:
	.zero	295408296
	.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:

double p[333][333][333];
n;c[4];i,j,k;
main(a){
	for(;~scanf("%d",&a);)!n?n=a:c[a]++;
	//for(;k<=n;k++)for(j=-1;j++<n;)for(i=-1;i++<n;)
	//for(;k<=n;k++)for(i=j=0;i>n?i=0,j++<n:1;i++)
	for(;i>n?i=0,j++<n?:(j=0,k++<n):1;i++)
	//for(k=0;k<=n;k++)for(j=0;j<=n;j++)for(i=0;i<=n;i++)
	{
		p[i][j][k]=i+j+k?(i*p[i?i-1:i][j][k]+j*p[i+1][j?j-1:j][k]+k*p[i][j+1][k?k-1:k]+n)/(i+j+k):0;
	}
	printf("%.9f",p[c[1]][c[2]][c[3]]);
}
//#define r(i)for(i=-1;i++<n;);r(k)r(j)r(i)

1
1
 3
1 2 1
 3
2 2 1
 2
1 3
 1
2
 3
2 3 1
 2
1 1
 10
1 3 2 2 3 2 3 2 1 3
 2
2 1
 3
2 2 2

1.000000000 7.333333333 8.638888889 6.250000000 2.000000000 10.548611111 3.000000000 52.864392304 4.500000000 9.638888889
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
double p[333][333][333];
n;c[4];i,j,k;
main(a){
	for(;~scanf("%d",&a);)!n?n=a:c[a]++;
	//for(;k<=n;k++)for(j=-1;j++<n;)for(i=-1;i++<n;)
	//for(;k<=n;k++)for(i=j=0;i>n?i=0,j++<n:1;i++)
	for(;i>n?i=0,j++<n?:(j=0,k++<n):1;i++)
	//for(k=0;k<=n;k++)for(j=0;j<=n;j++)for(i=0;i<=n;i++)
	{
		p[i][j][k]=i+j+k?(i*p[i?i-1:i][j][k]+j*p[i+1][j?j-1:j][k]+k*p[i][j+1][k?k-1:k]+n)/(i+j+k):0;
	}
	printf("%.9f",p[c[1]][c[2]][c[3]]);
}
//#define r(i)for(i=-1;i++<n;);r(k)r(j)r(i)
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 295408296
p:
	.zero	295408296
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"%.9f"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L4:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movl	%eax, n(%rip)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L4
	jmp	.L5
.L18:
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	addl	%eax, %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	movl	i(%rip), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L7
	movl	i(%rip), %eax
	subl	$1, %eax
	jmp	.L8
.L7:
	movl	i(%rip), %eax
.L8:
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm0, %xmm1
	movl	j(%rip), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	i(%rip), %eax
	leal	1(%rax), %ecx
	movl	j(%rip), %eax
	testl	%eax, %eax
	je	.L9
	movl	j(%rip), %eax
	subl	$1, %eax
	jmp	.L10
.L9:
	movl	j(%rip), %eax
.L10:
	movl	k(%rip), %edx
	movslq	%edx, %rsi
	movslq	%ecx, %rcx
	movslq	%eax, %rdx
	imulq	$110889, %rcx, %rcx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	k(%rip), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	leal	1(%rax), %ecx
	movl	k(%rip), %eax
	testl	%eax, %eax
	je	.L11
	movl	k(%rip), %eax
	subl	$1, %eax
	jmp	.L12
.L11:
	movl	k(%rip), %eax
.L12:
	movslq	%eax, %rsi
	movslq	%edx, %rax
	movslq	%ecx, %rdx
	imulq	$110889, %rax, %rcx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	n(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	addsd	%xmm1, %xmm0
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	addl	%eax, %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	jmp	.L13
.L6:
	pxor	%xmm0, %xmm0
.L13:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	$0, i(%rip)
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	testl	%eax, %eax
	je	.L15
	testl	%eax, %eax
	setne	%al
	jmp	.L17
.L15:
	movl	$0, j(%rip)
	movl	k(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, k(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	jmp	.L17
.L14:
	movl	$1, %eax
.L17:
	testb	%al, %al
	jne	.L18
	movl	4+c(%rip), %eax
	movl	8+c(%rip), %edx
	movl	12+c(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %xmm0
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 295408296
p:
	.zero	295408296
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 16
	.type	c, @object
	.size	c, 16
c:
	.zero	16
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"%.9f"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L4:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movl	%eax, n(%rip)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L4
	jmp	.L5
.L18:
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	addl	%eax, %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	movl	i(%rip), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L7
	movl	i(%rip), %eax
	subl	$1, %eax
	jmp	.L8
.L7:
	movl	i(%rip), %eax
.L8:
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm0, %xmm1
	movl	j(%rip), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	i(%rip), %eax
	leal	1(%rax), %ecx
	movl	j(%rip), %eax
	testl	%eax, %eax
	je	.L9
	movl	j(%rip), %eax
	subl	$1, %eax
	jmp	.L10
.L9:
	movl	j(%rip), %eax
.L10:
	movl	k(%rip), %edx
	movslq	%edx, %rsi
	movslq	%ecx, %rcx
	movslq	%eax, %rdx
	imulq	$110889, %rcx, %rcx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	k(%rip), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	leal	1(%rax), %ecx
	movl	k(%rip), %eax
	testl	%eax, %eax
	je	.L11
	movl	k(%rip), %eax
	subl	$1, %eax
	jmp	.L12
.L11:
	movl	k(%rip), %eax
.L12:
	movslq	%eax, %rsi
	movslq	%edx, %rax
	movslq	%ecx, %rdx
	imulq	$110889, %rax, %rcx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm0, %xmm1
	movl	n(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	addsd	%xmm1, %xmm0
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	addl	%eax, %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	jmp	.L13
.L6:
	pxor	%xmm0, %xmm0
.L13:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	$0, i(%rip)
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	testl	%eax, %eax
	je	.L15
	testl	%eax, %eax
	setne	%al
	jmp	.L17
.L15:
	movl	$0, j(%rip)
	movl	k(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, k(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	jmp	.L17
.L14:
	movl	$1, %eax
.L17:
	testb	%al, %al
	jne	.L18
	movl	4+c(%rip), %eax
	movl	8+c(%rip), %edx
	movl	12+c(%rip), %ecx
	movslq	%ecx, %rcx
	cltq
	movslq	%edx, %rdx
	imulq	$110889, %rax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	addq	%rdx, %rax
	addq	%rsi, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %xmm0
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
