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>

int main(void)
{
  int n,i,time[101],a,b,j;

  while(scanf("%d",&n)!=EOF)
    {
      a=0;
      for(i=0;i<n;i++)
	{
	  scanf("%d",&time[i]);
	}

      for(i=0;i<n;i++)
	{
	  for(j=i+1;j<n;j++)
	    {
	      if(time[i]>time[j])
		{
		  b=time[i];
		  time[i]=time[j];
		  time[j]=b;
		}
	    }
	}
      for(i=1;i<n;i++)
	{
	  time[i]=time[i]+time[i-1]; 
	}
      for(i=0;i<n;i++)
	{
	  a+=time[i];
	}
      printf("%d\n",a);
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -428(%rbp)
	movl	$0, -432(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-432(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L4
	movl	$0, -432(%rbp)
	jmp	.L5
.L9:
	movl	-432(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -424(%rbp)
	jmp	.L6
.L8:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L7:
	addl	$1, -424(%rbp)
.L6:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L8
	addl	$1, -432(%rbp)
.L5:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L9
	movl	$1, -432(%rbp)
	jmp	.L10
.L11:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-432(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
.L10:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L11
	movl	$0, -432(%rbp)
	jmp	.L12
.L13:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -428(%rbp)
	addl	$1, -432(%rbp)
.L12:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L13
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L15
	movl	12(%rsp), %eax
	leaq	16(%rsp), %rbx
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	movq	%rbx, %r15
	testl	%eax, %eax
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r15
	cmpl	%r14d, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L4
	leaq	20(%rsp), %r9
	movl	$1, %r10d
	movq	%r9, %rdi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdi, %rax
	movl	%r10d, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	-4(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L7
	movl	%esi, -4(%rdi)
	movl	%ecx, (%rax)
.L7:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L8
	leal	1(%r10), %ecx
	movl	%r10d, %esi
	addq	$4, %rdi
	movl	%ecx, %r10d
	cmpl	%ecx, %r8d
	jne	.L5
	subl	$1, %esi
	movl	16(%rsp), %edx
	movq	%r9, %rax
	leaq	24(%rsp,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	addl	(%rax), %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%rsi, %rax
	jne	.L10
	testl	%ecx, %ecx
	movl	$1, %esi
	cmovg	%ecx, %esi
	cmpl	$3, %ecx
	jle	.L35
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	paddd	(%rbx), %xmm0
	addq	$16, %rbx
	cmpq	%rax, %rbx
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L17
	movslq	%eax, %rsi
	addl	$1, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jge	.L17
.L18:
	movslq	%eax, %rsi
	addl	$1, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jge	.L17
	cltq
	addl	16(%rsp,%rax,4), %edx
.L17:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	movl	16(%rsp), %edx
	movl	$1, %eax
	jmp	.L18
.L4:
	movl	$0, %edx
	cmove	16(%rsp), %edx
	jmp	.L17
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L15
	movl	12(%rsp), %eax
	leaq	16(%rsp), %rbx
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	movq	%rbx, %r15
	testl	%eax, %eax
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r15
	cmpl	%r14d, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L4
	leaq	20(%rsp), %r9
	movl	$1, %r10d
	movq	%r9, %rdi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdi, %rax
	movl	%r10d, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	-4(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L7
	movl	%esi, -4(%rdi)
	movl	%ecx, (%rax)
.L7:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L8
	leal	1(%r10), %ecx
	movl	%r10d, %esi
	addq	$4, %rdi
	movl	%ecx, %r10d
	cmpl	%ecx, %r8d
	jne	.L5
	subl	$1, %esi
	movl	16(%rsp), %edx
	movq	%r9, %rax
	leaq	24(%rsp,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	addl	(%rax), %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%rsi, %rax
	jne	.L10
	testl	%ecx, %ecx
	movl	$1, %esi
	cmovg	%ecx, %esi
	cmpl	$3, %ecx
	jle	.L35
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	paddd	(%rbx), %xmm0
	addq	$16, %rbx
	cmpq	%rax, %rbx
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L17
	movslq	%eax, %rsi
	addl	$1, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jge	.L17
.L18:
	movslq	%eax, %rsi
	addl	$1, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jge	.L17
	cltq
	addl	16(%rsp,%rax,4), %edx
.L17:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	movl	16(%rsp), %edx
	movl	$1, %eax
	jmp	.L18
.L4:
	movl	$0, %edx
	cmove	16(%rsp), %edx
	jmp	.L17
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main(void)
{
  int n,i,time[101],a,b,j;

  while(scanf("%d",&n)!=EOF)
    {
      a=0;
      for(i=0;i<n;i++)
	{
	  scanf("%d",&time[i]);
	}

      for(i=0;i<n;i++)
	{
	  for(j=i+1;j<n;j++)
	    {
	      if(time[i]>time[j])
		{
		  b=time[i];
		  time[i]=time[j];
		  time[j]=b;
		}
	    }
	}
      for(i=1;i<n;i++)
	{
	  time[i]=time[i]+time[i-1]; 
	}
      for(i=0;i<n;i++)
	{
	  a+=time[i];
	}
      printf("%d\n",a);
    }
  return 0;
}
3
10 20 30
7
56 26 62 43 38 80 7
 3
10 20 47
7
56 26 62 43 38 80 7
 3
19 20 47
7
56 26 62 43 38 80 7
 3
19 20 47
7
56 26 49 43 38 80 7
 3
19 20 2
7
56 26 49 43 38 80 7
 3
19 20 2
7
72 26 49 43 38 80 7
 3
19 20 2
7
72 26 49 43 38 80 3
 3
19 20 2
7
72 26 20 43 38 80 3
 3
19 20 2
7
72 26 20 43 66 80 3
 3
19 21 2
7
72 26 20 43 66 80 3

100
939
 117
939
 144
939
 144
906
 64
906
 64
938
 64
910
 64
776
 64
865
 65
865

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>

int main(void)
{
  int n,i,time[101],a,b,j;

  while(scanf("%d",&n)!=EOF)
    {
      a=0;
      for(i=0;i<n;i++)
	{
	  scanf("%d",&time[i]);
	}

      for(i=0;i<n;i++)
	{
	  for(j=i+1;j<n;j++)
	    {
	      if(time[i]>time[j])
		{
		  b=time[i];
		  time[i]=time[j];
		  time[j]=b;
		}
	    }
	}
      for(i=1;i<n;i++)
	{
	  time[i]=time[i]+time[i-1]; 
	}
      for(i=0;i<n;i++)
	{
	  a+=time[i];
	}
      printf("%d\n",a);
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -428(%rbp)
	movl	$0, -432(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-432(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L4
	movl	$0, -432(%rbp)
	jmp	.L5
.L9:
	movl	-432(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -424(%rbp)
	jmp	.L6
.L8:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L7:
	addl	$1, -424(%rbp)
.L6:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L8
	addl	$1, -432(%rbp)
.L5:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L9
	movl	$1, -432(%rbp)
	jmp	.L10
.L11:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-432(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
.L10:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L11
	movl	$0, -432(%rbp)
	jmp	.L12
.L13:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -428(%rbp)
	addl	$1, -432(%rbp)
.L12:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L13
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -428(%rbp)
	movl	$0, -432(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-432(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L4
	movl	$0, -432(%rbp)
	jmp	.L5
.L9:
	movl	-432(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -424(%rbp)
	jmp	.L6
.L8:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L7:
	addl	$1, -424(%rbp)
.L6:
	movl	-436(%rbp), %eax
	cmpl	%eax, -424(%rbp)
	jl	.L8
	addl	$1, -432(%rbp)
.L5:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L9
	movl	$1, -432(%rbp)
	jmp	.L10
.L11:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-432(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
.L10:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L11
	movl	$0, -432(%rbp)
	jmp	.L12
.L13:
	movl	-432(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -428(%rbp)
	addl	$1, -432(%rbp)
.L12:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L13
	movl	-428(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
