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>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(void){
    int n,tmp,sum=0;
    scanf("%d",&n);
    int l[2*n];
    for(int i=0;2*n>i;++i)
    scanf("%d",&l[i]);
    for(int i=0;2*n>i;++i){
        for(int j=i+1;2*n>j;++j){
            if(l[i]>l[j]){
                tmp=l[i];
                l[i]=l[j];
                l[j]=tmp;
            }
        }
    }
    for(int i=0;2*n>i;i+=2)
    sum+=l[i];
    printf("%d\n",sum);
    return 0;
}```

Assembly Code:

```assembly
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	movq	%rsp, %rsi
	leal	(%rax,%rax), %edx
	movslq	%edx, %rax
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	%rsp, %rbx
	testl	%edx, %edx
	jle	.L5
	movq	%rbx, %r15
	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	-60(%rbp), %eax
	addq	$4, %r13
	leal	(%rax,%rax), %edi
	cmpl	%r12d, %edi
	jg	.L6
	testl	%edi, %edi
	jle	.L5
	movslq	%edi, %r9
	movq	%rbx, %rsi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rsi), %edx
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %edx
	jle	.L9
	movl	%ecx, (%rsi)
	movl	%edx, (%rbx,%rax,4)
.L9:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L10
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r9, %r8
	jne	.L7
	leal	-1(%rdi), %eax
	cmpl	$7, %eax
	jbe	.L17
	shrl	$3, %eax
	pxor	%xmm0, %xmm0
	movl	%eax, %edx
	salq	$5, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqu	(%r15), %xmm1
	movdqu	16(%r15), %xmm2
	addq	$32, %r15
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%r15, %rdx
	jne	.L13
	movdqa	%xmm0, %xmm1
	sall	$3, %eax
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
.L12:
	movslq	%eax, %rcx
	leal	2(%rax), %esi
	leaq	(%rbx,%rcx,4), %rcx
	addl	(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	leal	4(%rax), %esi
	addl	8(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	addl	$6, %eax
	addl	16(%rcx), %edx
	cmpl	%eax, %edi
	jle	.L15
	addl	24(%rcx), %edx
.L15:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L5:
	xorl	%edx, %edx
	jmp	.L15
.L17:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L12
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	movq	%rsp, %rsi
	leal	(%rax,%rax), %edx
	movslq	%edx, %rax
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	%rsp, %rbx
	testl	%edx, %edx
	jle	.L5
	movq	%rbx, %r15
	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	-60(%rbp), %eax
	addq	$4, %r13
	leal	(%rax,%rax), %edi
	cmpl	%r12d, %edi
	jg	.L6
	testl	%edi, %edi
	jle	.L5
	movslq	%edi, %r9
	movq	%rbx, %rsi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rsi), %edx
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %edx
	jle	.L9
	movl	%ecx, (%rsi)
	movl	%edx, (%rbx,%rax,4)
.L9:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L10
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r9, %r8
	jne	.L7
	leal	-1(%rdi), %eax
	cmpl	$7, %eax
	jbe	.L17
	shrl	$3, %eax
	pxor	%xmm0, %xmm0
	movl	%eax, %edx
	salq	$5, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqu	(%r15), %xmm1
	movdqu	16(%r15), %xmm2
	addq	$32, %r15
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%r15, %rdx
	jne	.L13
	movdqa	%xmm0, %xmm1
	sall	$3, %eax
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
.L12:
	movslq	%eax, %rcx
	leal	2(%rax), %esi
	leaq	(%rbx,%rcx,4), %rcx
	addl	(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	leal	4(%rax), %esi
	addl	8(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	addl	$6, %eax
	addl	16(%rcx), %edx
	cmpl	%eax, %edi
	jle	.L15
	addl	24(%rcx), %edx
.L15:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L5:
	xorl	%edx, %edx
	jmp	.L15
.L17:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L12
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	movq	%rsp, %rsi
	leal	(%rax,%rax), %edx
	movslq	%edx, %rax
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	%rsp, %rbx
	testl	%edx, %edx
	jle	.L5
	movq	%rbx, %r15
	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	-60(%rbp), %eax
	addq	$4, %r13
	leal	(%rax,%rax), %edi
	cmpl	%r12d, %edi
	jg	.L6
	testl	%edi, %edi
	jle	.L5
	movslq	%edi, %r9
	movq	%rbx, %rsi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rsi), %edx
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %edx
	jle	.L9
	movl	%ecx, (%rsi)
	movl	%edx, (%rbx,%rax,4)
.L9:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L10
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r9, %r8
	jne	.L7
	leal	-1(%rdi), %eax
	cmpl	$7, %eax
	jbe	.L17
	shrl	$3, %eax
	pxor	%xmm0, %xmm0
	movl	%eax, %edx
	salq	$5, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqu	(%r15), %xmm1
	movdqu	16(%r15), %xmm2
	addq	$32, %r15
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%r15, %rdx
	jne	.L13
	movdqa	%xmm0, %xmm1
	sall	$3, %eax
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
.L12:
	movslq	%eax, %rcx
	leal	2(%rax), %esi
	leaq	(%rbx,%rcx,4), %rcx
	addl	(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	leal	4(%rax), %esi
	addl	8(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	addl	$6, %eax
	addl	16(%rcx), %edx
	cmpl	%eax, %edi
	jle	.L15
	addl	24(%rcx), %edx
.L15:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L5:
	xorl	%edx, %edx
	jmp	.L15
.L17:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L12
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(void){
    int n,tmp,sum=0;
    scanf("%d",&n);
    int l[2*n];
    for(int i=0;2*n>i;++i)
    scanf("%d",&l[i]);
    for(int i=0;2*n>i;++i){
        for(int j=i+1;2*n>j;++j){
            if(l[i]>l[j]){
                tmp=l[i];
                l[i]=l[j];
                l[j]=tmp;
            }
        }
    }
    for(int i=0;2*n>i;i+=2)
    sum+=l[i];
    printf("%d\n",sum);
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(void){
    int n,tmp,sum=0;
    scanf("%d",&n);
    int l[2*n];
    for(int i=0;2*n>i;++i)
    scanf("%d",&l[i]);
    for(int i=0;2*n>i;++i){
        for(int j=i+1;2*n>j;++j){
            if(l[i]>l[j]){
                tmp=l[i];
                l[i]=l[j];
                l[j]=tmp;
            }
        }
    }
    for(int i=0;2*n>i;i+=2)
    sum+=l[i];
    printf("%d\n",sum);
    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:

5
100 1 2 3 14 15 58 58 9 29
 2
1 3 1 1
 5
100 1 2 3 1 15 58 58 9 29
 2
1 2 1 2
 5
100 1 2 3 1 19 40 14 9 29
 2
1 2 0 1
 5
110 1 2 3 1 19 40 14 1 29
 5
110 1 0 3 1 19 40 14 1 29
 2
2 0 0 0
 2
2 -1 0 0

105
 2
 99
 3
 71
 1
 64
 63
 0
 -1

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>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(void){
    int n,tmp,sum=0;
    scanf("%d",&n);
    int l[2*n];
    for(int i=0;2*n>i;++i)
    scanf("%d",&l[i]);
    for(int i=0;2*n>i;++i){
        for(int j=i+1;2*n>j;++j){
            if(l[i]>l[j]){
                tmp=l[i];
                l[i]=l[j];
                l[j]=tmp;
            }
        }
    }
    for(int i=0;2*n>i;i+=2)
    sum+=l[i];
    printf("%d\n",sum);
    return 0;
}```

Assembly Code:

```assembly
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	movq	%rsp, %rsi
	leal	(%rax,%rax), %edx
	movslq	%edx, %rax
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	%rsp, %rbx
	testl	%edx, %edx
	jle	.L5
	movq	%rbx, %r15
	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	-60(%rbp), %eax
	addq	$4, %r13
	leal	(%rax,%rax), %edi
	cmpl	%r12d, %edi
	jg	.L6
	testl	%edi, %edi
	jle	.L5
	movslq	%edi, %r9
	movq	%rbx, %rsi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rsi), %edx
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %edx
	jle	.L9
	movl	%ecx, (%rsi)
	movl	%edx, (%rbx,%rax,4)
.L9:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L10
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r9, %r8
	jne	.L7
	leal	-1(%rdi), %eax
	cmpl	$7, %eax
	jbe	.L17
	shrl	$3, %eax
	pxor	%xmm0, %xmm0
	movl	%eax, %edx
	salq	$5, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqu	(%r15), %xmm1
	movdqu	16(%r15), %xmm2
	addq	$32, %r15
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%r15, %rdx
	jne	.L13
	movdqa	%xmm0, %xmm1
	sall	$3, %eax
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
.L12:
	movslq	%eax, %rcx
	leal	2(%rax), %esi
	leaq	(%rbx,%rcx,4), %rcx
	addl	(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	leal	4(%rax), %esi
	addl	8(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	addl	$6, %eax
	addl	16(%rcx), %edx
	cmpl	%eax, %edi
	jle	.L15
	addl	24(%rcx), %edx
.L15:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L5:
	xorl	%edx, %edx
	jmp	.L15
.L17:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L12
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	movq	%rsp, %rsi
	leal	(%rax,%rax), %edx
	movslq	%edx, %rax
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	%rsp, %rbx
	testl	%edx, %edx
	jle	.L5
	movq	%rbx, %r15
	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	-60(%rbp), %eax
	addq	$4, %r13
	leal	(%rax,%rax), %edi
	cmpl	%r12d, %edi
	jg	.L6
	testl	%edi, %edi
	jle	.L5
	movslq	%edi, %r9
	movq	%rbx, %rsi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rsi), %edx
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %edx
	jle	.L9
	movl	%ecx, (%rsi)
	movl	%edx, (%rbx,%rax,4)
.L9:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L10
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r9, %r8
	jne	.L7
	leal	-1(%rdi), %eax
	cmpl	$7, %eax
	jbe	.L17
	shrl	$3, %eax
	pxor	%xmm0, %xmm0
	movl	%eax, %edx
	salq	$5, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqu	(%r15), %xmm1
	movdqu	16(%r15), %xmm2
	addq	$32, %r15
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%r15, %rdx
	jne	.L13
	movdqa	%xmm0, %xmm1
	sall	$3, %eax
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
.L12:
	movslq	%eax, %rcx
	leal	2(%rax), %esi
	leaq	(%rbx,%rcx,4), %rcx
	addl	(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	leal	4(%rax), %esi
	addl	8(%rcx), %edx
	cmpl	%esi, %edi
	jle	.L15
	addl	$6, %eax
	addl	16(%rcx), %edx
	cmpl	%eax, %edi
	jle	.L15
	addl	24(%rcx), %edx
.L15:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L5:
	xorl	%edx, %edx
	jmp	.L15
.L17:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L12
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```