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

```c
long long l,i;main(r,x){for(;scanf("%lld",&l),l;printf("%d\n",(l>1?3:1)*r/2+1))for(r=1,i=2;i*i<=l;r*=2*x+1,i++)for(x=0;!(l%i);l/=i)x++;exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	l
	.bss
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.globl	i
	.align 8
	.type	i, @object
	.size	i, 8
i:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%lld"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	jmp	.L2
.L9:
	movl	$1, -4(%rbp)
	movq	$2, i(%rip)
	jmp	.L3
.L6:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	addl	$1, -8(%rbp)
	movq	l(%rip), %rax
	movq	i(%rip), %rcx
	cqto
	idivq	%rcx
	movq	%rax, l(%rip)
.L4:
	movq	l(%rip), %rax
	movq	i(%rip), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L5
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	movq	i(%rip), %rax
	addq	$1, %rax
	movq	%rax, i(%rip)
.L3:
	movq	i(%rip), %rdx
	movq	i(%rip), %rax
	imulq	%rax, %rdx
	movq	l(%rip), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movq	l(%rip), %rax
	cmpq	$1, %rax
	jle	.L7
	movl	$3, %eax
	jmp	.L8
.L7:
	movl	$1, %eax
.L8:
	imull	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	l(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	l(%rip), %rax
	testq	%rax, %rax
	jne	.L9
	movl	$0, %edi
	call	exit@PLT
	.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\n"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	l(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movq	l(%rip), %rcx
	testq	%rcx, %rcx
	je	.L23
	xorl	%r9d, %r9d
	movl	$1, %r8d
	movl	$2, %esi
	movq	$2, i(%rip)
	cmpq	$3, %rcx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rcx, %rax
	xorl	%edi, %edi
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rcx, %rax
	addl	$1, %edi
	cqto
	idivq	%rsi
	cqto
	movq	%rax, %rcx
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L5
	leal	1(%rdi,%rdi), %eax
	movl	$1, %r9d
	imull	%eax, %r8d
.L7:
	addq	$1, %rsi
	movq	%rsi, %rax
	imulq	%rsi, %rax
	cmpq	%rcx, %rax
	jle	.L3
	movq	%rsi, i(%rip)
	testb	%r9b, %r9b
	je	.L4
	movq	%rcx, l(%rip)
.L4:
	cmpq	$1, %rcx
	leal	(%r8,%r8,2), %eax
	movq	%r12, %rdi
	cmovg	%eax, %r8d
	xorl	%eax, %eax
	sarl	%r8d
	leal	1(%r8), %esi
	call	printf@PLT
	jmp	.L2
.L23:
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 8
	.type	i, @object
	.size	i, 8
i:
	.zero	8
	.globl	l
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.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\n"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	l(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movq	l(%rip), %rcx
	testq	%rcx, %rcx
	je	.L23
	xorl	%r9d, %r9d
	movl	$1, %r8d
	movl	$2, %esi
	movq	$2, i(%rip)
	cmpq	$3, %rcx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rcx, %rax
	xorl	%edi, %edi
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rcx, %rax
	addl	$1, %edi
	cqto
	idivq	%rsi
	cqto
	movq	%rax, %rcx
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L5
	leal	1(%rdi,%rdi), %eax
	movl	$1, %r9d
	imull	%eax, %r8d
.L7:
	addq	$1, %rsi
	movq	%rsi, %rax
	imulq	%rsi, %rax
	cmpq	%rcx, %rax
	jle	.L3
	movq	%rsi, i(%rip)
	testb	%r9b, %r9b
	je	.L4
	movq	%rcx, l(%rip)
.L4:
	cmpq	$1, %rcx
	leal	(%r8,%r8,2), %eax
	movq	%r12, %rdi
	cmovg	%eax, %r8d
	xorl	%eax, %eax
	sarl	%r8d
	leal	1(%r8), %esi
	call	printf@PLT
	jmp	.L2
.L23:
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 8
	.type	i, @object
	.size	i, 8
i:
	.zero	8
	.globl	l
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.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:

long long l,i;main(r,x){for(;scanf("%lld",&l),l;printf("%d\n",(l>1?3:1)*r/2+1))for(r=1,i=2;i*i<=l;r*=2*x+1,i++)for(x=0;!(l%i);l/=i)x++;exit(0);}
12
11
2
0
 12
9
3
0
 12
8
2
0
 12
9
0
0
 12
0
3
0
 12
15
2
0
 12
9
1
0
 12
8
1
0
 12
9
4
0
 12
11
4
0

8
2
2
 8
3
2
 8
4
2
 8
3
 8
 8
5
2
 8
3
1
 8
4
1
 8
3
3
 8
2
3

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

```c
long long l,i;main(r,x){for(;scanf("%lld",&l),l;printf("%d\n",(l>1?3:1)*r/2+1))for(r=1,i=2;i*i<=l;r*=2*x+1,i++)for(x=0;!(l%i);l/=i)x++;exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	l
	.bss
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.globl	i
	.align 8
	.type	i, @object
	.size	i, 8
i:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%lld"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	jmp	.L2
.L9:
	movl	$1, -4(%rbp)
	movq	$2, i(%rip)
	jmp	.L3
.L6:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	addl	$1, -8(%rbp)
	movq	l(%rip), %rax
	movq	i(%rip), %rcx
	cqto
	idivq	%rcx
	movq	%rax, l(%rip)
.L4:
	movq	l(%rip), %rax
	movq	i(%rip), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L5
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	movq	i(%rip), %rax
	addq	$1, %rax
	movq	%rax, i(%rip)
.L3:
	movq	i(%rip), %rdx
	movq	i(%rip), %rax
	imulq	%rax, %rdx
	movq	l(%rip), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movq	l(%rip), %rax
	cmpq	$1, %rax
	jle	.L7
	movl	$3, %eax
	jmp	.L8
.L7:
	movl	$1, %eax
.L8:
	imull	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	l(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	l(%rip), %rax
	testq	%rax, %rax
	jne	.L9
	movl	$0, %edi
	call	exit@PLT
	.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	l
	.bss
	.align 8
	.type	l, @object
	.size	l, 8
l:
	.zero	8
	.globl	i
	.align 8
	.type	i, @object
	.size	i, 8
i:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%lld"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	jmp	.L2
.L9:
	movl	$1, -4(%rbp)
	movq	$2, i(%rip)
	jmp	.L3
.L6:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	addl	$1, -8(%rbp)
	movq	l(%rip), %rax
	movq	i(%rip), %rcx
	cqto
	idivq	%rcx
	movq	%rax, l(%rip)
.L4:
	movq	l(%rip), %rax
	movq	i(%rip), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L5
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	movq	i(%rip), %rax
	addq	$1, %rax
	movq	%rax, i(%rip)
.L3:
	movq	i(%rip), %rdx
	movq	i(%rip), %rax
	imulq	%rax, %rdx
	movq	l(%rip), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movq	l(%rip), %rax
	cmpq	$1, %rax
	jle	.L7
	movl	$3, %eax
	jmp	.L8
.L7:
	movl	$1, %eax
.L8:
	imull	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	l(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	l(%rip), %rax
	testq	%rax, %rax
	jne	.L9
	movl	$0, %edi
	call	exit@PLT
	.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:
