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>

int main(void){
	int n, i, j, ice[10], a;
	while (1){
		scanf("%d", &n);
		if (n == 0) break;
		for (i = 0; i < 10; i++)
		ice[i] = 0;
		for (i = 0; i < n; i++){
			scanf("%d", &a);
			ice[a] += 1;
		}
		for (i = 0; i < 10; i++){
			if (ice[i] == 0)
				printf("-\n");
			else {
				for (j = 0; j < ice[i]; j++){
					printf("*");
				}
				printf("\n");
			}
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-56(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$9, -56(%rbp)
	jle	.L5
	movl	$0, -56(%rbp)
	jmp	.L6
.L7:
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-60(%rbp), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L6:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L7
	movl	$0, -56(%rbp)
	jmp	.L8
.L13:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L9:
	movl	$0, -52(%rbp)
	jmp	.L11
.L12:
	movl	$42, %edi
	call	putchar@PLT
	addl	$1, -52(%rbp)
.L11:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L12
	movl	$10, %edi
	call	putchar@PLT
.L10:
	addl	$1, -56(%rbp)
.L8:
	cmpl	$9, -56(%rbp)
	jle	.L13
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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
.LC0:
	.string	"%d"
.LC1:
	.string	"-"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC1(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	$0, 64(%rsp)
	pxor	%xmm0, %xmm0
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	jle	.L3
	xorl	%ebx, %ebx
	leaq	28(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rax
	addl	$1, 32(%rsp,%rax,4)
	cmpl	%ebx, 24(%rsp)
	jg	.L4
.L3:
	leaq	32(%rsp), %rbp
	leaq	72(%rsp), %r12
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rdi
	call	puts@PLT
.L8:
	addq	$4, %rbp
	cmpq	%rbp, %r12
	je	.L10
.L9:
	movl	0(%rbp), %ebx
	testl	%ebx, %ebx
	je	.L5
	movl	$0, %r15d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$42, %edi
	addl	$1, %r15d
	call	putchar@PLT
	cmpl	%r15d, %ebx
	jne	.L6
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$88, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"-"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC1(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	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	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	$0, 64(%rsp)
	pxor	%xmm0, %xmm0
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	jle	.L3
	xorl	%ebx, %ebx
	leaq	28(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rax
	addl	$1, 32(%rsp,%rax,4)
	cmpl	%ebx, 24(%rsp)
	jg	.L4
.L3:
	leaq	32(%rsp), %rbp
	leaq	72(%rsp), %r12
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rdi
	call	puts@PLT
.L8:
	addq	$4, %rbp
	cmpq	%rbp, %r12
	je	.L10
.L9:
	movl	0(%rbp), %ebx
	testl	%ebx, %ebx
	je	.L5
	movl	$0, %r15d
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$42, %edi
	addl	$1, %r15d
	call	putchar@PLT
	cmpl	%r15d, %ebx
	jne	.L6
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$88, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>

int main(void){
	int n, i, j, ice[10], a;
	while (1){
		scanf("%d", &n);
		if (n == 0) break;
		for (i = 0; i < 10; i++)
		ice[i] = 0;
		for (i = 0; i < n; i++){
			scanf("%d", &a);
			ice[a] += 1;
		}
		for (i = 0; i < 10; i++){
			if (ice[i] == 0)
				printf("-\n");
			else {
				for (j = 0; j < ice[i]; j++){
					printf("*");
				}
				printf("\n");
			}
		}
	}
	return 0;
}
15
2
6
7
0
1
9
8
7
3
8
9
4
8
4
2
3
9
1
5
0
 15
2
6
7
0
0
9
8
7
3
8
9
4
8
2
2
3
9
1
5
0
 15
2
6
7
0
1
9
8
7
3
8
9
4
8
4
2
3
9
1
2
0
 15
2
6
7
0
0
9
8
7
3
8
9
8
8
2
2
3
9
1
5
0
 15
2
6
7
0
1
9
8
7
3
8
9
4
8
4
2
3
2
1
2
0
 15
2
6
7
0
0
9
8
7
3
8
9
9
8
2
2
3
9
1
5
0
 15
2
3
7
0
1
9
8
7
3
8
9
4
8
2
2
3
9
1
5
0
 15
2
6
7
0
0
9
8
7
3
8
9
4
8
2
2
3
8
1
5
0
 15
2
6
7
0
1
9
8
7
3
8
6
4
8
4
2
3
9
1
2
0
 15
2
6
7
0
1
9
8
7
3
8
9
5
8
4
2
3
2
1
2
0

*
*
**
*
**
-
*
**
***
**
-
*
-
-
-
*
-
-
-
*
 **
-
***
*
*
-
*
**
***
**
-
*
-
-
-
*
-
-
-
*
 *
*
**
*
**
-
*
**
***
**
-
*
*
-
-
-
-
-
-
*
 **
-
***
*
-
-
*
**
****
**
-
*
-
-
-
*
-
-
-
*
 *
*
**
*
**
-
*
**
***
**
-
*
**
-
-
-
-
-
-
-
 **
-
***
*
-
-
*
**
***
***
-
*
-
-
-
*
-
-
-
*
 *
*
***
**
*
-
-
**
***
**
-
*
-
-
-
*
-
-
-
*
 **
-
***
*
*
-
*
**
***
**
-
*
-
-
-
*
-
-
*
-
 *
*
**
*
**
-
**
**
***
*
-
*
*
-
-
-
-
-
-
*
 *
*
**
*
*
*
*
**
***
**
-
*
**
-
-
-
-
-
-
-

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>

int main(void){
	int n, i, j, ice[10], a;
	while (1){
		scanf("%d", &n);
		if (n == 0) break;
		for (i = 0; i < 10; i++)
		ice[i] = 0;
		for (i = 0; i < n; i++){
			scanf("%d", &a);
			ice[a] += 1;
		}
		for (i = 0; i < 10; i++){
			if (ice[i] == 0)
				printf("-\n");
			else {
				for (j = 0; j < ice[i]; j++){
					printf("*");
				}
				printf("\n");
			}
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-56(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$9, -56(%rbp)
	jle	.L5
	movl	$0, -56(%rbp)
	jmp	.L6
.L7:
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-60(%rbp), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L6:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L7
	movl	$0, -56(%rbp)
	jmp	.L8
.L13:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L9:
	movl	$0, -52(%rbp)
	jmp	.L11
.L12:
	movl	$42, %edi
	call	putchar@PLT
	addl	$1, -52(%rbp)
.L11:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L12
	movl	$10, %edi
	call	putchar@PLT
.L10:
	addl	$1, -56(%rbp)
.L8:
	cmpl	$9, -56(%rbp)
	jle	.L13
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-56(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$9, -56(%rbp)
	jle	.L5
	movl	$0, -56(%rbp)
	jmp	.L6
.L7:
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-60(%rbp), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L6:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L7
	movl	$0, -56(%rbp)
	jmp	.L8
.L13:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L10
.L9:
	movl	$0, -52(%rbp)
	jmp	.L11
.L12:
	movl	$42, %edi
	call	putchar@PLT
	addl	$1, -52(%rbp)
.L11:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L12
	movl	$10, %edi
	call	putchar@PLT
.L10:
	addl	$1, -56(%rbp)
.L8:
	cmpl	$9, -56(%rbp)
	jle	.L13
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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:
