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

```c
char buf[2<<20],out[6];
sz;
cnt[1<<20];
main()
{
	read(0,buf,2<<20);
	int N=0;
	for(;;)
	{
		char k=buf[sz++];
		if(k<'0')break;
		N=N*10+k-'0';
	}
	for(int i=0;i<N;i++)
	{
		int A=0;
		for(;;)
		{
			char k=buf[sz++];
			if(k<'0')break;
			A=A*10+k-'0';
		}
		cnt[A]++;
	}
	int ans=0;
	for(int i=1;i<=1000000;i++)
	{
		if(cnt[i])
		{
			ans+=cnt[i]<2;
			for(int j=i+i;j<=1000000;j+=i)cnt[j]=0;
		}
	}
	int osz=6;
	do{
		out[--osz]=ans%10+'0';
	}while(ans/=10);
	write(1,out+osz,6-osz);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 2097152
buf:
	.zero	2097152
	.globl	out
	.type	out, @object
	.size	out, 6
out:
	.zero	6
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 4194304
cnt:
	.zero	4194304
	.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	$32, %rsp
	movl	$2097152, %edx
	leaq	buf(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$0, %eax
	call	read@PLT
	movl	$0, -28(%rbp)
.L4:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	buf(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -30(%rbp)
	cmpb	$47, -30(%rbp)
	jle	.L19
	movl	-28(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-30(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -28(%rbp)
	jmp	.L4
.L19:
	nop
	movl	$0, -24(%rbp)
	jmp	.L5
.L9:
	movl	$0, -20(%rbp)
.L8:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	buf(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -29(%rbp)
	cmpb	$47, -29(%rbp)
	jle	.L20
	movl	-20(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-29(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L20:
	nop
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L9
	movl	$0, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L10
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	setle	%al
	movzbl	%al, %eax
	addl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-12(%rbp), %eax
	addl	%eax, -8(%rbp)
.L12:
	cmpl	$1000000, -8(%rbp)
	jle	.L13
.L11:
	addl	$1, -12(%rbp)
.L10:
	cmpl	$1000000, -12(%rbp)
	jle	.L14
	movl	$6, -4(%rbp)
.L15:
	movl	-16(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	addl	$48, %eax
	subl	$1, -4(%rbp)
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	out(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	jne	.L15
	movl	$6, %eax
	subl	-4(%rbp), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	out(%rip), %rcx
	addq	%rdx, %rcx
	movl	%eax, %edx
	movq	%rcx, %rsi
	movl	$1, %edi
	movl	$0, %eax
	call	write@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	.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
	movl	$2097152, %edx
	xorl	%edi, %edi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	cnt(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	buf(%rip), %rbx
	movq	%rbx, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	read@PLT
	movl	sz(%rip), %edx
	leal	1(%rdx), %eax
	movl	%eax, sz(%rip)
	movslq	%edx, %rax
	movsbl	(%rbx,%rax), %eax
	cmpb	$47, %al
	jle	.L3
	addl	$2, %edx
	xorl	%r8d, %r8d
	leaq	-2+buf(%rip), %rdi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %esi
	addq	$1, %rdx
	leal	-48(%rax,%rcx,2), %r8d
	movsbl	(%rdi,%rdx), %eax
	cmpb	$47, %al
	jg	.L7
	movl	%esi, sz(%rip)
	xorl	%r9d, %r9d
	leaq	cnt(%rip), %r12
	testl	%r8d, %r8d
	je	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%esi, %rax
	leal	1(%rsi), %edx
	movsbl	(%rbx,%rax), %eax
	cmpb	$47, %al
	jle	.L35
	addl	$2, %esi
	xorl	%ecx, %ecx
	movslq	%esi, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	leal	(%rcx,%rcx,4), %ecx
	movl	%edx, %esi
	addq	$1, %rdx
	leal	-48(%rax,%rcx,2), %ecx
	movsbl	(%rdi,%rdx), %eax
	cmpb	$47, %al
	jg	.L8
.L10:
	movslq	%ecx, %rcx
	addl	$1, %r9d
	addl	$1, (%r12,%rcx,4)
	cmpl	%r9d, %r8d
	jne	.L4
	movl	%esi, sz(%rip)
.L3:
	movl	$2, %ebp
	movl	$1, %ebx
	xorl	%r13d, %r13d
	leaq	8+cnt(%rip), %rcx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rbx
	addq	$2, %rbp
	cmpq	$1000001, %rbx
	je	.L36
.L16:
	movl	(%r12,%rbx,4), %eax
	testl	%eax, %eax
	je	.L12
	cmpl	$1, %eax
	setle	%al
	movzbl	%al, %eax
	addl	%eax, %r13d
	cmpq	$1000000, %rbp
	ja	.L12
	cmpq	$1, %rbx
	jne	.L37
	movl	$1000000, %eax
	movq	%rcx, %rdi
	xorl	%esi, %esi
	subl	%ebp, %eax
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rbp, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	$0, (%r12,%rax,4)
	addq	%rbx, %rax
	cmpl	$1000000, %eax
	jle	.L14
	jmp	.L12
.L36:
	movl	%r13d, %edx
	movl	$3435973837, %esi
	imulq	%rsi, %rdx
	shrq	$35, %rdx
	leal	(%rdx,%rdx,4), %eax
	addl	%eax, %eax
	subl	%eax, %r13d
	leal	48(%r13), %eax
	movb	%al, 5+out(%rip)
	testl	%edx, %edx
	je	.L20
	movl	%edx, %ecx
	imulq	%rsi, %rcx
	shrq	$35, %rcx
	leal	(%rcx,%rcx,4), %eax
	addl	%eax, %eax
	subl	%eax, %edx
	leal	48(%rdx), %eax
	movb	%al, 4+out(%rip)
	testl	%ecx, %ecx
	je	.L21
	movl	%ecx, %eax
	imulq	%rsi, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %ecx
	leal	48(%rcx), %edx
	movb	%dl, 3+out(%rip)
	testl	%eax, %eax
	je	.L22
	movl	$10, %ecx
	cltd
	idivl	%ecx
	addl	$48, %edx
	movb	%dl, 2+out(%rip)
	testl	%eax, %eax
	je	.L23
	cltd
	idivl	%ecx
	addl	$48, %edx
	movb	%dl, 1+out(%rip)
	testl	%eax, %eax
	je	.L24
	cltd
	idivl	%ecx
	xorl	%eax, %eax
	addl	$48, %edx
	movb	%dl, out(%rip)
.L17:
	leaq	out(%rip), %rcx
	movl	$6, %edx
	movl	$1, %edi
	subl	%eax, %edx
	leaq	(%rax,%rcx), %rsi
	xorl	%eax, %eax
	call	write@PLT
	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
.L35:
	.cfi_restore_state
	movl	%edx, %esi
	xorl	%ecx, %ecx
	jmp	.L10
.L23:
	movl	$2, %eax
	jmp	.L17
.L20:
	movl	$5, %eax
	jmp	.L17
.L21:
	movl	$4, %eax
	jmp	.L17
.L22:
	movl	$3, %eax
	jmp	.L17
.L24:
	movl	$1, %eax
	jmp	.L17
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 4194304
cnt:
	.zero	4194304
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	out
	.type	out, @object
	.size	out, 6
out:
	.zero	6
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 2097152
buf:
	.zero	2097152
	.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	.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
	movl	$2097152, %edx
	xorl	%edi, %edi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	cnt(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	buf(%rip), %rbx
	movq	%rbx, %rsi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	read@PLT
	movl	sz(%rip), %edx
	leal	1(%rdx), %eax
	movl	%eax, sz(%rip)
	movslq	%edx, %rax
	movsbl	(%rbx,%rax), %eax
	cmpb	$47, %al
	jle	.L3
	addl	$2, %edx
	xorl	%r8d, %r8d
	leaq	-2+buf(%rip), %rdi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %esi
	addq	$1, %rdx
	leal	-48(%rax,%rcx,2), %r8d
	movsbl	(%rdi,%rdx), %eax
	cmpb	$47, %al
	jg	.L7
	movl	%esi, sz(%rip)
	xorl	%r9d, %r9d
	leaq	cnt(%rip), %r12
	testl	%r8d, %r8d
	je	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%esi, %rax
	leal	1(%rsi), %edx
	movsbl	(%rbx,%rax), %eax
	cmpb	$47, %al
	jle	.L35
	addl	$2, %esi
	xorl	%ecx, %ecx
	movslq	%esi, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	leal	(%rcx,%rcx,4), %ecx
	movl	%edx, %esi
	addq	$1, %rdx
	leal	-48(%rax,%rcx,2), %ecx
	movsbl	(%rdi,%rdx), %eax
	cmpb	$47, %al
	jg	.L8
.L10:
	movslq	%ecx, %rcx
	addl	$1, %r9d
	addl	$1, (%r12,%rcx,4)
	cmpl	%r9d, %r8d
	jne	.L4
	movl	%esi, sz(%rip)
.L3:
	movl	$2, %ebp
	movl	$1, %ebx
	xorl	%r13d, %r13d
	leaq	8+cnt(%rip), %rcx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rbx
	addq	$2, %rbp
	cmpq	$1000001, %rbx
	je	.L36
.L16:
	movl	(%r12,%rbx,4), %eax
	testl	%eax, %eax
	je	.L12
	cmpl	$1, %eax
	setle	%al
	movzbl	%al, %eax
	addl	%eax, %r13d
	cmpq	$1000000, %rbp
	ja	.L12
	cmpq	$1, %rbx
	jne	.L37
	movl	$1000000, %eax
	movq	%rcx, %rdi
	xorl	%esi, %esi
	subl	%ebp, %eax
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rbp, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	$0, (%r12,%rax,4)
	addq	%rbx, %rax
	cmpl	$1000000, %eax
	jle	.L14
	jmp	.L12
.L36:
	movl	%r13d, %edx
	movl	$3435973837, %esi
	imulq	%rsi, %rdx
	shrq	$35, %rdx
	leal	(%rdx,%rdx,4), %eax
	addl	%eax, %eax
	subl	%eax, %r13d
	leal	48(%r13), %eax
	movb	%al, 5+out(%rip)
	testl	%edx, %edx
	je	.L20
	movl	%edx, %ecx
	imulq	%rsi, %rcx
	shrq	$35, %rcx
	leal	(%rcx,%rcx,4), %eax
	addl	%eax, %eax
	subl	%eax, %edx
	leal	48(%rdx), %eax
	movb	%al, 4+out(%rip)
	testl	%ecx, %ecx
	je	.L21
	movl	%ecx, %eax
	imulq	%rsi, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %ecx
	leal	48(%rcx), %edx
	movb	%dl, 3+out(%rip)
	testl	%eax, %eax
	je	.L22
	movl	$10, %ecx
	cltd
	idivl	%ecx
	addl	$48, %edx
	movb	%dl, 2+out(%rip)
	testl	%eax, %eax
	je	.L23
	cltd
	idivl	%ecx
	addl	$48, %edx
	movb	%dl, 1+out(%rip)
	testl	%eax, %eax
	je	.L24
	cltd
	idivl	%ecx
	xorl	%eax, %eax
	addl	$48, %edx
	movb	%dl, out(%rip)
.L17:
	leaq	out(%rip), %rcx
	movl	$6, %edx
	movl	$1, %edi
	subl	%eax, %edx
	leaq	(%rax,%rcx), %rsi
	xorl	%eax, %eax
	call	write@PLT
	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
.L35:
	.cfi_restore_state
	movl	%edx, %esi
	xorl	%ecx, %ecx
	jmp	.L10
.L23:
	movl	$2, %eax
	jmp	.L17
.L20:
	movl	$5, %eax
	jmp	.L17
.L21:
	movl	$4, %eax
	jmp	.L17
.L22:
	movl	$3, %eax
	jmp	.L17
.L24:
	movl	$1, %eax
	jmp	.L17
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 4194304
cnt:
	.zero	4194304
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	out
	.type	out, @object
	.size	out, 6
out:
	.zero	6
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 2097152
buf:
	.zero	2097152
	.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:

char buf[2<<20],out[6];
sz;
cnt[1<<20];
main()
{
	read(0,buf,2<<20);
	int N=0;
	for(;;)
	{
		char k=buf[sz++];
		if(k<'0')break;
		N=N*10+k-'0';
	}
	for(int i=0;i<N;i++)
	{
		int A=0;
		for(;;)
		{
			char k=buf[sz++];
			if(k<'0')break;
			A=A*10+k-'0';
		}
		cnt[A]++;
	}
	int ans=0;
	for(int i=1;i<=1000000;i++)
	{
		if(cnt[i])
		{
			ans+=cnt[i]<2;
			for(int j=i+i;j<=1000000;j+=i)cnt[j]=0;
		}
	}
	int osz=6;
	do{
		out[--osz]=ans%10+'0';
	}while(ans/=10);
	write(1,out+osz,6-osz);
}

5
24 11 8 1 16
 10
33 4 45 28 8 19 89 86 2 4
 10
33 4 26 28 8 19 89 86 2 4
 4
6 8 5 5
 5
31 11 8 2 16
 10
11 2 41 17 8 25 89 28 3 4
 10
11 2 41 17 8 33 89 28 3 4
 5
31 11 1 1 16
 10
11 2 41 17 8 25 89 28 3 7
 4
5 8 5 5

1 5 4 2 3 7 6 0 8 1
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
char buf[2<<20],out[6];
sz;
cnt[1<<20];
main()
{
	read(0,buf,2<<20);
	int N=0;
	for(;;)
	{
		char k=buf[sz++];
		if(k<'0')break;
		N=N*10+k-'0';
	}
	for(int i=0;i<N;i++)
	{
		int A=0;
		for(;;)
		{
			char k=buf[sz++];
			if(k<'0')break;
			A=A*10+k-'0';
		}
		cnt[A]++;
	}
	int ans=0;
	for(int i=1;i<=1000000;i++)
	{
		if(cnt[i])
		{
			ans+=cnt[i]<2;
			for(int j=i+i;j<=1000000;j+=i)cnt[j]=0;
		}
	}
	int osz=6;
	do{
		out[--osz]=ans%10+'0';
	}while(ans/=10);
	write(1,out+osz,6-osz);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 2097152
buf:
	.zero	2097152
	.globl	out
	.type	out, @object
	.size	out, 6
out:
	.zero	6
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 4194304
cnt:
	.zero	4194304
	.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	$32, %rsp
	movl	$2097152, %edx
	leaq	buf(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$0, %eax
	call	read@PLT
	movl	$0, -28(%rbp)
.L4:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	buf(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -30(%rbp)
	cmpb	$47, -30(%rbp)
	jle	.L19
	movl	-28(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-30(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -28(%rbp)
	jmp	.L4
.L19:
	nop
	movl	$0, -24(%rbp)
	jmp	.L5
.L9:
	movl	$0, -20(%rbp)
.L8:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	buf(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -29(%rbp)
	cmpb	$47, -29(%rbp)
	jle	.L20
	movl	-20(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-29(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L20:
	nop
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L9
	movl	$0, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L10
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	setle	%al
	movzbl	%al, %eax
	addl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-12(%rbp), %eax
	addl	%eax, -8(%rbp)
.L12:
	cmpl	$1000000, -8(%rbp)
	jle	.L13
.L11:
	addl	$1, -12(%rbp)
.L10:
	cmpl	$1000000, -12(%rbp)
	jle	.L14
	movl	$6, -4(%rbp)
.L15:
	movl	-16(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	addl	$48, %eax
	subl	$1, -4(%rbp)
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	out(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	jne	.L15
	movl	$6, %eax
	subl	-4(%rbp), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	out(%rip), %rcx
	addq	%rdx, %rcx
	movl	%eax, %edx
	movq	%rcx, %rsi
	movl	$1, %edi
	movl	$0, %eax
	call	write@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	buf
	.bss
	.align 32
	.type	buf, @object
	.size	buf, 2097152
buf:
	.zero	2097152
	.globl	out
	.type	out, @object
	.size	out, 6
out:
	.zero	6
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 4194304
cnt:
	.zero	4194304
	.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	$32, %rsp
	movl	$2097152, %edx
	leaq	buf(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$0, %eax
	call	read@PLT
	movl	$0, -28(%rbp)
.L4:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	buf(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -30(%rbp)
	cmpb	$47, -30(%rbp)
	jle	.L19
	movl	-28(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-30(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -28(%rbp)
	jmp	.L4
.L19:
	nop
	movl	$0, -24(%rbp)
	jmp	.L5
.L9:
	movl	$0, -20(%rbp)
.L8:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	buf(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -29(%rbp)
	cmpb	$47, -29(%rbp)
	jle	.L20
	movl	-20(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-29(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L20:
	nop
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L9
	movl	$0, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L10
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	setle	%al
	movzbl	%al, %eax
	addl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-12(%rbp), %eax
	addl	%eax, -8(%rbp)
.L12:
	cmpl	$1000000, -8(%rbp)
	jle	.L13
.L11:
	addl	$1, -12(%rbp)
.L10:
	cmpl	$1000000, -12(%rbp)
	jle	.L14
	movl	$6, -4(%rbp)
.L15:
	movl	-16(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	addl	$48, %eax
	subl	$1, -4(%rbp)
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	out(%rip), %rdx
	movb	%cl, (%rax,%rdx)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	jne	.L15
	movl	$6, %eax
	subl	-4(%rbp), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	out(%rip), %rcx
	addq	%rdx, %rcx
	movl	%eax, %edx
	movq	%rcx, %rsi
	movl	$1, %edi
	movl	$0, %eax
	call	write@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:
