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

int main(void)
{
	int n, l;
	scanf("%d %d", &n, &l);
	int i = 1;
	int sum = 0;
	while (i <= n)
	{
		sum += i;
		i++;
	}
	if ( l >= 0)
	{
		printf("%d\n", n*l - n + sum - l);
	}
	else if (-1*l >= n)
	{
		printf("%d\n", n*l - n + sum - (l+n-1));
	}
	else
	{
		printf("%d\n", n*l - n + sum );
	}
	return (0);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L3
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L6
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%ecx, %edx
	subl	$1, %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L6:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.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
.LC1:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L11
	leal	-1(%rcx), %eax
	cmpl	$9, %eax
	jbe	.L12
	movl	%ecx, %edx
	movdqa	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	movdqa	.LC2(%rip), %xmm3
	shrl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm1, %xmm2
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%eax, %edx
	jne	.L4
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %edx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%esi, %ecx
	je	.L2
.L3:
	leal	1(%rdx), %esi
	addl	%edx, %eax
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	2(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	3(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	4(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	5(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	6(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	7(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	8(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	$9, %edx
	addl	%esi, %eax
	cmpl	%edx, %ecx
	jl	.L2
	addl	%edx, %eax
.L2:
	movl	4(%rsp), %esi
	testl	%esi, %esi
	jns	.L16
	movl	%esi, %edx
	negl	%edx
	cmpl	%edx, %ecx
	jle	.L17
	leal	-1(%rsi), %edx
	movl	$1, %edi
	movl	%edx, %esi
	imull	%ecx, %esi
	leal	(%rsi,%rax), %edx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	movl	%esi, %edx
	movl	$1, %edi
	imull	%ecx, %edx
	subl	%ecx, %edx
	addl	%eax, %edx
	leal	-1(%rsi,%rcx), %eax
	leaq	.LC3(%rip), %rsi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L16:
	leal	-1(%rsi), %edx
	movl	$1, %edi
	imull	%ecx, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	subl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L8
.L11:
	xorl	%eax, %eax
	jmp	.L2
.L12:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L3
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	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
.LC1:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L11
	leal	-1(%rcx), %eax
	cmpl	$9, %eax
	jbe	.L12
	movl	%ecx, %edx
	movdqa	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	movdqa	.LC2(%rip), %xmm3
	shrl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm1, %xmm2
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%eax, %edx
	jne	.L4
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %edx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%esi, %ecx
	je	.L2
.L3:
	leal	1(%rdx), %esi
	addl	%edx, %eax
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	2(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	3(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	4(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	5(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	6(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	7(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	%esi, %eax
	leal	8(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L2
	addl	$9, %edx
	addl	%esi, %eax
	cmpl	%edx, %ecx
	jl	.L2
	addl	%edx, %eax
.L2:
	movl	4(%rsp), %esi
	testl	%esi, %esi
	jns	.L16
	movl	%esi, %edx
	negl	%edx
	cmpl	%edx, %ecx
	jle	.L17
	leal	-1(%rsi), %edx
	movl	$1, %edi
	movl	%edx, %esi
	imull	%ecx, %esi
	leal	(%rsi,%rax), %edx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	movl	%esi, %edx
	movl	$1, %edi
	imull	%ecx, %edx
	subl	%ecx, %edx
	addl	%eax, %edx
	leal	-1(%rsi,%rcx), %eax
	leaq	.LC3(%rip), %rsi
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L16:
	leal	-1(%rsi), %edx
	movl	$1, %edi
	imull	%ecx, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	subl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L8
.L11:
	xorl	%eax, %eax
	jmp	.L2
.L12:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L3
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	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:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
	int n, l;
	scanf("%d %d", &n, &l);
	int i = 1;
	int sum = 0;
	while (i <= n)
	{
		sum += i;
		i++;
	}
	if ( l >= 0)
	{
		printf("%d\n", n*l - n + sum - l);
	}
	else if (-1*l >= n)
	{
		printf("%d\n", n*l - n + sum - (l+n-1));
	}
	else
	{
		printf("%d\n", n*l - n + sum );
	}
	return (0);
}


5 4
 13 -50
 3 -2
 5 7
 16 -50
 5 -2
 5 9
 23 -50
 4 -2
 8 9

26
 -534
 -3
 38
 -645
 0
 46
 -869
 -2
 91

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

int main(void)
{
	int n, l;
	scanf("%d %d", &n, &l);
	int i = 1;
	int sum = 0;
	while (i <= n)
	{
		sum += i;
		i++;
	}
	if ( l >= 0)
	{
		printf("%d\n", n*l - n + sum - l);
	}
	else if (-1*l >= n)
	{
		printf("%d\n", n*l - n + sum - (l+n-1));
	}
	else
	{
		printf("%d\n", n*l - n + sum );
	}
	return (0);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L3
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L6
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%ecx, %edx
	subl	$1, %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L6:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.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	"%d %d"
.LC1:
	.string	"%d\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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L3
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movl	-20(%rbp), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L6
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%ecx, %edx
	subl	$1, %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L6:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	imull	%edx, %eax
	movl	-24(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.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:
