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

  while( 1 ) {
    int i, n;
    char card[ 200 ];
    int x;
    int turn = 1, cont = 1;
    int tcn, hcn;
    int count = 0;

    scanf( "%d", &n );
    if( !n )
      break;

    tcn = n;
    hcn = n;

    for( i = 0; i < n * 2; i++ )
      card[ i ] = 2;

    for( i = 0; i < n; i++ ) {
      scanf( "%d", &x );
      card[ x - 1 ] = 1;
    }

    while( cont ) {
      for( i = 0; i < n * 2; i++ ) {
        if( turn == 1 ) {
          if( card[ i ] == 1 ) {
            card[ i ] = 0;
            turn = 2;
            tcn--;
          }
        } else {
          if( card[ i ] == 2 ) {
            card[ i ] = 0;
            turn = 1;
            hcn--;
          }
        }
        if( !tcn || !hcn ) {
          cont = 0;
          break;
        }
      }

      if( turn == 1 )
        turn = 2;
      else
        turn = 1;
    }

    for( i = 0; i < n * 2; i++ )
      if( card[ i ] )
        count++;

    if( !tcn )
      printf( "%d\n0\n", count );
    else
      printf( "0\n%d\n", count );
  }

  return( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n0\n"
.LC2:
	.string	"0\n%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	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	movl	$1, -228(%rbp)
	movl	$1, -224(%rbp)
	movl	$0, -212(%rbp)
	leaq	-240(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-240(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	jmp	.L25
.L2:
	movl	-240(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	$0, -232(%rbp)
	jmp	.L4
.L5:
	movl	-232(%rbp), %eax
	cltq
	movb	$2, -208(%rbp,%rax)
	addl	$1, -232(%rbp)
.L4:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L5
	movl	$0, -232(%rbp)
	jmp	.L6
.L7:
	leaq	-236(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-236(%rbp), %eax
	subl	$1, %eax
	cltq
	movb	$1, -208(%rbp,%rax)
	addl	$1, -232(%rbp)
.L6:
	movl	-240(%rbp), %eax
	cmpl	%eax, -232(%rbp)
	jl	.L7
	jmp	.L8
.L17:
	movl	$0, -232(%rbp)
	jmp	.L9
.L15:
	cmpl	$1, -228(%rbp)
	jne	.L10
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L11
	movl	-232(%rbp), %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	movl	$2, -228(%rbp)
	subl	$1, -220(%rbp)
	jmp	.L11
.L10:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$2, %al
	jne	.L11
	movl	-232(%rbp), %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	movl	$1, -228(%rbp)
	subl	$1, -216(%rbp)
.L11:
	cmpl	$0, -220(%rbp)
	je	.L12
	cmpl	$0, -216(%rbp)
	jne	.L13
.L12:
	movl	$0, -224(%rbp)
	jmp	.L14
.L13:
	addl	$1, -232(%rbp)
.L9:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L15
.L14:
	cmpl	$1, -228(%rbp)
	jne	.L16
	movl	$2, -228(%rbp)
	jmp	.L8
.L16:
	movl	$1, -228(%rbp)
.L8:
	cmpl	$0, -224(%rbp)
	jne	.L17
	movl	$0, -232(%rbp)
	jmp	.L18
.L20:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	testb	%al, %al
	je	.L19
	addl	$1, -212(%rbp)
.L19:
	addl	$1, -232(%rbp)
.L18:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L20
	cmpl	$0, -220(%rbp)
	jne	.L21
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L21:
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L25:
	call	__stack_chk_fail@PLT
.L24:
	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"
.LC2:
	.string	"%d\n0\n"
.LC3:
	.string	"0\n%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$3, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L36:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %r14d
	testl	%r14d, %r14d
	je	.L2
	leal	(%r14,%r14), %r8d
	testl	%r8d, %r8d
	jle	.L81
	leaq	32(%rsp), %rbx
	movslq	%r8d, %rdx
	movl	$2, %esi
	movl	%r8d, 4(%rsp)
	movq	%rbx, %rdi
	call	memset@PLT
	movl	4(%rsp), %r8d
.L6:
	xorl	%r13d, %r13d
	leaq	28(%rsp), %r15
	testl	%r14d, %r14d
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	24(%rsp), %r8d
	subl	$1, %eax
	cltq
	movb	$1, 32(%rsp,%rax)
	cmpl	%r13d, %r8d
	jg	.L4
	addl	%r8d, %r8d
.L5:
	leal	-1(%r8), %eax
	movl	%r14d, %edi
	movl	$1, %edx
	movq	%rax, %r10
	leaq	33(%rsp,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rax
	testl	%r8d, %r8d
	jg	.L11
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$2, %edx
	cmpb	$2, %cl
	je	.L82
.L37:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L14
.L11:
	movzbl	(%rax), %ecx
	cmpl	$1, %edx
	jne	.L7
	cmpb	$1, %cl
	jne	.L37
	movb	$0, (%rax)
	subl	$1, %r14d
	movl	$2, %edx
.L9:
	testl	%r14d, %r14d
	je	.L10
	testl	%edi, %edi
	jne	.L37
.L10:
	cmpl	$14, %r10d
	jbe	.L41
	pxor	%xmm4, %xmm4
	pxor	%xmm3, %xmm3
	movl	%r8d, %eax
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm0
	movdqa	%xmm3, %xmm5
	shrl	$4, %eax
	pcmpeqb	32(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm2
	punpcklbw	%xmm0, %xmm2
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm2, %xmm5
	movdqa	%xmm2, %xmm6
	movdqa	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	punpcklwd	%xmm5, %xmm6
	punpckhwd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	paddd	%xmm6, %xmm0
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	48(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$2, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	64(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$3, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	80(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$4, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	96(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$5, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	112(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$6, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	128(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$7, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	144(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$8, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	pcmpeqb	160(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm4, %xmm5
	punpckhbw	%xmm4, %xmm1
	movdqa	%xmm3, %xmm4
	pcmpgtw	%xmm5, %xmm4
	pcmpgtw	%xmm1, %xmm3
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm4, %xmm2
	punpckhwd	%xmm4, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm1, %xmm2
	punpckhwd	%xmm3, %xmm1
	paddd	%xmm5, %xmm0
	punpcklwd	%xmm3, %xmm2
	paddd	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$9, %eax
	je	.L16
	pxor	%xmm3, %xmm3
	movdqa	%xmm3, %xmm1
	movdqa	%xmm3, %xmm2
	pcmpeqb	176(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	movdqa	%xmm2, %xmm6
	movdqa	%xmm5, %xmm4
	pcmpgtw	%xmm5, %xmm6
	punpcklwd	%xmm6, %xmm4
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm5
	punpckhwd	%xmm4, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$10, %eax
	je	.L16
	movdqa	%xmm3, %xmm1
	movdqa	%xmm3, %xmm4
	movdqa	%xmm2, %xmm6
	pcmpeqb	192(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm4, %xmm5
	punpckhbw	%xmm4, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm4
	punpcklwd	%xmm6, %xmm4
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm5
	punpckhwd	%xmm4, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$11, %eax
	je	.L16
	movdqa	%xmm3, %xmm1
	movdqa	%xmm2, %xmm5
	pcmpeqb	208(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm3
	movdqa	%xmm1, %xmm4
	punpcklbw	%xmm3, %xmm4
	punpckhbw	%xmm3, %xmm1
	pcmpgtw	%xmm4, %xmm5
	pcmpgtw	%xmm1, %xmm2
	movdqa	%xmm4, %xmm3
	punpcklwd	%xmm5, %xmm3
	punpckhwd	%xmm5, %xmm4
	paddd	%xmm3, %xmm0
	movdqa	%xmm1, %xmm3
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm4, %xmm0
	punpcklwd	%xmm2, %xmm3
	paddd	%xmm3, %xmm0
	paddd	%xmm1, %xmm0
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm0, %xmm1
	movl	%r8d, %eax
	psrldq	$8, %xmm1
	andl	$-16, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$15, %r8b
	je	.L17
.L15:
	movslq	%eax, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	1(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%r8d, %ecx
	jge	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	2(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%r8d, %ecx
	jge	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	3(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%r8d, %ecx
	jge	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	4(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	5(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	6(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	7(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	8(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	9(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	10(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	11(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	12(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	13(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	sbbl	$-1, %edx
	addl	$14, %eax
	cmpl	%eax, %r8d
	jle	.L17
	cltq
	cmpb	$1, 32(%rsp,%rax)
	sbbl	$-1, %edx
	.p2align 4,,10
	.p2align 3
.L17:
	testl	%r14d, %r14d
	jne	.L34
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L82:
	movb	$0, (%rax)
	subl	$1, %edi
	movl	$1, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%r12d, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	jmp	.L12
.L34:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L36
.L41:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L15
.L2:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	addq	$248, %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
.L81:
	.cfi_restore_state
	leaq	32(%rsp), %rbx
	jmp	.L6
.L83:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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"
.LC2:
	.string	"%d\n0\n"
.LC3:
	.string	"0\n%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$3, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L36:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %r14d
	testl	%r14d, %r14d
	je	.L2
	leal	(%r14,%r14), %r8d
	testl	%r8d, %r8d
	jle	.L81
	leaq	32(%rsp), %rbx
	movslq	%r8d, %rdx
	movl	$2, %esi
	movl	%r8d, 4(%rsp)
	movq	%rbx, %rdi
	call	memset@PLT
	movl	4(%rsp), %r8d
.L6:
	xorl	%r13d, %r13d
	leaq	28(%rsp), %r15
	testl	%r14d, %r14d
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	24(%rsp), %r8d
	subl	$1, %eax
	cltq
	movb	$1, 32(%rsp,%rax)
	cmpl	%r13d, %r8d
	jg	.L4
	addl	%r8d, %r8d
.L5:
	leal	-1(%r8), %eax
	movl	%r14d, %edi
	movl	$1, %edx
	movq	%rax, %r10
	leaq	33(%rsp,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rax
	testl	%r8d, %r8d
	jg	.L11
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$2, %edx
	cmpb	$2, %cl
	je	.L82
.L37:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L14
.L11:
	movzbl	(%rax), %ecx
	cmpl	$1, %edx
	jne	.L7
	cmpb	$1, %cl
	jne	.L37
	movb	$0, (%rax)
	subl	$1, %r14d
	movl	$2, %edx
.L9:
	testl	%r14d, %r14d
	je	.L10
	testl	%edi, %edi
	jne	.L37
.L10:
	cmpl	$14, %r10d
	jbe	.L41
	pxor	%xmm4, %xmm4
	pxor	%xmm3, %xmm3
	movl	%r8d, %eax
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm0
	movdqa	%xmm3, %xmm5
	shrl	$4, %eax
	pcmpeqb	32(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm0
	movdqa	%xmm1, %xmm2
	punpcklbw	%xmm0, %xmm2
	punpckhbw	%xmm0, %xmm1
	pcmpgtw	%xmm2, %xmm5
	movdqa	%xmm2, %xmm6
	movdqa	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	punpcklwd	%xmm5, %xmm6
	punpckhwd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	paddd	%xmm6, %xmm0
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$1, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	48(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$2, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	64(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$3, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	80(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$4, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	96(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$5, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	112(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$6, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	128(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$7, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	movdqa	%xmm4, %xmm2
	movdqa	%xmm3, %xmm6
	pcmpeqb	144(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm6, %xmm2
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	pcmpgtw	%xmm1, %xmm2
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm2, %xmm5
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$8, %eax
	je	.L16
	movdqa	%xmm4, %xmm1
	pcmpeqb	160(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm4, %xmm5
	punpckhbw	%xmm4, %xmm1
	movdqa	%xmm3, %xmm4
	pcmpgtw	%xmm5, %xmm4
	pcmpgtw	%xmm1, %xmm3
	movdqa	%xmm5, %xmm2
	punpcklwd	%xmm4, %xmm2
	punpckhwd	%xmm4, %xmm5
	paddd	%xmm2, %xmm0
	movdqa	%xmm1, %xmm2
	punpckhwd	%xmm3, %xmm1
	paddd	%xmm5, %xmm0
	punpcklwd	%xmm3, %xmm2
	paddd	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$9, %eax
	je	.L16
	pxor	%xmm3, %xmm3
	movdqa	%xmm3, %xmm1
	movdqa	%xmm3, %xmm2
	pcmpeqb	176(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm2
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm2, %xmm5
	punpckhbw	%xmm2, %xmm1
	pxor	%xmm2, %xmm2
	movdqa	%xmm2, %xmm6
	movdqa	%xmm5, %xmm4
	pcmpgtw	%xmm5, %xmm6
	punpcklwd	%xmm6, %xmm4
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm5
	punpckhwd	%xmm4, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$10, %eax
	je	.L16
	movdqa	%xmm3, %xmm1
	movdqa	%xmm3, %xmm4
	movdqa	%xmm2, %xmm6
	pcmpeqb	192(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm4
	movdqa	%xmm1, %xmm5
	punpcklbw	%xmm4, %xmm5
	punpckhbw	%xmm4, %xmm1
	pcmpgtw	%xmm5, %xmm6
	movdqa	%xmm5, %xmm4
	punpcklwd	%xmm6, %xmm4
	punpckhwd	%xmm6, %xmm5
	paddd	%xmm4, %xmm0
	movdqa	%xmm2, %xmm4
	pcmpgtw	%xmm1, %xmm4
	paddd	%xmm5, %xmm0
	movdqa	%xmm1, %xmm5
	punpcklwd	%xmm4, %xmm5
	punpckhwd	%xmm4, %xmm1
	paddd	%xmm5, %xmm0
	paddd	%xmm1, %xmm0
	cmpl	$11, %eax
	je	.L16
	movdqa	%xmm3, %xmm1
	movdqa	%xmm2, %xmm5
	pcmpeqb	208(%rsp), %xmm1
	pandn	.LC1(%rip), %xmm1
	pcmpgtb	%xmm1, %xmm3
	movdqa	%xmm1, %xmm4
	punpcklbw	%xmm3, %xmm4
	punpckhbw	%xmm3, %xmm1
	pcmpgtw	%xmm4, %xmm5
	pcmpgtw	%xmm1, %xmm2
	movdqa	%xmm4, %xmm3
	punpcklwd	%xmm5, %xmm3
	punpckhwd	%xmm5, %xmm4
	paddd	%xmm3, %xmm0
	movdqa	%xmm1, %xmm3
	punpckhwd	%xmm2, %xmm1
	paddd	%xmm4, %xmm0
	punpcklwd	%xmm2, %xmm3
	paddd	%xmm3, %xmm0
	paddd	%xmm1, %xmm0
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm0, %xmm1
	movl	%r8d, %eax
	psrldq	$8, %xmm1
	andl	$-16, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$15, %r8b
	je	.L17
.L15:
	movslq	%eax, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	1(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%r8d, %ecx
	jge	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	2(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%r8d, %ecx
	jge	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	3(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%r8d, %ecx
	jge	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	4(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	5(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	6(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	7(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	8(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	9(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	10(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	11(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	12(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	leal	13(%rax), %ecx
	sbbl	$-1, %edx
	cmpl	%ecx, %r8d
	jle	.L17
	movslq	%ecx, %rcx
	cmpb	$1, 32(%rsp,%rcx)
	sbbl	$-1, %edx
	addl	$14, %eax
	cmpl	%eax, %r8d
	jle	.L17
	cltq
	cmpb	$1, 32(%rsp,%rax)
	sbbl	$-1, %edx
	.p2align 4,,10
	.p2align 3
.L17:
	testl	%r14d, %r14d
	jne	.L34
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L82:
	movb	$0, (%rax)
	subl	$1, %edi
	movl	$1, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%r12d, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	jmp	.L12
.L34:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L36
.L41:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L15
.L2:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	addq	$248, %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
.L81:
	.cfi_restore_state
	leaq	32(%rsp), %rbx
	jmp	.L6
.L83:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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 ) {

  while( 1 ) {
    int i, n;
    char card[ 200 ];
    int x;
    int turn = 1, cont = 1;
    int tcn, hcn;
    int count = 0;

    scanf( "%d", &n );
    if( !n )
      break;

    tcn = n;
    hcn = n;

    for( i = 0; i < n * 2; i++ )
      card[ i ] = 2;

    for( i = 0; i < n; i++ ) {
      scanf( "%d", &x );
      card[ x - 1 ] = 1;
    }

    while( cont ) {
      for( i = 0; i < n * 2; i++ ) {
        if( turn == 1 ) {
          if( card[ i ] == 1 ) {
            card[ i ] = 0;
            turn = 2;
            tcn--;
          }
        } else {
          if( card[ i ] == 2 ) {
            card[ i ] = 0;
            turn = 1;
            hcn--;
          }
        }
        if( !tcn || !hcn ) {
          cont = 0;
          break;
        }
      }

      if( turn == 1 )
        turn = 2;
      else
        turn = 1;
    }

    for( i = 0; i < n * 2; i++ )
      if( card[ i ] )
        count++;

    if( !tcn )
      printf( "%d\n0\n", count );
    else
      printf( "0\n%d\n", count );
  }

  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>

int main( void ) {

  while( 1 ) {
    int i, n;
    char card[ 200 ];
    int x;
    int turn = 1, cont = 1;
    int tcn, hcn;
    int count = 0;

    scanf( "%d", &n );
    if( !n )
      break;

    tcn = n;
    hcn = n;

    for( i = 0; i < n * 2; i++ )
      card[ i ] = 2;

    for( i = 0; i < n; i++ ) {
      scanf( "%d", &x );
      card[ x - 1 ] = 1;
    }

    while( cont ) {
      for( i = 0; i < n * 2; i++ ) {
        if( turn == 1 ) {
          if( card[ i ] == 1 ) {
            card[ i ] = 0;
            turn = 2;
            tcn--;
          }
        } else {
          if( card[ i ] == 2 ) {
            card[ i ] = 0;
            turn = 1;
            hcn--;
          }
        }
        if( !tcn || !hcn ) {
          cont = 0;
          break;
        }
      }

      if( turn == 1 )
        turn = 2;
      else
        turn = 1;
    }

    for( i = 0; i < n * 2; i++ )
      if( card[ i ] )
        count++;

    if( !tcn )
      printf( "%d\n0\n", count );
    else
      printf( "0\n%d\n", count );
  }

  return( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n0\n"
.LC2:
	.string	"0\n%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	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	movl	$1, -228(%rbp)
	movl	$1, -224(%rbp)
	movl	$0, -212(%rbp)
	leaq	-240(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-240(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	jmp	.L25
.L2:
	movl	-240(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	$0, -232(%rbp)
	jmp	.L4
.L5:
	movl	-232(%rbp), %eax
	cltq
	movb	$2, -208(%rbp,%rax)
	addl	$1, -232(%rbp)
.L4:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L5
	movl	$0, -232(%rbp)
	jmp	.L6
.L7:
	leaq	-236(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-236(%rbp), %eax
	subl	$1, %eax
	cltq
	movb	$1, -208(%rbp,%rax)
	addl	$1, -232(%rbp)
.L6:
	movl	-240(%rbp), %eax
	cmpl	%eax, -232(%rbp)
	jl	.L7
	jmp	.L8
.L17:
	movl	$0, -232(%rbp)
	jmp	.L9
.L15:
	cmpl	$1, -228(%rbp)
	jne	.L10
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L11
	movl	-232(%rbp), %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	movl	$2, -228(%rbp)
	subl	$1, -220(%rbp)
	jmp	.L11
.L10:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$2, %al
	jne	.L11
	movl	-232(%rbp), %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	movl	$1, -228(%rbp)
	subl	$1, -216(%rbp)
.L11:
	cmpl	$0, -220(%rbp)
	je	.L12
	cmpl	$0, -216(%rbp)
	jne	.L13
.L12:
	movl	$0, -224(%rbp)
	jmp	.L14
.L13:
	addl	$1, -232(%rbp)
.L9:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L15
.L14:
	cmpl	$1, -228(%rbp)
	jne	.L16
	movl	$2, -228(%rbp)
	jmp	.L8
.L16:
	movl	$1, -228(%rbp)
.L8:
	cmpl	$0, -224(%rbp)
	jne	.L17
	movl	$0, -232(%rbp)
	jmp	.L18
.L20:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	testb	%al, %al
	je	.L19
	addl	$1, -212(%rbp)
.L19:
	addl	$1, -232(%rbp)
.L18:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L20
	cmpl	$0, -220(%rbp)
	jne	.L21
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L21:
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L25:
	call	__stack_chk_fail@PLT
.L24:
	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\n0\n"
.LC2:
	.string	"0\n%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	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	movl	$1, -228(%rbp)
	movl	$1, -224(%rbp)
	movl	$0, -212(%rbp)
	leaq	-240(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-240(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	jmp	.L25
.L2:
	movl	-240(%rbp), %eax
	movl	%eax, -220(%rbp)
	movl	-240(%rbp), %eax
	movl	%eax, -216(%rbp)
	movl	$0, -232(%rbp)
	jmp	.L4
.L5:
	movl	-232(%rbp), %eax
	cltq
	movb	$2, -208(%rbp,%rax)
	addl	$1, -232(%rbp)
.L4:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L5
	movl	$0, -232(%rbp)
	jmp	.L6
.L7:
	leaq	-236(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-236(%rbp), %eax
	subl	$1, %eax
	cltq
	movb	$1, -208(%rbp,%rax)
	addl	$1, -232(%rbp)
.L6:
	movl	-240(%rbp), %eax
	cmpl	%eax, -232(%rbp)
	jl	.L7
	jmp	.L8
.L17:
	movl	$0, -232(%rbp)
	jmp	.L9
.L15:
	cmpl	$1, -228(%rbp)
	jne	.L10
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$1, %al
	jne	.L11
	movl	-232(%rbp), %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	movl	$2, -228(%rbp)
	subl	$1, -220(%rbp)
	jmp	.L11
.L10:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$2, %al
	jne	.L11
	movl	-232(%rbp), %eax
	cltq
	movb	$0, -208(%rbp,%rax)
	movl	$1, -228(%rbp)
	subl	$1, -216(%rbp)
.L11:
	cmpl	$0, -220(%rbp)
	je	.L12
	cmpl	$0, -216(%rbp)
	jne	.L13
.L12:
	movl	$0, -224(%rbp)
	jmp	.L14
.L13:
	addl	$1, -232(%rbp)
.L9:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L15
.L14:
	cmpl	$1, -228(%rbp)
	jne	.L16
	movl	$2, -228(%rbp)
	jmp	.L8
.L16:
	movl	$1, -228(%rbp)
.L8:
	cmpl	$0, -224(%rbp)
	jne	.L17
	movl	$0, -232(%rbp)
	jmp	.L18
.L20:
	movl	-232(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	testb	%al, %al
	je	.L19
	addl	$1, -212(%rbp)
.L19:
	addl	$1, -232(%rbp)
.L18:
	movl	-240(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -232(%rbp)
	jl	.L20
	cmpl	$0, -220(%rbp)
	jne	.L21
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L21:
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L25:
	call	__stack_chk_fail@PLT
.L24:
	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:
