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<string.h>

int a;
int taroN,hanaN;
void card(int,int *,int *);

int main(void){
	int n;
	int taro[201],hana[201];
	while(1){
		for(a=0;a<=200;a++){
			 taro[a]=0;
			 hana[a]=0;
		}
		scanf("%d",&n);
		if(n==0)break;
		taroN=n,hanaN=n;
		for(a=0;a<n;a++){
			int b;
			scanf("%d",&b);
			taro[b]=1,hana[b]=0;
		}
		for(a=1;a<=n*2;a++){
			if(taro[a]==0)hana[a]=1;
		}
		card(n,taro,hana);
		printf("%d\n",hanaN);
		printf("%d\n",taroN);
	}
	return 0;
}

void card(int n,int taro[201],int hana[201]){
	int max=0;
	while(1){
		for(a=1;a<=n*2;a++){
			if(taro[a]==1 && a>max){
				max=a;
				taro[a]=0;
				taroN--;
				break;
			}
			if(a==n*2)max=0;
		}
		if(taroN==0)return;
		
		for(a=1;a<=n*2;a++){
			if(hana[a]==1 && a>max){
				max=a;
				hana[a]=0;
				hanaN--;
				break;
			}
			if(a==n*2)max=0;
		}
		if(hanaN==0)return;
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	taroN
	.align 4
	.type	taroN, @object
	.size	taroN, 4
taroN:
	.zero	4
	.globl	hanaN
	.align 4
	.type	hanaN, @object
	.size	hanaN, 4
hanaN:
	.zero	4
	.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	$1648, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	movl	$0, a(%rip)
	jmp	.L2
.L3:
	movl	a(%rip), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	movl	a(%rip), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L2:
	movl	a(%rip), %eax
	cmpl	$200, %eax
	jle	.L3
	leaq	-1640(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1640(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	-1640(%rbp), %eax
	movl	%eax, taroN(%rip)
	movl	-1640(%rbp), %eax
	movl	%eax, hanaN(%rip)
	movl	$0, a(%rip)
	jmp	.L6
.L7:
	leaq	-1636(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1636(%rbp), %eax
	cltq
	movl	$1, -1632(%rbp,%rax,4)
	movl	-1636(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L6:
	movl	a(%rip), %edx
	movl	-1640(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	$1, a(%rip)
	jmp	.L8
.L10:
	movl	a(%rip), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	a(%rip), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
.L9:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L8:
	movl	-1640(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-1640(%rbp), %eax
	leaq	-816(%rbp), %rdx
	leaq	-1632(%rbp), %rcx
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	card
	movl	hanaN(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	taroN(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
	.globl	card
	.type	card, @function
card:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	$0, -4(%rbp)
.L30:
	movl	$1, a(%rip)
	jmp	.L17
.L21:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	a(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L18
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	movl	taroN(%rip), %eax
	subl	$1, %eax
	movl	%eax, taroN(%rip)
	jmp	.L19
.L18:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	$0, -4(%rbp)
.L20:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L17:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L21
.L19:
	movl	taroN(%rip), %eax
	testl	%eax, %eax
	je	.L31
	movl	$1, a(%rip)
	jmp	.L24
.L28:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	a(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L25
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	movl	hanaN(%rip), %eax
	subl	$1, %eax
	movl	%eax, hanaN(%rip)
	jmp	.L26
.L25:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jne	.L27
	movl	$0, -4(%rbp)
.L27:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L24:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L28
.L26:
	movl	hanaN(%rip), %eax
	testl	%eax, %eax
	je	.L32
	jmp	.L30
.L31:
	nop
	jmp	.L16
.L32:
	nop
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	card, .-card
	.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	card
	.type	card, @function
card:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdx, %r11
	leal	(%rdi,%rdi), %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %r10
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	leal	1(%r8), %edi
	leaq	4(%r11), %rbp
	leaq	4(%rsi), %rbx
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$1, a(%rip)
	testl	%r8d, %r8d
	jle	.L2
	cmpl	$1, 4(%r10)
	jne	.L5
	testl	%edx, %edx
	jle	.L49
.L5:
	leaq	8(%r10), %rsi
	movl	$1, %eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rsi, %rcx
	leaq	4(%rsi), %rsi
	cmpl	$1, (%rcx)
	jne	.L8
	cmpl	%edx, %eax
	jg	.L50
.L8:
	cmpl	%r8d, %eax
	cmove	%r9d, %edx
.L11:
	addl	$1, %eax
	movl	%eax, a(%rip)
	cmpl	%edi, %eax
	jne	.L13
	movl	taroN(%rip), %ecx
	testl	%ecx, %ecx
	je	.L1
	movl	$1, a(%rip)
	cmpl	$1, 4(%r11)
	jne	.L10
	testl	%edx, %edx
	jle	.L51
.L10:
	leaq	8(%r11), %rcx
	movl	$1, %eax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rcx, %rsi
	addq	$4, %rcx
	cmpl	$1, (%rsi)
	jne	.L19
	cmpl	%edx, %eax
	jg	.L17
.L19:
	cmpl	%r8d, %eax
	cmove	%r9d, %edx
.L21:
	addl	$1, %eax
	movl	%eax, a(%rip)
	cmpl	%edi, %eax
	jne	.L23
.L47:
	movl	hanaN(%rip), %ecx
.L20:
	testl	%ecx, %ecx
	jne	.L24
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	movq	%rbp, %rsi
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$0, (%rsi)
	movl	hanaN(%rip), %edx
	leal	-1(%rdx), %ecx
	movl	%eax, %edx
	movl	%ecx, hanaN(%rip)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L50:
	movl	%eax, %edx
.L6:
	movl	$0, (%rcx)
	subl	$1, taroN(%rip)
	jne	.L10
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	taroN(%rip), %eax
	testl	%eax, %eax
	jne	.L47
	jmp	.L1
.L49:
	movq	%rbx, %rcx
	movl	$1, %edx
	jmp	.L6
	.cfi_endproc
.LFE36:
	.size	card, .-card
	.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:
.LFB35:
	.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
	leaq	.LC1(%rip), %r14
	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	$1656, %rsp
	.cfi_def_cfa_offset 1712
	movq	%fs:40, %rax
	movq	%rax, 1640(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	8(%rsp), %r15
	leaq	832(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L59:
	xorl	%eax, %eax
	movl	$100, %ecx
	movq	%rbp, %rdi
	movq	%r15, %rsi
	rep stosq
	movl	$100, %ecx
	movl	$201, a(%rip)
	movl	$0, (%rdi)
	movq	%r13, %rdi
	rep stosq
	movl	$0, (%rdi)
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	testl	%edi, %edi
	je	.L53
	movl	%edi, taroN(%rip)
	movl	%edi, hanaN(%rip)
	movl	$0, a(%rip)
	jle	.L54
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L55:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	8(%rsp), %edi
	movl	$1, 16(%rsp,%rax,4)
	movl	$0, 832(%rsp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
	cmpl	%edi, %eax
	jl	.L55
.L54:
	movl	$1, a(%rip)
	leal	(%rdi,%rdi), %eax
	testl	%eax, %eax
	jle	.L56
	leal	1(%rax), %edx
	movl	$1, %eax
	movq	%rdx, %rcx
	.p2align 4,,10
	.p2align 3
.L58:
	movl	0(%rbp,%rax,4), %esi
	testl	%esi, %esi
	jne	.L57
	movl	$1, 0(%r13,%rax,4)
.L57:
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L58
	movl	%ecx, a(%rip)
.L56:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	call	card
	movl	hanaN(%rip), %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movl	taroN(%rip), %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L53:
	movq	1640(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	addq	$1656, %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
.L64:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	hanaN
	.bss
	.align 4
	.type	hanaN, @object
	.size	hanaN, 4
hanaN:
	.zero	4
	.globl	taroN
	.align 4
	.type	taroN, @object
	.size	taroN, 4
taroN:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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	card
	.type	card, @function
card:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdx, %r11
	leal	(%rdi,%rdi), %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %r10
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	leal	1(%r8), %edi
	leaq	4(%r11), %rbp
	leaq	4(%rsi), %rbx
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$1, a(%rip)
	testl	%r8d, %r8d
	jle	.L2
	cmpl	$1, 4(%r10)
	jne	.L5
	testl	%edx, %edx
	jle	.L49
.L5:
	leaq	8(%r10), %rsi
	movl	$1, %eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rsi, %rcx
	leaq	4(%rsi), %rsi
	cmpl	$1, (%rcx)
	jne	.L8
	cmpl	%edx, %eax
	jg	.L50
.L8:
	cmpl	%r8d, %eax
	cmove	%r9d, %edx
.L11:
	addl	$1, %eax
	movl	%eax, a(%rip)
	cmpl	%edi, %eax
	jne	.L13
	movl	taroN(%rip), %ecx
	testl	%ecx, %ecx
	je	.L1
	movl	$1, a(%rip)
	cmpl	$1, 4(%r11)
	jne	.L10
	testl	%edx, %edx
	jle	.L51
.L10:
	leaq	8(%r11), %rcx
	movl	$1, %eax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rcx, %rsi
	addq	$4, %rcx
	cmpl	$1, (%rsi)
	jne	.L19
	cmpl	%edx, %eax
	jg	.L17
.L19:
	cmpl	%r8d, %eax
	cmove	%r9d, %edx
.L21:
	addl	$1, %eax
	movl	%eax, a(%rip)
	cmpl	%edi, %eax
	jne	.L23
.L47:
	movl	hanaN(%rip), %ecx
.L20:
	testl	%ecx, %ecx
	jne	.L24
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	movq	%rbp, %rsi
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$0, (%rsi)
	movl	hanaN(%rip), %edx
	leal	-1(%rdx), %ecx
	movl	%eax, %edx
	movl	%ecx, hanaN(%rip)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L50:
	movl	%eax, %edx
.L6:
	movl	$0, (%rcx)
	subl	$1, taroN(%rip)
	jne	.L10
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	movl	taroN(%rip), %eax
	testl	%eax, %eax
	jne	.L47
	jmp	.L1
.L49:
	movq	%rbx, %rcx
	movl	$1, %edx
	jmp	.L6
	.cfi_endproc
.LFE36:
	.size	card, .-card
	.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:
.LFB35:
	.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
	leaq	.LC1(%rip), %r14
	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	$1656, %rsp
	.cfi_def_cfa_offset 1712
	movq	%fs:40, %rax
	movq	%rax, 1640(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	8(%rsp), %r15
	leaq	832(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L59:
	xorl	%eax, %eax
	movl	$100, %ecx
	movq	%rbp, %rdi
	movq	%r15, %rsi
	rep stosq
	movl	$100, %ecx
	movl	$201, a(%rip)
	movl	$0, (%rdi)
	movq	%r13, %rdi
	rep stosq
	movl	$0, (%rdi)
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	testl	%edi, %edi
	je	.L53
	movl	%edi, taroN(%rip)
	movl	%edi, hanaN(%rip)
	movl	$0, a(%rip)
	jle	.L54
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L55:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	8(%rsp), %edi
	movl	$1, 16(%rsp,%rax,4)
	movl	$0, 832(%rsp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
	cmpl	%edi, %eax
	jl	.L55
.L54:
	movl	$1, a(%rip)
	leal	(%rdi,%rdi), %eax
	testl	%eax, %eax
	jle	.L56
	leal	1(%rax), %edx
	movl	$1, %eax
	movq	%rdx, %rcx
	.p2align 4,,10
	.p2align 3
.L58:
	movl	0(%rbp,%rax,4), %esi
	testl	%esi, %esi
	jne	.L57
	movl	$1, 0(%r13,%rax,4)
.L57:
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L58
	movl	%ecx, a(%rip)
.L56:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	call	card
	movl	hanaN(%rip), %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movl	taroN(%rip), %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L53:
	movq	1640(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	addq	$1656, %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
.L64:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	hanaN
	.bss
	.align 4
	.type	hanaN, @object
	.size	hanaN, 4
hanaN:
	.zero	4
	.globl	taroN
	.align 4
	.type	taroN, @object
	.size	taroN, 4
taroN:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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<string.h>

int a;
int taroN,hanaN;
void card(int,int *,int *);

int main(void){
	int n;
	int taro[201],hana[201];
	while(1){
		for(a=0;a<=200;a++){
			 taro[a]=0;
			 hana[a]=0;
		}
		scanf("%d",&n);
		if(n==0)break;
		taroN=n,hanaN=n;
		for(a=0;a<n;a++){
			int b;
			scanf("%d",&b);
			taro[b]=1,hana[b]=0;
		}
		for(a=1;a<=n*2;a++){
			if(taro[a]==0)hana[a]=1;
		}
		card(n,taro,hana);
		printf("%d\n",hanaN);
		printf("%d\n",taroN);
	}
	return 0;
}

void card(int n,int taro[201],int hana[201]){
	int max=0;
	while(1){
		for(a=1;a<=n*2;a++){
			if(taro[a]==1 && a>max){
				max=a;
				taro[a]=0;
				taroN--;
				break;
			}
			if(a==n*2)max=0;
		}
		if(taroN==0)return;
		
		for(a=1;a<=n*2;a++){
			if(hana[a]==1 && a>max){
				max=a;
				hana[a]=0;
				hanaN--;
				break;
			}
			if(a==n*2)max=0;
		}
		if(hanaN==0)return;
	}
}
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<string.h>

int a;
int taroN,hanaN;
void card(int,int *,int *);

int main(void){
	int n;
	int taro[201],hana[201];
	while(1){
		for(a=0;a<=200;a++){
			 taro[a]=0;
			 hana[a]=0;
		}
		scanf("%d",&n);
		if(n==0)break;
		taroN=n,hanaN=n;
		for(a=0;a<n;a++){
			int b;
			scanf("%d",&b);
			taro[b]=1,hana[b]=0;
		}
		for(a=1;a<=n*2;a++){
			if(taro[a]==0)hana[a]=1;
		}
		card(n,taro,hana);
		printf("%d\n",hanaN);
		printf("%d\n",taroN);
	}
	return 0;
}

void card(int n,int taro[201],int hana[201]){
	int max=0;
	while(1){
		for(a=1;a<=n*2;a++){
			if(taro[a]==1 && a>max){
				max=a;
				taro[a]=0;
				taroN--;
				break;
			}
			if(a==n*2)max=0;
		}
		if(taroN==0)return;
		
		for(a=1;a<=n*2;a++){
			if(hana[a]==1 && a>max){
				max=a;
				hana[a]=0;
				hanaN--;
				break;
			}
			if(a==n*2)max=0;
		}
		if(hanaN==0)return;
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	taroN
	.align 4
	.type	taroN, @object
	.size	taroN, 4
taroN:
	.zero	4
	.globl	hanaN
	.align 4
	.type	hanaN, @object
	.size	hanaN, 4
hanaN:
	.zero	4
	.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	$1648, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	movl	$0, a(%rip)
	jmp	.L2
.L3:
	movl	a(%rip), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	movl	a(%rip), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L2:
	movl	a(%rip), %eax
	cmpl	$200, %eax
	jle	.L3
	leaq	-1640(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1640(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	-1640(%rbp), %eax
	movl	%eax, taroN(%rip)
	movl	-1640(%rbp), %eax
	movl	%eax, hanaN(%rip)
	movl	$0, a(%rip)
	jmp	.L6
.L7:
	leaq	-1636(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1636(%rbp), %eax
	cltq
	movl	$1, -1632(%rbp,%rax,4)
	movl	-1636(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L6:
	movl	a(%rip), %edx
	movl	-1640(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	$1, a(%rip)
	jmp	.L8
.L10:
	movl	a(%rip), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	a(%rip), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
.L9:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L8:
	movl	-1640(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-1640(%rbp), %eax
	leaq	-816(%rbp), %rdx
	leaq	-1632(%rbp), %rcx
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	card
	movl	hanaN(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	taroN(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
	.globl	card
	.type	card, @function
card:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	$0, -4(%rbp)
.L30:
	movl	$1, a(%rip)
	jmp	.L17
.L21:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	a(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L18
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	movl	taroN(%rip), %eax
	subl	$1, %eax
	movl	%eax, taroN(%rip)
	jmp	.L19
.L18:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	$0, -4(%rbp)
.L20:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L17:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L21
.L19:
	movl	taroN(%rip), %eax
	testl	%eax, %eax
	je	.L31
	movl	$1, a(%rip)
	jmp	.L24
.L28:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	a(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L25
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	movl	hanaN(%rip), %eax
	subl	$1, %eax
	movl	%eax, hanaN(%rip)
	jmp	.L26
.L25:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jne	.L27
	movl	$0, -4(%rbp)
.L27:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L24:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L28
.L26:
	movl	hanaN(%rip), %eax
	testl	%eax, %eax
	je	.L32
	jmp	.L30
.L31:
	nop
	jmp	.L16
.L32:
	nop
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	card, .-card
	.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.
val
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	taroN
	.align 4
	.type	taroN, @object
	.size	taroN, 4
taroN:
	.zero	4
	.globl	hanaN
	.align 4
	.type	hanaN, @object
	.size	hanaN, 4
hanaN:
	.zero	4
	.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	$1648, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	movl	$0, a(%rip)
	jmp	.L2
.L3:
	movl	a(%rip), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	movl	a(%rip), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L2:
	movl	a(%rip), %eax
	cmpl	$200, %eax
	jle	.L3
	leaq	-1640(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1640(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	-1640(%rbp), %eax
	movl	%eax, taroN(%rip)
	movl	-1640(%rbp), %eax
	movl	%eax, hanaN(%rip)
	movl	$0, a(%rip)
	jmp	.L6
.L7:
	leaq	-1636(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1636(%rbp), %eax
	cltq
	movl	$1, -1632(%rbp,%rax,4)
	movl	-1636(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L6:
	movl	a(%rip), %edx
	movl	-1640(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	$1, a(%rip)
	jmp	.L8
.L10:
	movl	a(%rip), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	a(%rip), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
.L9:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L8:
	movl	-1640(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-1640(%rbp), %eax
	leaq	-816(%rbp), %rdx
	leaq	-1632(%rbp), %rcx
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	card
	movl	hanaN(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	taroN(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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
	.globl	card
	.type	card, @function
card:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	$0, -4(%rbp)
.L30:
	movl	$1, a(%rip)
	jmp	.L17
.L21:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	a(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L18
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	movl	taroN(%rip), %eax
	subl	$1, %eax
	movl	%eax, taroN(%rip)
	jmp	.L19
.L18:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	$0, -4(%rbp)
.L20:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L17:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L21
.L19:
	movl	taroN(%rip), %eax
	testl	%eax, %eax
	je	.L31
	movl	$1, a(%rip)
	jmp	.L24
.L28:
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L25
	movl	a(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L25
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	a(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	movl	hanaN(%rip), %eax
	subl	$1, %eax
	movl	%eax, hanaN(%rip)
	jmp	.L26
.L25:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jne	.L27
	movl	$0, -4(%rbp)
.L27:
	movl	a(%rip), %eax
	addl	$1, %eax
	movl	%eax, a(%rip)
.L24:
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jge	.L28
.L26:
	movl	hanaN(%rip), %eax
	testl	%eax, %eax
	je	.L32
	jmp	.L30
.L31:
	nop
	jmp	.L16
.L32:
	nop
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	card, .-card
	.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:
