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>

void swap_str(int *a, int *b){
  int temp = *a;
  *a = *b;
  *b = temp;
}

void sort_str(int *s, int n){
  int i, j;
  
  for(i = 0; i < n; i++){
    for(j = n - 1; j > i; j-- ){
      if(s[j - 1] > s[j])
        swap_str(&s[j - 1], &s[j]);
    }
  }
}

int main(){
  int n;
  int i;
  int a[101];
  int sum_a = 0;
  int sum_b = 0;
  int t = 0;
  
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", &a[i]);
  }
  
  sort_str(a, n);
  
  for(i = n - 1; i >= 0; i--){
    if(t == 0){
      sum_a += a[i];
      t = 1;
    }
    else if(t == 1){
      sum_b += a[i];
      t = 0;
    }
  }
  
  printf("%d\n", sum_a - sum_b);
  
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	swap_str
	.type	swap_str, @function
swap_str:
.LFB23:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE23:
	.size	swap_str, .-swap_str
	.p2align 4
	.globl	sort_str
	.type	sort_str, @function
sort_str:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L3
	subl	$1, %esi
	je	.L3
	xorl	%r8d, %r8d
	movslq	%esi, %r9
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L9
	movq	%xmm1, -4(%rdi,%rdx,4)
.L9:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L6
	addl	$1, %r8d
	cmpl	%esi, %r8d
	jl	.L7
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	ret
	.cfi_endproc
.LFE24:
	.size	sort_str, .-sort_str
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L18
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r12
	cmpl	%ebp, %r9d
	jg	.L19
	leal	-1(%r9), %r8d
	testl	%r9d, %r9d
	jle	.L18
	movslq	%r8d, %r11
	testl	%r8d, %r8d
	jle	.L20
	leaq	-4(%rbx,%r11,4), %r10
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rdx
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L24
	movq	%xmm1, (%rdx)
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L21
	addl	$1, %edi
	cmpl	%r8d, %edi
	jl	.L22
.L20:
	andl	$-2, %r9d
	movl	%r8d, %ecx
	leaq	(%rbx,%r11,4), %rax
	xorl	%esi, %esi
	subl	%r9d, %ecx
	xorl	%edx, %edx
.L23:
	addl	(%rax), %edx
	cmpl	%r8d, %ecx
	je	.L27
	subl	$2, %r8d
	addl	-4(%rax), %esi
	subq	$8, %rax
	cmpl	$-1, %r8d
	jne	.L23
.L27:
	subl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	.L27
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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	swap_str
	.type	swap_str, @function
swap_str:
.LFB23:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE23:
	.size	swap_str, .-swap_str
	.p2align 4
	.globl	sort_str
	.type	sort_str, @function
sort_str:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L3
	subl	$1, %esi
	je	.L3
	xorl	%r8d, %r8d
	movslq	%esi, %r9
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L9
	movq	%xmm1, -4(%rdi,%rdx,4)
.L9:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L6
	addl	$1, %r8d
	cmpl	%esi, %r8d
	jl	.L7
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	ret
	.cfi_endproc
.LFE24:
	.size	sort_str, .-sort_str
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L18
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r12
	cmpl	%ebp, %r9d
	jg	.L19
	leal	-1(%r9), %r8d
	testl	%r9d, %r9d
	jle	.L18
	movslq	%r8d, %r11
	testl	%r8d, %r8d
	jle	.L20
	leaq	-4(%rbx,%r11,4), %r10
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rdx
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L24
	movq	%xmm1, (%rdx)
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L21
	addl	$1, %edi
	cmpl	%r8d, %edi
	jl	.L22
.L20:
	andl	$-2, %r9d
	movl	%r8d, %ecx
	leaq	(%rbx,%r11,4), %rax
	xorl	%esi, %esi
	subl	%r9d, %ecx
	xorl	%edx, %edx
.L23:
	addl	(%rax), %edx
	cmpl	%r8d, %ecx
	je	.L27
	subl	$2, %r8d
	addl	-4(%rax), %esi
	subq	$8, %rax
	cmpl	$-1, %r8d
	jne	.L23
