Given the following C code and 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;
}
```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.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
```assembly
	.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:
```
```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;
}
```
Given the following C 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;
}
```

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.
Optimized Assembly Code:

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 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;
}
```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.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:
```