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>

#define MAX 100

int n, a[MAX], cnt;

void selectionSort()
{
	int i, j, tmp, minj;
	cnt = 0;
	
	for (i = 0; i <= n-1; i++) {
		minj = i;
		
		for (j = i; j <= n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
				
			}
		}
		
		tmp = a[i];
		a[i] = a[minj];
		a[minj] = tmp;
		
		if (i != minj) {
			cnt++;
		}
	}
	
}

int main()
{
	int i;
	
	scanf("%d\n",&n);
	
	for (i = 0; i < n; i++) {
		 scanf ("%d",&a[i]);
	}
	
	selectionSort();
	
	for (i = 0; i < n; i++) {
		if (i > 0) {
			printf(" ");
			}
		printf("%d",a[i]);
	}
	printf("\n");
	
	printf("%d\n",cnt);
return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	movl	$0, cnt(%rip)
	testl	%r8d, %r8d
	jle	.L16
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%r9d, %r9d
	xorl	%ebp, %ebp
	xorl	%r11d, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	a(%rip), %rsi
	movslq	%r8d, %rbx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rsi,%r9,4), %r10d
	movslq	%r9d, %rdi
	movq	%r9, %rax
	movl	%r10d, %ecx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rsi,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L4
	movl	%edx, %ecx
	movslq	%eax, %rdi
.L4:
	addq	$1, %rax
	cmpl	%eax, %r8d
	jg	.L5
	cmpl	%r9d, %edi
	je	.L6
	addl	$1, %r11d
	movl	$1, %ebp
.L6:
	movl	%ecx, (%rsi,%r9,4)
	addq	$1, %r9
	movl	%r10d, (%rsi,%rdi,4)
	cmpq	%rbx, %r9
	jne	.L7
	testb	%bpl, %bpl
	je	.L1
	movl	%r11d, cnt(%rip)
.L1:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE23:
	.size	selectionSort, .-selectionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	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	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L21
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L22
.L21:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	a(%rip), %rbp
	call	selectionSort
	movl	n(%rip), %eax
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jg	.L23
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$32, %edi
	call	putchar@PLT
.L23:
	movl	0(%rbp,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L24
.L25:
	movl	$10, %edi
	call	putchar@PLT
	movl	cnt(%rip), %edx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	movl	$0, cnt(%rip)
	testl	%r8d, %r8d
	jle	.L16
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%r9d, %r9d
	xorl	%ebp, %ebp
	xorl	%r11d, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	a(%rip), %rsi
	movslq	%r8d, %rbx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rsi,%r9,4), %r10d
	movslq	%r9d, %rdi
	movq	%r9, %rax
	movl	%r10d, %ecx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rsi,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L4
	movl	%edx, %ecx
	movslq	%eax, %rdi
.L4:
	addq	$1, %rax
	cmpl	%eax, %r8d
	jg	.L5
	cmpl	%r9d, %edi
	je	.L6
	addl	$1, %r11d
	movl	$1, %ebp
.L6:
	movl	%ecx, (%rsi,%r9,4)
	addq	$1, %r9
	movl	%r10d, (%rsi,%rdi,4)
	cmpq	%rbx, %r9
	jne	.L7
	testb	%bpl, %bpl
	je	.L1
	movl	%r11d, cnt(%rip)
.L1:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE23:
	.size	selectionSort, .-selectionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	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	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L21
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L22
.L21:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	a(%rip), %rbp
	call	selectionSort
	movl	n(%rip), %eax
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jg	.L23
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$32, %edi
	call	putchar@PLT
.L23:
	movl	0(%rbp,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L24
.L25:
	movl	$10, %edi
	call	putchar@PLT
	movl	cnt(%rip), %edx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	movl	$0, cnt(%rip)
	testl	%r8d, %r8d
	jle	.L16
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%r9d, %r9d
	xorl	%ebp, %ebp
	xorl	%r11d, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	a(%rip), %rsi
	movslq	%r8d, %rbx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rsi,%r9,4), %r10d
	movslq	%r9d, %rdi
	movq	%r9, %rax
	movl	%r10d, %ecx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rsi,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L4
	movl	%edx, %ecx
	movslq	%eax, %rdi
.L4:
	addq	$1, %rax
	cmpl	%eax, %r8d
	jg	.L5
	cmpl	%r9d, %edi
	je	.L6
	addl	$1, %r11d
	movl	$1, %ebp
.L6:
	movl	%ecx, (%rsi,%r9,4)
	addq	$1, %r9
	movl	%r10d, (%rsi,%rdi,4)
	cmpq	%rbx, %r9
	jne	.L7
	testb	%bpl, %bpl
	je	.L1
	movl	%r11d, cnt(%rip)
.L1:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE23:
	.size	selectionSort, .-selectionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	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	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L21
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L22
.L21:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	a(%rip), %rbp
	call	selectionSort
	movl	n(%rip), %eax
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jg	.L23
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$32, %edi
	call	putchar@PLT
.L23:
	movl	0(%rbp,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L24
.L25:
	movl	$10, %edi
	call	putchar@PLT
	movl	cnt(%rip), %edx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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>

#define MAX 100

int n, a[MAX], cnt;

void selectionSort()
{
	int i, j, tmp, minj;
	cnt = 0;
	
	for (i = 0; i <= n-1; i++) {
		minj = i;
		
		for (j = i; j <= n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
				
			}
		}
		
		tmp = a[i];
		a[i] = a[minj];
		a[minj] = tmp;
		
		if (i != minj) {
			cnt++;
		}
	}
	
}

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

