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 main(void) {
	int n,step,a[100],end;
	int i,j,temp;

	while (1) {
		scanf("%d",&n);
		if (n ==0)break;
		step = 0;
		for (i = 0; i < n; i++)
			scanf("%d",&a[i]);
		for (end = n-1; end > 0; end--) {
			for (j = 0; j < end; j++) {
				if (a[j+1] < a[j]) {
					temp = a[j];
					a[j] = a[j+1];
					a[j+1] = temp;
					step++;
				}
			}
		}
		printf("%d\n",step);
	}
	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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L2
	jle	.L3
	leaq	16(%rsp), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r14
	cmpl	%r13d, %edi
	jg	.L4
.L3:
	subl	$1, %edi
	xorl	%r8d, %r8d
	testl	%edi, %edi
	jle	.L5
	leaq	16(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r9, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	addl	$1, %ecx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L6
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L6:
	addq	$4, %rdx
	cmpl	%edi, %ecx
	jl	.L7
	subl	$1, %edi
	jne	.L8
.L5:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$432, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L2
	jle	.L3
	leaq	16(%rsp), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r14
	cmpl	%r13d, %edi
	jg	.L4
.L3:
	subl	$1, %edi
	xorl	%r8d, %r8d
	testl	%edi, %edi
	jle	.L5
	leaq	16(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r9, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	addl	$1, %ecx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L6
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L6:
	addq	$4, %rdx
	cmpl	%edi, %ecx
	jl	.L7
	subl	$1, %edi
	jne	.L8
.L5:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$432, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L2
	jle	.L3
	leaq	16(%rsp), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r14
	cmpl	%r13d, %edi
	jg	.L4
.L3:
	subl	$1, %edi
	xorl	%r8d, %r8d
	testl	%edi, %edi
	jle	.L5
	leaq	16(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r9, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	addl	$1, %ecx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L6
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L6:
	addq	$4, %rdx
	cmpl	%edi, %ecx
	jl	.L7
	subl	$1, %edi
	jne	.L8
.L5:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$432, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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 main(void) {
	int n,step,a[100],end;
	int i,j,temp;

	while (1) {
		scanf("%d",&n);
		if (n ==0)break;
		step = 0;
		for (i = 0; i < n; i++)
			scanf("%d",&a[i]);
		for (end = n-1; end > 0; end--) {
			for (j = 0; j < end; j++) {
				if (a[j+1] < a[j]) {
					temp = a[j];
					a[j] = a[j+1];
					a[j+1] = temp;
					step++;
				}
			}
		}
		printf("%d\n",step);
	}
	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 main(void) {
	int n,step,a[100],end;
	int i,j,temp;

	while (1) {
		scanf("%d",&n);
		if (n ==0)break;
		step = 0;
		for (i = 0; i < n; i++)
			scanf("%d",&a[i]);
		for (end = n-1; end > 0; end--) {
			for (j = 0; j < end; j++) {
				if (a[j+1] < a[j]) {
					temp = a[j];
					a[j] = a[j+1];
					a[j+1] = temp;
					step++;
				}
			}
		}
		printf("%d\n",step);
	}
	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 main(void) {
	int n,step,a[100],end;
	int i,j,temp;

	while (1) {
		scanf("%d",&n);
		if (n ==0)break;
		step = 0;
		for (i = 0; i < n; i++)
			scanf("%d",&a[i]);
		for (end = n-1; end > 0; end--) {
			for (j = 0; j < end; j++) {
				if (a[j+1] < a[j]) {
					temp = a[j];
					a[j] = a[j+1];
					a[j+1] = temp;
					step++;
				}
			}
		}
		printf("%d\n",step);
	}
	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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L2
	jle	.L3
	leaq	16(%rsp), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r14
	cmpl	%r13d, %edi
	jg	.L4
.L3:
	subl	$1, %edi
	xorl	%r8d, %r8d
	testl	%edi, %edi
	jle	.L5
	leaq	16(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r9, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	addl	$1, %ecx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L6
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L6:
	addq	$4, %rdx
	cmpl	%edi, %ecx
	jl	.L7
	subl	$1, %edi
	jne	.L8
.L5:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$432, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L2
	jle	.L3
	leaq	16(%rsp), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r14
	cmpl	%r13d, %edi
	jg	.L4
.L3:
	subl	$1, %edi
	xorl	%r8d, %r8d
	testl	%edi, %edi
	jle	.L5
	leaq	16(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r9, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	addl	$1, %ecx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jge	.L6
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L6:
	addq	$4, %rdx
	cmpl	%edi, %ecx
	jl	.L7
	subl	$1, %edi
	jne	.L8
.L5:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$432, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```