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>
#include <math.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
	long long n,ans=0,total,j,i;
	scanf("%lld",&n);
	for(i=2;i<=sqrt(n);i++){
		if(n%i==0){
			total=0,j=1;
			while(n%i==0){
				n/=i;
				total++;
			}
			while(total-j>=0){
				total-=j;
				j++;ans++;
			}
		}
	}
	if(n!=1)ans++;
	printf("%lld\n",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -52(%rbp)
	movq	%rsi, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -16(%rbp)
	jmp	.L2
.L8:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	$0, -32(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L4
.L5:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rax, -48(%rbp)
	addq	$1, -32(%rbp)
.L4:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L5
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	subq	%rax, -32(%rbp)
	addq	$1, -24(%rbp)
	addq	$1, -40(%rbp)
.L6:
	movq	-32(%rbp), %rax
	subq	-24(%rbp), %rax
	testq	%rax, %rax
	jns	.L7
.L3:
	addq	$1, -16(%rbp)
.L2:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-16(%rbp), %xmm1
	movsd	%xmm1, -72(%rbp)
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm3
	comisd	-72(%rbp), %xmm3
	jnb	.L8
	movq	-48(%rbp), %rax
	cmpq	$1, %rax
	je	.L9
	addq	$1, -40(%rbp)
.L9:
	movq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	movl	$2, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	$2, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	pxor	%xmm2, %xmm2
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rbp
.L2:
	movq	16(%rsp), %rbx
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rbp, %xmm1
	cvtsi2sdq	%rbx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L18
	sqrtsd	%xmm0, %xmm0
.L8:
	comisd	%xmm1, %xmm0
	jb	.L21
	movq	%rbx, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %rsi
	testq	%rdx, %rdx
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	movq	%rsi, %rcx
	leaq	1(%rsi), %rsi
	cqto
	idivq	%rbp
	cqto
	movq	%rax, %rbx
	idivq	%rbp
	testq	%rdx, %rdx
	je	.L4
	movq	%rbx, 16(%rsp)
	movq	%r13, %rsi
	movq	%r12, %rax
	subq	%r12, %rsi
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rsi,%rax), %rdx
	addq	$1, %rax
	subq	%rdx, %rcx
	jns	.L5
	movq	%rax, %r12
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	cmpq	$1, %rbx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	setne	%al
	addq	%rax, %r12
	xorl	%eax, %eax
	movq	%r12, %rdx
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$40, %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
.L18:
	.cfi_restore_state
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	pxor	%xmm2, %xmm2
	jmp	.L8
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	movl	$2, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	$2, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	pxor	%xmm2, %xmm2
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rbp
.L2:
	movq	16(%rsp), %rbx
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rbp, %xmm1
	cvtsi2sdq	%rbx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L18
	sqrtsd	%xmm0, %xmm0
.L8:
	comisd	%xmm1, %xmm0
	jb	.L21
	movq	%rbx, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %rsi
	testq	%rdx, %rdx
	jne	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	movq	%rsi, %rcx
	leaq	1(%rsi), %rsi
	cqto
	idivq	%rbp
	cqto
	movq	%rax, %rbx
	idivq	%rbp
	testq	%rdx, %rdx
	je	.L4
	movq	%rbx, 16(%rsp)
	movq	%r13, %rsi
	movq	%r12, %rax
	subq	%r12, %rsi
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rsi,%rax), %rdx
	addq	$1, %rax
	subq	%rdx, %rcx
	jns	.L5
	movq	%rax, %r12
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	cmpq	$1, %rbx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	setne	%al
	addq	%rax, %r12
	xorl	%eax, %eax
	movq	%r12, %rdx
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$40, %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
.L18:
	.cfi_restore_state
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	pxor	%xmm2, %xmm2
	jmp	.L8
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>
#include <math.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
	long long n,ans=0,total,j,i;
	scanf("%lld",&n);
	for(i=2;i<=sqrt(n);i++){
		if(n%i==0){
			total=0,j=1;
			while(n%i==0){
				n/=i;
				total++;
			}
			while(total-j>=0){
				total-=j;
				j++;ans++;
			}
		}
	}
	if(n!=1)ans++;
	printf("%lld\n",ans);
}
1336021909504
 2
 1390976380
 116
 1130063570614
 72
 2986505832
 001
 30410688
 4

7
 1
 5
 2
 4
 3
 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
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
	long long n,ans=0,total,j,i;
	scanf("%lld",&n);
	for(i=2;i<=sqrt(n);i++){
		if(n%i==0){
			total=0,j=1;
			while(n%i==0){
				n/=i;
				total++;
			}
			while(total-j>=0){
				total-=j;
				j++;ans++;
			}
		}
	}
	if(n!=1)ans++;
	printf("%lld\n",ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -52(%rbp)
	movq	%rsi, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -16(%rbp)
	jmp	.L2
.L8:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	$0, -32(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L4
.L5:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rax, -48(%rbp)
	addq	$1, -32(%rbp)
.L4:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L5
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	subq	%rax, -32(%rbp)
	addq	$1, -24(%rbp)
	addq	$1, -40(%rbp)
.L6:
	movq	-32(%rbp), %rax
	subq	-24(%rbp), %rax
	testq	%rax, %rax
	jns	.L7
.L3:
	addq	$1, -16(%rbp)
.L2:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-16(%rbp), %xmm1
	movsd	%xmm1, -72(%rbp)
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm3
	comisd	-72(%rbp), %xmm3
	jnb	.L8
	movq	-48(%rbp), %rax
	cmpq	$1, %rax
	je	.L9
	addq	$1, -40(%rbp)
.L9:
	movq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -52(%rbp)
	movq	%rsi, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -16(%rbp)
	jmp	.L2
.L8:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	$0, -32(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L4
.L5:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rax, -48(%rbp)
	addq	$1, -32(%rbp)
.L4:
	movq	-48(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L5
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	subq	%rax, -32(%rbp)
	addq	$1, -24(%rbp)
	addq	$1, -40(%rbp)
.L6:
	movq	-32(%rbp), %rax
	subq	-24(%rbp), %rax
	testq	%rax, %rax
	jns	.L7
.L3:
	addq	$1, -16(%rbp)
.L2:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-16(%rbp), %xmm1
	movsd	%xmm1, -72(%rbp)
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm3
	comisd	-72(%rbp), %xmm3
	jnb	.L8
	movq	-48(%rbp), %rax
	cmpq	$1, %rax
	je	.L9
	addq	$1, -40(%rbp)
.L9:
	movq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
