Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
  while(1){
    int n, i, j, k;
    int card[201], player[2], turn = 0, ba = 0;
    for(i = 0;i < 201;i++){
      card[i] = 1;
    }
    card[0] = 2;
    scanf("%d", &n);
    if(n == 0){
      return 0;
    }
    player[0] = player[1] = n;
    for(i = 0;i < n;i++){
      scanf("%d", &j);
      card[j] = 0;
    }
    while(player[0] != 0 && player[1] != 0){
      for(;ba <= 2 * n;ba++){
	if(card[ba] == turn){
	  card[ba] = 2;
	  player[turn]--;
	  break;
	}
      }
      if(ba == 2 * n + 1){
	ba = 0;
      }
      turn ^= 1;
    }
    printf("%d\n%d\n", player[1], player[0]);
  }
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.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	.LC1(%rip), %rbx
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	832(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	16(%rsp), %rbp
.L13:
	movq	8(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movdqa	.LC0(%rip), %xmm2
	addq	$16, %rax
	movaps	%xmm2, -16(%rax)
	cmpq	%r12, %rax
	jne	.L2
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$2, 32(%rsp)
	movl	$1, 832(%rsp)
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r15d
	movd	%r15d, %xmm1
	pshufd	$0xe0, %xmm1, %xmm0
	testl	%r15d, %r15d
	je	.L29
	movq	%xmm0, 24(%rsp)
	jle	.L15
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	movl	16(%rsp), %esi
	movl	$0, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jg	.L5
.L4:
	addl	%esi, %esi
	movl	%r15d, %r8d
	xorl	%edi, %edi
	xorl	%eax, %eax
	leal	1(%rsi), %r10d
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	8(%rsp), %rcx
	movslq	%eax, %rdx
	leaq	(%rcx,%rdx,4), %rdx
	cmpl	%eax, %esi
	jge	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%eax, %esi
	jl	.L8
.L9:
	cmpl	%edi, (%rdx)
	jne	.L7
	movslq	%eax, %rdx
	movl	$2, 32(%rsp,%rdx,4)
	movslq	%edi, %rdx
	subl	$1, 24(%rsp,%rdx,4)
	movl	24(%rsp), %r15d
	movl	28(%rsp), %r8d
.L8:
	cmpl	%eax, %r10d
	cmove	%r9d, %eax
	xorl	$1, %edi
	testl	%r15d, %r15d
	je	.L11
	testl	%r8d, %r8d
	jne	.L6
.L11:
	movl	%r15d, %ecx
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$856, %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
.L15:
	.cfi_restore_state
	movl	%r15d, %esi
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.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	.LC1(%rip), %rbx
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	832(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	16(%rsp), %rbp
.L13:
	movq	8(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movdqa	.LC0(%rip), %xmm2
	addq	$16, %rax
	movaps	%xmm2, -16(%rax)
	cmpq	%r12, %rax
	jne	.L2
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$2, 32(%rsp)
	movl	$1, 832(%rsp)
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r15d
	movd	%r15d, %xmm1
	pshufd	$0xe0, %xmm1, %xmm0
	testl	%r15d, %r15d
	je	.L29
	movq	%xmm0, 24(%rsp)
	jle	.L15
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	movl	16(%rsp), %esi
	movl	$0, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jg	.L5
.L4:
	addl	%esi, %esi
	movl	%r15d, %r8d
	xorl	%edi, %edi
	xorl	%eax, %eax
	leal	1(%rsi), %r10d
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	8(%rsp), %rcx
	movslq	%eax, %rdx
	leaq	(%rcx,%rdx,4), %rdx
	cmpl	%eax, %esi
	jge	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%eax, %esi
	jl	.L8
.L9:
	cmpl	%edi, (%rdx)
	jne	.L7
	movslq	%eax, %rdx
	movl	$2, 32(%rsp,%rdx,4)
	movslq	%edi, %rdx
	subl	$1, 24(%rsp,%rdx,4)
	movl	24(%rsp), %r15d
	movl	28(%rsp), %r8d
.L8:
	cmpl	%eax, %r10d
	cmove	%r9d, %eax
	xorl	$1, %edi
	testl	%r15d, %r15d
	je	.L11
	testl	%r8d, %r8d
	jne	.L6
.L11:
	movl	%r15d, %ecx
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$856, %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
.L15:
	.cfi_restore_state
	movl	%r15d, %esi
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.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	.LC1(%rip), %rbx
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	832(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	16(%rsp), %rbp
.L13:
	movq	8(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movdqa	.LC0(%rip), %xmm2
	addq	$16, %rax
	movaps	%xmm2, -16(%rax)
	cmpq	%r12, %rax
	jne	.L2
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$2, 32(%rsp)
	movl	$1, 832(%rsp)
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r15d
	movd	%r15d, %xmm1
	pshufd	$0xe0, %xmm1, %xmm0
	testl	%r15d, %r15d
	je	.L29
	movq	%xmm0, 24(%rsp)
	jle	.L15
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	movl	16(%rsp), %esi
	movl	$0, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jg	.L5
.L4:
	addl	%esi, %esi
	movl	%r15d, %r8d
	xorl	%edi, %edi
	xorl	%eax, %eax
	leal	1(%rsi), %r10d
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	8(%rsp), %rcx
	movslq	%eax, %rdx
	leaq	(%rcx,%rdx,4), %rdx
	cmpl	%eax, %esi
	jge	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%eax, %esi
	jl	.L8
.L9:
	cmpl	%edi, (%rdx)
	jne	.L7
	movslq	%eax, %rdx
	movl	$2, 32(%rsp,%rdx,4)
	movslq	%edi, %rdx
	subl	$1, 24(%rsp,%rdx,4)
	movl	24(%rsp), %r15d
	movl	28(%rsp), %r8d
.L8:
	cmpl	%eax, %r10d
	cmove	%r9d, %eax
	xorl	$1, %edi
	testl	%r15d, %r15d
	je	.L11
	testl	%r8d, %r8d
	jne	.L6
.L11:
	movl	%r15d, %ecx
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$856, %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
.L15:
	.cfi_restore_state
	movl	%r15d, %esi
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	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:
```
```c
#include<stdio.h>

int main(){
  while(1){
    int n, i, j, k;
    int card[201], player[2], turn = 0, ba = 0;
    for(i = 0;i < 201;i++){
      card[i] = 1;
    }
    card[0] = 2;
    scanf("%d", &n);
    if(n == 0){
      return 0;
    }
    player[0] = player[1] = n;
    for(i = 0;i < n;i++){
      scanf("%d", &j);
      card[j] = 0;
    }
    while(player[0] != 0 && player[1] != 0){
      for(;ba <= 2 * n;ba++){
	if(card[ba] == turn){
	  card[ba] = 2;
	  player[turn]--;
	  break;
	}
      }
      if(ba == 2 * n + 1){
	ba = 0;
      }
      turn ^= 1;
    }
    printf("%d\n%d\n", player[1], player[0]);
  }
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
  while(1){
    int n, i, j, k;
    int card[201], player[2], turn = 0, ba = 0;
    for(i = 0;i < 201;i++){
      card[i] = 1;
    }
    card[0] = 2;
    scanf("%d", &n);
    if(n == 0){
      return 0;
    }
    player[0] = player[1] = n;
    for(i = 0;i < n;i++){
      scanf("%d", &j);
      card[j] = 0;
    }
    while(player[0] != 0 && player[1] != 0){
      for(;ba <= 2 * n;ba++){
	if(card[ba] == turn){
	  card[ba] = 2;
	  player[turn]--;
	  break;
	}
      }
      if(ba == 2 * n + 1){
	ba = 0;
      }
      turn ^= 1;
    }
    printf("%d\n%d\n", player[1], player[0]);
  }
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
  while(1){
    int n, i, j, k;
    int card[201], player[2], turn = 0, ba = 0;
    for(i = 0;i < 201;i++){
      card[i] = 1;
    }
    card[0] = 2;
    scanf("%d", &n);
    if(n == 0){
      return 0;
    }
    player[0] = player[1] = n;
    for(i = 0;i < n;i++){
      scanf("%d", &j);
      card[j] = 0;
    }
    while(player[0] != 0 && player[1] != 0){
      for(;ba <= 2 * n;ba++){
	if(card[ba] == turn){
	  card[ba] = 2;
	  player[turn]--;
	  break;
	}
      }
      if(ba == 2 * n + 1){
	ba = 0;
      }
      turn ^= 1;
    }
    printf("%d\n%d\n", player[1], player[0]);
  }
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.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	.LC1(%rip), %rbx
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	832(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	16(%rsp), %rbp
.L13:
	movq	8(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movdqa	.LC0(%rip), %xmm2
	addq	$16, %rax
	movaps	%xmm2, -16(%rax)
	cmpq	%r12, %rax
	jne	.L2
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$2, 32(%rsp)
	movl	$1, 832(%rsp)
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r15d
	movd	%r15d, %xmm1
	pshufd	$0xe0, %xmm1, %xmm0
	testl	%r15d, %r15d
	je	.L29
	movq	%xmm0, 24(%rsp)
	jle	.L15
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	movl	16(%rsp), %esi
	movl	$0, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jg	.L5
.L4:
	addl	%esi, %esi
	movl	%r15d, %r8d
	xorl	%edi, %edi
	xorl	%eax, %eax
	leal	1(%rsi), %r10d
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	8(%rsp), %rcx
	movslq	%eax, %rdx
	leaq	(%rcx,%rdx,4), %rdx
	cmpl	%eax, %esi
	jge	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%eax, %esi
	jl	.L8
.L9:
	cmpl	%edi, (%rdx)
	jne	.L7
	movslq	%eax, %rdx
	movl	$2, 32(%rsp,%rdx,4)
	movslq	%edi, %rdx
	subl	$1, 24(%rsp,%rdx,4)
	movl	24(%rsp), %r15d
	movl	28(%rsp), %r8d
.L8:
	cmpl	%eax, %r10d
	cmove	%r9d, %eax
	xorl	$1, %edi
	testl	%r15d, %r15d
	je	.L11
	testl	%r8d, %r8d
	jne	.L6
.L11:
	movl	%r15d, %ecx
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$856, %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
.L15:
	.cfi_restore_state
	movl	%r15d, %esi
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.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	.LC1(%rip), %rbx
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	832(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	16(%rsp), %rbp
.L13:
	movq	8(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movdqa	.LC0(%rip), %xmm2
	addq	$16, %rax
	movaps	%xmm2, -16(%rax)
	cmpq	%r12, %rax
	jne	.L2
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$2, 32(%rsp)
	movl	$1, 832(%rsp)
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r15d
	movd	%r15d, %xmm1
	pshufd	$0xe0, %xmm1, %xmm0
	testl	%r15d, %r15d
	je	.L29
	movq	%xmm0, 24(%rsp)
	jle	.L15
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	movl	16(%rsp), %esi
	movl	$0, 32(%rsp,%rax,4)
	cmpl	%r13d, %esi
	jg	.L5
.L4:
	addl	%esi, %esi
	movl	%r15d, %r8d
	xorl	%edi, %edi
	xorl	%eax, %eax
	leal	1(%rsi), %r10d
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	8(%rsp), %rcx
	movslq	%eax, %rdx
	leaq	(%rcx,%rdx,4), %rdx
	cmpl	%eax, %esi
	jge	.L9
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%eax, %esi
	jl	.L8
.L9:
	cmpl	%edi, (%rdx)
	jne	.L7
	movslq	%eax, %rdx
	movl	$2, 32(%rsp,%rdx,4)
	movslq	%edi, %rdx
	subl	$1, 24(%rsp,%rdx,4)
	movl	24(%rsp), %r15d
	movl	28(%rsp), %r8d
.L8:
	cmpl	%eax, %r10d
	cmove	%r9d, %eax
	xorl	$1, %edi
	testl	%r15d, %r15d
	je	.L11
	testl	%r8d, %r8d
	jne	.L6
.L11:
	movl	%r15d, %ecx
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$856, %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
.L15:
	.cfi_restore_state
	movl	%r15d, %esi
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	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:
```