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 a,b[10],c,i,j;
	while(1)
	{
		scanf("%d",&a);
		if(a <= 0)break;
		for(i = 0;i <10;i++)b[i] = 0;
		for(i = 0;i < a;i++)
		{
			scanf("%d",&c);
			b[c] += 1;
		}

		for(i = 0;i < 10;i++)
		{
			if(b[i] == 0)
			{
				printf("-");
			}
			else
			{
				for(j = 0;j < b[i];j++)
				{
					printf("*");
				}
			}
			printf("\n");
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.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
	jle	.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
	movl	$45, %edi
	call	putchar@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
.L10:
	movl	$10, %edi
	call	putchar@PLT
	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"
	.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
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movq	$0, 48(%rsp)
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	leaq	12(%rsp), %rbp
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	addl	$1, 16(%rsp,%rax,4)
	cmpl	%ebx, 8(%rsp)
	jg	.L3
	leaq	16(%rsp), %r12
	leaq	56(%rsp), %r15
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$45, %edi
	call	putchar@PLT
.L7:
	movl	$10, %edi
	addq	$4, %r12
	call	putchar@PLT
	cmpq	%r12, %r15
	je	.L9
.L8:
	movl	(%r12), %ebp
	testl	%ebp, %ebp
	je	.L4
	movl	$0, %ebx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$42, %edi
	addl	$1, %ebx
	call	putchar@PLT
	cmpl	%ebx, %ebp
	jne	.L5
	jmp	.L7
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$72, %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
.L18:
	.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"
	.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
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movq	$0, 48(%rsp)
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	leaq	12(%rsp), %rbp
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	addl	$1, 16(%rsp,%rax,4)
	cmpl	%ebx, 8(%rsp)
	jg	.L3
	leaq	16(%rsp), %r12
	leaq	56(%rsp), %r15
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$45, %edi
	call	putchar@PLT
.L7:
	movl	$10, %edi
	addq	$4, %r12
	call	putchar@PLT
	cmpq	%r12, %r15
	je	.L9
.L8:
	movl	(%r12), %ebp
	testl	%ebp, %ebp
	je	.L4
	movl	$0, %ebx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$42, %edi
	addl	$1, %ebx
	call	putchar@PLT
	cmpl	%ebx, %ebp
	jne	.L5
	jmp	.L7
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$72, %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
.L18:
	.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 a,b[10],c,i,j;
	while(1)
	{
		scanf("%d",&a);
		if(a <= 0)break;
		for(i = 0;i <10;i++)b[i] = 0;
		for(i = 0;i < a;i++)
		{
			scanf("%d",&c);
			b[c] += 1;
		}

		for(i = 0;i < 10;i++)
		{
			if(b[i] == 0)
			{
				printf("-");
			}
			else
			{
				for(j = 0;j < b[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 a,b[10],c,i,j;
	while(1)
	{
		scanf("%d",&a);
		if(a <= 0)break;
		for(i = 0;i <10;i++)b[i] = 0;
		for(i = 0;i < a;i++)
		{
			scanf("%d",&c);
			b[c] += 1;
		}

		for(i = 0;i < 10;i++)
		{
			if(b[i] == 0)
			{
				printf("-");
			}
			else
			{
				for(j = 0;j < b[i];j++)
				{
					printf("*");
				}
			}
			printf("\n");
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.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
	jle	.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
	movl	$45, %edi
	call	putchar@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
.L10:
	movl	$10, %edi
	call	putchar@PLT
	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"
	.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
	jle	.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
	movl	$45, %edi
	call	putchar@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
.L10:
	movl	$10, %edi
	call	putchar@PLT
	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:
