Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(void)
{
	int n, i, j, t, c, num[100];
	
	while (scanf("%d", &n), n != 0){
		for (i = 0; i < n; i++){
			scanf("%d", &num[i]);
		}
		c = 0;
		for (i = 1; i < n; i++){
			for(j = 1; j < n; j++){
				if (num[j - 1] > num[j]){
					t = num[j - 1];
					num[j - 1] = num[j];
					num[j] = t;
					c++;
				}
			}
		}
		
		printf("%d\n", c);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L10:
	movl	$0, -432(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-432(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L4
	movl	$0, -424(%rbp)
	movl	$1, -432(%rbp)
	jmp	.L5
.L9:
	movl	$1, -428(%rbp)
	jmp	.L6
.L8:
	movl	-428(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-428(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-428(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-428(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -424(%rbp)
.L7:
	addl	$1, -428(%rbp)
.L6:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L8
	addl	$1, -432(%rbp)
.L5:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L9
	movl	-424(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-436(%rbp), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
user
	.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
.L2:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L8
	leaq	16(%rsp), %r14
	movl	$0, %r13d
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	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	.L3
.L10:
	cmpl	$1, %edi
	jle	.L12
	leal	-2(%rdi), %eax
	leaq	16(%rsp), %r10
	xorl	%r8d, %r8d
	movl	$1, %r9d
	leaq	20(%rsp,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L5
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L5:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L6
	addl	$1, %r9d
	cmpl	%r9d, %edi
	jne	.L7
.L4:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L8:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	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
.L12:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L19:
	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
	.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
.L2:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L8
	leaq	16(%rsp), %r14
	movl	$0, %r13d
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	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	.L3
.L10:
	cmpl	$1, %edi
	jle	.L12
	leal	-2(%rdi), %eax
	leaq	16(%rsp), %r10
	xorl	%r8d, %r8d
	movl	$1, %r9d
	leaq	20(%rsp,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L5
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L5:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L6
	addl	$1, %r9d
	cmpl	%r9d, %edi
	jne	.L7
.L4:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L8:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	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
.L12:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L19:
	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:

#include <stdio.h>

int main(void)
{
	int n, i, j, t, c, num[100];
	
	while (scanf("%d", &n), n != 0){
		for (i = 0; i < n; i++){
			scanf("%d", &num[i]);
		}
		c = 0;
		for (i = 1; i < n; i++){
			for(j = 1; j < n; j++){
				if (num[j - 1] > num[j]){
					t = num[j - 1];
					num[j - 1] = num[j];
					num[j] = t;
					c++;
				}
			}
		}
		
		printf("%d\n", c);
	}
	
	return (0);
}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(void)
{
	int n, i, j, t, c, num[100];
	
	while (scanf("%d", &n), n != 0){
		for (i = 0; i < n; i++){
			scanf("%d", &num[i]);
		}
		c = 0;
		for (i = 1; i < n; i++){
			for(j = 1; j < n; j++){
				if (num[j - 1] > num[j]){
					t = num[j - 1];
					num[j - 1] = num[j];
					num[j] = t;
					c++;
				}
			}
		}
		
		printf("%d\n", c);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L10:
	movl	$0, -432(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-432(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L4
	movl	$0, -424(%rbp)
	movl	$1, -432(%rbp)
	jmp	.L5
.L9:
	movl	$1, -428(%rbp)
	jmp	.L6
.L8:
	movl	-428(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-428(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-428(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-428(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -424(%rbp)
.L7:
	addl	$1, -428(%rbp)
.L6:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L8
	addl	$1, -432(%rbp)
.L5:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L9
	movl	-424(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-436(%rbp), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L10:
	movl	$0, -432(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-432(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L4
	movl	$0, -424(%rbp)
	movl	$1, -432(%rbp)
	jmp	.L5
.L9:
	movl	$1, -428(%rbp)
	jmp	.L6
.L8:
	movl	-428(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-428(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-428(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -416(%rbp,%rax,4)
	movl	-428(%rbp), %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -424(%rbp)
.L7:
	addl	$1, -428(%rbp)
.L6:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L8
	addl	$1, -432(%rbp)
.L5:
	movl	-436(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L9
	movl	-424(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-436(%rbp), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
