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<math.h>
typedef long long int llint;

llint sum(llint n) {
	return n * (n + 1) / 2;
}

int main() {
	llint b;
	llint l, d, i, k;
	for (;;) {
		scanf("%lld", &b);
		if (b == 0) break;
		b *= 2;
		k = 0;
		for (i = 1; i <= sqrt(b); i++)
		{
			if (b % i == 0)
			{
				d = b / i;
				l = i;
				l--;
				l -= d;
				if (l < 0)
					continue;
				if (l % 2 == 1)
					continue;
				l /= 2;
				printf("%lld %lld\n", l + 1, d);
				k++;
				break;
			}
		}
		if (k > 0)
			continue;
		for (i = sqrt(b); i > 0; i--)
		{
			if (b % i == 0)
			{
				d = i;
				l = b / i;
				l--;
				l -= d;
				if (l < 0)
					continue;
				if (l % 2 == 1)
					continue;
				l /= 2;
				printf("%lld %lld\n", l + 1, d);
				break;
			}
		}
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sum
	.type	sum, @function
sum:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	addq	$1, %rax
	imulq	-8(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sum, .-sum
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	.L23
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -32(%rbp)
	movq	$1, -40(%rbp)
	jmp	.L6
.L11:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rax, -24(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	subq	$1, -16(%rbp)
	movq	-24(%rbp), %rax
	subq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L24
	movq	-16(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	je	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -32(%rbp)
	jmp	.L10
.L24:
	nop
	jmp	.L7
.L25:
	nop
.L7:
	addq	$1, -40(%rbp)
.L6:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-40(%rbp), %xmm1
	movsd	%xmm1, -56(%rbp)
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm3
	comisd	-56(%rbp), %xmm3
	jnb	.L11
.L10:
	cmpq	$0, -32(%rbp)
	jg	.L26
	movq	-48(%rbp), %rax
	pxor	%xmm4, %xmm4
	cvtsi2sdq	%rax, %xmm4
	movq	%xmm4, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -40(%rbp)
	jmp	.L14
.L18:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L15
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rax, -16(%rbp)
	subq	$1, -16(%rbp)
	movq	-24(%rbp), %rax
	subq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L27
	movq	-16(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	je	.L28
	movq	-16(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L27:
	nop
	jmp	.L15
.L28:
	nop
.L15:
	subq	$1, -40(%rbp)
.L14:
	cmpq	$0, -40(%rbp)
	jg	.L18
	jmp	.L19
.L26:
	nop
.L13:
	jmp	.L19
.L23:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	sum
	.type	sum, @function
sum:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	1(%rdi), %rdx
	imulq	%rdi, %rdx
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	ret
	.cfi_endproc
.LFE23:
	.size	sum, .-sum
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rbx
	testq	%rbx, %rbx
	je	.L5
	addq	%rbx, %rbx
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rbx, %xmm1
	movq	%rbx, 16(%rsp)
	ucomisd	%xmm1, %xmm3
	ja	.L31
	movapd	%xmm1, %xmm0
	movl	$1, %esi
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rsi, %xmm1
	sqrtsd	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jb	.L19
.L15:
	movq	%rbx, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L13
	leaq	-1(%rsi), %rdx
	subq	%rax, %rdx
	js	.L13
	testb	$1, %dl
	jne	.L13
.L12:
	sarq	%rdx
	movq	%rax, %rcx
	movq	%r13, %rsi
	movl	$1, %edi
	addq	$1, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rsi
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rsi, %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L15
.L19:
	cvttsd2siq	%xmm0, %rcx
	testq	%rcx, %rcx
	jle	.L4
.L21:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L20
	subq	$1, %rax
	subq	%rcx, %rax
	js	.L20
	testb	$1, %al
	jne	.L20
	sarq	%rax
	movq	%r13, %rsi
	movl	$1, %edi
	leaq	1(%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L20:
	subq	$1, %rcx
	jne	.L21
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore_state
	movl	$1, %r14d
.L6:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r14, %xmm0
	comisd	%xmm0, %xmm2
	jb	.L32
	movq	%rbx, %rax
	cqto
	idivq	%r14
	testq	%rdx, %rdx
	jne	.L11
	leaq	-1(%r14), %rdx
	subq	%rax, %rdx
	js	.L11
	testb	$1, %dl
	je	.L12
.L11:
	addq	$1, %r14
	jmp	.L6
.L32:
	pxor	%xmm4, %xmm4
	ucomisd	%xmm1, %xmm4
	jbe	.L36
	movapd	%xmm1, %xmm0
	call	sqrt@PLT
	jmp	.L19
.L35:
	call	__stack_chk_fail@PLT
.L36:
	sqrtsd	%xmm1, %xmm0
	jmp	.L19
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	sum
	.type	sum, @function
sum:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	1(%rdi), %rdx
	imulq	%rdi, %rdx
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	ret
	.cfi_endproc
.LFE23:
	.size	sum, .-sum
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld %lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rbx
	testq	%rbx, %rbx
	je	.L5
	addq	%rbx, %rbx
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rbx, %xmm1
	movq	%rbx, 16(%rsp)
	ucomisd	%xmm1, %xmm3
	ja	.L31
	movapd	%xmm1, %xmm0
	movl	$1, %esi
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rsi, %xmm1
	sqrtsd	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jb	.L19
.L15:
	movq	%rbx, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L13
	leaq	-1(%rsi), %rdx
	subq	%rax, %rdx
	js	.L13
	testb	$1, %dl
	jne	.L13
.L12:
	sarq	%rdx
	movq	%rax, %rcx
	movq	%r13, %rsi
	movl	$1, %edi
	addq	$1, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rsi
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rsi, %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L15
.L19:
	cvttsd2siq	%xmm0, %rcx
	testq	%rcx, %rcx
	jle	.L4
.L21:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L20
	subq	$1, %rax
	subq	%rcx, %rax
	js	.L20
	testb	$1, %al
	jne	.L20
	sarq	%rax
	movq	%r13, %rsi
	movl	$1, %edi
	leaq	1(%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L20:
	subq	$1, %rcx
	jne	.L21
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore_state
	movl	$1, %r14d
.L6:
	movapd	%xmm1, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%r14, %xmm0
	comisd	%xmm0, %xmm2
	jb	.L32
	movq	%rbx, %rax
	cqto
	idivq	%r14
	testq	%rdx, %rdx
	jne	.L11
	leaq	-1(%r14), %rdx
	subq	%rax, %rdx
	js	.L11
	testb	$1, %dl
	je	.L12
.L11:
	addq	$1, %r14
	jmp	.L6
.L32:
	pxor	%xmm4, %xmm4
	ucomisd	%xmm1, %xmm4
	jbe	.L36
	movapd	%xmm1, %xmm0
	call	sqrt@PLT
	jmp	.L19
.L35:
	call	__stack_chk_fail@PLT
.L36:
	sqrtsd	%xmm1, %xmm0
	jmp	.L19
	.cfi_endproc
.LFE24:
	.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<math.h>
typedef long long int llint;

llint sum(llint n) {
	return n * (n + 1) / 2;
}

int main() {
	llint b;
	llint l, d, i, k;
	for (;;) {
		scanf("%lld", &b);
		if (b == 0) break;
		b *= 2;
		k = 0;
		for (i = 1; i <= sqrt(b); i++)
		{
			if (b % i == 0)
			{
				d = b / i;
				l = i;
				l--;
				l -= d;
				if (l < 0)
					continue;
				if (l % 2 == 1)
					continue;
				l /= 2;
				printf("%lld %lld\n", l + 1, d);
				k++;
				break;
			}
		}
		if (k > 0)
			continue;
		for (i = sqrt(b); i > 0; i--)
		{
			if (b % i == 0)
			{
				d = i;
				l = b / i;
				l--;
				l -= d;
				if (l < 0)
					continue;
				if (l % 2 == 1)
					continue;
				l /= 2;
				printf("%lld %lld\n", l + 1, d);
				break;
			}
		}
	}
	return 0;
}

15
16
2
3
9699690
116276261
847288609
900660121
987698769
999999999
0
 15
16
2
3
9699690
223092870
869854515
900660121
987698769
999999999
0
 15
26
2
3
9699690
223092870
869854515
900660121
987698769
999999999
0
 15
26
3
3
9699690
223092870
869854515
900660121
987698769
999999999
0
 15
26
3
3
6561145
223092870
869854515
900660121
987698769
999999999
0
 15
26
3
5
6561145
223092870
869854515
900660121
987698769
999999999
0
 15
16
4
3
9699690
223092870
847288609
900660121
987698769
999999999
0
 15
16
2
3
9699690
116276261
932780910
900660121
987698769
999999999
0
 15
26
3
3
9699690
219653957
869854515
900660121
987698769
999999999
0
 15
26
3
5
6561145
223092870
151086107
900660121
987698769
999999999
0

1 5
16 1
2 1
1 2
16 4389
1236935 94
4112949 206
15006 30011
46887 17718
163837 5994
 1 5
16 1
2 1
1 2
16 4389
129 20995
28995136 30
15006 30011
46887 17718
163837 5994
 1 5
5 4
2 1
1 2
16 4389
129 20995
28995136 30
15006 30011
46887 17718
163837 5994
 1 5
5 4
1 2
1 2
16 4389
129 20995
28995136 30
15006 30011
46887 17718
163837 5994
 1 5
5 4
1 2
1 2
656110 10
129 20995
28995136 30
15006 30011
46887 17718
163837 5994
 1 5
5 4
1 2
2 2
656110 10
129 20995
28995136 30
15006 30011
46887 17718
163837 5994
 1 5
16 1
4 1
1 2
16 4389
129 20995
4112949 206
15006 30011
46887 17718
163837 5994
 1 5
16 1
2 1
1 2
16 4389
1236935 94
342 42852
15006 30011
46887 17718
163837 5994
 1 5
5 4
1 2
1 2
16 4389
6460394 34
28995136 30
15006 30011
46887 17718
163837 5994
 1 5
5 4
1 2
2 2
656110 10
129 20995
1842473 82
15006 30011
46887 17718
163837 5994

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<math.h>
typedef long long int llint;

llint sum(llint n) {
	return n * (n + 1) / 2;
}

int main() {
	llint b;
	llint l, d, i, k;
	for (;;) {
		scanf("%lld", &b);
		if (b == 0) break;
		b *= 2;
		k = 0;
		for (i = 1; i <= sqrt(b); i++)
		{
			if (b % i == 0)
			{
				d = b / i;
				l = i;
				l--;
				l -= d;
				if (l < 0)
					continue;
				if (l % 2 == 1)
					continue;
				l /= 2;
				printf("%lld %lld\n", l + 1, d);
				k++;
				break;
			}
		}
		if (k > 0)
			continue;
		for (i = sqrt(b); i > 0; i--)
		{
			if (b % i == 0)
			{
				d = i;
				l = b / i;
				l--;
				l -= d;
				if (l < 0)
					continue;
				if (l % 2 == 1)
					continue;
				l /= 2;
				printf("%lld %lld\n", l + 1, d);
				break;
			}
		}
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sum
	.type	sum, @function
sum:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	addq	$1, %rax
	imulq	-8(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sum, .-sum
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	.L23
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -32(%rbp)
	movq	$1, -40(%rbp)
	jmp	.L6
.L11:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rax, -24(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	subq	$1, -16(%rbp)
	movq	-24(%rbp), %rax
	subq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L24
	movq	-16(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	je	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -32(%rbp)
	jmp	.L10
.L24:
	nop
	jmp	.L7
.L25:
	nop
.L7:
	addq	$1, -40(%rbp)
.L6:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-40(%rbp), %xmm1
	movsd	%xmm1, -56(%rbp)
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm3
	comisd	-56(%rbp), %xmm3
	jnb	.L11
.L10:
	cmpq	$0, -32(%rbp)
	jg	.L26
	movq	-48(%rbp), %rax
	pxor	%xmm4, %xmm4
	cvtsi2sdq	%rax, %xmm4
	movq	%xmm4, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -40(%rbp)
	jmp	.L14
.L18:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L15
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rax, -16(%rbp)
	subq	$1, -16(%rbp)
	movq	-24(%rbp), %rax
	subq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L27
	movq	-16(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	je	.L28
	movq	-16(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L27:
	nop
	jmp	.L15
.L28:
	nop
.L15:
	subq	$1, -40(%rbp)
.L14:
	cmpq	$0, -40(%rbp)
	jg	.L18
	jmp	.L19
.L26:
	nop
.L13:
	jmp	.L19
.L23:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	sum
	.type	sum, @function
sum:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	addq	$1, %rax
	imulq	-8(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sum, .-sum
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	.L23
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -32(%rbp)
	movq	$1, -40(%rbp)
	jmp	.L6
.L11:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rax, -24(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	subq	$1, -16(%rbp)
	movq	-24(%rbp), %rax
	subq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L24
	movq	-16(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	je	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -32(%rbp)
	jmp	.L10
.L24:
	nop
	jmp	.L7
.L25:
	nop
.L7:
	addq	$1, -40(%rbp)
.L6:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-40(%rbp), %xmm1
	movsd	%xmm1, -56(%rbp)
	movq	-48(%rbp), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm3
	comisd	-56(%rbp), %xmm3
	jnb	.L11
.L10:
	cmpq	$0, -32(%rbp)
	jg	.L26
	movq	-48(%rbp), %rax
	pxor	%xmm4, %xmm4
	cvtsi2sdq	%rax, %xmm4
	movq	%xmm4, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -40(%rbp)
	jmp	.L14
.L18:
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L15
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-48(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rax, -16(%rbp)
	subq	$1, -16(%rbp)
	movq	-24(%rbp), %rax
	subq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	js	.L27
	movq	-16(%rbp), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	cmpq	$1, %rax
	je	.L28
	movq	-16(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L27:
	nop
	jmp	.L15
.L28:
	nop
.L15:
	subq	$1, -40(%rbp)
.L14:
	cmpq	$0, -40(%rbp)
	jg	.L18
	jmp	.L19
.L26:
	nop
.L13:
	jmp	.L19
.L23:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