.L27:
	subl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	.L27
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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	swap_str
	.type	swap_str, @function
swap_str:
.LFB23:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE23:
	.size	swap_str, .-swap_str
	.p2align 4
	.globl	sort_str
	.type	sort_str, @function
sort_str:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L3
	subl	$1, %esi
	je	.L3
	xorl	%r8d, %r8d
	movslq	%esi, %r9
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L9
	movq	%xmm1, -4(%rdi,%rdx,4)
.L9:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L6
	addl	$1, %r8d
	cmpl	%esi, %r8d
	jl	.L7
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	ret
	.cfi_endproc
.LFE24:
	.size	sort_str, .-sort_str
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L18
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r12
	cmpl	%ebp, %r9d
	jg	.L19
	leal	-1(%r9), %r8d
	testl	%r9d, %r9d
	jle	.L18
	movslq	%r8d, %r11
	testl	%r8d, %r8d
	jle	.L20
	leaq	-4(%rbx,%r11,4), %r10
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rdx
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L24
	movq	%xmm1, (%rdx)
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L21
	addl	$1, %edi
	cmpl	%r8d, %edi
	jl	.L22
.L20:
	andl	$-2, %r9d
	movl	%r8d, %ecx
	leaq	(%rbx,%r11,4), %rax
	xorl	%esi, %esi
	subl	%r9d, %ecx
	xorl	%edx, %edx
.L23:
	addl	(%rax), %edx
	cmpl	%r8d, %ecx
	je	.L27
	subl	$2, %r8d
	addl	-4(%rax), %esi
	subq	$8, %rax
	cmpl	$-1, %r8d
	jne	.L23
.L27:
	subl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	.L27
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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>

void swap_str(int *a, int *b){
  int temp = *a;
  *a = *b;
  *b = temp;
}

void sort_str(int *s, int n){
  int i, j;
  
  for(i = 0; i < n; i++){
    for(j = n - 1; j > i; j-- ){
      if(s[j - 1] > s[j])
        swap_str(&s[j - 1], &s[j]);
    }
  }
}

int main(){
  int n;
  int i;
  int a[101];
  int sum_a = 0;
  int sum_b = 0;
  int t = 0;
  
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", &a[i]);
  }
  
  sort_str(a, n);
  
  for(i = n - 1; i >= 0; i--){
    if(t == 0){
      sum_a += a[i];
      t = 1;
    }
    else if(t == 1){
      sum_b += a[i];
      t = 0;
    }
  }
  
  printf("%d\n", sum_a - sum_b);
  
  return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

void swap_str(int *a, int *b){
  int temp = *a;
  *a = *b;
  *b = temp;
}

void sort_str(int *s, int n){
  int i, j;
  
  for(i = 0; i < n; i++){
    for(j = n - 1; j > i; j-- ){
      if(s[j - 1] > s[j])
        swap_str(&s[j - 1], &s[j]);
    }
  }
}

int main(){
  int n;
  int i;
  int a[101];
  int sum_a = 0;
  int sum_b = 0;
  int t = 0;
  
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", &a[i]);
  }
  
  sort_str(a, n);
  
  for(i = n - 1; i >= 0; i--){
    if(t == 0){
      sum_a += a[i];
      t = 1;
    }
    else if(t == 1){
      sum_b += a[i];
      t = 0;
    }
  }
  
  printf("%d\n", sum_a - sum_b);
  
  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:

4
20 18 2 12
 2
2 1
 3
3 7 4
 4
20 1 2 12
 2
2 0
 3
3 9 4
 4
20 1 4 12
 2
2 -1
 2
4 -1
 4
20 2 0 12

12
 1
 6
 9
 2
 8
 11
 3
 5
 10

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>

void swap_str(int *a, int *b){
  int temp = *a;
  *a = *b;
  *b = temp;
}

void sort_str(int *s, int n){
  int i, j;
  
  for(i = 0; i < n; i++){
    for(j = n - 1; j > i; j-- ){
      if(s[j - 1] > s[j])
        swap_str(&s[j - 1], &s[j]);
    }
  }
}

