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 <string.h>
#include <limits.h>
#include <float.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
	long int n;
	long int i, j, k;
	long int sum = 0;
	
	scanf("%ld", &n);
	
	for(i = 2; i <= (int)sqrt(n); i++) {
		if(n % i == 0) {
			if( (n / (i - 1)) == (n % (i - 1)) ) {
				sum += (i - 1);
			}
			if( (n / (n / i - 1)) == (n % (n / i - 1)) ) {
				sum += (n / i - 1);
			}
		}
	}
	
	if(n != 2) {
		sum += n - 1;
	}
	
	if( (n % (int)sqrt(n) == 0) && (n > 3) ) {
		if( (n / ((int)sqrt(n) - 1)) == (n % ((int)sqrt(n) - 1)) ) {
			sum -= (int)sqrt(n);
		}
	}
	
	printf("%ld\n", sum);
	
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -32(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -40(%rbp)
	jmp	.L2
.L5:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	leaq	-1(%rdx), %rdi
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	leaq	-1(%rdx), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	cmpq	%rax, %rsi
	jne	.L4
	movq	-40(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L4:
	movq	-48(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	leaq	-1(%rax), %rsi
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rax, %rdi
	movq	-48(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	leaq	-1(%rax), %rsi
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rax
	cmpq	%rax, %rdi
	jne	.L3
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L3:
	addq	$1, -40(%rbp)
.L2:
	movq	-48(%rbp), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jle	.L5
	movq	-48(%rbp), %rax
	cmpq	$2, %rax
	je	.L6
	movq	-48(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L6:
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movslq	%eax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	cmpq	$3, %rax
	jle	.L7
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rax, %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movq	%rbx, %rax
	cqto
	idivq	%rdi
	movq	%rax, %r12
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm4, %xmm4
	cvtsi2sdq	%rax, %xmm4
	movq	%xmm4, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	cmpq	%rax, %r12
	jne	.L7
	movq	-48(%rbp), %rax
	pxor	%xmm5, %xmm5
	cvtsi2sdq	%rax, %xmm5
	movq	%xmm5, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	subq	%rax, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.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	"%ld"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rbx
	pxor	%xmm1, %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rbx, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L31
	movapd	%xmm1, %xmm0
	xorl	%r12d, %r12d
	movl	$2, %ecx
	sqrtsd	%xmm0, %xmm0
	cvttsd2sil	%xmm0, %eax
	movslq	%eax, %r8
	cmpl	$1, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	testq	%rdx, %rdx
	jne	.L9
	movq	%rbx, %rax
	leaq	-1(%rcx), %rdi
	cqto
	idivq	%rdi
	addq	%r12, %rdi
	cmpq	%rdx, %rax
	movq	%rbx, %rax
	cmove	%rdi, %r12
	subq	$1, %rsi
	cqto
	idivq	%rsi
	addq	%r12, %rsi
	cmpq	%rdx, %rax
	cmove	%rsi, %r12
.L9:
	addq	$1, %rcx
	cmpq	%r8, %rcx
	jle	.L4
.L5:
	movapd	%xmm1, %xmm0
	cmpq	$2, %rbx
	je	.L11
	ucomisd	%xmm1, %xmm2
	leaq	-1(%r12,%rbx), %r12
	ja	.L32
.L11:
	sqrtsd	%xmm0, %xmm0
.L14:
	cvttsd2sil	%xmm0, %ecx
	movq	%rbx, %rax
	cqto
	movslq	%ecx, %rcx
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L15
	cmpq	$3, %rbx
	jg	.L35
.L15:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	movapd	%xmm1, %xmm0
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movsd	(%rsp), %xmm1
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm1, %xmm0
	call	sqrt@PLT
	movsd	8(%rsp), %xmm2
	movq	%rbx, %rax
	movsd	(%rsp), %xmm1
	cqto
	cvttsd2sil	%xmm2, %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	idivq	%rcx
	cvttsd2sil	%xmm0, %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movq	%rax, %rsi
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	cmpq	%rdx, %rsi
	jne	.L15
	movapd	%xmm1, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	subq	%rax, %r12
	jmp	.L15
.L32:
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movsd	(%rsp), %xmm1
	jmp	.L14
.L31:
	xorl	%r12d, %r12d
	movl	$2, %ebp
	jmp	.L2
.L37:
	movq	%rbx, %rax
	cqto
	idivq	%rbp
	movq	%rax, %rcx
	testq	%rdx, %rdx
	jne	.L6
	movq	%rbx, %rax
	leaq	-1(%rbp), %rsi
	cqto
	idivq	%rsi
	cmpq	%rdx, %rax
	jne	.L8
	addq	%rsi, %r12
.L8:
	movq	%rbx, %rax
	subq	$1, %rcx
	cqto
	idivq	%rcx
	cmpq	%rdx, %rax
	jne	.L6
	addq	%rcx, %r12
.L6:
	addq	$1, %rbp
.L2:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movsd	(%rsp), %xmm1
	pxor	%xmm2, %xmm2
	cvttsd2sil	%xmm0, %eax
	cltq
	cmpq	%rax, %rbp
	jle	.L37
	jmp	.L5
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"%ld"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rbx
	pxor	%xmm1, %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rbx, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L31
	movapd	%xmm1, %xmm0
	xorl	%r12d, %r12d
	movl	$2, %ecx
	sqrtsd	%xmm0, %xmm0
	cvttsd2sil	%xmm0, %eax
	movslq	%eax, %r8
	cmpl	$1, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	testq	%rdx, %rdx
	jne	.L9
	movq	%rbx, %rax
	leaq	-1(%rcx), %rdi
	cqto
	idivq	%rdi
	addq	%r12, %rdi
	cmpq	%rdx, %rax
	movq	%rbx, %rax
	cmove	%rdi, %r12
	subq	$1, %rsi
	cqto
	idivq	%rsi
	addq	%r12, %rsi
	cmpq	%rdx, %rax
	cmove	%rsi, %r12
.L9:
	addq	$1, %rcx
	cmpq	%r8, %rcx
	jle	.L4
.L5:
	movapd	%xmm1, %xmm0
	cmpq	$2, %rbx
	je	.L11
	ucomisd	%xmm1, %xmm2
	leaq	-1(%r12,%rbx), %r12
	ja	.L32
.L11:
	sqrtsd	%xmm0, %xmm0
.L14:
	cvttsd2sil	%xmm0, %ecx
	movq	%rbx, %rax
	cqto
	movslq	%ecx, %rcx
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L15
	cmpq	$3, %rbx
	jg	.L35
.L15:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	movapd	%xmm1, %xmm0
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movsd	(%rsp), %xmm1
	movsd	%xmm0, 8(%rsp)
	movapd	%xmm1, %xmm0
	call	sqrt@PLT
	movsd	8(%rsp), %xmm2
	movq	%rbx, %rax
	movsd	(%rsp), %xmm1
	cqto
	cvttsd2sil	%xmm2, %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	idivq	%rcx
	cvttsd2sil	%xmm0, %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movq	%rax, %rsi
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	cmpq	%rdx, %rsi
	jne	.L15
	movapd	%xmm1, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	subq	%rax, %r12
	jmp	.L15
.L32:
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movsd	(%rsp), %xmm1
	jmp	.L14
.L31:
	xorl	%r12d, %r12d
	movl	$2, %ebp
	jmp	.L2
.L37:
	movq	%rbx, %rax
	cqto
	idivq	%rbp
	movq	%rax, %rcx
	testq	%rdx, %rdx
	jne	.L6
	movq	%rbx, %rax
	leaq	-1(%rbp), %rsi
	cqto
	idivq	%rsi
	cmpq	%rdx, %rax
	jne	.L8
	addq	%rsi, %r12
.L8:
	movq	%rbx, %rax
	subq	$1, %rcx
	cqto
	idivq	%rcx
	cmpq	%rdx, %rax
	jne	.L6
	addq	%rcx, %r12
.L6:
	addq	$1, %rbp
.L2:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movsd	(%rsp), %xmm1
	pxor	%xmm2, %xmm2
	cvttsd2sil	%xmm0, %eax
	cltq
	cmpq	%rax, %rbp
	jle	.L37
	jmp	.L5
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 <string.h>
#include <limits.h>
#include <float.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
	long int n;
	long int i, j, k;
	long int sum = 0;
	
	scanf("%ld", &n);
	
	for(i = 2; i <= (int)sqrt(n); i++) {
		if(n % i == 0) {
			if( (n / (i - 1)) == (n % (i - 1)) ) {
				sum += (i - 1);
			}
			if( (n / (n / i - 1)) == (n % (n / i - 1)) ) {
				sum += (n / i - 1);
			}
		}
	}
	
	if(n != 2) {
		sum += n - 1;
	}
	
	if( (n % (int)sqrt(n) == 0) && (n > 3) ) {
		if( (n / ((int)sqrt(n) - 1)) == (n % ((int)sqrt(n) - 1)) ) {
			sum -= (int)sqrt(n);
		}
	}
	
	printf("%ld\n", sum);
	
	return 0;
}

1000010000000
 1000011000000
 1100011000000
 1110011000000
 1110011100000
 1110011100100
 1110111100100
 1110111100101
 1110111000101
 1010111000101

2716922731275
 3307289212967
 2999416055122
 3146654438234
 4080876601631
 2753043984264
 2417637625420
 1603984026418
 1113798127512
 1185123120376

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 <string.h>
#include <limits.h>
#include <float.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
	long int n;
	long int i, j, k;
	long int sum = 0;
	
	scanf("%ld", &n);
	
	for(i = 2; i <= (int)sqrt(n); i++) {
		if(n % i == 0) {
			if( (n / (i - 1)) == (n % (i - 1)) ) {
				sum += (i - 1);
			}
			if( (n / (n / i - 1)) == (n % (n / i - 1)) ) {
				sum += (n / i - 1);
			}
		}
	}
	
	if(n != 2) {
		sum += n - 1;
	}
	
	if( (n % (int)sqrt(n) == 0) && (n > 3) ) {
		if( (n / ((int)sqrt(n) - 1)) == (n % ((int)sqrt(n) - 1)) ) {
			sum -= (int)sqrt(n);
		}
	}
	
	printf("%ld\n", sum);
	
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -32(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -40(%rbp)
	jmp	.L2
.L5:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	leaq	-1(%rdx), %rdi
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	leaq	-1(%rdx), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	cmpq	%rax, %rsi
	jne	.L4
	movq	-40(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L4:
	movq	-48(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	leaq	-1(%rax), %rsi
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rax, %rdi
	movq	-48(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	leaq	-1(%rax), %rsi
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rax
	cmpq	%rax, %rdi
	jne	.L3
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L3:
	addq	$1, -40(%rbp)
.L2:
	movq	-48(%rbp), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jle	.L5
	movq	-48(%rbp), %rax
	cmpq	$2, %rax
	je	.L6
	movq	-48(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L6:
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movslq	%eax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	cmpq	$3, %rax
	jle	.L7
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rax, %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movq	%rbx, %rax
	cqto
	idivq	%rdi
	movq	%rax, %r12
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm4, %xmm4
	cvtsi2sdq	%rax, %xmm4
	movq	%xmm4, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	cmpq	%rax, %r12
	jne	.L7
	movq	-48(%rbp), %rax
	pxor	%xmm5, %xmm5
	cvtsi2sdq	%rax, %xmm5
	movq	%xmm5, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	subq	%rax, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.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	"%ld"
.LC1:
	.string	"%ld\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
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -32(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$2, -40(%rbp)
	jmp	.L2
.L5:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	leaq	-1(%rdx), %rdi
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	leaq	-1(%rdx), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	cmpq	%rax, %rsi
	jne	.L4
	movq	-40(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L4:
	movq	-48(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	leaq	-1(%rax), %rsi
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rax, %rdi
	movq	-48(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	leaq	-1(%rax), %rsi
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rdx, %rax
	cmpq	%rax, %rdi
	jne	.L3
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L3:
	addq	$1, -40(%rbp)
.L2:
	movq	-48(%rbp), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jle	.L5
	movq	-48(%rbp), %rax
	cmpq	$2, %rax
	je	.L6
	movq	-48(%rbp), %rax
	subq	$1, %rax
	addq	%rax, -32(%rbp)
.L6:
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movslq	%eax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	cmpq	$3, %rax
	jle	.L7
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rax, %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movq	%rbx, %rax
	cqto
	idivq	%rdi
	movq	%rax, %r12
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	pxor	%xmm4, %xmm4
	cvtsi2sdq	%rax, %xmm4
	movq	%xmm4, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	cmpq	%rax, %r12
	jne	.L7
	movq	-48(%rbp), %rax
	pxor	%xmm5, %xmm5
	cvtsi2sdq	%rax, %xmm5
	movq	%xmm5, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	subq	%rax, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.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:
