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>
main(){
  int ma;
  int a[10];
  int b[10];
  int aa;
  int bb;
  int c;
  int d;
  int counta;
  int countb;
  for(ma=0;ma<10;ma++){
    scanf("%d",&a[ma]);
  }
  for(ma=0;ma<10;ma++){
    scanf("%d",&b[ma]);
  }
  for(c=0;c<10;c++){
    for(d=10-1;d>c;d--){
      if(a[d]>a[d-1]){
	aa=a[d];
	a[d]=a[d-1];
	a[d-1]=aa;
      }
      if(b[d]>b[d-1]){
	bb=b[d];
	b[d]=b[d-1];
	b[d-1]=bb;
      }
    }
  }
  counta=a[0]+a[1]+a[2];
  countb=b[0]+b[1]+b[2];
  printf("%d %d\n",counta,countb);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -124(%rbp)
	jmp	.L2
.L3:
	leaq	-96(%rbp), %rdx
	movl	-124(%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, -124(%rbp)
.L2:
	cmpl	$9, -124(%rbp)
	jle	.L3
	movl	$0, -124(%rbp)
	jmp	.L4
.L5:
	leaq	-48(%rbp), %rdx
	movl	-124(%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, -124(%rbp)
.L4:
	cmpl	$9, -124(%rbp)
	jle	.L5
	movl	$0, -120(%rbp)
	jmp	.L6
.L11:
	movl	$9, -116(%rbp)
	jmp	.L7
.L10:
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	movl	%eax, -104(%rbp)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-104(%rbp), %edx
	movl	%edx, -96(%rbp,%rax,4)
.L8:
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, -100(%rbp)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-100(%rbp), %edx
	movl	%edx, -48(%rbp,%rax,4)
.L9:
	subl	$1, -116(%rbp)
.L7:
	movl	-116(%rbp), %eax
	cmpl	-120(%rbp), %eax
	jg	.L10
	addl	$1, -120(%rbp)
.L6:
	cmpl	$9, -120(%rbp)
	jle	.L11
	movl	-96(%rbp), %edx
	movl	-92(%rbp), %eax
	addl	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -112(%rbp)
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -108(%rbp)
	movl	-108(%rbp), %edx
	movl	-112(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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 %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$96, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	40(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	48(%rsp), %rbx
	leaq	88(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L3
	xorl	%eax, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L26:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %ecx
	movd	%xmm2, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L5
	movq	%xmm1, 32(%rsp)
.L5:
	movq	80(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L6
	movq	%xmm1, 80(%rsp)
.L6:
	cmpl	$8, %eax
	je	.L24
	movq	28(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L8
	movq	%xmm1, 28(%rsp)
.L8:
	movq	76(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L9
	movq	%xmm1, 76(%rsp)
.L9:
	cmpl	$7, %eax
	je	.L24
	movq	24(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L10
	movq	%xmm1, 24(%rsp)
.L10:
	movq	72(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L11
	movq	%xmm1, 72(%rsp)
.L11:
	cmpl	$6, %eax
	je	.L24
	movq	20(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L12
	movq	%xmm1, 20(%rsp)
.L12:
	movq	68(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L13
	movq	%xmm1, 68(%rsp)
.L13:
	cmpl	$5, %eax
	je	.L24
	movq	16(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L14
	movq	%xmm1, 16(%rsp)
.L14:
	movq	64(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L15
	movq	%xmm1, 64(%rsp)
.L15:
	cmpl	$4, %eax
	je	.L24
	movq	12(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L16
	movq	%xmm1, 12(%rsp)
.L16:
	movq	60(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L17
	movq	%xmm1, 60(%rsp)
.L17:
	cmpl	$3, %eax
	je	.L24
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L18
	movq	%xmm1, 8(%rsp)
.L18:
	movq	56(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L19
	movq	%xmm1, 56(%rsp)
.L19:
	cmpl	$2, %eax
	je	.L24
	movq	4(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L20
	movq	%xmm1, 4(%rsp)
.L20:
	movq	52(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L21
	movq	%xmm1, 52(%rsp)
.L21:
	testl	%eax, %eax
	jne	.L24
	movq	(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L22
	movq	%xmm1, (%rsp)
.L22:
	movq	48(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L24
	movq	%xmm1, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %eax
.L4:
	cmpl	$8, %eax
	jbe	.L26
	cmpl	$9, %eax
	jne	.L24
	movl	52(%rsp), %ecx
	movl	4(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	addl	48(%rsp), %ecx
	addl	(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	addl	56(%rsp), %ecx
	addl	8(%rsp), %edx
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$96, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L56:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$96, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	40(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L2
	leaq	48(%rsp), %rbx
	leaq	88(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L3
	xorl	%eax, %eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L26:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %ecx
	movd	%xmm2, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jge	.L5
	movq	%xmm1, 32(%rsp)
.L5:
	movq	80(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L6
	movq	%xmm1, 80(%rsp)
.L6:
	cmpl	$8, %eax
	je	.L24
	movq	28(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L8
	movq	%xmm1, 28(%rsp)
.L8:
	movq	76(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L9
	movq	%xmm1, 76(%rsp)
.L9:
	cmpl	$7, %eax
	je	.L24
	movq	24(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L10
	movq	%xmm1, 24(%rsp)
.L10:
	movq	72(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L11
	movq	%xmm1, 72(%rsp)
.L11:
	cmpl	$6, %eax
	je	.L24
	movq	20(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L12
	movq	%xmm1, 20(%rsp)
.L12:
	movq	68(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L13
	movq	%xmm1, 68(%rsp)
.L13:
	cmpl	$5, %eax
	je	.L24
	movq	16(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L14
	movq	%xmm1, 16(%rsp)
.L14:
	movq	64(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L15
	movq	%xmm1, 64(%rsp)
.L15:
	cmpl	$4, %eax
	je	.L24
	movq	12(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L16
	movq	%xmm1, 12(%rsp)
.L16:
	movq	60(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L17
	movq	%xmm1, 60(%rsp)
.L17:
	cmpl	$3, %eax
	je	.L24
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %edx
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L18
	movq	%xmm1, 8(%rsp)
.L18:
	movq	56(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L19
	movq	%xmm1, 56(%rsp)
.L19:
	cmpl	$2, %eax
	je	.L24
	movq	4(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L20
	movq	%xmm1, 4(%rsp)
.L20:
	movq	52(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %edx
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L21
	movq	%xmm1, 52(%rsp)
.L21:
	testl	%eax, %eax
	jne	.L24
	movq	(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L22
	movq	%xmm1, (%rsp)
.L22:
	movq	48(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %edx
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %ecx
	jle	.L24
	movq	%xmm1, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %eax
.L4:
	cmpl	$8, %eax
	jbe	.L26
	cmpl	$9, %eax
	jne	.L24
	movl	52(%rsp), %ecx
	movl	4(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	addl	48(%rsp), %ecx
	addl	(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	addl	56(%rsp), %ecx
	addl	8(%rsp), %edx
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$96, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L56:
	.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:

#include<stdio.h>
main(){
  int ma;
  int a[10];
  int b[10];
  int aa;
  int bb;
  int c;
  int d;
  int counta;
  int countb;
  for(ma=0;ma<10;ma++){
    scanf("%d",&a[ma]);
  }
  for(ma=0;ma<10;ma++){
    scanf("%d",&b[ma]);
  }
  for(c=0;c<10;c++){
    for(d=10-1;d>c;d--){
      if(a[d]>a[d-1]){
	aa=a[d];
	a[d]=a[d-1];
	a[d-1]=aa;
      }
      if(b[d]>b[d-1]){
	bb=b[d];
	b[d]=b[d-1];
	b[d-1]=bb;
      }
    }
  }
  counta=a[0]+a[1]+a[2];
  countb=b[0]+b[1]+b[2];
  printf("%d %d\n",counta,countb);
  return 0;
}
23
23
20
15
15
14
13
9
7
6
25
19
17
17
16
13
12
11
9
5

66 61

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>
main(){
  int ma;
  int a[10];
  int b[10];
  int aa;
  int bb;
  int c;
  int d;
  int counta;
  int countb;
  for(ma=0;ma<10;ma++){
    scanf("%d",&a[ma]);
  }
  for(ma=0;ma<10;ma++){
    scanf("%d",&b[ma]);
  }
  for(c=0;c<10;c++){
    for(d=10-1;d>c;d--){
      if(a[d]>a[d-1]){
	aa=a[d];
	a[d]=a[d-1];
	a[d-1]=aa;
      }
      if(b[d]>b[d-1]){
	bb=b[d];
	b[d]=b[d-1];
	b[d-1]=bb;
      }
    }
  }
  counta=a[0]+a[1]+a[2];
  countb=b[0]+b[1]+b[2];
  printf("%d %d\n",counta,countb);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -124(%rbp)
	jmp	.L2
.L3:
	leaq	-96(%rbp), %rdx
	movl	-124(%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, -124(%rbp)
.L2:
	cmpl	$9, -124(%rbp)
	jle	.L3
	movl	$0, -124(%rbp)
	jmp	.L4
.L5:
	leaq	-48(%rbp), %rdx
	movl	-124(%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, -124(%rbp)
.L4:
	cmpl	$9, -124(%rbp)
	jle	.L5
	movl	$0, -120(%rbp)
	jmp	.L6
.L11:
	movl	$9, -116(%rbp)
	jmp	.L7
.L10:
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	movl	%eax, -104(%rbp)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-104(%rbp), %edx
	movl	%edx, -96(%rbp,%rax,4)
.L8:
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, -100(%rbp)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-100(%rbp), %edx
	movl	%edx, -48(%rbp,%rax,4)
.L9:
	subl	$1, -116(%rbp)
.L7:
	movl	-116(%rbp), %eax
	cmpl	-120(%rbp), %eax
	jg	.L10
	addl	$1, -120(%rbp)
.L6:
	cmpl	$9, -120(%rbp)
	jle	.L11
	movl	-96(%rbp), %edx
	movl	-92(%rbp), %eax
	addl	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -112(%rbp)
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -108(%rbp)
	movl	-108(%rbp), %edx
	movl	-112(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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 %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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -124(%rbp)
	jmp	.L2
.L3:
	leaq	-96(%rbp), %rdx
	movl	-124(%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, -124(%rbp)
.L2:
	cmpl	$9, -124(%rbp)
	jle	.L3
	movl	$0, -124(%rbp)
	jmp	.L4
.L5:
	leaq	-48(%rbp), %rdx
	movl	-124(%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, -124(%rbp)
.L4:
	cmpl	$9, -124(%rbp)
	jle	.L5
	movl	$0, -120(%rbp)
	jmp	.L6
.L11:
	movl	$9, -116(%rbp)
	jmp	.L7
.L10:
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	movl	%eax, -104(%rbp)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-104(%rbp), %edx
	movl	%edx, -96(%rbp,%rax,4)
.L8:
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, -100(%rbp)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-116(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-100(%rbp), %edx
	movl	%edx, -48(%rbp,%rax,4)
.L9:
	subl	$1, -116(%rbp)
.L7:
	movl	-116(%rbp), %eax
	cmpl	-120(%rbp), %eax
	jg	.L10
	addl	$1, -120(%rbp)
.L6:
	cmpl	$9, -120(%rbp)
	jle	.L11
	movl	-96(%rbp), %edx
	movl	-92(%rbp), %eax
	addl	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -112(%rbp)
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -108(%rbp)
	movl	-108(%rbp), %edx
	movl	-112(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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:
