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

```c
n,i=2;main(r){
for(scanf("%d",&n),r=n;i*i<=n;i++)if(n%i==0)for(r=1LL*r*(i-1)/i;n%i==0;n/=i);
if(--n)r=1LL*r*n/++n;
n=!printf("%d\n",r);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.data
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.long	2
	.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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L6:
	movl	n(%rip), %eax
	movl	i(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movl	i(%rip), %edx
	movslq	%edx, %rsi
	cqto
	idivq	%rsi
	movl	%eax, -4(%rbp)
	jmp	.L4
.L5:
	movl	n(%rip), %eax
	movl	i(%rip), %edi
	cltd
	idivl	%edi
	movl	%eax, n(%rip)
.L4:
	movl	n(%rip), %eax
	movl	i(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L5
.L3:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	imull	%eax, %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	n(%rip), %eax
	subl	$1, %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L7
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	n(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movl	n(%rip), %edx
	addl	$1, %edx
	movl	%edx, n(%rip)
	movl	n(%rip), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, n(%rip)
	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	.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
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %ecx
	movl	n(%rip), %r8d
	movl	%ecx, %eax
	imull	%ecx, %eax
	cmpl	%eax, %r8d
	jl	.L8
	movslq	%ecx, %rdi
	movslq	%r8d, %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %ecx
	addq	$1, %rdi
	movl	%ecx, %eax
	imull	%ecx, %eax
	cmpl	%eax, %esi
	jl	.L14
.L5:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L3
	leal	-1(%rcx), %eax
	movslq	%r8d, %r8
	cltq
	imulq	%r8, %rax
	cqto
	idivq	%rdi
	movq	%rax, %r8
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	cltd
	movslq	%eax, %rsi
	idivl	%ecx
	testl	%edx, %edx
	je	.L4
	addl	$1, %ecx
	addq	$1, %rdi
	movl	%ecx, %eax
	imull	%ecx, %eax
	cmpl	%eax, %esi
	jge	.L5
.L14:
	movl	%ecx, i(%rip)
.L2:
	movl	%esi, %eax
	subl	$1, %eax
	jne	.L6
	movl	$0, n(%rip)
.L7:
	xorl	%eax, %eax
	movl	%r8d, %esi
	leaq	.LC1(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, n(%rip)
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	cltq
	movslq	%r8d, %r8
	movl	%esi, n(%rip)
	imulq	%rax, %r8
	movq	%r8, %rax
	cqto
	idivq	%rsi
	movq	%rax, %r8
	jmp	.L7
.L8:
	movslq	%r8d, %rsi
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.data
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.long	2
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %ecx
	movl	n(%rip), %r8d
	movl	%ecx, %eax
	imull	%ecx, %eax
	cmpl	%eax, %r8d
	jl	.L8
	movslq	%ecx, %rdi
	movslq	%r8d, %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %ecx
	addq	$1, %rdi
	movl	%ecx, %eax
	imull	%ecx, %eax
	cmpl	%eax, %esi
	jl	.L14
.L5:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L3
	leal	-1(%rcx), %eax
	movslq	%r8d, %r8
	cltq
	imulq	%r8, %rax
	cqto
	idivq	%rdi
	movq	%rax, %r8
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	cltd
	movslq	%eax, %rsi
	idivl	%ecx
	testl	%edx, %edx
	je	.L4
	addl	$1, %ecx
	addq	$1, %rdi
	movl	%ecx, %eax
	imull	%ecx, %eax
	cmpl	%eax, %esi
	jge	.L5
.L14:
	movl	%ecx, i(%rip)
.L2:
	movl	%esi, %eax
	subl	$1, %eax
	jne	.L6
	movl	$0, n(%rip)
.L7:
	xorl	%eax, %eax
	movl	%r8d, %esi
	leaq	.LC1(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, n(%rip)
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	cltq
	movslq	%r8d, %r8
	movl	%esi, n(%rip)
	imulq	%rax, %r8
	movq	%r8, %rax
	cqto
	idivq	%rsi
	movq	%rax, %r8
	jmp	.L7
.L8:
	movslq	%r8d, %rsi
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.data
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.long	2
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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:

n,i=2;main(r){
for(scanf("%d",&n),r=n;i*i<=n;i++)if(n%i==0)for(r=1LL*r*(i-1)/i;n%i==0;n/=i);
if(--n)r=1LL*r*n/++n;
n=!printf("%d\n",r);
}
1000100
 5
 1000101
 1000001
 1000011
 16
 1010011
 31
 61
 59

391680
 4
 666732
 990000
 666672
 8
 976500
 30
 60
 58

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

```c
n,i=2;main(r){
for(scanf("%d",&n),r=n;i*i<=n;i++)if(n%i==0)for(r=1LL*r*(i-1)/i;n%i==0;n/=i);
if(--n)r=1LL*r*n/++n;
n=!printf("%d\n",r);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.data
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.long	2
	.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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L6:
	movl	n(%rip), %eax
	movl	i(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movl	i(%rip), %edx
	movslq	%edx, %rsi
	cqto
	idivq	%rsi
	movl	%eax, -4(%rbp)
	jmp	.L4
.L5:
	movl	n(%rip), %eax
	movl	i(%rip), %edi
	cltd
	idivl	%edi
	movl	%eax, n(%rip)
.L4:
	movl	n(%rip), %eax
	movl	i(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L5
.L3:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	imull	%eax, %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	n(%rip), %eax
	subl	$1, %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L7
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	n(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movl	n(%rip), %edx
	addl	$1, %edx
	movl	%edx, n(%rip)
	movl	n(%rip), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, n(%rip)
	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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.data
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.long	2
	.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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L6:
	movl	n(%rip), %eax
	movl	i(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	i(%rip), %eax
	subl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movl	i(%rip), %edx
	movslq	%edx, %rsi
	cqto
	idivq	%rsi
	movl	%eax, -4(%rbp)
	jmp	.L4
.L5:
	movl	n(%rip), %eax
	movl	i(%rip), %edi
	cltd
	idivl	%edi
	movl	%eax, n(%rip)
.L4:
	movl	n(%rip), %eax
	movl	i(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L5
.L3:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	imull	%eax, %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	n(%rip), %eax
	subl	$1, %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L7
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	n(%rip), %eax
	cltq
	imulq	%rdx, %rax
	movl	n(%rip), %edx
	addl	$1, %edx
	movl	%edx, n(%rip)
	movl	n(%rip), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	%eax, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, n(%rip)
	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:
