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,i,j,t,m[10000];
  long  s;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&m[i]);
    }
    for(i=0;i<n;i++){
      for(j=1;j+i<n;j++){
	if(m[j-1]>m[j]){
	  t=m[j-1];
	  m[j-1]=m[j];
	  m[j]=t;
	}
      }
    }
    s=0;
    for(i=0;i<n;i++){
      s+=m[i]*(n-i-1);
    }
    printf("%ld\n",s);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\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
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L13:
	leaq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40040(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	movl	$0, -40036(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rdx
	movl	-40036(%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, -40036(%rbp)
.L4:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L5
	movl	$0, -40036(%rbp)
	jmp	.L6
.L10:
	movl	$1, -40032(%rbp)
	jmp	.L7
.L9:
	movl	-40032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movl	-40032(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-40032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -40028(%rbp)
	movl	-40032(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-40032(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -40016(%rbp,%rax,4)
	movl	-40032(%rbp), %eax
	cltq
	movl	-40028(%rbp), %edx
	movl	%edx, -40016(%rbp,%rax,4)
.L8:
	addl	$1, -40032(%rbp)
.L7:
	movl	-40032(%rbp), %edx
	movl	-40036(%rbp), %eax
	addl	%eax, %edx
	movl	-40040(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L9
	addl	$1, -40036(%rbp)
.L6:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L10
	movq	$0, -40024(%rbp)
	movl	$0, -40036(%rbp)
	jmp	.L11
.L12:
	movl	-40036(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movl	-40040(%rbp), %eax
	subl	-40036(%rbp), %eax
	subl	$1, %eax
	imull	%edx, %eax
	cltq
	addq	%rax, -40024(%rbp)
	addl	$1, -40036(%rbp)
.L11:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L12
	movq	-40024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	"%ld\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
	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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3192, %rsp
	.cfi_def_cfa_offset 40112
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 40040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L15:
	movq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L3
	movq	%rbp, %rbx
	movq	%rbp, %r14
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edi
	addq	$4, %r14
	cmpl	%r15d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	xorl	%r8d, %r8d
	leal	-1(%rdi), %r9d
.L5:
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jle	.L28
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %eax
	movq	%rbp, %rdx
	subl	%r8d, %eax
	leaq	0(%r13,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %eax
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L6
	movq	%xmm1, (%rdx)
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jg	.L10
.L28:
	jne	.L5
	cmpl	$2, %r9d
	jbe	.L19
	movd	%edi, %xmm5
	pxor	%xmm7, %xmm7
	pxor	%xmm4, %xmm4
	movl	%edi, %eax
	shrl	$2, %eax
	pshufd	$0, %xmm5, %xmm6
	movdqa	.LC0(%rip), %xmm3
	pcmpeqd	%xmm5, %xmm5
	leal	-1(%rax), %edx
	leaq	16(%rbp), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	addq	$16, %rax
.L13:
	movdqa	%xmm3, %xmm1
	movdqa	%xmm6, %xmm0
	movdqa	(%rbx), %xmm2
	paddd	.LC2(%rip), %xmm3
	psubd	%xmm1, %xmm0
	paddd	%xmm5, %xmm0
	psrlq	$32, %xmm2
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	(%rbx), %xmm1
	movq	%rax, %rbx
	pmuludq	%xmm2, %xmm0
	pshufd	$8, %xmm1, %xmm1
	movdqa	%xmm4, %xmm2
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pcmpgtd	%xmm1, %xmm2
	movdqa	%xmm1, %xmm0
	punpckldq	%xmm2, %xmm0
	punpckhdq	%xmm2, %xmm1
	paddq	%xmm7, %xmm0
	movdqa	%xmm0, %xmm7
	paddq	%xmm1, %xmm7
	cmpq	%rdx, %rax
	jne	.L29
	movdqa	%xmm7, %xmm0
	movl	%edi, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm7
	movq	%xmm7, %rdx
	testb	$3, %dil
	je	.L16
.L12:
	movl	%edi, %ecx
	movslq	%eax, %rsi
	subl	%eax, %ecx
	subl	$1, %ecx
	imull	32(%rsp,%rsi,4), %ecx
	leal	1(%rax), %esi
	movslq	%ecx, %rcx
	addq	%rcx, %rdx
	cmpl	%esi, %edi
	jle	.L16
	movl	%edi, %ecx
	subl	%esi, %ecx
	movslq	%esi, %rsi
	subl	$1, %ecx
	imull	32(%rsp,%rsi,4), %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rdx
	leal	2(%rax), %ecx
	cmpl	%ecx, %edi
	jle	.L16
	subl	%ecx, %edi
	movslq	%ecx, %rcx
	leal	-1(%rdi), %eax
	imull	32(%rsp,%rcx,4), %eax
	cltq
	addq	%rax, %rdx
.L16:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L2:
	movq	40040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40056, %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
.L3:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L16
.L19:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L12
.L30:
	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	"%ld\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
	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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3192, %rsp
	.cfi_def_cfa_offset 40112
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 40040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L15:
	movq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L3
	movq	%rbp, %rbx
	movq	%rbp, %r14
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edi
	addq	$4, %r14
	cmpl	%r15d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	xorl	%r8d, %r8d
	leal	-1(%rdi), %r9d
.L5:
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jle	.L28
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %eax
	movq	%rbp, %rdx
	subl	%r8d, %eax
	leaq	0(%r13,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %eax
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L6
	movq	%xmm1, (%rdx)
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jg	.L10
.L28:
	jne	.L5
	cmpl	$2, %r9d
	jbe	.L19
	movd	%edi, %xmm5
	pxor	%xmm7, %xmm7
	pxor	%xmm4, %xmm4
	movl	%edi, %eax
	shrl	$2, %eax
	pshufd	$0, %xmm5, %xmm6
	movdqa	.LC0(%rip), %xmm3
	pcmpeqd	%xmm5, %xmm5
	leal	-1(%rax), %edx
	leaq	16(%rbp), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	addq	$16, %rax
.L13:
	movdqa	%xmm3, %xmm1
	movdqa	%xmm6, %xmm0
	movdqa	(%rbx), %xmm2
	paddd	.LC2(%rip), %xmm3
	psubd	%xmm1, %xmm0
	paddd	%xmm5, %xmm0
	psrlq	$32, %xmm2
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	(%rbx), %xmm1
	movq	%rax, %rbx
	pmuludq	%xmm2, %xmm0
	pshufd	$8, %xmm1, %xmm1
	movdqa	%xmm4, %xmm2
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	pcmpgtd	%xmm1, %xmm2
	movdqa	%xmm1, %xmm0
	punpckldq	%xmm2, %xmm0
	punpckhdq	%xmm2, %xmm1
	paddq	%xmm7, %xmm0
	movdqa	%xmm0, %xmm7
	paddq	%xmm1, %xmm7
	cmpq	%rdx, %rax
	jne	.L29
	movdqa	%xmm7, %xmm0
	movl	%edi, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm7
	movq	%xmm7, %rdx
	testb	$3, %dil
	je	.L16
.L12:
	movl	%edi, %ecx
	movslq	%eax, %rsi
	subl	%eax, %ecx
	subl	$1, %ecx
	imull	32(%rsp,%rsi,4), %ecx
	leal	1(%rax), %esi
	movslq	%ecx, %rcx
	addq	%rcx, %rdx
	cmpl	%esi, %edi
	jle	.L16
	movl	%edi, %ecx
	subl	%esi, %ecx
	movslq	%esi, %rsi
	subl	$1, %ecx
	imull	32(%rsp,%rsi,4), %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %rdx
	leal	2(%rax), %ecx
	cmpl	%ecx, %edi
	jle	.L16
	subl	%ecx, %edi
	movslq	%ecx, %rcx
	leal	-1(%rdi), %eax
	imull	32(%rsp,%rcx,4), %eax
	cltq
	addq	%rax, %rdx
.L16:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L15
.L2:
	movq	40040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40056, %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
.L3:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L16
.L19:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L12
.L30:
	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,i,j,t,m[10000];
  long  s;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&m[i]);
    }
    for(i=0;i<n;i++){
      for(j=1;j+i<n;j++){
	if(m[j-1]>m[j]){
	  t=m[j-1];
	  m[j-1]=m[j];
	  m[j]=t;
	}
      }
    }
    s=0;
    for(i=0;i<n;i++){
      s+=m[i]*(n-i-1);
    }
    printf("%ld\n",s);
  }
  return 0;
}
5
2
6
4
6
9
0
 5
2
10
4
6
9
0
 5
2
6
4
7
9
0
 5
2
10
4
7
9
0
 5
2
17
8
7
9
0
 5
4
6
4
7
14
0
 5
2
17
8
7
12
0
 5
4
6
5
7
14
0
 5
1
17
8
7
12
0
 5
0
17
8
7
12
0

38
 41
 39
 43
 54
 47
 57
 50
 53
 49

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,i,j,t,m[10000];
  long  s;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&m[i]);
    }
    for(i=0;i<n;i++){
      for(j=1;j+i<n;j++){
	if(m[j-1]>m[j]){
	  t=m[j-1];
	  m[j-1]=m[j];
	  m[j]=t;
	}
      }
    }
    s=0;
    for(i=0;i<n;i++){
      s+=m[i]*(n-i-1);
    }
    printf("%ld\n",s);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\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
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L13:
	leaq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40040(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	movl	$0, -40036(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rdx
	movl	-40036(%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, -40036(%rbp)
.L4:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L5
	movl	$0, -40036(%rbp)
	jmp	.L6
.L10:
	movl	$1, -40032(%rbp)
	jmp	.L7
.L9:
	movl	-40032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movl	-40032(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-40032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -40028(%rbp)
	movl	-40032(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-40032(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -40016(%rbp,%rax,4)
	movl	-40032(%rbp), %eax
	cltq
	movl	-40028(%rbp), %edx
	movl	%edx, -40016(%rbp,%rax,4)
.L8:
	addl	$1, -40032(%rbp)
.L7:
	movl	-40032(%rbp), %edx
	movl	-40036(%rbp), %eax
	addl	%eax, %edx
	movl	-40040(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L9
	addl	$1, -40036(%rbp)
.L6:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L10
	movq	$0, -40024(%rbp)
	movl	$0, -40036(%rbp)
	jmp	.L11
.L12:
	movl	-40036(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movl	-40040(%rbp), %eax
	subl	-40036(%rbp), %eax
	subl	$1, %eax
	imull	%edx, %eax
	cltq
	addq	%rax, -40024(%rbp)
	addl	$1, -40036(%rbp)
.L11:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L12
	movq	-40024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	"%ld\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
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L13:
	leaq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40040(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	movl	$0, -40036(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rdx
	movl	-40036(%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, -40036(%rbp)
.L4:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L5
	movl	$0, -40036(%rbp)
	jmp	.L6
.L10:
	movl	$1, -40032(%rbp)
	jmp	.L7
.L9:
	movl	-40032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movl	-40032(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-40032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -40028(%rbp)
	movl	-40032(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-40032(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -40016(%rbp,%rax,4)
	movl	-40032(%rbp), %eax
	cltq
	movl	-40028(%rbp), %edx
	movl	%edx, -40016(%rbp,%rax,4)
.L8:
	addl	$1, -40032(%rbp)
.L7:
	movl	-40032(%rbp), %edx
	movl	-40036(%rbp), %eax
	addl	%eax, %edx
	movl	-40040(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L9
	addl	$1, -40036(%rbp)
.L6:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L10
	movq	$0, -40024(%rbp)
	movl	$0, -40036(%rbp)
	jmp	.L11
.L12:
	movl	-40036(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %edx
	movl	-40040(%rbp), %eax
	subl	-40036(%rbp), %eax
	subl	$1, %eax
	imull	%edx, %eax
	cltq
	addq	%rax, -40024(%rbp)
	addl	$1, -40036(%rbp)
.L11:
	movl	-40040(%rbp), %eax
	cmpl	%eax, -40036(%rbp)
	jl	.L12
	movq	-40024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
