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(void)
{
        int n,x,y,i,j;
        long s;

        scanf("%d",&n);

        int d[n];

        for(i=0;i<n;i++)
                scanf("%d",&d[i]);

        s=0;
        for(i=0;i<n-1;i++){
                for(j=i+1;j<n;j++){
                        s=s+d[i]*d[j];
                }
        }

        printf("%ld",s);
        return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	movq	%r14, %rdi
	leaq	-44(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-44(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdi
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L27:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L27
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L28
.L4:
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edi
	addq	$4, %r13
	cmpl	%r12d, %edi
	jg	.L6
.L5:
	leal	-1(%rdi), %r12d
	testl	%r12d, %r12d
	jle	.L15
	movl	%r12d, %r10d
	leaq	4(%rbx), %r9
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	pxor	%xmm6, %xmm6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %esi
	leal	-1(%r10), %r11d
	cmpl	%edi, %esi
	jge	.L8
	leal	-1(%r10), %r11d
	movl	-4(%r9), %edx
	cmpl	$2, %r11d
	jbe	.L16
	movl	%r10d, %eax
	movd	%edx, %xmm7
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm7, %xmm4
	subl	$1, %eax
	movdqa	%xmm4, %xmm5
	salq	$4, %rax
	psrlq	$32, %xmm5
	leaq	16(%r9,%rax), %rcx
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	psrlq	$32, %xmm1
	pmuludq	%xmm4, %xmm0
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm6, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rcx, %rax
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%r10d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rax
	addq	%rax, %r8
	leal	(%rcx,%rsi), %eax
	cmpl	%r10d, %ecx
	je	.L8
.L9:
	movslq	%eax, %rcx
	leaq	(%rbx,%rcx,4), %r10
	movl	(%r10), %ecx
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	leal	1(%rax), %ecx
	cmpl	%edi, %ecx
	jge	.L8
	movl	4(%r10), %ecx
	addl	$2, %eax
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	cmpl	%eax, %edi
	jle	.L8
	imull	8(%r10), %edx
	movslq	%edx, %rdx
	addq	%rdx, %r8
.L8:
	movl	%r11d, %r10d
	addq	$4, %r9
	cmpl	%esi, %r12d
	jne	.L13
.L7:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L29
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	jmp	.L9
.L28:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%r8d, %r8d
	jmp	.L7
.L29:
	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:
```

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
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	movq	%r14, %rdi
	leaq	-44(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-44(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdi
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L27:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L27
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L28
.L4:
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edi
	addq	$4, %r13
	cmpl	%r12d, %edi
	jg	.L6
.L5:
	leal	-1(%rdi), %r12d
	testl	%r12d, %r12d
	jle	.L15
	movl	%r12d, %r10d
	leaq	4(%rbx), %r9
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	pxor	%xmm6, %xmm6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %esi
	leal	-1(%r10), %r11d
	cmpl	%edi, %esi
	jge	.L8
	leal	-1(%r10), %r11d
	movl	-4(%r9), %edx
	cmpl	$2, %r11d
	jbe	.L16
	movl	%r10d, %eax
	movd	%edx, %xmm7
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm7, %xmm4
	subl	$1, %eax
	movdqa	%xmm4, %xmm5
	salq	$4, %rax
	psrlq	$32, %xmm5
	leaq	16(%r9,%rax), %rcx
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	psrlq	$32, %xmm1
	pmuludq	%xmm4, %xmm0
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm6, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rcx, %rax
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%r10d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rax
	addq	%rax, %r8
	leal	(%rcx,%rsi), %eax
	cmpl	%r10d, %ecx
	je	.L8
.L9:
	movslq	%eax, %rcx
	leaq	(%rbx,%rcx,4), %r10
	movl	(%r10), %ecx
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	leal	1(%rax), %ecx
	cmpl	%edi, %ecx
	jge	.L8
	movl	4(%r10), %ecx
	addl	$2, %eax
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	cmpl	%eax, %edi
	jle	.L8
	imull	8(%r10), %edx
	movslq	%edx, %rdx
	addq	%rdx, %r8
.L8:
	movl	%r11d, %r10d
	addq	$4, %r9
	cmpl	%esi, %r12d
	jne	.L13
.L7:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L29
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	jmp	.L9
.L28:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%r8d, %r8d
	jmp	.L7
.L29:
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	movq	%r14, %rdi
	leaq	-44(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-44(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdi
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L27:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L27
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L28
.L4:
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edi
	addq	$4, %r13
	cmpl	%r12d, %edi
	jg	.L6
.L5:
	leal	-1(%rdi), %r12d
	testl	%r12d, %r12d
	jle	.L15
	movl	%r12d, %r10d
	leaq	4(%rbx), %r9
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	pxor	%xmm6, %xmm6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %esi
	leal	-1(%r10), %r11d
	cmpl	%edi, %esi
	jge	.L8
	leal	-1(%r10), %r11d
	movl	-4(%r9), %edx
	cmpl	$2, %r11d
	jbe	.L16
	movl	%r10d, %eax
	movd	%edx, %xmm7
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm7, %xmm4
	subl	$1, %eax
	movdqa	%xmm4, %xmm5
	salq	$4, %rax
	psrlq	$32, %xmm5
	leaq	16(%r9,%rax), %rcx
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	psrlq	$32, %xmm1
	pmuludq	%xmm4, %xmm0
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm6, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rcx, %rax
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%r10d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rax
	addq	%rax, %r8
	leal	(%rcx,%rsi), %eax
	cmpl	%r10d, %ecx
	je	.L8
.L9:
	movslq	%eax, %rcx
	leaq	(%rbx,%rcx,4), %r10
	movl	(%r10), %ecx
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	leal	1(%rax), %ecx
	cmpl	%edi, %ecx
	jge	.L8
	movl	4(%r10), %ecx
	addl	$2, %eax
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	cmpl	%eax, %edi
	jle	.L8
	imull	8(%r10), %edx
	movslq	%edx, %rdx
	addq	%rdx, %r8
.L8:
	movl	%r11d, %r10d
	addq	$4, %r9
	cmpl	%esi, %r12d
	jne	.L13
.L7:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L29
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	jmp	.L9
.L28:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%r8d, %r8d
	jmp	.L7
.L29:
	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:
```
```c
#include <stdio.h>

int main(void)
{
        int n,x,y,i,j;
        long s;

        scanf("%d",&n);

        int d[n];

        for(i=0;i<n;i++)
                scanf("%d",&d[i]);

        s=0;
        for(i=0;i<n-1;i++){
                for(j=i+1;j<n;j++){
                        s=s+d[i]*d[j];
                }
        }

        printf("%ld",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(void)
{
        int n,x,y,i,j;
        long s;

        scanf("%d",&n);

        int d[n];

        for(i=0;i<n;i++)
                scanf("%d",&d[i]);

        s=0;
        for(i=0;i<n-1;i++){
                for(j=i+1;j<n;j++){
                        s=s+d[i]*d[j];
                }
        }

        printf("%ld",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
3 1 3
 7
5 0 7 8 6 3 2
 3
3 1 5
 7
5 0 7 10 6 3 2
 3
1 1 5
 7
5 0 7 2 6 3 2
 3
1 1 8
 7
5 -1 7 2 6 3 2
 3
0 1 8
 7
5 -1 7 2 12 3 2

15 387 23 433 11 249 17 224 8 332
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(void)
{
        int n,x,y,i,j;
        long s;

        scanf("%d",&n);

        int d[n];

        for(i=0;i<n;i++)
                scanf("%d",&d[i]);

        s=0;
        for(i=0;i<n-1;i++){
                for(j=i+1;j<n;j++){
                        s=s+d[i]*d[j];
                }
        }

        printf("%ld",s);
        return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	movq	%r14, %rdi
	leaq	-44(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-44(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdi
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L27:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L27
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L28
.L4:
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edi
	addq	$4, %r13
	cmpl	%r12d, %edi
	jg	.L6
.L5:
	leal	-1(%rdi), %r12d
	testl	%r12d, %r12d
	jle	.L15
	movl	%r12d, %r10d
	leaq	4(%rbx), %r9
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	pxor	%xmm6, %xmm6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %esi
	leal	-1(%r10), %r11d
	cmpl	%edi, %esi
	jge	.L8
	leal	-1(%r10), %r11d
	movl	-4(%r9), %edx
	cmpl	$2, %r11d
	jbe	.L16
	movl	%r10d, %eax
	movd	%edx, %xmm7
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm7, %xmm4
	subl	$1, %eax
	movdqa	%xmm4, %xmm5
	salq	$4, %rax
	psrlq	$32, %xmm5
	leaq	16(%r9,%rax), %rcx
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	psrlq	$32, %xmm1
	pmuludq	%xmm4, %xmm0
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm6, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rcx, %rax
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%r10d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rax
	addq	%rax, %r8
	leal	(%rcx,%rsi), %eax
	cmpl	%r10d, %ecx
	je	.L8
.L9:
	movslq	%eax, %rcx
	leaq	(%rbx,%rcx,4), %r10
	movl	(%r10), %ecx
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	leal	1(%rax), %ecx
	cmpl	%edi, %ecx
	jge	.L8
	movl	4(%r10), %ecx
	addl	$2, %eax
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	cmpl	%eax, %edi
	jle	.L8
	imull	8(%r10), %edx
	movslq	%edx, %rdx
	addq	%rdx, %r8
.L8:
	movl	%r11d, %r10d
	addq	$4, %r9
	cmpl	%esi, %r12d
	jne	.L13
.L7:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L29
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	jmp	.L9
.L28:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%r8d, %r8d
	jmp	.L7
.L29:
	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:
```

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
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	movq	%r14, %rdi
	leaq	-44(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-44(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdi
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L27:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L27
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L28
.L4:
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edi
	addq	$4, %r13
	cmpl	%r12d, %edi
	jg	.L6
.L5:
	leal	-1(%rdi), %r12d
	testl	%r12d, %r12d
	jle	.L15
	movl	%r12d, %r10d
	leaq	4(%rbx), %r9
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	pxor	%xmm6, %xmm6
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %esi
	leal	-1(%r10), %r11d
	cmpl	%edi, %esi
	jge	.L8
	leal	-1(%r10), %r11d
	movl	-4(%r9), %edx
	cmpl	$2, %r11d
	jbe	.L16
	movl	%r10d, %eax
	movd	%edx, %xmm7
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm7, %xmm4
	subl	$1, %eax
	movdqa	%xmm4, %xmm5
	salq	$4, %rax
	psrlq	$32, %xmm5
	leaq	16(%r9,%rax), %rcx
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	psrlq	$32, %xmm1
	pmuludq	%xmm4, %xmm0
	pmuludq	%xmm5, %xmm1
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm6, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rcx, %rax
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%r10d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rax
	addq	%rax, %r8
	leal	(%rcx,%rsi), %eax
	cmpl	%r10d, %ecx
	je	.L8
.L9:
	movslq	%eax, %rcx
	leaq	(%rbx,%rcx,4), %r10
	movl	(%r10), %ecx
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	leal	1(%rax), %ecx
	cmpl	%edi, %ecx
	jge	.L8
	movl	4(%r10), %ecx
	addl	$2, %eax
	imull	%edx, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r8
	cmpl	%eax, %edi
	jle	.L8
	imull	8(%r10), %edx
	movslq	%edx, %rdx
	addq	%rdx, %r8
.L8:
	movl	%r11d, %r10d
	addq	$4, %r9
	cmpl	%esi, %r12d
	jne	.L13
.L7:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L29
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	jmp	.L9
.L28:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%r8d, %r8d
	jmp	.L7
.L29:
	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:
```