```c
#include <stdio.h>

#define MAX 100

int n, a[MAX], cnt;

void selectionSort()
{
	int i, j, tmp, minj;
	cnt = 0;
	
	for (i = 0; i <= n-1; i++) {
		minj = i;
		
		for (j = i; j <= n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
				
			}
		}
		
		tmp = a[i];
		a[i] = a[minj];
		a[minj] = tmp;
		
		if (i != minj) {
			cnt++;
		}
	}
	
}

int main()
{
	int i;
	
	scanf("%d\n",&n);
	
	for (i = 0; i < n; i++) {
		 scanf ("%d",&a[i]);
	}
	
	selectionSort();
	
	for (i = 0; i < n; i++) {
		if (i > 0) {
			printf(" ");
			}
		printf("%d",a[i]);
	}
	printf("\n");
	
	printf("%d\n",cnt);
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:

6
5 2 4 6 1 0
 6
5 6 4 4 1 3
 6
6 2 4 6 1 0
 6
5 6 4 4 1 2
 6
6 2 4 6 0 0
 6
5 6 4 3 1 2
 6
6 2 8 6 0 0
 6
5 6 4 2 1 2
 6
6 4 8 6 0 0
 6
9 6 4 2 1 3

0 1 2 4 5 6
5
 1 3 4 4 5 6
2
 0 1 2 4 6 6
4
 1 2 4 4 5 6
2
 0 0 2 4 6 6
4
 1 2 3 4 5 6
3
 0 0 2 6 6 8
3
 1 2 2 4 5 6
4
 0 0 4 6 6 8
3
 1 2 3 4 6 9
5

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>

#define MAX 100

int n, a[MAX], cnt;

void selectionSort()
{
	int i, j, tmp, minj;
	cnt = 0;
	
	for (i = 0; i <= n-1; i++) {
		minj = i;
		
		for (j = i; j <= n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
				
			}
		}
		
		tmp = a[i];
		a[i] = a[minj];
		a[minj] = tmp;
		
		if (i != minj) {
			cnt++;
		}
	}
	
}

int main()
{
	int i;
	
	scanf("%d\n",&n);
	
	for (i = 0; i < n; i++) {
		 scanf ("%d",&a[i]);
	}
	
	selectionSort();
	
	for (i = 0; i < n; i++) {
		if (i > 0) {
			printf(" ");
			}
		printf("%d",a[i]);
	}
	printf("\n");
	
	printf("%d\n",cnt);
return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	movl	$0, cnt(%rip)
	testl	%r8d, %r8d
	jle	.L16
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%r9d, %r9d
	xorl	%ebp, %ebp
	xorl	%r11d, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	a(%rip), %rsi
	movslq	%r8d, %rbx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rsi,%r9,4), %r10d
	movslq	%r9d, %rdi
	movq	%r9, %rax
	movl	%r10d, %ecx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rsi,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L4
	movl	%edx, %ecx
	movslq	%eax, %rdi
.L4:
	addq	$1, %rax
	cmpl	%eax, %r8d
	jg	.L5
	cmpl	%r9d, %edi
	je	.L6
	addl	$1, %r11d
	movl	$1, %ebp
.L6:
	movl	%ecx, (%rsi,%r9,4)
	addq	$1, %r9
	movl	%r10d, (%rsi,%rdi,4)
	cmpq	%rbx, %r9
	jne	.L7
	testb	%bpl, %bpl
	je	.L1
	movl	%r11d, cnt(%rip)
.L1:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE23:
	.size	selectionSort, .-selectionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	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	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L21
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L22
.L21:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	a(%rip), %rbp
	call	selectionSort
	movl	n(%rip), %eax
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jg	.L23
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$32, %edi
	call	putchar@PLT
.L23:
	movl	0(%rbp,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L24
.L25:
	movl	$10, %edi
	call	putchar@PLT
	movl	cnt(%rip), %edx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	movl	$0, cnt(%rip)
	testl	%r8d, %r8d
	jle	.L16
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%r9d, %r9d
	xorl	%ebp, %ebp
	xorl	%r11d, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	a(%rip), %rsi
	movslq	%r8d, %rbx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rsi,%r9,4), %r10d
	movslq	%r9d, %rdi
	movq	%r9, %rax
	movl	%r10d, %ecx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rsi,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L4
	movl	%edx, %ecx
	movslq	%eax, %rdi
.L4:
	addq	$1, %rax
	cmpl	%eax, %r8d
	jg	.L5
	cmpl	%r9d, %edi
	je	.L6
	addl	$1, %r11d
	movl	$1, %ebp
.L6:
	movl	%ecx, (%rsi,%r9,4)
	addq	$1, %r9
	movl	%r10d, (%rsi,%rdi,4)
	cmpq	%rbx, %r9
	jne	.L7
	testb	%bpl, %bpl
	je	.L1
	movl	%r11d, cnt(%rip)
.L1:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE23:
	.size	selectionSort, .-selectionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	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	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L21
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L22
.L21:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	a(%rip), %rbp
	call	selectionSort
	movl	n(%rip), %eax
	leaq	.LC1(%rip), %r12
	testl	%eax, %eax
	jg	.L23
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$32, %edi
	call	putchar@PLT
.L23:
	movl	0(%rbp,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L24
.L25:
	movl	$10, %edi
	call	putchar@PLT
	movl	cnt(%rip), %edx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 4
	.type	cnt, @object
	.size	cnt, 4
cnt:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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:
```