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 a[10],t,i,b[5],l;

	while(1){
		scanf("%d %d",&a[0],&a[5]);
		if((a[0]==0)&&(a[5]==0)){
			return 0;
		}
		for(t=1;t<5;t++){
			scanf("%d %d",&a[t],&a[5+t]);
		}
		for(t=0;t<5;t++){
			a[t]+=a[t+5];
			b[t]=t;
		}
		for(t=0;t<4;t++){
			for(i=1;i<5-t;i++){
				if(a[i-1]<a[i]){
					l=a[i-1];
					a[i-1]=a[i];
					a[i]=l;
					l=b[i-1];
					b[i-1]=b[i];
					b[i]=l;
				}
			}
		}
		if(b[0]==0){
			printf("A ");
		}
		if(b[0]==1){
			printf("B ");
		}
		if(b[0]==2){
			printf("C ");
		}
		if(b[0]==3){
			printf("D ");
		}
		if(b[0]==4){
			printf("E ");
		}
		printf("%d\n",a[0]);
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"A "
.LC2:
	.string	"B "
.LC3:
	.string	"C "
.LC4:
	.string	"D "
.LC5:
	.string	"E "
.LC6:
	.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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L18:
	leaq	-48(%rbp), %rax
	leaq	20(%rax), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	jmp	.L20
.L2:
	movl	$1, -92(%rbp)
	jmp	.L4
.L5:
	movl	-92(%rbp), %eax
	addl	$5, %eax
	leaq	-48(%rbp), %rdx
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-48(%rbp), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L4:
	cmpl	$4, -92(%rbp)
	jle	.L5
	movl	$0, -92(%rbp)
	jmp	.L6
.L7:
	movl	-92(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-92(%rbp), %eax
	addl	$5, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-92(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-92(%rbp), %eax
	cltq
	movl	-92(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -92(%rbp)
.L6:
	cmpl	$4, -92(%rbp)
	jle	.L7
	movl	$0, -92(%rbp)
	jmp	.L8
.L12:
	movl	$1, -88(%rbp)
	jmp	.L9
.L11:
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-88(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, -84(%rbp)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-88(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -48(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	cltq
	movl	-84(%rbp), %edx
	movl	%edx, -48(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	movl	%eax, -84(%rbp)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-88(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -80(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	cltq
	movl	-84(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
.L10:
	addl	$1, -88(%rbp)
.L9:
	movl	$5, %eax
	subl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L11
	addl	$1, -92(%rbp)
.L8:
	cmpl	$3, -92(%rbp)
	jle	.L12
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	movl	-80(%rbp), %eax
	cmpl	$1, %eax
	jne	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movl	-80(%rbp), %eax
	cmpl	$2, %eax
	jne	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	-80(%rbp), %eax
	cmpl	$3, %eax
	jne	.L16
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	movl	-80(%rbp), %eax
	cmpl	$4, %eax
	jne	.L17
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L18
.L20:
	call	__stack_chk_fail@PLT
.L19:
	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 %d"
.LC3:
	.string	"A "
.LC4:
	.string	"B "
.LC5:
	.string	"C "
.LC6:
	.string	"D "
.LC7:
	.string	"E "
.LC8:
	.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
	leaq	.LC4(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %r12
	leaq	52(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L31:
	xorl	%eax, %eax
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	orl	52(%rsp), %eax
	je	.L39
	leaq	36(%rsp), %r14
.L3:
	leaq	20(%r14), %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addq	$4, %r14
	cmpq	%r14, %rbp
	jne	.L3
	movdqu	52(%rsp), %xmm0
	paddd	32(%rsp), %xmm0
	movl	64(%rsp), %edx
	movdqa	.LC1(%rip), %xmm2
	pshufd	$255, %xmm0, %xmm1
	addl	44(%rsp), %edx
	movd	%xmm0, %r8d
	movl	60(%rsp), %eax
	movd	%xmm1, %edi
	movdqa	%xmm0, %xmm1
	movl	%edx, %r9d
	movl	68(%rsp), %edx
	punpckhdq	%xmm0, %xmm1
	addl	48(%rsp), %edx
	addl	40(%rsp), %eax
	movaps	%xmm2, (%rsp)
	movd	%xmm1, %esi
	pshufd	$85, %xmm0, %xmm1
	movl	%edx, 48(%rsp)
	movd	%xmm1, %ecx
	movaps	%xmm0, 32(%rsp)
	cmpl	%ecx, %r8d
	jge	.L4
	movq	%r13, (%rsp)
	movd	%xmm1, 32(%rsp)
	movd	%xmm0, 36(%rsp)
.L4:
	movd	36(%rsp), %xmm3
	movd	%eax, %xmm0
	punpckldq	%xmm3, %xmm0
	cmpl	%esi, 36(%rsp)
	jge	.L12
	movl	4(%rsp), %eax
	movl	$2, 4(%rsp)
	movq	%xmm0, 36(%rsp)
	movl	%eax, 8(%rsp)
.L12:
	movd	40(%rsp), %xmm3
	movd	%r9d, %xmm0
	punpckldq	%xmm3, %xmm0
	cmpl	%edi, 40(%rsp)
	jge	.L11
	movl	8(%rsp), %eax
	movl	$3, 8(%rsp)
	movq	%xmm0, 40(%rsp)
	movl	%eax, 12(%rsp)
.L11:
	movd	44(%rsp), %xmm5
	movd	%edx, %xmm0
	punpckldq	%xmm5, %xmm0
	cmpl	44(%rsp), %edx
	jle	.L10
	movl	$4, 12(%rsp)
	movq	%xmm0, 44(%rsp)
.L10:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %eax
	movd	%xmm4, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L9
	movq	%xmm1, 32(%rsp)
	rolq	$32, (%rsp)
.L9:
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %eax
	movd	%xmm5, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L18
	movq	%xmm1, 36(%rsp)
	rolq	$32, 4(%rsp)
.L18:
	movq	40(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L17
	movq	%xmm1, 40(%rsp)
	rolq	$32, 8(%rsp)
.L17:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %eax
	movd	%xmm6, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L16
	movq	%xmm1, 32(%rsp)
	rolq	$32, (%rsp)
.L16:
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L22
	movq	%xmm1, 36(%rsp)
	rolq	$32, 4(%rsp)
.L22:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L21
	movq	%xmm1, 32(%rsp)
	rolq	$32, (%rsp)
.L21:
	movl	(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	cmpl	$1, %eax
	je	.L25
	cmpl	$2, %eax
	je	.L41
	cmpl	$3, %eax
	jne	.L42
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	movl	32(%rsp), %edx
	leaq	.LC8(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L40:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L24
.L42:
	cmpl	$4, %eax
	jne	.L24
	leaq	.LC7(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L41:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L39:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$88, %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
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	1
	.long	2
	.long	3
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	1
	.long	0
	.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 %d"
.LC3:
	.string	"A "
.LC4:
	.string	"B "
.LC5:
	.string	"C "
.LC6:
	.string	"D "
.LC7:
	.string	"E "
.LC8:
	.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
	leaq	.LC4(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %r12
	leaq	52(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L31:
	xorl	%eax, %eax
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	orl	52(%rsp), %eax
	je	.L39
	leaq	36(%rsp), %r14
.L3:
	leaq	20(%r14), %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addq	$4, %r14
	cmpq	%r14, %rbp
	jne	.L3
	movdqu	52(%rsp), %xmm0
	paddd	32(%rsp), %xmm0
	movl	64(%rsp), %edx
	movdqa	.LC1(%rip), %xmm2
	pshufd	$255, %xmm0, %xmm1
	addl	44(%rsp), %edx
	movd	%xmm0, %r8d
	movl	60(%rsp), %eax
	movd	%xmm1, %edi
	movdqa	%xmm0, %xmm1
	movl	%edx, %r9d
	movl	68(%rsp), %edx
	punpckhdq	%xmm0, %xmm1
	addl	48(%rsp), %edx
	addl	40(%rsp), %eax
	movaps	%xmm2, (%rsp)
	movd	%xmm1, %esi
	pshufd	$85, %xmm0, %xmm1
	movl	%edx, 48(%rsp)
	movd	%xmm1, %ecx
	movaps	%xmm0, 32(%rsp)
	cmpl	%ecx, %r8d
	jge	.L4
	movq	%r13, (%rsp)
	movd	%xmm1, 32(%rsp)
	movd	%xmm0, 36(%rsp)
.L4:
	movd	36(%rsp), %xmm3
	movd	%eax, %xmm0
	punpckldq	%xmm3, %xmm0
	cmpl	%esi, 36(%rsp)
	jge	.L12
	movl	4(%rsp), %eax
	movl	$2, 4(%rsp)
	movq	%xmm0, 36(%rsp)
	movl	%eax, 8(%rsp)
.L12:
	movd	40(%rsp), %xmm3
	movd	%r9d, %xmm0
	punpckldq	%xmm3, %xmm0
	cmpl	%edi, 40(%rsp)
	jge	.L11
	movl	8(%rsp), %eax
	movl	$3, 8(%rsp)
	movq	%xmm0, 40(%rsp)
	movl	%eax, 12(%rsp)
.L11:
	movd	44(%rsp), %xmm5
	movd	%edx, %xmm0
	punpckldq	%xmm5, %xmm0
	cmpl	44(%rsp), %edx
	jle	.L10
	movl	$4, 12(%rsp)
	movq	%xmm0, 44(%rsp)
.L10:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %eax
	movd	%xmm4, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L9
	movq	%xmm1, 32(%rsp)
	rolq	$32, (%rsp)
.L9:
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %eax
	movd	%xmm5, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L18
	movq	%xmm1, 36(%rsp)
	rolq	$32, 4(%rsp)
.L18:
	movq	40(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %edx
	movd	%xmm4, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L17
	movq	%xmm1, 40(%rsp)
	rolq	$32, 8(%rsp)
.L17:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %eax
	movd	%xmm6, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L16
	movq	%xmm1, 32(%rsp)
	rolq	$32, (%rsp)
.L16:
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %edx
	movd	%xmm7, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L22
	movq	%xmm1, 36(%rsp)
	rolq	$32, 4(%rsp)
.L22:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jle	.L21
	movq	%xmm1, 32(%rsp)
	rolq	$32, (%rsp)
.L21:
	movl	(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	cmpl	$1, %eax
	je	.L25
	cmpl	$2, %eax
	je	.L41
	cmpl	$3, %eax
	jne	.L42
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	movl	32(%rsp), %edx
	leaq	.LC8(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L40:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L24
.L42:
	cmpl	$4, %eax
	jne	.L24
	leaq	.LC7(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L41:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L39:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$88, %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
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	1
	.long	2
	.long	3
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	1
	.long	0
	.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 a[10],t,i,b[5],l;

	while(1){
		scanf("%d %d",&a[0],&a[5]);
		if((a[0]==0)&&(a[5]==0)){
			return 0;
		}
		for(t=1;t<5;t++){
			scanf("%d %d",&a[t],&a[5+t]);
		}
		for(t=0;t<5;t++){
			a[t]+=a[t+5];
			b[t]=t;
		}
		for(t=0;t<4;t++){
			for(i=1;i<5-t;i++){
				if(a[i-1]<a[i]){
					l=a[i-1];
					a[i-1]=a[i];
					a[i]=l;
					l=b[i-1];
					b[i-1]=b[i];
					b[i]=l;
				}
			}
		}
		if(b[0]==0){
			printf("A ");
		}
		if(b[0]==1){
			printf("B ");
		}
		if(b[0]==2){
			printf("C ");
		}
		if(b[0]==3){
			printf("D ");
		}
		if(b[0]==4){
			printf("E ");
		}
		printf("%d\n",a[0]);
	}
}
1593 4311
4321 2155
1256 6421
5310 1455
2152 5421
1549 3386
4528 1578
1234 4321
3330 3109
2739 2199
0 0
 1593 4311
4321 2155
1256 6421
5310 1455
2152 5421
1549 3288
4528 3719
1234 4321
3330 3109
2739 2199
0 0
 1593 4311
4321 2155
1256 6421
5310 1455
2152 5421
1549 3386
4528 1578
1234 8354
3330 3109
2739 2199
0 0
 1593 4311
4321 2155
1256 3848
5310 1455
455 5421
1549 3288
4528 3719
1234 4321
3330 3109
2739 1241
0 0
 1593 4311
4321 2155
1256 3848
5310 1455
455 5421
1549 3288
4528 1686
1234 4321
3330 3109
2739 1241
0 0
 1593 4311
4321 2155
1256 6421
5310 2818
2152 5421
1549 3386
4528 3719
1234 4321
3330 3109
2739 2199
0 0
 1593 4311
4321 2155
974 6421
5310 1455
2152 5421
1549 3386
4528 1578
1234 4321
3330 3109
2739 2199
0 0
 1593 4311
4321 2155
1256 11201
5310 1455
2152 5421
1928 3386
4528 1578
1234 4321
3330 3109
2739 2199
0 0
 1593 4311
4321 2155
1256 6421
5310 1790
2152 6253
1549 3386
4528 1578
1234 8354
3330 3109
2739 2199
0 0
 1593 4311
4321 2155
1256 3848
5310 1455
455 5421
1549 3288
4528 3719
1234 4321
5197 3109
2739 1241
0 0

C 7677
D 6439
 C 7677
B 8247
 C 7677
C 9588
 D 6765
B 8247
 D 6765
D 6439
 D 8128
B 8247
 E 7573
D 6439
 C 12457
D 6439
 E 8405
C 9588
 D 6765
D 8306

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 a[10],t,i,b[5],l;

	while(1){
		scanf("%d %d",&a[0],&a[5]);
		if((a[0]==0)&&(a[5]==0)){
			return 0;
		}
		for(t=1;t<5;t++){
			scanf("%d %d",&a[t],&a[5+t]);
		}
		for(t=0;t<5;t++){
			a[t]+=a[t+5];
			b[t]=t;
		}
		for(t=0;t<4;t++){
			for(i=1;i<5-t;i++){
				if(a[i-1]<a[i]){
					l=a[i-1];
					a[i-1]=a[i];
					a[i]=l;
					l=b[i-1];
					b[i-1]=b[i];
					b[i]=l;
				}
			}
		}
		if(b[0]==0){
			printf("A ");
		}
		if(b[0]==1){
			printf("B ");
		}
		if(b[0]==2){
			printf("C ");
		}
		if(b[0]==3){
			printf("D ");
		}
		if(b[0]==4){
			printf("E ");
		}
		printf("%d\n",a[0]);
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"A "
.LC2:
	.string	"B "
.LC3:
	.string	"C "
.LC4:
	.string	"D "
.LC5:
	.string	"E "
.LC6:
	.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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L18:
	leaq	-48(%rbp), %rax
	leaq	20(%rax), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	jmp	.L20
.L2:
	movl	$1, -92(%rbp)
	jmp	.L4
.L5:
	movl	-92(%rbp), %eax
	addl	$5, %eax
	leaq	-48(%rbp), %rdx
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-48(%rbp), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L4:
	cmpl	$4, -92(%rbp)
	jle	.L5
	movl	$0, -92(%rbp)
	jmp	.L6
.L7:
	movl	-92(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-92(%rbp), %eax
	addl	$5, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-92(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-92(%rbp), %eax
	cltq
	movl	-92(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -92(%rbp)
.L6:
	cmpl	$4, -92(%rbp)
	jle	.L7
	movl	$0, -92(%rbp)
	jmp	.L8
.L12:
	movl	$1, -88(%rbp)
	jmp	.L9
.L11:
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-88(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, -84(%rbp)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-88(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -48(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	cltq
	movl	-84(%rbp), %edx
	movl	%edx, -48(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	movl	%eax, -84(%rbp)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-88(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -80(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	cltq
	movl	-84(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
.L10:
	addl	$1, -88(%rbp)
.L9:
	movl	$5, %eax
	subl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L11
	addl	$1, -92(%rbp)
.L8:
	cmpl	$3, -92(%rbp)
	jle	.L12
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	movl	-80(%rbp), %eax
	cmpl	$1, %eax
	jne	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movl	-80(%rbp), %eax
	cmpl	$2, %eax
	jne	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	-80(%rbp), %eax
	cmpl	$3, %eax
	jne	.L16
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	movl	-80(%rbp), %eax
	cmpl	$4, %eax
	jne	.L17
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L18
.L20:
	call	__stack_chk_fail@PLT
.L19:
	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 %d"
.LC1:
	.string	"A "
.LC2:
	.string	"B "
.LC3:
	.string	"C "
.LC4:
	.string	"D "
.LC5:
	.string	"E "
.LC6:
	.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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L18:
	leaq	-48(%rbp), %rax
	leaq	20(%rax), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	jmp	.L20
.L2:
	movl	$1, -92(%rbp)
	jmp	.L4
.L5:
	movl	-92(%rbp), %eax
	addl	$5, %eax
	leaq	-48(%rbp), %rdx
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-48(%rbp), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L4:
	cmpl	$4, -92(%rbp)
	jle	.L5
	movl	$0, -92(%rbp)
	jmp	.L6
.L7:
	movl	-92(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-92(%rbp), %eax
	addl	$5, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-92(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-92(%rbp), %eax
	cltq
	movl	-92(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -92(%rbp)
.L6:
	cmpl	$4, -92(%rbp)
	jle	.L7
	movl	$0, -92(%rbp)
	jmp	.L8
.L12:
	movl	$1, -88(%rbp)
	jmp	.L9
.L11:
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-88(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, -84(%rbp)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-88(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -48(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	cltq
	movl	-84(%rbp), %edx
	movl	%edx, -48(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	movl	%eax, -84(%rbp)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-88(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -80(%rbp,%rax,4)
	movl	-88(%rbp), %eax
	cltq
	movl	-84(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
.L10:
	addl	$1, -88(%rbp)
.L9:
	movl	$5, %eax
	subl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L11
	addl	$1, -92(%rbp)
.L8:
	cmpl	$3, -92(%rbp)
	jle	.L12
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	movl	-80(%rbp), %eax
	cmpl	$1, %eax
	jne	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movl	-80(%rbp), %eax
	cmpl	$2, %eax
	jne	.L15
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	-80(%rbp), %eax
	cmpl	$3, %eax
	jne	.L16
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	movl	-80(%rbp), %eax
	cmpl	$4, %eax
	jne	.L17
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L18
.L20:
	call	__stack_chk_fail@PLT
.L19:
	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:
