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(){
  int t[201], h[201], tres, hres, n, num, i, j, order, tmp;

  while(1){
    scanf("%d", &n);
    if(n==0) break;
    
    for(i=1; i<2*n+1; i++){
      t[i]=0;
      h[i]=0;
    }
    for(i=0; i<n; i++){
      scanf("%d", &num);
      t[num]=1;
    }
    for(i=1; i<2*n+1; i++){
      if(t[i]==0){
	h[i]=1;
      }
    }
    
    tres=hres=n;
    order=0;
    tmp=0;
    while(1){
      if(tres==0 || hres==0) break;
      j=1;
      if(tmp!=0){
	if(order==0){
	  order=1;
	}else{
	  order=0;
	}
      }
      for(i=j; i<2*n+1; i++){
	if(tres==0 || hres==0) break;
	if(order==0){
	  if(t[i]==1){
	    t[i]=0;
	    tres--;
	    order=1;
	    j=i;
	    continue;
	  }
	}else{
	  if(h[i]==1){
	    h[i]=0;
	    hres--;
	    order=0;
	    j=i;
	    continue;
	  }
	}
	tmp=1;
      }
    }    
    printf("%d\n%d\n", hres, tres);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	$1664, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L21:
	leaq	-1664(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1664(%rbp), %eax
	testl	%eax, %eax
	je	.L25
	movl	$1, -1648(%rbp)
	jmp	.L4
.L5:
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	addl	$1, -1648(%rbp)
.L4:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L5
	movl	$0, -1648(%rbp)
	jmp	.L6
.L7:
	leaq	-1660(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1660(%rbp), %eax
	cltq
	movl	$1, -1632(%rbp,%rax,4)
	addl	$1, -1648(%rbp)
.L6:
	movl	-1664(%rbp), %eax
	cmpl	%eax, -1648(%rbp)
	jl	.L7
	movl	$1, -1648(%rbp)
	jmp	.L8
.L10:
	movl	-1648(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-1648(%rbp), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
.L9:
	addl	$1, -1648(%rbp)
.L8:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L10
	movl	-1664(%rbp), %eax
	movl	%eax, -1652(%rbp)
	movl	-1652(%rbp), %eax
	movl	%eax, -1656(%rbp)
	movl	$0, -1644(%rbp)
	movl	$0, -1640(%rbp)
.L20:
	cmpl	$0, -1656(%rbp)
	je	.L11
	cmpl	$0, -1652(%rbp)
	je	.L11
	movl	$1, -1636(%rbp)
	cmpl	$0, -1640(%rbp)
	je	.L12
	cmpl	$0, -1644(%rbp)
	jne	.L13
	movl	$1, -1644(%rbp)
	jmp	.L12
.L13:
	movl	$0, -1644(%rbp)
.L12:
	movl	-1636(%rbp), %eax
	movl	%eax, -1648(%rbp)
	jmp	.L14
.L19:
	cmpl	$0, -1656(%rbp)
	je	.L20
	cmpl	$0, -1652(%rbp)
	je	.L20
	cmpl	$0, -1644(%rbp)
	jne	.L16
	movl	-1648(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	subl	$1, -1656(%rbp)
	movl	$1, -1644(%rbp)
	movl	-1648(%rbp), %eax
	movl	%eax, -1636(%rbp)
	jmp	.L18
.L16:
	movl	-1648(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	subl	$1, -1652(%rbp)
	movl	$0, -1644(%rbp)
	movl	-1648(%rbp), %eax
	movl	%eax, -1636(%rbp)
	jmp	.L18
.L17:
	movl	$1, -1640(%rbp)
.L18:
	addl	$1, -1648(%rbp)
.L14:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L19
	jmp	.L20
.L11:
	movl	-1656(%rbp), %edx
	movl	-1652(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L21
.L25:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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
	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	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L2
	leal	(%r13,%r13), %r14d
	testl	%r14d, %r14d
	jle	.L6
	movslq	%r14d, %r15
	leaq	20(%rsp), %rdi
	xorl	%esi, %esi
	salq	$2, %r15
	movq	%r15, %rdx
	call	memset@PLT
	leaq	836(%rsp), %r9
	movq	%r15, %rdx
	xorl	%esi, %esi
	movq	%r9, %rdi
	call	memset@PLT
.L6:
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r15
	testl	%r13d, %r13d
	jle	.L37
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	8(%rsp), %r13d
	movl	$1, 16(%rsp,%rax,4)
	cmpl	%r12d, %r13d
	jg	.L4
	leal	(%r13,%r13), %r14d
	testl	%r14d, %r14d
	jle	.L12
.L7:
	leal	1(%r14), %ecx
	movl	$1, %eax
	leaq	16(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rdx,%rax,4), %esi
	testl	%esi, %esi
	jne	.L10
	movl	$1, 832(%rsp,%rax,4)
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L11
.L12:
	testl	%r13d, %r13d
	je	.L27
.L22:
	leal	-1(%r14), %eax
	leaq	20(%rsp), %r11
	movl	%r13d, %r10d
	xorl	%edi, %edi
	leaq	(%r11,%rax,4), %rsi
	xorl	%ecx, %ecx
	leaq	836(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%r14d, %r14d
	jle	.L19
	movq	%r11, %rax
	movq	%r9, %rdx
.L20:
	testl	%ecx, %ecx
	jne	.L14
.L40:
	cmpl	$1, (%rax)
	je	.L38
.L15:
	cmpq	%rax, %rsi
	je	.L39
	addq	$4, %rax
	addq	$4, %rdx
	movl	$1, %edi
	testl	%ecx, %ecx
	je	.L40
.L14:
	cmpl	$1, (%rdx)
	jne	.L15
	movl	$0, (%rdx)
	subl	$1, %r10d
	xorl	%ecx, %ecx
.L16:
	testl	%r13d, %r13d
	sete	%r8b
	testl	%r10d, %r10d
	sete	%r15b
	orl	%r15d, %r8d
	cmpq	%rax, %rsi
	je	.L18
	addq	$4, %rax
	addq	$4, %rdx
	testb	%r8b, %r8b
	je	.L20
.L8:
	movl	%r13d, %ecx
	movl	%r10d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L39:
	movl	$1, %edi
.L18:
	testl	%r13d, %r13d
	je	.L8
	testl	%r10d, %r10d
	je	.L8
.L19:
	xorl	%edi, %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L38:
	movl	$0, (%rax)
	subl	$1, %r13d
	movl	$1, %ecx
	jmp	.L16
.L2:
	movq	1640(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	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
.L27:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L8
.L37:
	testl	%r14d, %r14d
	jg	.L7
	jmp	.L22
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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
	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	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L2
	leal	(%r13,%r13), %r14d
	testl	%r14d, %r14d
	jle	.L6
	movslq	%r14d, %r15
	leaq	20(%rsp), %rdi
	xorl	%esi, %esi
	salq	$2, %r15
	movq	%r15, %rdx
	call	memset@PLT
	leaq	836(%rsp), %r9
	movq	%r15, %rdx
	xorl	%esi, %esi
	movq	%r9, %rdi
	call	memset@PLT
.L6:
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r15
	testl	%r13d, %r13d
	jle	.L37
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	8(%rsp), %r13d
	movl	$1, 16(%rsp,%rax,4)
	cmpl	%r12d, %r13d
	jg	.L4
	leal	(%r13,%r13), %r14d
	testl	%r14d, %r14d
	jle	.L12
.L7:
	leal	1(%r14), %ecx
	movl	$1, %eax
	leaq	16(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rdx,%rax,4), %esi
	testl	%esi, %esi
	jne	.L10
	movl	$1, 832(%rsp,%rax,4)
.L10:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L11
.L12:
	testl	%r13d, %r13d
	je	.L27
.L22:
	leal	-1(%r14), %eax
	leaq	20(%rsp), %r11
	movl	%r13d, %r10d
	xorl	%edi, %edi
	leaq	(%r11,%rax,4), %rsi
	xorl	%ecx, %ecx
	leaq	836(%rsp), %r9
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%r14d, %r14d
	jle	.L19
	movq	%r11, %rax
	movq	%r9, %rdx
.L20:
	testl	%ecx, %ecx
	jne	.L14
.L40:
	cmpl	$1, (%rax)
	je	.L38
.L15:
	cmpq	%rax, %rsi
	je	.L39
	addq	$4, %rax
	addq	$4, %rdx
	movl	$1, %edi
	testl	%ecx, %ecx
	je	.L40
.L14:
	cmpl	$1, (%rdx)
	jne	.L15
	movl	$0, (%rdx)
	subl	$1, %r10d
	xorl	%ecx, %ecx
.L16:
	testl	%r13d, %r13d
	sete	%r8b
	testl	%r10d, %r10d
	sete	%r15b
	orl	%r15d, %r8d
	cmpq	%rax, %rsi
	je	.L18
	addq	$4, %rax
	addq	$4, %rdx
	testb	%r8b, %r8b
	je	.L20
.L8:
	movl	%r13d, %ecx
	movl	%r10d, %edx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L39:
	movl	$1, %edi
.L18:
	testl	%r13d, %r13d
	je	.L8
	testl	%r10d, %r10d
	je	.L8
.L19:
	xorl	%edi, %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L38:
	movl	$0, (%rax)
	subl	$1, %r13d
	movl	$1, %ecx
	jmp	.L16
.L2:
	movq	1640(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	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
.L27:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L8
.L37:
	testl	%r14d, %r14d
	jg	.L7
	jmp	.L22
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

int main(){
  int t[201], h[201], tres, hres, n, num, i, j, order, tmp;

  while(1){
    scanf("%d", &n);
    if(n==0) break;
    
    for(i=1; i<2*n+1; i++){
      t[i]=0;
      h[i]=0;
    }
    for(i=0; i<n; i++){
      scanf("%d", &num);
      t[num]=1;
    }
    for(i=1; i<2*n+1; i++){
      if(t[i]==0){
	h[i]=1;
      }
    }
    
    tres=hres=n;
    order=0;
    tmp=0;
    while(1){
      if(tres==0 || hres==0) break;
      j=1;
      if(tmp!=0){
	if(order==0){
	  order=1;
	}else{
	  order=0;
	}
      }
      for(i=j; i<2*n+1; i++){
	if(tres==0 || hres==0) break;
	if(order==0){
	  if(t[i]==1){
	    t[i]=0;
	    tres--;
	    order=1;
	    j=i;
	    continue;
	  }
	}else{
	  if(h[i]==1){
	    h[i]=0;
	    hres--;
	    order=0;
	    j=i;
	    continue;
	  }
	}
	tmp=1;
      }
    }    
    printf("%d\n%d\n", hres, tres);
  }
  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(){
  int t[201], h[201], tres, hres, n, num, i, j, order, tmp;

  while(1){
    scanf("%d", &n);
    if(n==0) break;
    
    for(i=1; i<2*n+1; i++){
      t[i]=0;
      h[i]=0;
    }
    for(i=0; i<n; i++){
      scanf("%d", &num);
      t[num]=1;
    }
    for(i=1; i<2*n+1; i++){
      if(t[i]==0){
	h[i]=1;
      }
    }
    
    tres=hres=n;
    order=0;
    tmp=0;
    while(1){
      if(tres==0 || hres==0) break;
      j=1;
      if(tmp!=0){
	if(order==0){
	  order=1;
	}else{
	  order=0;
	}
      }
      for(i=j; i<2*n+1; i++){
	if(tres==0 || hres==0) break;
	if(order==0){
	  if(t[i]==1){
	    t[i]=0;
	    tres--;
	    order=1;
	    j=i;
	    continue;
	  }
	}else{
	  if(h[i]==1){
	    h[i]=0;
	    hres--;
	    order=0;
	    j=i;
	    continue;
	  }
	}
	tmp=1;
      }
    }    
    printf("%d\n%d\n", hres, tres);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	$1664, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L21:
	leaq	-1664(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1664(%rbp), %eax
	testl	%eax, %eax
	je	.L25
	movl	$1, -1648(%rbp)
	jmp	.L4
.L5:
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	addl	$1, -1648(%rbp)
.L4:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L5
	movl	$0, -1648(%rbp)
	jmp	.L6
.L7:
	leaq	-1660(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1660(%rbp), %eax
	cltq
	movl	$1, -1632(%rbp,%rax,4)
	addl	$1, -1648(%rbp)
.L6:
	movl	-1664(%rbp), %eax
	cmpl	%eax, -1648(%rbp)
	jl	.L7
	movl	$1, -1648(%rbp)
	jmp	.L8
.L10:
	movl	-1648(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-1648(%rbp), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
.L9:
	addl	$1, -1648(%rbp)
.L8:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L10
	movl	-1664(%rbp), %eax
	movl	%eax, -1652(%rbp)
	movl	-1652(%rbp), %eax
	movl	%eax, -1656(%rbp)
	movl	$0, -1644(%rbp)
	movl	$0, -1640(%rbp)
.L20:
	cmpl	$0, -1656(%rbp)
	je	.L11
	cmpl	$0, -1652(%rbp)
	je	.L11
	movl	$1, -1636(%rbp)
	cmpl	$0, -1640(%rbp)
	je	.L12
	cmpl	$0, -1644(%rbp)
	jne	.L13
	movl	$1, -1644(%rbp)
	jmp	.L12
.L13:
	movl	$0, -1644(%rbp)
.L12:
	movl	-1636(%rbp), %eax
	movl	%eax, -1648(%rbp)
	jmp	.L14
.L19:
	cmpl	$0, -1656(%rbp)
	je	.L20
	cmpl	$0, -1652(%rbp)
	je	.L20
	cmpl	$0, -1644(%rbp)
	jne	.L16
	movl	-1648(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	subl	$1, -1656(%rbp)
	movl	$1, -1644(%rbp)
	movl	-1648(%rbp), %eax
	movl	%eax, -1636(%rbp)
	jmp	.L18
.L16:
	movl	-1648(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	subl	$1, -1652(%rbp)
	movl	$0, -1644(%rbp)
	movl	-1648(%rbp), %eax
	movl	%eax, -1636(%rbp)
	jmp	.L18
.L17:
	movl	$1, -1640(%rbp)
.L18:
	addl	$1, -1648(%rbp)
.L14:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L19
	jmp	.L20
.L11:
	movl	-1656(%rbp), %edx
	movl	-1652(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L21
.L25:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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\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	$1664, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L21:
	leaq	-1664(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1664(%rbp), %eax
	testl	%eax, %eax
	je	.L25
	movl	$1, -1648(%rbp)
	jmp	.L4
.L5:
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	addl	$1, -1648(%rbp)
.L4:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L5
	movl	$0, -1648(%rbp)
	jmp	.L6
.L7:
	leaq	-1660(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1660(%rbp), %eax
	cltq
	movl	$1, -1632(%rbp,%rax,4)
	addl	$1, -1648(%rbp)
.L6:
	movl	-1664(%rbp), %eax
	cmpl	%eax, -1648(%rbp)
	jl	.L7
	movl	$1, -1648(%rbp)
	jmp	.L8
.L10:
	movl	-1648(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-1648(%rbp), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
.L9:
	addl	$1, -1648(%rbp)
.L8:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L10
	movl	-1664(%rbp), %eax
	movl	%eax, -1652(%rbp)
	movl	-1652(%rbp), %eax
	movl	%eax, -1656(%rbp)
	movl	$0, -1644(%rbp)
	movl	$0, -1640(%rbp)
.L20:
	cmpl	$0, -1656(%rbp)
	je	.L11
	cmpl	$0, -1652(%rbp)
	je	.L11
	movl	$1, -1636(%rbp)
	cmpl	$0, -1640(%rbp)
	je	.L12
	cmpl	$0, -1644(%rbp)
	jne	.L13
	movl	$1, -1644(%rbp)
	jmp	.L12
.L13:
	movl	$0, -1644(%rbp)
.L12:
	movl	-1636(%rbp), %eax
	movl	%eax, -1648(%rbp)
	jmp	.L14
.L19:
	cmpl	$0, -1656(%rbp)
	je	.L20
	cmpl	$0, -1652(%rbp)
	je	.L20
	cmpl	$0, -1644(%rbp)
	jne	.L16
	movl	-1648(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -1632(%rbp,%rax,4)
	subl	$1, -1656(%rbp)
	movl	$1, -1644(%rbp)
	movl	-1648(%rbp), %eax
	movl	%eax, -1636(%rbp)
	jmp	.L18
.L16:
	movl	-1648(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L17
	movl	-1648(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	subl	$1, -1652(%rbp)
	movl	$0, -1644(%rbp)
	movl	-1648(%rbp), %eax
	movl	%eax, -1636(%rbp)
	jmp	.L18
.L17:
	movl	$1, -1640(%rbp)
.L18:
	addl	$1, -1648(%rbp)
.L14:
	movl	-1664(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -1648(%rbp)
	jle	.L19
	jmp	.L20
.L11:
	movl	-1656(%rbp), %edx
	movl	-1652(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L21
.L25:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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:
