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(){

  int n,m,A[100],count=0,taihi,i,j,k;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&m);
      A[i]=m;
    }
    for(k=n;k>0;k--){
      for(j=0;j<n-1;j++){
	if(A[j]>A[j+1]){
	  taihi=A[j];
	  A[j]=A[j+1];
	  A[j+1]=taihi;
	  count += 1;
	}
      }
    }  
    printf("%d\n",count);
    count=0;
  }
  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
	movl	$0, -436(%rbp)
.L11:
	leaq	-444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-444(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	$0, -432(%rbp)
	jmp	.L4
.L5:
	leaq	-440(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-440(%rbp), %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
.L4:
	movl	-444(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L5
	movl	-444(%rbp), %eax
	movl	%eax, -424(%rbp)
	jmp	.L6
.L10:
	movl	$0, -428(%rbp)
	jmp	.L7
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -436(%rbp)
.L8:
	addl	$1, -428(%rbp)
.L7:
	movl	-444(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -428(%rbp)
	jl	.L9
	subl	$1, -424(%rbp)
.L6:
	cmpl	$0, -424(%rbp)
	jg	.L10
	movl	-436(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -436(%rbp)
	jmp	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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	%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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L3
	xorl	%r14d, %r14d
	leaq	12(%rsp), %r15
	leaq	16(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	8(%rsp), %edi
	movl	%eax, (%rbx,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	leal	-2(%rdi), %eax
	movl	%edi, %r9d
	xorl	%r8d, %r8d
	leaq	20(%rsp,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rdx
	cmpl	$1, %edi
	je	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %ecx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jle	.L6
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
.L9:
	subl	$1, %r9d
	jne	.L5
.L8:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	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
.L3:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L8
.L21:
	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	%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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L3
	xorl	%r14d, %r14d
	leaq	12(%rsp), %r15
	leaq	16(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	8(%rsp), %edi
	movl	%eax, (%rbx,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	leal	-2(%rdi), %eax
	movl	%edi, %r9d
	xorl	%r8d, %r8d
	leaq	20(%rsp,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rdx
	cmpl	$1, %edi
	je	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %ecx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jle	.L6
	movq	%xmm1, (%rdx)
	addl	$1, %r8d
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
.L9:
	subl	$1, %r9d
	jne	.L5
.L8:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	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
.L3:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L8
.L21:
	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(){

  int n,m,A[100],count=0,taihi,i,j,k;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&m);
      A[i]=m;
    }
    for(k=n;k>0;k--){
      for(j=0;j<n-1;j++){
	if(A[j]>A[j+1]){
	  taihi=A[j];
	  A[j]=A[j+1];
	  A[j+1]=taihi;
	  count += 1;
	}
      }
    }  
    printf("%d\n",count);
    count=0;
  }
  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(){

  int n,m,A[100],count=0,taihi,i,j,k;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&m);
      A[i]=m;
    }
    for(k=n;k>0;k--){
      for(j=0;j<n-1;j++){
	if(A[j]>A[j+1]){
	  taihi=A[j];
	  A[j]=A[j+1];
	  A[j+1]=taihi;
	  count += 1;
	}
      }
    }  
    printf("%d\n",count);
    count=0;
  }
  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
	movl	$0, -436(%rbp)
.L11:
	leaq	-444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-444(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	$0, -432(%rbp)
	jmp	.L4
.L5:
	leaq	-440(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-440(%rbp), %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
.L4:
	movl	-444(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L5
	movl	-444(%rbp), %eax
	movl	%eax, -424(%rbp)
	jmp	.L6
.L10:
	movl	$0, -428(%rbp)
	jmp	.L7
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -436(%rbp)
.L8:
	addl	$1, -428(%rbp)
.L7:
	movl	-444(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -428(%rbp)
	jl	.L9
	subl	$1, -424(%rbp)
.L6:
	cmpl	$0, -424(%rbp)
	jg	.L10
	movl	-436(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -436(%rbp)
	jmp	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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
	movl	$0, -436(%rbp)
.L11:
	leaq	-444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-444(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	$0, -432(%rbp)
	jmp	.L4
.L5:
	leaq	-440(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-440(%rbp), %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
.L4:
	movl	-444(%rbp), %eax
	cmpl	%eax, -432(%rbp)
	jl	.L5
	movl	-444(%rbp), %eax
	movl	%eax, -424(%rbp)
	jmp	.L6
.L10:
	movl	$0, -428(%rbp)
	jmp	.L7
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-428(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-428(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -436(%rbp)
.L8:
	addl	$1, -428(%rbp)
.L7:
	movl	-444(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -428(%rbp)
	jl	.L9
	subl	$1, -424(%rbp)
.L6:
	cmpl	$0, -424(%rbp)
	jg	.L10
	movl	-436(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -436(%rbp)
	jmp	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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:
