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

```c
#include <stdio.h>

int main(void)
{
	int n;
	int age;
	int a_g[7] = {0};
	int i;
	
	while (1) {
		
		scanf("%d", &n);
		
		if (n == 0) {
			break;
		}
		else {
			for (i = 0; i < n; i++) {
				
				scanf("%d", &age);
				
				if ((age >= 0) && (age <= 9)) {
					a_g[0]++;
				}
				
				else if ((age >= 10) && (age <= 19)) {
					a_g[1]++;
				}
				
				else if ((age >= 20) && (age <= 29)) {
					a_g[2]++;
				}
				
				else if ((age >= 30) && (age <= 39)) {
					a_g[3]++;
				}
				
				else if ((age >= 40) && (age <= 49)) {
					a_g[4]++;
				}
				
				else if ((age >= 50) && (age <= 59)) {
					a_g[5]++;
				}
				
				else if (age >= 60) {
					a_g[6]++;
				}
			}
		}
		for (i = 0; i < 7; i++){
			printf("%d\n", a_g[i]);
			a_g[i] = 0;
		}
	}
	
	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	pxor	%xmm0, %xmm0
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.L9(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$0, 56(%rsp)
	leaq	28(%rsp), %r12
	movq	$0, 48(%rsp)
	movq	%rax, 8(%rsp)
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L15:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	32(%rsp), %r13d
	movl	$0, %r15d
	jg	.L3
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %r13d
	movl	%r13d, 32(%rsp)
.L6:
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jle	.L14
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$9, %eax
	jbe	.L23
	leal	-10(%rax), %ecx
	cmpl	$49, %ecx
	ja	.L7
	movslq	0(%rbp,%rcx,4), %rax
	addq	%rbp, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L9:
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, 48(%rsp)
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jg	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	32(%rsp), %r15
	leaq	60(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%r15), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__printf_chk@PLT
	movl	$0, -4(%r15)
	cmpq	%r15, %r13
	jne	.L4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, 44(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, 40(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, 36(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, 52(%rsp)
	jmp	.L6
.L7:
	cmpl	$59, %eax
	jle	.L6
	addl	$1, 56(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	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
.L24:
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	pxor	%xmm0, %xmm0
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.L9(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$0, 56(%rsp)
	leaq	28(%rsp), %r12
	movq	$0, 48(%rsp)
	movq	%rax, 8(%rsp)
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L15:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	32(%rsp), %r13d
	movl	$0, %r15d
	jg	.L3
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %r13d
	movl	%r13d, 32(%rsp)
.L6:
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jle	.L14
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$9, %eax
	jbe	.L23
	leal	-10(%rax), %ecx
	cmpl	$49, %ecx
	ja	.L7
	movslq	0(%rbp,%rcx,4), %rax
	addq	%rbp, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L9:
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, 48(%rsp)
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jg	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	32(%rsp), %r15
	leaq	60(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%r15), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__printf_chk@PLT
	movl	$0, -4(%r15)
	cmpq	%r15, %r13
	jne	.L4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, 44(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, 40(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, 36(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, 52(%rsp)
	jmp	.L6
.L7:
	cmpl	$59, %eax
	jle	.L6
	addl	$1, 56(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	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
.L24:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	pxor	%xmm0, %xmm0
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.L9(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$0, 56(%rsp)
	leaq	28(%rsp), %r12
	movq	$0, 48(%rsp)
	movq	%rax, 8(%rsp)
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L15:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	32(%rsp), %r13d
	movl	$0, %r15d
	jg	.L3
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %r13d
	movl	%r13d, 32(%rsp)
.L6:
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jle	.L14
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$9, %eax
	jbe	.L23
	leal	-10(%rax), %ecx
	cmpl	$49, %ecx
	ja	.L7
	movslq	0(%rbp,%rcx,4), %rax
	addq	%rbp, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L9:
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, 48(%rsp)
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jg	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	32(%rsp), %r15
	leaq	60(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%r15), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__printf_chk@PLT
	movl	$0, -4(%r15)
	cmpq	%r15, %r13
	jne	.L4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, 44(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, 40(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, 36(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, 52(%rsp)
	jmp	.L6
.L7:
	cmpl	$59, %eax
	jle	.L6
	addl	$1, 56(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	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
.L24:
	.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:
```
```c
#include <stdio.h>

int main(void)
{
	int n;
	int age;
	int a_g[7] = {0};
	int i;
	
	while (1) {
		
		scanf("%d", &n);
		
		if (n == 0) {
			break;
		}
		else {
			for (i = 0; i < n; i++) {
				
				scanf("%d", &age);
				
				if ((age >= 0) && (age <= 9)) {
					a_g[0]++;
				}
				
				else if ((age >= 10) && (age <= 19)) {
					a_g[1]++;
				}
				
				else if ((age >= 20) && (age <= 29)) {
					a_g[2]++;
				}
				
				else if ((age >= 30) && (age <= 39)) {
					a_g[3]++;
				}
				
				else if ((age >= 40) && (age <= 49)) {
					a_g[4]++;
				}
				
				else if ((age >= 50) && (age <= 59)) {
					a_g[5]++;
				}
				
				else if (age >= 60) {
					a_g[6]++;
				}
			}
		}
		for (i = 0; i < 7; i++){
			printf("%d\n", a_g[i]);
			a_g[i] = 0;
		}
	}
	
	return (0);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(void)
{
	int n;
	int age;
	int a_g[7] = {0};
	int i;
	
	while (1) {
		
		scanf("%d", &n);
		
		if (n == 0) {
			break;
		}
		else {
			for (i = 0; i < n; i++) {
				
				scanf("%d", &age);
				
				if ((age >= 0) && (age <= 9)) {
					a_g[0]++;
				}
				
				else if ((age >= 10) && (age <= 19)) {
					a_g[1]++;
				}
				
				else if ((age >= 20) && (age <= 29)) {
					a_g[2]++;
				}
				
				else if ((age >= 30) && (age <= 39)) {
					a_g[3]++;
				}
				
				else if ((age >= 40) && (age <= 49)) {
					a_g[4]++;
				}
				
				else if ((age >= 50) && (age <= 59)) {
					a_g[5]++;
				}
				
				else if (age >= 60) {
					a_g[6]++;
				}
			}
		}
		for (i = 0; i < 7; i++){
			printf("%d\n", a_g[i]);
			a_g[i] = 0;
		}
	}
	
	return (0);
}```

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.
Optimized Assembly Code:

