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

```c
sum[3<<17],cnt[3<<17],ans[3<<17];
N,i,acc,t,A;
main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)
	{
		scanf("%d",&A);
		++sum[cnt[A]++];
	}
	i=0;
	for(t=N;t>0;t--)
	{
		while(acc>=i*t)acc+=sum[i++];
		ans[t]=i-1;
	}
	for(i=1;i<=N;i++)printf("%d\n",ans[i]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sum
	.bss
	.align 32
	.type	sum, @object
	.size	sum, 1572864
sum:
	.zero	1572864
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 1572864
cnt:
	.zero	1572864
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 1572864
ans:
	.zero	1572864
	.globl	N
	.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	acc
	.align 4
	.type	acc, @object
	.size	acc, 4
acc:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	leaq	A(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	A(%rip), %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cnt(%rip), %rax
	movl	(%rcx,%rax), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	leaq	cnt(%rip), %rdx
	movl	%ecx, (%rsi,%rdx)
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	sum(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sum(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	$0, i(%rip)
	movl	N(%rip), %eax
	movl	%eax, t(%rip)
	jmp	.L4
.L6:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sum(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	acc(%rip), %eax
	addl	%edx, %eax
	movl	%eax, acc(%rip)
.L5:
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	imull	%eax, %edx
	movl	acc(%rip), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, t(%rip)
.L4:
	movl	t(%rip), %eax
	testl	%eax, %eax
	jg	.L5
	movl	$1, i(%rip)
	jmp	.L8
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	$0, %eax
	popq	%rbp
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	scanf@PLT
	movl	N(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L2
	leaq	A(%rip), %r12
	leaq	cnt(%rip), %r13
	leaq	sum(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	A(%rip), %rdx
	movslq	N(%rip), %r8
	movslq	0(%r13,%rdx,4), %rax
	leal	1(%rax), %ecx
	addl	$1, 0(%rbp,%rax,4)
	movl	i(%rip), %eax
	movl	%ecx, 0(%r13,%rdx,4)
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%r8d, %eax
	jl	.L3
	movl	%r8d, t(%rip)
	testl	%r8d, %r8d
	jle	.L5
	movl	acc(%rip), %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	leaq	ans(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	movl	%r8d, %r10d
	leal	-1(%rdx), %r9d
	imull	%r8d, %eax
	cmpl	%eax, %ecx
	jl	.L10
	movslq	%edx, %rsi
	addl	%r8d, %eax
	leaq	0(%rbp,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	addl	(%rsi), %ecx
	movl	%eax, %edi
	movl	%edx, %r9d
	addq	$4, %rsi
	addl	$1, %edx
	addl	%r10d, %eax
	cmpl	%edi, %ecx
	jge	.L7
	movl	$1, %esi
.L10:
	movl	%r9d, (%rbx,%r8,4)
	subq	$1, %r8
	testl	%r8d, %r8d
	jg	.L6
	movl	$0, t(%rip)
	testb	%sil, %sil
	je	.L5
	movl	%ecx, acc(%rip)
.L5:
	movl	N(%rip), %edx
	movl	$1, %eax
	movl	$1, i(%rip)
	leaq	ans(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	testl	%edx, %edx
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	cltq
	movq	%rbp, %rdi
	movl	(%rbx,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	N(%rip), %eax
	movl	%eax, i(%rip)
	jle	.L12
.L22:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	%eax, t(%rip)
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	A
	.bss
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	acc
	.align 4
	.type	acc, @object
	.size	acc, 4
acc:
	.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
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 1572864
ans:
	.zero	1572864
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 1572864
cnt:
	.zero	1572864
	.globl	sum
	.align 32
	.type	sum, @object
	.size	sum, 1572864
sum:
	.zero	1572864
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	scanf@PLT
	movl	N(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L2
	leaq	A(%rip), %r12
	leaq	cnt(%rip), %r13
	leaq	sum(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	A(%rip), %rdx
	movslq	N(%rip), %r8
	movslq	0(%r13,%rdx,4), %rax
	leal	1(%rax), %ecx
	addl	$1, 0(%rbp,%rax,4)
	movl	i(%rip), %eax
	movl	%ecx, 0(%r13,%rdx,4)
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%r8d, %eax
	jl	.L3
	movl	%r8d, t(%rip)
	testl	%r8d, %r8d
	jle	.L5
	movl	acc(%rip), %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	leaq	ans(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	movl	%r8d, %r10d
	leal	-1(%rdx), %r9d
	imull	%r8d, %eax
	cmpl	%eax, %ecx
	jl	.L10
	movslq	%edx, %rsi
	addl	%r8d, %eax
	leaq	0(%rbp,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	addl	(%rsi), %ecx
	movl	%eax, %edi
	movl	%edx, %r9d
	addq	$4, %rsi
	addl	$1, %edx
	addl	%r10d, %eax
	cmpl	%edi, %ecx
	jge	.L7
	movl	$1, %esi
.L10:
	movl	%r9d, (%rbx,%r8,4)
	subq	$1, %r8
	testl	%r8d, %r8d
	jg	.L6
	movl	$0, t(%rip)
	testb	%sil, %sil
	je	.L5
	movl	%ecx, acc(%rip)
.L5:
	movl	N(%rip), %edx
	movl	$1, %eax
	movl	$1, i(%rip)
	leaq	ans(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	testl	%edx, %edx
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L12:
	cltq
	movq	%rbp, %rdi
	movl	(%rbx,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	N(%rip), %eax
	movl	%eax, i(%rip)
	jle	.L12
.L22:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	%eax, t(%rip)
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	A
	.bss
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	acc
	.align 4
	.type	acc, @object
	.size	acc, 4
acc:
	.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
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 1572864
ans:
	.zero	1572864
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 1572864
cnt:
	.zero	1572864
	.globl	sum
	.align 32
	.type	sum, @object
	.size	sum, 1572864
sum:
	.zero	1572864
	.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:

sum[3<<17],cnt[3<<17],ans[3<<17];
N,i,acc,t,A;
main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)
	{
		scanf("%d",&A);
		++sum[cnt[A]++];
	}
	i=0;
	for(t=N;t>0;t--)
	{
		while(acc>=i*t)acc+=sum[i++];
		ans[t]=i-1;
	}
	for(i=1;i<=N;i++)printf("%d\n",ans[i]);
}
4
1 3 1 3
 4
1 3 3 2
 3
2 2 2
 4
2 3 2 2
 5
1 2 3 3 5
 5
2 2 3 3 5
 4
2 3 4 1
 4
2 2 2 2
 5
4 2 2 4 4
 3
2 2 1

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

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

```c
sum[3<<17],cnt[3<<17],ans[3<<17];
N,i,acc,t,A;
main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)
	{
		scanf("%d",&A);
		++sum[cnt[A]++];
	}
	i=0;
	for(t=N;t>0;t--)
	{
		while(acc>=i*t)acc+=sum[i++];
		ans[t]=i-1;
	}
	for(i=1;i<=N;i++)printf("%d\n",ans[i]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sum
	.bss
	.align 32
	.type	sum, @object
	.size	sum, 1572864
sum:
	.zero	1572864
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 1572864
cnt:
	.zero	1572864
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 1572864
ans:
	.zero	1572864
	.globl	N
	.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	acc
	.align 4
	.type	acc, @object
	.size	acc, 4
acc:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	leaq	A(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	A(%rip), %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cnt(%rip), %rax
	movl	(%rcx,%rax), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	leaq	cnt(%rip), %rdx
	movl	%ecx, (%rsi,%rdx)
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	sum(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sum(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	$0, i(%rip)
	movl	N(%rip), %eax
	movl	%eax, t(%rip)
	jmp	.L4
.L6:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sum(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	acc(%rip), %eax
	addl	%edx, %eax
	movl	%eax, acc(%rip)
.L5:
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	imull	%eax, %edx
	movl	acc(%rip), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, t(%rip)
.L4:
	movl	t(%rip), %eax
	testl	%eax, %eax
	jg	.L5
	movl	$1, i(%rip)
	jmp	.L8
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	$0, %eax
	popq	%rbp
	.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	sum
	.bss
	.align 32
	.type	sum, @object
	.size	sum, 1572864
sum:
	.zero	1572864
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 1572864
cnt:
	.zero	1572864
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 1572864
ans:
	.zero	1572864
	.globl	N
	.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	acc
	.align 4
	.type	acc, @object
	.size	acc, 4
acc:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	leaq	A(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	A(%rip), %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cnt(%rip), %rax
	movl	(%rcx,%rax), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	leaq	cnt(%rip), %rdx
	movl	%ecx, (%rsi,%rdx)
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	sum(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sum(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	$0, i(%rip)
	movl	N(%rip), %eax
	movl	%eax, t(%rip)
	jmp	.L4
.L6:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	sum(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	acc(%rip), %eax
	addl	%edx, %eax
	movl	%eax, acc(%rip)
.L5:
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	imull	%eax, %edx
	movl	acc(%rip), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, t(%rip)
.L4:
	movl	t(%rip), %eax
	testl	%eax, %eax
	jg	.L5
	movl	$1, i(%rip)
	jmp	.L8
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	$0, %eax
	popq	%rbp
	.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:
