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 sort(int a[], int n) {
  int i, j, k = 0, t;
  for (i = 0; i < n; i++) {
    for (j = n - 1; j > i; j--) {
      if (a[j] < a[j-1]) {
	t = a[j];
	a[j] = a[j-1];
	a[j-1] = t;
	k++;
      }
    }
  }
  return k;
}

int main(void) {
  int n, a[100], i, count;

  while (scanf("%d", &n) != EOF) {
    if (n == 0) break;
    for (i = 0; i < n; i++)
      scanf("%d", &a[i]);

    count = sort(a, n);
    printf("%d\n", count);
  }

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %r10d
	testl	%esi, %esi
	jle	.L8
	subl	$1, %r10d
	je	.L1
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movslq	%r10d, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L4
	movq	%xmm1, -4(%rdi,%rdx,4)
	addl	$1, %r9d
.L4:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L5
	addl	$1, %r8d
	cmpl	%r8d, %r10d
	jg	.L6
	movl	%r9d, %r10d
.L1:
	movl	%r10d, %eax
	ret
.L8:
	xorl	%r10d, %r10d
	movl	%r10d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	sort, .-sort
	.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:
.LFB24:
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L18
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L18
	leaq	16(%rsp), %r13
	movl	$0, %r14d
	movq	%r13, %r15
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r15
	cmpl	%r14d, %r9d
	jg	.L21
	testl	%r9d, %r9d
	jle	.L22
	subl	$1, %r9d
	je	.L20
	movslq	%r9d, %rax
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	leaq	-4(%r13,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r10, %rdx
	movl	%r9d, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %esi
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jle	.L24
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L25
	addl	$1, %edi
	cmpl	%r9d, %edi
	jl	.L26
	movl	%r8d, %r9d
.L20:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L18:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	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
.L22:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L20
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %r10d
	testl	%esi, %esi
	jle	.L8
	subl	$1, %r10d
	je	.L1
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movslq	%r10d, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L4
	movq	%xmm1, -4(%rdi,%rdx,4)
	addl	$1, %r9d
.L4:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L5
	addl	$1, %r8d
	cmpl	%r8d, %r10d
	jg	.L6
	movl	%r9d, %r10d
.L1:
	movl	%r10d, %eax
	ret
.L8:
	xorl	%r10d, %r10d
	movl	%r10d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	sort, .-sort
	.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:
.LFB24:
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L18
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L18
	leaq	16(%rsp), %r13
	movl	$0, %r14d
	movq	%r13, %r15
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r15
	cmpl	%r14d, %r9d
	jg	.L21
	testl	%r9d, %r9d
	jle	.L22
	subl	$1, %r9d
	je	.L20
	movslq	%r9d, %rax
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	leaq	-4(%r13,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r10, %rdx
	movl	%r9d, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %esi
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jle	.L24
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L25
	addl	$1, %edi
	cmpl	%r9d, %edi
	jl	.L26
	movl	%r8d, %r9d
.L20:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L18:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	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
.L22:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L20
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %r10d
	testl	%esi, %esi
	jle	.L8
	subl	$1, %r10d
	je	.L1
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movslq	%r10d, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L4
	movq	%xmm1, -4(%rdi,%rdx,4)
	addl	$1, %r9d
.L4:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L5
	addl	$1, %r8d
	cmpl	%r8d, %r10d
	jg	.L6
	movl	%r9d, %r10d
.L1:
	movl	%r10d, %eax
	ret
.L8:
	xorl	%r10d, %r10d
	movl	%r10d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	sort, .-sort
	.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:
.LFB24:
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L18
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L18
	leaq	16(%rsp), %r13
	movl	$0, %r14d
	movq	%r13, %r15
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r15
	cmpl	%r14d, %r9d
	jg	.L21
	testl	%r9d, %r9d
	jle	.L22
	subl	$1, %r9d
	je	.L20
	movslq	%r9d, %rax
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	leaq	-4(%r13,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r10, %rdx
	movl	%r9d, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %esi
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jle	.L24
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L25
	addl	$1, %edi
	cmpl	%r9d, %edi
	jl	.L26
	movl	%r8d, %r9d
.L20:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L18:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	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
.L22:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L20
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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 sort(int a[], int n) {
  int i, j, k = 0, t;
  for (i = 0; i < n; i++) {
    for (j = n - 1; j > i; j--) {
      if (a[j] < a[j-1]) {
	t = a[j];
	a[j] = a[j-1];
	a[j-1] = t;
	k++;
      }
    }
  }
  return k;
}

int main(void) {
  int n, a[100], i, count;

  while (scanf("%d", &n) != EOF) {
    if (n == 0) break;
    for (i = 0; i < n; i++)
      scanf("%d", &a[i]);

    count = sort(a, n);
    printf("%d\n", count);
  }

  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 sort(int a[], int n) {
  int i, j, k = 0, t;
  for (i = 0; i < n; i++) {
    for (j = n - 1; j > i; j--) {
      if (a[j] < a[j-1]) {
	t = a[j];
	a[j] = a[j-1];
	a[j-1] = t;
	k++;
      }
    }
  }
  return k;
}

int main(void) {
  int n, a[100], i, count;

  while (scanf("%d", &n) != EOF) {
    if (n == 0) break;
    for (i = 0; i < n; i++)
      scanf("%d", &a[i]);

    count = sort(a, n);
    printf("%d\n", count);
  }

  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
5
3
2
1
7
6
1
2
3
4
5
6
3
3
2
1
0
 5
5
3
2
1
7
6
1
2
3
4
0
6
3
3
2
1
0
 5
5
3
2
1
4
6
1
2
2
4
5
6
3
3
2
1
0
 5
5
3
2
1
7
6
1
2
3
4
5
6
3
3
3
1
0
 5
5
3
2
1
7
6
1
2
3
8
5
6
3
3
3
1
0
 5
5
3
2
1
7
9
1
2
3
4
0
6
3
3
2
0
0
 5
5
2
2
1
0
6
1
2
2
4
5
6
3
3
2
1
0
 5
5
3
2
1
7
6
1
2
3
0
5
6
3
3
3
1
0
 5
5
3
1
1
7
9
1
2
3
4
0
6
3
3
2
0
0
 5
5
3
1
1
7
9
1
2
3
4
0
6
3
6
2
0
0

6
0
3
 6
4
3
 7
0
3
 6
0
2
 6
2
2
 6
13
 9
0
3
 6
3
2
 5
13
 5
11

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 sort(int a[], int n) {
  int i, j, k = 0, t;
  for (i = 0; i < n; i++) {
    for (j = n - 1; j > i; j--) {
      if (a[j] < a[j-1]) {
	t = a[j];
	a[j] = a[j-1];
	a[j-1] = t;
	k++;
      }
    }
  }
  return k;
}

int main(void) {
  int n, a[100], i, count;

  while (scanf("%d", &n) != EOF) {
    if (n == 0) break;
    for (i = 0; i < n; i++)
      scanf("%d", &a[i]);

    count = sort(a, n);
    printf("%d\n", count);
  }

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %r10d
	testl	%esi, %esi
	jle	.L8
	subl	$1, %r10d
	je	.L1
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movslq	%r10d, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L4
	movq	%xmm1, -4(%rdi,%rdx,4)
	addl	$1, %r9d
.L4:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L5
	addl	$1, %r8d
	cmpl	%r8d, %r10d
	jg	.L6
	movl	%r9d, %r10d
.L1:
	movl	%r10d, %eax
	ret
.L8:
	xorl	%r10d, %r10d
	movl	%r10d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	sort, .-sort
	.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:
.LFB24:
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L18
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L18
	leaq	16(%rsp), %r13
	movl	$0, %r14d
	movq	%r13, %r15
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r15
	cmpl	%r14d, %r9d
	jg	.L21
	testl	%r9d, %r9d
	jle	.L22
	subl	$1, %r9d
	je	.L20
	movslq	%r9d, %rax
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	leaq	-4(%r13,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r10, %rdx
	movl	%r9d, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %esi
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jle	.L24
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L25
	addl	$1, %edi
	cmpl	%r9d, %edi
	jl	.L26
	movl	%r8d, %r9d
.L20:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L18:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	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
.L22:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L20
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %r10d
	testl	%esi, %esi
	jle	.L8
	subl	$1, %r10d
	je	.L1
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movslq	%r10d, %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L4
	movq	%xmm1, -4(%rdi,%rdx,4)
	addl	$1, %r9d
.L4:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L5
	addl	$1, %r8d
	cmpl	%r8d, %r10d
	jg	.L6
	movl	%r9d, %r10d
.L1:
	movl	%r10d, %eax
	ret
.L8:
	xorl	%r10d, %r10d
	movl	%r10d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	sort, .-sort
	.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:
.LFB24:
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L18
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L18
	leaq	16(%rsp), %r13
	movl	$0, %r14d
	movq	%r13, %r15
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r15
	cmpl	%r14d, %r9d
	jg	.L21
	testl	%r9d, %r9d
	jle	.L22
	subl	$1, %r9d
	je	.L20
	movslq	%r9d, %rax
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	leaq	-4(%r13,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r10, %rdx
	movl	%r9d, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %esi
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jle	.L24
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L25
	addl	$1, %edi
	cmpl	%r9d, %edi
	jl	.L26
	movl	%r8d, %r9d
.L20:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L18:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	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
.L22:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L20
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:
```