8
71
34
65
11
41
39
3
5
4
67
81
78
65
0
 8
71
34
65
11
12
39
6
5
4
67
81
78
65
0
 8
71
34
65
0
41
39
3
5
4
67
81
78
65
0
 8
71
34
65
11
12
39
6
5
4
16
81
78
65
0
 8
71
34
65
0
41
39
3
5
4
67
81
78
21
0
 8
71
34
65
11
1
39
6
5
4
16
81
78
65
0
 8
71
67
65
0
41
39
3
5
4
67
81
78
21
0
 8
71
34
65
11
37
39
6
5
4
67
81
78
65
0
 8
71
34
65
0
41
39
3
5
4
67
13
78
21
0
 8
71
67
65
0
41
7
3
5
4
67
81
78
21
0

2
1
0
2
1
0
2
0
0
0
0
0
0
4
 2
2
0
2
0
0
2
0
0
0
0
0
0
4
 3
0
0
2
1
0
2
0
0
0
0
0
0
4
 2
2
0
2
0
0
2
0
1
0
0
0
0
3
 3
0
0
2
1
0
2
0
0
1
0
0
0
3
 3
1
0
2
0
0
2
0
1
0
0
0
0
3
 3
0
0
1
1
0
3
0
0
1
0
0
0
3
 2
1
0
3
0
0
2
0
0
0
0
0
0
4
 3
0
0
2
1
0
2
0
1
1
0
0
0
2
 4
0
0
0
1
0
3
0
0
1
0
0
0
3

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

```c
#include <stdio.h>

int main(void)
{
	int n;
	int age;
	int a_g[7] = {0};
	int i;
	
	while (1) {
		
		scanf("%d", &n);
		
		if (n == 0) {
			break;
		}
		else {
			for (i = 0; i < n; i++) {
				
				scanf("%d", &age);
				
				if ((age >= 0) && (age <= 9)) {
					a_g[0]++;
				}
				
				else if ((age >= 10) && (age <= 19)) {
					a_g[1]++;
				}
				
				else if ((age >= 20) && (age <= 29)) {
					a_g[2]++;
				}
				
				else if ((age >= 30) && (age <= 39)) {
					a_g[3]++;
				}
				
				else if ((age >= 40) && (age <= 49)) {
					a_g[4]++;
				}
				
				else if ((age >= 50) && (age <= 59)) {
					a_g[5]++;
				}
				
				else if (age >= 60) {
					a_g[6]++;
				}
			}
		}
		for (i = 0; i < 7; i++){
			printf("%d\n", a_g[i]);
			a_g[i] = 0;
		}
	}
	
	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	pxor	%xmm0, %xmm0
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.L9(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$0, 56(%rsp)
	leaq	28(%rsp), %r12
	movq	$0, 48(%rsp)
	movq	%rax, 8(%rsp)
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L15:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	32(%rsp), %r13d
	movl	$0, %r15d
	jg	.L3
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %r13d
	movl	%r13d, 32(%rsp)
.L6:
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jle	.L14
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$9, %eax
	jbe	.L23
	leal	-10(%rax), %ecx
	cmpl	$49, %ecx
	ja	.L7
	movslq	0(%rbp,%rcx,4), %rax
	addq	%rbp, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L9:
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, 48(%rsp)
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jg	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	32(%rsp), %r15
	leaq	60(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%r15), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__printf_chk@PLT
	movl	$0, -4(%r15)
	cmpq	%r15, %r13
	jne	.L4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, 44(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, 40(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, 36(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, 52(%rsp)
	jmp	.L6
.L7:
	cmpl	$59, %eax
	jle	.L6
	addl	$1, 56(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	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
.L24:
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	pxor	%xmm0, %xmm0
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.L9(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$0, 56(%rsp)
	leaq	28(%rsp), %r12
	movq	$0, 48(%rsp)
	movq	%rax, 8(%rsp)
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L15:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movl	32(%rsp), %r13d
	movl	$0, %r15d
	jg	.L3
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %r13d
	movl	%r13d, 32(%rsp)
.L6:
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jle	.L14
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$9, %eax
	jbe	.L23
	leal	-10(%rax), %ecx
	cmpl	$49, %ecx
	ja	.L7
	movslq	0(%rbp,%rcx,4), %rax
	addq	%rbp, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L9:
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L13-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L12-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L11-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L10-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.long	.L8-.L9
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, 48(%rsp)
	addl	$1, %r15d
	cmpl	%r15d, 24(%rsp)
	jg	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	32(%rsp), %r15
	leaq	60(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%r15), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__printf_chk@PLT
	movl	$0, -4(%r15)
	cmpq	%r15, %r13
	jne	.L4
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, 44(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, 40(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, 36(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, 52(%rsp)
	jmp	.L6
.L7:
	cmpl	$59, %eax
	jle	.L6
	addl	$1, 56(%rsp)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	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
.L24:
	.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:
```