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>
#include<stdlib.h>

int comp(const void *a, const void *b){
	return *(int *)a-*(int*)b;
}

void dasu(int *card,int s,int num){
	int i;
	for(i=s;i<num-1;i++){
		card[i]=card[i+1];
	}
}

int main(){
	int n,card[2][100],c,score[2],turn,now,i,f;
	char check[200];
	while(1){
		scanf("%d",&n);
		if(n==0) break;
		for(i=0;i<n*2;i++){
			check[i]=1;
		}
		for(i=0;i<n;i++){
			scanf("%d",&card[0][i]);
			check[card[0][i]-1]=0;
		}
		qsort(card[0],n,sizeof(int),comp);
		c=0;
		for(i=0;i<n*2;i++){
			if(check[i]==1){
				card[1][c]=i+1;
				c++;
			}
		}
		turn=1;
		now=0;
		score[0]=n;
		score[1]=n;
		while(score[0]>0 && score[1]>0){
			turn=(turn+1)%2;
			f=1;
			for(i=0;i<score[turn];i++){
				if(card[turn][i]>now){
					now=card[turn][i];
					dasu(card[turn],i,score[turn]);
					score[turn]--;
					f=0;
					break;
				}
			}
			if(f) now=0;
		}
		printf("%d\n%d\n",score[1],score[0]);
	}
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	dasu
	.type	dasu, @function
dasu:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -4(%rbp)
.L4:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jl	.L5
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dasu, .-dasu
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1040(%rbp), %eax
	testl	%eax, %eax
	je	.L27
	movl	$0, -1024(%rbp)
	jmp	.L9
.L10:
	movl	-1024(%rbp), %eax
	cltq
	movb	$1, -208(%rbp,%rax)
	addl	$1, -1024(%rbp)
.L9:
	movl	-1040(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L10
	movl	$0, -1024(%rbp)
	jmp	.L11
.L12:
	leaq	-1008(%rbp), %rdx
	movl	-1024(%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
	movl	-1024(%rbp), %eax
	cltq
	movl	-1008(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	addl	$1, -1024(%rbp)
.L11:
	movl	-1040(%rbp), %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L12
	movl	-1040(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-1008(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -1036(%rbp)
	movl	$0, -1024(%rbp)
	jmp	.L13
.L15:
	movl	-1024(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L14
	movl	-1024(%rbp), %eax
	leal	1(%rax), %edx
	movl	-1036(%rbp), %eax
	cltq
	addq	$100, %rax
	movl	%edx, -1008(%rbp,%rax,4)
	addl	$1, -1036(%rbp)
.L14:
	addl	$1, -1024(%rbp)
.L13:
	movl	-1040(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L15
	movl	$1, -1032(%rbp)
	movl	$0, -1028(%rbp)
	movl	-1040(%rbp), %eax
	movl	%eax, -1016(%rbp)
	movl	-1040(%rbp), %eax
	movl	%eax, -1012(%rbp)
	jmp	.L16
.L22:
	movl	-1032(%rbp), %eax
	addl	$1, %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -1032(%rbp)
	movl	$1, -1020(%rbp)
	movl	$0, -1024(%rbp)
	jmp	.L17
.L20:
	movl	-1024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1008(%rbp,%rax,4), %eax
	cmpl	%eax, -1028(%rbp)
	jge	.L18
	movl	-1024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1008(%rbp,%rax,4), %eax
	movl	%eax, -1028(%rbp)
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %edx
	leaq	-1008(%rbp), %rsi
	movl	-1032(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$4, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-1024(%rbp), %eax
	movl	%eax, %esi
	movq	%rcx, %rdi
	call	dasu
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-1032(%rbp), %eax
	cltq
	movl	%edx, -1016(%rbp,%rax,4)
	movl	$0, -1020(%rbp)
	jmp	.L19
.L18:
	addl	$1, -1024(%rbp)
.L17:
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L20
.L19:
	cmpl	$0, -1020(%rbp)
	je	.L16
	movl	$0, -1028(%rbp)
.L16:
	movl	-1016(%rbp), %eax
	testl	%eax, %eax
	jle	.L21
	movl	-1012(%rbp), %eax
	testl	%eax, %eax
	jg	.L22
.L21:
	movl	-1016(%rbp), %edx
	movl	-1012(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L27:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.p2align 4
	.globl	dasu
	.type	dasu, @function
dasu:
.LFB40:
	.cfi_startproc
	endbr64
	leal	-1(%rdx), %eax
	cmpl	%eax, %esi
	jge	.L3
	movslq	%esi, %rax
	subl	$2, %edx
	salq	$2, %rax
	subl	%esi, %edx
	leaq	4(,%rdx,4), %rdx
	leaq	4(%rdi,%rax), %rsi
	addq	%rax, %rdi
	jmp	memmove@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	ret
	.cfi_endproc
.LFE40:
	.size	dasu, .-dasu
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1048, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L23:
	movq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r15d
	testl	%r15d, %r15d
	je	.L6
	leal	(%r15,%r15), %eax
	testl	%eax, %eax
	jle	.L10
	movslq	%eax, %rdx
	leaq	832(%rsp), %rdi
	movl	$1, %esi
	call	memset@PLT
.L10:
	leaq	32(%rsp), %rbp
	xorl	%r14d, %r14d
	movq	%rbp, %rbx
	testl	%r15d, %r15d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	movl	20(%rsp), %r15d
	addq	$4, %rbx
	subl	$1, %eax
	cltq
	movb	$0, 832(%rsp,%rax)
	cmpl	%r14d, %r15d
	jg	.L11
.L9:
	movslq	%r15d, %rsi
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	20(%rsp), %esi
	movd	%esi, %xmm1
	leal	(%rsi,%rsi), %eax
	pshufd	$0xe0, %xmm1, %xmm0
	testl	%eax, %eax
	jle	.L17
	leal	1(%rax), %edi
	xorl	%edx, %edx
	movl	$1, %eax
	leaq	831(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpb	$1, (%rcx,%rax)
	jne	.L15
	movslq	%edx, %r8
	addl	$1, %edx
	movl	%eax, 432(%rsp,%r8,4)
.L15:
	addq	$1, %rax
	cmpq	%rax, %rdi
	jne	.L16
.L17:
	movq	%xmm0, 24(%rsp)
	movl	%esi, %r8d
	movl	%esi, %r9d
	testl	%esi, %esi
	jle	.L14
	movl	$2, %edx
	xorl	%ecx, %ecx
	andl	$1, %edx
	movl	%edx, %r13d
	testl	%esi, %esi
	jle	.L26
	.p2align 4,,10
	.p2align 3
.L35:
	movslq	%edx, %r14
	movslq	%esi, %r10
	leaq	(%r14,%r14,4), %rax
	leaq	(%rax,%rax,4), %rdi
	xorl	%eax, %eax
	salq	$4, %rdi
	addq	%rbp, %rdi
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, %rax
	cmpq	%r10, %rax
	je	.L26
.L22:
	movl	(%rdi,%rax,4), %ebx
	movl	%eax, %edx
	cmpl	%ecx, %ebx
	jle	.L19
	leal	-1(%rsi), %r15d
	cmpl	%eax, %r15d
	jle	.L21
	cltq
	subl	$2, %esi
	salq	$2, %rax
	subl	%edx, %esi
	leaq	4(,%rsi,4), %rdx
	leaq	4(%rdi,%rax), %rsi
	addq	%rax, %rdi
	call	memmove@PLT
.L21:
	movl	%r15d, 24(%rsp,%r14,4)
	movl	24(%rsp), %r9d
	movl	28(%rsp), %r8d
	testl	%r9d, %r9d
	jle	.L14
	movl	%ebx, %ecx
	testl	%r8d, %r8d
	jle	.L14
.L36:
	movl	%r13d, %eax
	leal	1(%r13), %edx
	xorl	$1, %eax
	andl	$1, %edx
	cltq
	movl	%edx, %r13d
	movl	24(%rsp,%rax,4), %esi
	testl	%esi, %esi
	jg	.L35
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%ecx, %ecx
	testl	%r8d, %r8d
	jg	.L36
.L14:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L23
.L6:
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$1048, %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
.L37:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.p2align 4
	.globl	dasu
	.type	dasu, @function
dasu:
.LFB40:
	.cfi_startproc
	endbr64
	leal	-1(%rdx), %eax
	cmpl	%eax, %esi
	jge	.L3
	movslq	%esi, %rax
	subl	$2, %edx
	salq	$2, %rax
	subl	%esi, %edx
	leaq	4(,%rdx,4), %rdx
	leaq	4(%rdi,%rax), %rsi
	addq	%rax, %rdi
	jmp	memmove@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	ret
	.cfi_endproc
.LFE40:
	.size	dasu, .-dasu
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1048, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L23:
	movq	8(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r15d
	testl	%r15d, %r15d
	je	.L6
	leal	(%r15,%r15), %eax
	testl	%eax, %eax
	jle	.L10
	movslq	%eax, %rdx
	leaq	832(%rsp), %rdi
	movl	$1, %esi
	call	memset@PLT
.L10:
	leaq	32(%rsp), %rbp
	xorl	%r14d, %r14d
	movq	%rbp, %rbx
	testl	%r15d, %r15d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	movl	20(%rsp), %r15d
	addq	$4, %rbx
	subl	$1, %eax
	cltq
	movb	$0, 832(%rsp,%rax)
	cmpl	%r14d, %r15d
	jg	.L11
.L9:
	movslq	%r15d, %rsi
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	20(%rsp), %esi
	movd	%esi, %xmm1
	leal	(%rsi,%rsi), %eax
	pshufd	$0xe0, %xmm1, %xmm0
	testl	%eax, %eax
	jle	.L17
	leal	1(%rax), %edi
	xorl	%edx, %edx
	movl	$1, %eax
	leaq	831(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpb	$1, (%rcx,%rax)
	jne	.L15
	movslq	%edx, %r8
	addl	$1, %edx
	movl	%eax, 432(%rsp,%r8,4)
.L15:
	addq	$1, %rax
	cmpq	%rax, %rdi
	jne	.L16
.L17:
	movq	%xmm0, 24(%rsp)
	movl	%esi, %r8d
	movl	%esi, %r9d
	testl	%esi, %esi
	jle	.L14
	movl	$2, %edx
	xorl	%ecx, %ecx
	andl	$1, %edx
	movl	%edx, %r13d
	testl	%esi, %esi
	jle	.L26
	.p2align 4,,10
	.p2align 3
.L35:
	movslq	%edx, %r14
	movslq	%esi, %r10
	leaq	(%r14,%r14,4), %rax
	leaq	(%rax,%rax,4), %rdi
	xorl	%eax, %eax
	salq	$4, %rdi
	addq	%rbp, %rdi
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, %rax
	cmpq	%r10, %rax
	je	.L26
.L22:
	movl	(%rdi,%rax,4), %ebx
	movl	%eax, %edx
	cmpl	%ecx, %ebx
	jle	.L19
	leal	-1(%rsi), %r15d
	cmpl	%eax, %r15d
	jle	.L21
	cltq
	subl	$2, %esi
	salq	$2, %rax
	subl	%edx, %esi
	leaq	4(,%rsi,4), %rdx
	leaq	4(%rdi,%rax), %rsi
	addq	%rax, %rdi
	call	memmove@PLT
.L21:
	movl	%r15d, 24(%rsp,%r14,4)
	movl	24(%rsp), %r9d
	movl	28(%rsp), %r8d
	testl	%r9d, %r9d
	jle	.L14
	movl	%ebx, %ecx
	testl	%r8d, %r8d
	jle	.L14
.L36:
	movl	%r13d, %eax
	leal	1(%r13), %edx
	xorl	$1, %eax
	andl	$1, %edx
	cltq
	movl	%edx, %r13d
	movl	24(%rsp,%rax,4), %esi
	testl	%esi, %esi
	jg	.L35
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%ecx, %ecx
	testl	%r8d, %r8d
	jg	.L36
.L14:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L23
.L6:
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$1048, %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
.L37:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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>
#include<stdlib.h>

int comp(const void *a, const void *b){
	return *(int *)a-*(int*)b;
}

void dasu(int *card,int s,int num){
	int i;
	for(i=s;i<num-1;i++){
		card[i]=card[i+1];
	}
}

int main(){
	int n,card[2][100],c,score[2],turn,now,i,f;
	char check[200];
	while(1){
		scanf("%d",&n);
		if(n==0) break;
		for(i=0;i<n*2;i++){
			check[i]=1;
		}
		for(i=0;i<n;i++){
			scanf("%d",&card[0][i]);
			check[card[0][i]-1]=0;
		}
		qsort(card[0],n,sizeof(int),comp);
		c=0;
		for(i=0;i<n*2;i++){
			if(check[i]==1){
				card[1][c]=i+1;
				c++;
			}
		}
		turn=1;
		now=0;
		score[0]=n;
		score[1]=n;
		while(score[0]>0 && score[1]>0){
			turn=(turn+1)%2;
			f=1;
			for(i=0;i<score[turn];i++){
				if(card[turn][i]>now){
					now=card[turn][i];
					dasu(card[turn],i,score[turn]);
					score[turn]--;
					f=0;
					break;
				}
			}
			if(f) now=0;
		}
		printf("%d\n%d\n",score[1],score[0]);
	}
    return 0;
}
5
1
7
9
6
10
10
8
7
14
18
2
11
3
17
5
19
0
 5
1
7
9
6
5
10
8
7
14
18
4
11
6
17
5
19
0
 5
1
7
9
6
10
10
4
7
14
18
2
11
3
17
5
19
0
 5
1
7
9
6
5
10
8
7
13
18
1
11
6
17
5
19
0
 5
1
7
9
6
10
10
8
7
14
18
2
11
3
1
5
19
0
 5
1
2
9
6
10
10
8
7
14
18
4
11
6
17
5
19
0
 5
1
7
9
6
10
10
8
7
14
18
2
17
3
1
5
19
0
 5
2
7
9
6
8
10
8
7
14
18
2
17
3
1
5
19
0
 5
1
7
9
6
5
10
8
7
13
18
1
11
6
16
5
19
0
 5
1
7
9
6
4
10
10
7
13
18
1
11
12
17
5
19
0

3
0
1
0
 1
0
1
0
 3
0
2
0
 1
0
2
0
 3
0
0
2
 2
0
1
0
 3
0
0
1
 2
0
0
1
 1
0
0
1
 0
1
2
0

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>
#include<stdlib.h>

int comp(const void *a, const void *b){
	return *(int *)a-*(int*)b;
}

void dasu(int *card,int s,int num){
	int i;
	for(i=s;i<num-1;i++){
		card[i]=card[i+1];
	}
}

int main(){
	int n,card[2][100],c,score[2],turn,now,i,f;
	char check[200];
	while(1){
		scanf("%d",&n);
		if(n==0) break;
		for(i=0;i<n*2;i++){
			check[i]=1;
		}
		for(i=0;i<n;i++){
			scanf("%d",&card[0][i]);
			check[card[0][i]-1]=0;
		}
		qsort(card[0],n,sizeof(int),comp);
		c=0;
		for(i=0;i<n*2;i++){
			if(check[i]==1){
				card[1][c]=i+1;
				c++;
			}
		}
		turn=1;
		now=0;
		score[0]=n;
		score[1]=n;
		while(score[0]>0 && score[1]>0){
			turn=(turn+1)%2;
			f=1;
			for(i=0;i<score[turn];i++){
				if(card[turn][i]>now){
					now=card[turn][i];
					dasu(card[turn],i,score[turn]);
					score[turn]--;
					f=0;
					break;
				}
			}
			if(f) now=0;
		}
		printf("%d\n%d\n",score[1],score[0]);
	}
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	dasu
	.type	dasu, @function
dasu:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -4(%rbp)
.L4:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jl	.L5
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dasu, .-dasu
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1040(%rbp), %eax
	testl	%eax, %eax
	je	.L27
	movl	$0, -1024(%rbp)
	jmp	.L9
.L10:
	movl	-1024(%rbp), %eax
	cltq
	movb	$1, -208(%rbp,%rax)
	addl	$1, -1024(%rbp)
.L9:
	movl	-1040(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L10
	movl	$0, -1024(%rbp)
	jmp	.L11
.L12:
	leaq	-1008(%rbp), %rdx
	movl	-1024(%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
	movl	-1024(%rbp), %eax
	cltq
	movl	-1008(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	addl	$1, -1024(%rbp)
.L11:
	movl	-1040(%rbp), %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L12
	movl	-1040(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-1008(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -1036(%rbp)
	movl	$0, -1024(%rbp)
	jmp	.L13
.L15:
	movl	-1024(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L14
	movl	-1024(%rbp), %eax
	leal	1(%rax), %edx
	movl	-1036(%rbp), %eax
	cltq
	addq	$100, %rax
	movl	%edx, -1008(%rbp,%rax,4)
	addl	$1, -1036(%rbp)
.L14:
	addl	$1, -1024(%rbp)
.L13:
	movl	-1040(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L15
	movl	$1, -1032(%rbp)
	movl	$0, -1028(%rbp)
	movl	-1040(%rbp), %eax
	movl	%eax, -1016(%rbp)
	movl	-1040(%rbp), %eax
	movl	%eax, -1012(%rbp)
	jmp	.L16
.L22:
	movl	-1032(%rbp), %eax
	addl	$1, %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -1032(%rbp)
	movl	$1, -1020(%rbp)
	movl	$0, -1024(%rbp)
	jmp	.L17
.L20:
	movl	-1024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1008(%rbp,%rax,4), %eax
	cmpl	%eax, -1028(%rbp)
	jge	.L18
	movl	-1024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1008(%rbp,%rax,4), %eax
	movl	%eax, -1028(%rbp)
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %edx
	leaq	-1008(%rbp), %rsi
	movl	-1032(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$4, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-1024(%rbp), %eax
	movl	%eax, %esi
	movq	%rcx, %rdi
	call	dasu
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-1032(%rbp), %eax
	cltq
	movl	%edx, -1016(%rbp,%rax,4)
	movl	$0, -1020(%rbp)
	jmp	.L19
.L18:
	addl	$1, -1024(%rbp)
.L17:
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L20
.L19:
	cmpl	$0, -1020(%rbp)
	je	.L16
	movl	$0, -1028(%rbp)
.L16:
	movl	-1016(%rbp), %eax
	testl	%eax, %eax
	jle	.L21
	movl	-1012(%rbp), %eax
	testl	%eax, %eax
	jg	.L22
.L21:
	movl	-1016(%rbp), %edx
	movl	-1012(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L27:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	dasu
	.type	dasu, @function
dasu:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -4(%rbp)
.L4:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jl	.L5
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	dasu, .-dasu
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1040(%rbp), %eax
	testl	%eax, %eax
	je	.L27
	movl	$0, -1024(%rbp)
	jmp	.L9
.L10:
	movl	-1024(%rbp), %eax
	cltq
	movb	$1, -208(%rbp,%rax)
	addl	$1, -1024(%rbp)
.L9:
	movl	-1040(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L10
	movl	$0, -1024(%rbp)
	jmp	.L11
.L12:
	leaq	-1008(%rbp), %rdx
	movl	-1024(%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
	movl	-1024(%rbp), %eax
	cltq
	movl	-1008(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	addl	$1, -1024(%rbp)
.L11:
	movl	-1040(%rbp), %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L12
	movl	-1040(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-1008(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -1036(%rbp)
	movl	$0, -1024(%rbp)
	jmp	.L13
.L15:
	movl	-1024(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L14
	movl	-1024(%rbp), %eax
	leal	1(%rax), %edx
	movl	-1036(%rbp), %eax
	cltq
	addq	$100, %rax
	movl	%edx, -1008(%rbp,%rax,4)
	addl	$1, -1036(%rbp)
.L14:
	addl	$1, -1024(%rbp)
.L13:
	movl	-1040(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L15
	movl	$1, -1032(%rbp)
	movl	$0, -1028(%rbp)
	movl	-1040(%rbp), %eax
	movl	%eax, -1016(%rbp)
	movl	-1040(%rbp), %eax
	movl	%eax, -1012(%rbp)
	jmp	.L16
.L22:
	movl	-1032(%rbp), %eax
	addl	$1, %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -1032(%rbp)
	movl	$1, -1020(%rbp)
	movl	$0, -1024(%rbp)
	jmp	.L17
.L20:
	movl	-1024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1008(%rbp,%rax,4), %eax
	cmpl	%eax, -1028(%rbp)
	jge	.L18
	movl	-1024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1008(%rbp,%rax,4), %eax
	movl	%eax, -1028(%rbp)
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %edx
	leaq	-1008(%rbp), %rsi
	movl	-1032(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$4, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-1024(%rbp), %eax
	movl	%eax, %esi
	movq	%rcx, %rdi
	call	dasu
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-1032(%rbp), %eax
	cltq
	movl	%edx, -1016(%rbp,%rax,4)
	movl	$0, -1020(%rbp)
	jmp	.L19
.L18:
	addl	$1, -1024(%rbp)
.L17:
	movl	-1032(%rbp), %eax
	cltq
	movl	-1016(%rbp,%rax,4), %eax
	cmpl	%eax, -1024(%rbp)
	jl	.L20
.L19:
	cmpl	$0, -1020(%rbp)
	je	.L16
	movl	$0, -1028(%rbp)
.L16:
	movl	-1016(%rbp), %eax
	testl	%eax, %eax
	jle	.L21
	movl	-1012(%rbp), %eax
	testl	%eax, %eax
	jg	.L22
.L21:
	movl	-1016(%rbp), %edx
	movl	-1012(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L27:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