int main(){
  int n;
  int i;
  int a[101];
  int sum_a = 0;
  int sum_b = 0;
  int t = 0;
  
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d", &a[i]);
  }
  
  sort_str(a, n);
  
  for(i = n - 1; i >= 0; i--){
    if(t == 0){
      sum_a += a[i];
      t = 1;
    }
    else if(t == 1){
      sum_b += a[i];
      t = 0;
    }
  }
  
  printf("%d\n", sum_a - sum_b);
  
  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	swap_str
	.type	swap_str, @function
swap_str:
.LFB23:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE23:
	.size	swap_str, .-swap_str
	.p2align 4
	.globl	sort_str
	.type	sort_str, @function
sort_str:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L3
	subl	$1, %esi
	je	.L3
	xorl	%r8d, %r8d
	movslq	%esi, %r9
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L9
	movq	%xmm1, -4(%rdi,%rdx,4)
.L9:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L6
	addl	$1, %r8d
	cmpl	%esi, %r8d
	jl	.L7
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	ret
	.cfi_endproc
.LFE24:
	.size	sort_str, .-sort_str
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L18
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r12
	cmpl	%ebp, %r9d
	jg	.L19
	leal	-1(%r9), %r8d
	testl	%r9d, %r9d
	jle	.L18
	movslq	%r8d, %r11
	testl	%r8d, %r8d
	jle	.L20
	leaq	-4(%rbx,%r11,4), %r10
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rdx
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L24
	movq	%xmm1, (%rdx)
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L21
	addl	$1, %edi
	cmpl	%r8d, %edi
	jl	.L22
.L20:
	andl	$-2, %r9d
	movl	%r8d, %ecx
	leaq	(%rbx,%r11,4), %rax
	xorl	%esi, %esi
	subl	%r9d, %ecx
	xorl	%edx, %edx
.L23:
	addl	(%rax), %edx
	cmpl	%r8d, %ecx
	je	.L27
	subl	$2, %r8d
	addl	-4(%rax), %esi
	subq	$8, %rax
	cmpl	$-1, %r8d
	jne	.L23
.L27:
	subl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	.L27
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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	swap_str
	.type	swap_str, @function
swap_str:
.LFB23:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE23:
	.size	swap_str, .-swap_str
	.p2align 4
	.globl	sort_str
	.type	sort_str, @function
sort_str:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L3
	subl	$1, %esi
	je	.L3
	xorl	%r8d, %r8d
	movslq	%esi, %r9
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	-4(%rdi,%rdx,4), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L9
	movq	%xmm1, -4(%rdi,%rdx,4)
.L9:
	subq	$1, %rdx
	cmpl	%edx, %r8d
	jl	.L6
	addl	$1, %r8d
	cmpl	%esi, %r8d
	jl	.L7
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	ret
	.cfi_endproc
.LFE24:
	.size	sort_str, .-sort_str
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L18
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	addq	$4, %r12
	cmpl	%ebp, %r9d
	jg	.L19
	leal	-1(%r9), %r8d
	testl	%r9d, %r9d
	jle	.L18
	movslq	%r8d, %r11
	testl	%r8d, %r8d
	jle	.L20
	leaq	-4(%rbx,%r11,4), %r10
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rdx
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L24
	movq	%xmm1, (%rdx)
.L24:
	subl	$1, %ecx
	subq	$4, %rdx
	cmpl	%edi, %ecx
	jg	.L21
	addl	$1, %edi
	cmpl	%r8d, %edi
	jl	.L22
.L20:
	andl	$-2, %r9d
	movl	%r8d, %ecx
	leaq	(%rbx,%r11,4), %rax
	xorl	%esi, %esi
	subl	%r9d, %ecx
	xorl	%edx, %edx
.L23:
	addl	(%rax), %edx
	cmpl	%r8d, %ecx
	je	.L27
	subl	$2, %r8d
	addl	-4(%rax), %esi
	subq	$8, %rax
	cmpl	$-1, %r8d
	jne	.L23
.L27:
	subl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	.L27
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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:
```