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(){
  int n,m,s,i,j,t,d[101];
  while(scanf("%d",&n)!=EOF){
    for(i=0;i<n;i++){
      scanf("%d",&d[i]);
      for(j=i;j;j--){
	if(d[j-1]>d[j]){
	  t=d[j-1];
	  d[j-1]=d[j];
	  d[j]=t;
	}
      }
    }
    s=0;
    for(i=0;i<n;i++){
      s+=d[i]*(n-i);
    }
    printf("%d\n",s);
  }
  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
.L10:
	movl	$0, -428(%rbp)
	jmp	.L3
.L7:
	leaq	-416(%rbp), %rdx
	movl	-428(%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
	movl	-428(%rbp), %eax
	movl	%eax, -424(%rbp)
	jmp	.L4
.L6:
	movl	-424(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-424(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L5:
	subl	$1, -424(%rbp)
.L4:
	cmpl	$0, -424(%rbp)
	jne	.L6
	addl	$1, -428(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L7
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	jmp	.L8
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-436(%rbp), %eax
	subl	-428(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -432(%rbp)
	addl	$1, -428(%rbp)
.L8:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L9
	movl	-432(%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	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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
.LC1:
	.string	"%d"
.LC3:
	.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	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	20(%rsp), %r14
	cmpl	$1, %eax
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	-4(%r14), %rsi
	leaq	0(,%r15,4), %rax
	movq	%r14, %rdx
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L4:
	movq	-4(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %eax
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L3
	movq	%xmm1, -4(%rdx)
.L3:
	subq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L4
	addq	$1, %r15
	movl	12(%rsp), %eax
	addq	$4, %r14
	leal	1(%r15), %edx
	cmpl	%edx, %eax
	jg	.L5
.L15:
	testl	%eax, %eax
	jle	.L6
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L17
	movl	%eax, %ecx
	movd	%eax, %xmm7
	pxor	%xmm3, %xmm3
	movq	%rbp, %rdx
	shrl	$2, %ecx
	movdqa	.LC0(%rip), %xmm4
	pshufd	$0, %xmm7, %xmm5
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	32(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm4, %xmm1
	movdqa	(%rdx), %xmm2
	movdqa	%xmm5, %xmm0
	addq	$16, %rdx
	psubd	%xmm1, %xmm0
	paddd	.LC2(%rip), %xmm4
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm2
	pmuludq	-16(%rdx), %xmm1
	pshufd	$8, %xmm1, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm2, %xmm0
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm1, %xmm3
	cmpq	%rcx, %rdx
	jne	.L8
	movdqa	%xmm3, %xmm0
	movl	%eax, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %edx
	testb	$3, %al
	je	.L10
.L7:
	movslq	%ecx, %rdi
	movl	%eax, %esi
	subl	%ecx, %esi
	imull	16(%rsp,%rdi,4), %esi
	addl	%esi, %edx
	leal	1(%rcx), %esi
	cmpl	%eax, %esi
	jge	.L10
	movslq	%esi, %r8
	movl	%eax, %edi
	addl	$2, %ecx
	subl	%esi, %edi
	imull	16(%rsp,%r8,4), %edi
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jle	.L10
	subl	%ecx, %eax
	movslq	%ecx, %rcx
	imull	16(%rsp,%rcx,4), %eax
	addl	%eax, %edx
.L10:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L12:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	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
.L6:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L10
.L17:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.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"
.LC3:
	.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	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	20(%rsp), %r14
	cmpl	$1, %eax
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	-4(%r14), %rsi
	leaq	0(,%r15,4), %rax
	movq	%r14, %rdx
	subq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L4:
	movq	-4(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %eax
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L3
	movq	%xmm1, -4(%rdx)
.L3:
	subq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L4
	addq	$1, %r15
	movl	12(%rsp), %eax
	addq	$4, %r14
	leal	1(%r15), %edx
	cmpl	%edx, %eax
	jg	.L5
.L15:
	testl	%eax, %eax
	jle	.L6
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L17
	movl	%eax, %ecx
	movd	%eax, %xmm7
	pxor	%xmm3, %xmm3
	movq	%rbp, %rdx
	shrl	$2, %ecx
	movdqa	.LC0(%rip), %xmm4
	pshufd	$0, %xmm7, %xmm5
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	32(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm4, %xmm1
	movdqa	(%rdx), %xmm2
	movdqa	%xmm5, %xmm0
	addq	$16, %rdx
	psubd	%xmm1, %xmm0
	paddd	.LC2(%rip), %xmm4
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm2
	pmuludq	-16(%rdx), %xmm1
	pshufd	$8, %xmm1, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm2, %xmm0
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm1, %xmm3
	cmpq	%rcx, %rdx
	jne	.L8
	movdqa	%xmm3, %xmm0
	movl	%eax, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %edx
	testb	$3, %al
	je	.L10
.L7:
	movslq	%ecx, %rdi
	movl	%eax, %esi
	subl	%ecx, %esi
	imull	16(%rsp,%rdi,4), %esi
	addl	%esi, %edx
	leal	1(%rcx), %esi
	cmpl	%eax, %esi
	jge	.L10
	movslq	%esi, %r8
	movl	%eax, %edi
	addl	$2, %ecx
	subl	%esi, %edi
	imull	16(%rsp,%r8,4), %edi
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jle	.L10
	subl	%ecx, %eax
	movslq	%ecx, %rcx
	imull	16(%rsp,%rcx,4), %eax
	addl	%eax, %edx
.L10:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L12:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	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
.L6:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L10
.L17:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L7
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.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>
int main(){
  int n,m,s,i,j,t,d[101];
  while(scanf("%d",&n)!=EOF){
    for(i=0;i<n;i++){
      scanf("%d",&d[i]);
      for(j=i;j;j--){
	if(d[j-1]>d[j]){
	  t=d[j-1];
	  d[j-1]=d[j];
	  d[j]=t;
	}
      }
    }
    s=0;
    for(i=0;i<n;i++){
      s+=d[i]*(n-i);
    }
    printf("%d\n",s);
  }
  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(){
  int n,m,s,i,j,t,d[101];
  while(scanf("%d",&n)!=EOF){
    for(i=0;i<n;i++){
      scanf("%d",&d[i]);
      for(j=i;j;j--){
	if(d[j-1]>d[j]){
	  t=d[j-1];
	  d[j-1]=d[j];
	  d[j]=t;
	}
      }
    }
    s=0;
    for(i=0;i<n;i++){
      s+=d[i]*(n-i);
    }
    printf("%d\n",s);
  }
  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
.L10:
	movl	$0, -428(%rbp)
	jmp	.L3
.L7:
	leaq	-416(%rbp), %rdx
	movl	-428(%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
	movl	-428(%rbp), %eax
	movl	%eax, -424(%rbp)
	jmp	.L4
.L6:
	movl	-424(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-424(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L5:
	subl	$1, -424(%rbp)
.L4:
	cmpl	$0, -424(%rbp)
	jne	.L6
	addl	$1, -428(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L7
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	jmp	.L8
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-436(%rbp), %eax
	subl	-428(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -432(%rbp)
	addl	$1, -428(%rbp)
.L8:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L9
	movl	-432(%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	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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
.L10:
	movl	$0, -428(%rbp)
	jmp	.L3
.L7:
	leaq	-416(%rbp), %rdx
	movl	-428(%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
	movl	-428(%rbp), %eax
	movl	%eax, -424(%rbp)
	jmp	.L4
.L6:
	movl	-424(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-424(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L5:
	subl	$1, -424(%rbp)
.L4:
	cmpl	$0, -424(%rbp)
	jne	.L6
	addl	$1, -428(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L7
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	jmp	.L8
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-436(%rbp), %eax
	subl	-428(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, -432(%rbp)
	addl	$1, -428(%rbp)
.L8:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L9
	movl	-432(%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	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
