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 <math.h>

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

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	%xmm0, %xmm0
	cvtsi2sdq	%rbx, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L17
	sqrtsd	%xmm1, %xmm1
	xorl	%ebp, %ebp
	movl	$1, %ecx
	comisd	.LC2(%rip), %xmm1
	jb	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	cmove	%rcx, %rbp
	addq	$1, %rcx
	cvtsi2sdq	%rcx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L4
.L5:
	movq	%rbx, %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	cqto
	idivq	%rbp
	leaq	-2(%rbp,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	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
.L17:
	.cfi_restore_state
	xorl	%ebp, %ebp
	movl	$1, %r12d
	jmp	.L2
.L21:
	movq	%rbx, %rax
	movsd	8(%rsp), %xmm1
	cqto
	idivq	%r12
	testq	%rdx, %rdx
	cmove	%r12, %rbp
	addq	$1, %r12
.L2:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r12, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L21
	jmp	.L5
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.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"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	%xmm0, %xmm0
	cvtsi2sdq	%rbx, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L17
	sqrtsd	%xmm1, %xmm1
	xorl	%ebp, %ebp
	movl	$1, %ecx
	comisd	.LC2(%rip), %xmm1
	jb	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	cmove	%rcx, %rbp
	addq	$1, %rcx
	cvtsi2sdq	%rcx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L4
.L5:
	movq	%rbx, %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	cqto
	idivq	%rbp
	leaq	-2(%rbp,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	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
.L17:
	.cfi_restore_state
	xorl	%ebp, %ebp
	movl	$1, %r12d
	jmp	.L2
.L21:
	movq	%rbx, %rax
	movsd	8(%rsp), %xmm1
	cqto
	idivq	%r12
	testq	%rdx, %rdx
	cmove	%r12, %rbp
	addq	$1, %r12
.L2:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r12, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L21
	jmp	.L5
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.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"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	%xmm0, %xmm0
	cvtsi2sdq	%rbx, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L17
	sqrtsd	%xmm1, %xmm1
	xorl	%ebp, %ebp
	movl	$1, %ecx
	comisd	.LC2(%rip), %xmm1
	jb	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	cmove	%rcx, %rbp
	addq	$1, %rcx
	cvtsi2sdq	%rcx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L4
.L5:
	movq	%rbx, %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	cqto
	idivq	%rbp
	leaq	-2(%rbp,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	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
.L17:
	.cfi_restore_state
	xorl	%ebp, %ebp
	movl	$1, %r12d
	jmp	.L2
.L21:
	movq	%rbx, %rax
	movsd	8(%rsp), %xmm1
	cqto
	idivq	%r12
	testq	%rdx, %rdx
	cmove	%r12, %rbp
	addq	$1, %r12
.L2:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r12, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L21
	jmp	.L5
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.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 <math.h>

int main(void){
    long int i, n, min = 0, max = 0;
    scanf("%ld", &n);
    
    for( i = 1; i <= sqrt(n); i++ ){
        if( n % i == 0 ){
            min = i;
        }
    }
    
    max = n / min;
    printf("%ld\n", min+max-2);
    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 <math.h>

int main(void){
    long int i, n, min = 0, max = 0;
    scanf("%ld", &n);
    
    for( i = 1; i <= sqrt(n); i++ ){
        if( n % i == 0 ){
            min = i;
        }
    }
    
    max = n / min;
    printf("%ld\n", min+max-2);
    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:

6069423871
 83
 19
 605667865
 72
 33
 927082247
 40
 5
 223605823

23434326
 82
 18
 82100
 15
 12
 61750
 11
 4
 31934

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 <math.h>

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

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	%xmm0, %xmm0
	cvtsi2sdq	%rbx, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L17
	sqrtsd	%xmm1, %xmm1
	xorl	%ebp, %ebp
	movl	$1, %ecx
	comisd	.LC2(%rip), %xmm1
	jb	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	cmove	%rcx, %rbp
	addq	$1, %rcx
	cvtsi2sdq	%rcx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L4
.L5:
	movq	%rbx, %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	cqto
	idivq	%rbp
	leaq	-2(%rbp,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	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
.L17:
	.cfi_restore_state
	xorl	%ebp, %ebp
	movl	$1, %r12d
	jmp	.L2
.L21:
	movq	%rbx, %rax
	movsd	8(%rsp), %xmm1
	cqto
	idivq	%r12
	testq	%rdx, %rdx
	cmove	%r12, %rbp
	addq	$1, %r12
.L2:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r12, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L21
	jmp	.L5
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.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"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	%xmm0, %xmm0
	cvtsi2sdq	%rbx, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L17
	sqrtsd	%xmm1, %xmm1
	xorl	%ebp, %ebp
	movl	$1, %ecx
	comisd	.LC2(%rip), %xmm1
	jb	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	cmove	%rcx, %rbp
	addq	$1, %rcx
	cvtsi2sdq	%rcx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L4
.L5:
	movq	%rbx, %rax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	cqto
	idivq	%rbp
	leaq	-2(%rbp,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	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
.L17:
	.cfi_restore_state
	xorl	%ebp, %ebp
	movl	$1, %r12d
	jmp	.L2
.L21:
	movq	%rbx, %rax
	movsd	8(%rsp), %xmm1
	cqto
	idivq	%r12
	testq	%rdx, %rdx
	cmove	%r12, %rbp
	addq	$1, %r12
.L2:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r12, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L21
	jmp	.L5
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1072693248
	.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:
```