Given the following C code and 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;
}```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.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
```assembly
	.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:
```
```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;
}```
Given the following C 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;
}```

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.
Optimized Assembly Code:

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 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;
}```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.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:
```