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>
int main(void){
  int n;
  int L[201];
  int tmp, ans = 0;

  scanf("%d", &n);

  for(int i = 0; i < (n*2); i++){
    scanf("%d", &L[i]);
  }

   /* 数値を降順にソート */
  for (int i=0; i< n*2; i++) {
    for (int j=i; j<n*2; j++) {
      if (L[i] > L[j]) {
        tmp =  L[i];
        L[i] = L[j];
        L[j] = tmp;
      }
    }
  }

  for(int i = 0; i < n; i++){
    ans += L[i*2];
  }

  printf("%d\n", ans);

  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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	16(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %rbx
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r13
	leal	(%r9,%r9), %edi
	cmpl	%r12d, %edi
	jg	.L3
	testl	%edi, %edi
	jle	.L4
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rax
	movl	%r8d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, (%rbx)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %edi
	jg	.L6
	addl	$1, %r8d
	addq	$4, %rbx
	cmpl	%r8d, %edi
	jne	.L7
.L4:
	testl	%r9d, %r9d
	jle	.L14
	leal	-1(%r9), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%r9d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$5, %rax
	leaq	48(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	addq	$32, %rbp
	shufps	$136, -16(%rbp), %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%r9d, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r9b
	je	.L2
.L8:
	leal	(%rcx,%rcx), %eax
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r9d
	jle	.L2
	leal	2(%rax), %esi
	addl	$2, %ecx
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r9d
	jle	.L2
	addl	$4, %eax
	cltq
	addl	16(%rsp,%rax,4), %edx
.L2:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L2
.L15:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
.L22:
	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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	16(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %rbx
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r13
	leal	(%r9,%r9), %edi
	cmpl	%r12d, %edi
	jg	.L3
	testl	%edi, %edi
	jle	.L4
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rax
	movl	%r8d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, (%rbx)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %edi
	jg	.L6
	addl	$1, %r8d
	addq	$4, %rbx
	cmpl	%r8d, %edi
	jne	.L7
.L4:
	testl	%r9d, %r9d
	jle	.L14
	leal	-1(%r9), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%r9d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$5, %rax
	leaq	48(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	addq	$32, %rbp
	shufps	$136, -16(%rbp), %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%r9d, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r9b
	je	.L2
.L8:
	leal	(%rcx,%rcx), %eax
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r9d
	jle	.L2
	leal	2(%rax), %esi
	addl	$2, %ecx
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r9d
	jle	.L2
	addl	$4, %eax
	cltq
	addl	16(%rsp,%rax,4), %edx
.L2:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L2
.L15:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
.L22:
	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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	16(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %rbx
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r13
	leal	(%r9,%r9), %edi
	cmpl	%r12d, %edi
	jg	.L3
	testl	%edi, %edi
	jle	.L4
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rax
	movl	%r8d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, (%rbx)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %edi
	jg	.L6
	addl	$1, %r8d
	addq	$4, %rbx
	cmpl	%r8d, %edi
	jne	.L7
.L4:
	testl	%r9d, %r9d
	jle	.L14
	leal	-1(%r9), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%r9d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$5, %rax
	leaq	48(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	addq	$32, %rbp
	shufps	$136, -16(%rbp), %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%r9d, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r9b
	je	.L2
.L8:
	leal	(%rcx,%rcx), %eax
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r9d
	jle	.L2
	leal	2(%rax), %esi
	addl	$2, %ecx
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r9d
	jle	.L2
	addl	$4, %eax
	cltq
	addl	16(%rsp,%rax,4), %edx
.L2:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L2
.L15:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
.L22:
	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>
int main(void){
  int n;
  int L[201];
  int tmp, ans = 0;

  scanf("%d", &n);

  for(int i = 0; i < (n*2); i++){
    scanf("%d", &L[i]);
  }

   /* 数値を降順にソート */
  for (int i=0; i< n*2; i++) {
    for (int j=i; j<n*2; j++) {
      if (L[i] > L[j]) {
        tmp =  L[i];
        L[i] = L[j];
        L[j] = tmp;
      }
    }
  }

  for(int i = 0; i < n; i++){
    ans += L[i*2];
  }

  printf("%d\n", ans);

  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>
int main(void){
  int n;
  int L[201];
  int tmp, ans = 0;

  scanf("%d", &n);

  for(int i = 0; i < (n*2); i++){
    scanf("%d", &L[i]);
  }

   /* 数値を降順にソート */
  for (int i=0; i< n*2; i++) {
    for (int j=i; j<n*2; j++) {
      if (L[i] > L[j]) {
        tmp =  L[i];
        L[i] = L[j];
        L[j] = tmp;
      }
    }
  }

  for(int i = 0; i < n; i++){
    ans += L[i*2];
  }

  printf("%d\n", ans);

  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>
int main(void){
  int n;
  int L[201];
  int tmp, ans = 0;

  scanf("%d", &n);

  for(int i = 0; i < (n*2); i++){
    scanf("%d", &L[i]);
  }

   /* 数値を降順にソート */
  for (int i=0; i< n*2; i++) {
    for (int j=i; j<n*2; j++) {
      if (L[i] > L[j]) {
        tmp =  L[i];
        L[i] = L[j];
        L[j] = tmp;
      }
    }
  }

  for(int i = 0; i < n; i++){
    ans += L[i*2];
  }

  printf("%d\n", ans);

  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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	16(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %rbx
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r13
	leal	(%r9,%r9), %edi
	cmpl	%r12d, %edi
	jg	.L3
	testl	%edi, %edi
	jle	.L4
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rax
	movl	%r8d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, (%rbx)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %edi
	jg	.L6
	addl	$1, %r8d
	addq	$4, %rbx
	cmpl	%r8d, %edi
	jne	.L7
.L4:
	testl	%r9d, %r9d
	jle	.L14
	leal	-1(%r9), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%r9d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$5, %rax
	leaq	48(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	addq	$32, %rbp
	shufps	$136, -16(%rbp), %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%r9d, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r9b
	je	.L2
.L8:
	leal	(%rcx,%rcx), %eax
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r9d
	jle	.L2
	leal	2(%rax), %esi
	addl	$2, %ecx
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r9d
	jle	.L2
	addl	$4, %eax
	cltq
	addl	16(%rsp,%rax,4), %edx
.L2:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L2
.L15:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
.L22:
	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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	16(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %rbx
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r13
	leal	(%r9,%r9), %edi
	cmpl	%r12d, %edi
	jg	.L3
	testl	%edi, %edi
	jle	.L4
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rax
	movl	%r8d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, (%rbx)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %edi
	jg	.L6
	addl	$1, %r8d
	addq	$4, %rbx
	cmpl	%r8d, %edi
	jne	.L7
.L4:
	testl	%r9d, %r9d
	jle	.L14
	leal	-1(%r9), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%r9d, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	subl	$1, %eax
	salq	$5, %rax
	leaq	48(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	addq	$32, %rbp
	shufps	$136, -16(%rbp), %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%r9d, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r9b
	je	.L2
.L8:
	leal	(%rcx,%rcx), %eax
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r9d
	jle	.L2
	leal	2(%rax), %esi
	addl	$2, %ecx
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r9d
	jle	.L2
	addl	$4, %eax
	cltq
	addl	16(%rsp,%rax,4), %edx
.L2:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L2
.L15:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L8
.L22:
	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:
```