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 ans[210];
int a[210][3];
int cnt[3][100];

int main(void)
{
	int n;
	int i;
	int j;
	int q;

	scanf("%d", &n);
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			scanf("%d", &q);
			a[i][j] = q;
			cnt[j][q]++;
		}	
	}
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			if (cnt[j][a[i][j]] == 1){
				ans[i] += a[i][j];
			}
		}
		printf("%d\n", ans[i]);
	}

	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	movl	$0, 12(%rsp)
	leaq	a(%rip), %rbp
	leaq	20(%rsp), %r14
	movq	%rbp, %r12
	leaq	cnt(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%ebx, %ebx
.L3:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%ebx, %rdx
	movslq	20(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%eax, (%r12,%rbx,4)
	addq	$1, %rbx
	leaq	(%rax,%rdx,4), %rax
	addl	$1, (%r15,%rax,4)
	cmpq	$3, %rbx
	jne	.L3
	addl	$1, 12(%rsp)
	movl	16(%rsp), %eax
	addq	$12, %r12
	movl	12(%rsp), %ecx
	cmpl	%ecx, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	ans(%rip), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	0(%rbp), %rsi
	movl	(%rbx), %edx
	cmpl	$1, (%r15,%rsi,4)
	jne	.L6
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L6:
	movslq	4(%rbp), %rsi
	cmpl	$1, 400(%r15,%rsi,4)
	jne	.L7
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L7:
	movslq	8(%rbp), %rsi
	cmpl	$1, 800(%r15,%rsi,4)
	je	.L17
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__printf_chk@PLT
	addq	$12, %rbp
	addq	$4, %rbx
	cmpl	%r13d, 16(%rsp)
	jg	.L10
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	addl	%esi, %edx
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	%edx, (%rbx)
	addl	$1, %r13d
	addq	$12, %rbp
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpl	16(%rsp), %r13d
	jl	.L10
	jmp	.L5
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 1200
cnt:
	.zero	1200
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2520
a:
	.zero	2520
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 840
ans:
	.zero	840
	.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
.LC0:
	.string	"%d"
.LC1:
	.string	"%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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	movl	$0, 12(%rsp)
	leaq	a(%rip), %rbp
	leaq	20(%rsp), %r14
	movq	%rbp, %r12
	leaq	cnt(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%ebx, %ebx
.L3:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%ebx, %rdx
	movslq	20(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%eax, (%r12,%rbx,4)
	addq	$1, %rbx
	leaq	(%rax,%rdx,4), %rax
	addl	$1, (%r15,%rax,4)
	cmpq	$3, %rbx
	jne	.L3
	addl	$1, 12(%rsp)
	movl	16(%rsp), %eax
	addq	$12, %r12
	movl	12(%rsp), %ecx
	cmpl	%ecx, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	ans(%rip), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	0(%rbp), %rsi
	movl	(%rbx), %edx
	cmpl	$1, (%r15,%rsi,4)
	jne	.L6
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L6:
	movslq	4(%rbp), %rsi
	cmpl	$1, 400(%r15,%rsi,4)
	jne	.L7
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L7:
	movslq	8(%rbp), %rsi
	cmpl	$1, 800(%r15,%rsi,4)
	je	.L17
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__printf_chk@PLT
	addq	$12, %rbp
	addq	$4, %rbx
	cmpl	%r13d, 16(%rsp)
	jg	.L10
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	addl	%esi, %edx
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	%edx, (%rbx)
	addl	$1, %r13d
	addq	$12, %rbp
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpl	16(%rsp), %r13d
	jl	.L10
	jmp	.L5
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 1200
cnt:
	.zero	1200
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2520
a:
	.zero	2520
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 840
ans:
	.zero	840
	.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
.LC0:
	.string	"%d"
.LC1:
	.string	"%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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	movl	$0, 12(%rsp)
	leaq	a(%rip), %rbp
	leaq	20(%rsp), %r14
	movq	%rbp, %r12
	leaq	cnt(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%ebx, %ebx
.L3:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%ebx, %rdx
	movslq	20(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%eax, (%r12,%rbx,4)
	addq	$1, %rbx
	leaq	(%rax,%rdx,4), %rax
	addl	$1, (%r15,%rax,4)
	cmpq	$3, %rbx
	jne	.L3
	addl	$1, 12(%rsp)
	movl	16(%rsp), %eax
	addq	$12, %r12
	movl	12(%rsp), %ecx
	cmpl	%ecx, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	ans(%rip), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	0(%rbp), %rsi
	movl	(%rbx), %edx
	cmpl	$1, (%r15,%rsi,4)
	jne	.L6
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L6:
	movslq	4(%rbp), %rsi
	cmpl	$1, 400(%r15,%rsi,4)
	jne	.L7
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L7:
	movslq	8(%rbp), %rsi
	cmpl	$1, 800(%r15,%rsi,4)
	je	.L17
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__printf_chk@PLT
	addq	$12, %rbp
	addq	$4, %rbx
	cmpl	%r13d, 16(%rsp)
	jg	.L10
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	addl	%esi, %edx
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	%edx, (%rbx)
	addl	$1, %r13d
	addq	$12, %rbp
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpl	16(%rsp), %r13d
	jl	.L10
	jmp	.L5
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 1200
cnt:
	.zero	1200
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2520
a:
	.zero	2520
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 840
ans:
	.zero	840
	.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 ans[210];
int a[210][3];
int cnt[3][100];

int main(void)
{
	int n;
	int i;
	int j;
	int q;

	scanf("%d", &n);
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			scanf("%d", &q);
			a[i][j] = q;
			cnt[j][q]++;
		}	
	}
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			if (cnt[j][a[i][j]] == 1){
				ans[i] += a[i][j];
			}
		}
		printf("%d\n", ans[i]);
	}

	return (0);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int ans[210];
int a[210][3];
int cnt[3][100];

int main(void)
{
	int n;
	int i;
	int j;
	int q;

	scanf("%d", &n);
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			scanf("%d", &q);
			a[i][j] = q;
			cnt[j][q]++;
		}	
	}
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			if (cnt[j][a[i][j]] == 1){
				ans[i] += a[i][j];
			}
		}
		printf("%d\n", ans[i]);
	}

	return (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
100 99 98
100 97 68
63 89 63
99 99 99
89 97 98
 5
100 99 98
100 97 68
63 89 63
68 99 99
89 97 98
 5
100 99 98
100 97 92
63 53 63
99 99 99
89 97 98
 5
100 99 98
100 97 68
63 89 63
68 99 79
89 97 98
 5
100 99 98
100 97 92
63 32 63
99 99 99
89 97 98
 5
100 99 98
100 97 68
63 89 25
68 99 79
89 97 98
 5
100 99 98
000 97 92
63 32 63
99 99 99
89 97 98
 5
100 1 98
100 97 68
63 89 25
68 99 79
89 97 98
 5
100 1 98
100 97 68
44 89 25
68 99 79
89 97 98
 5
100 1 98
100 97 68
16 89 25
68 99 79
89 97 98

0
68
215
198
89
 0
68
215
167
89
 0
92
179
198
89
 0
68
215
147
89
 0
92
158
198
89
 0
68
177
147
89
 100
92
158
198
89
 1
68
177
246
89
 1
68
158
246
89
 1
68
130
246
89

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 ans[210];
int a[210][3];
int cnt[3][100];

int main(void)
{
	int n;
	int i;
	int j;
	int q;

	scanf("%d", &n);
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			scanf("%d", &q);
			a[i][j] = q;
			cnt[j][q]++;
		}	
	}
	for (i = 0; i < n; i++){
		for (j = 0; j < 3; j++){
			if (cnt[j][a[i][j]] == 1){
				ans[i] += a[i][j];
			}
		}
		printf("%d\n", ans[i]);
	}

	return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	movl	$0, 12(%rsp)
	leaq	a(%rip), %rbp
	leaq	20(%rsp), %r14
	movq	%rbp, %r12
	leaq	cnt(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%ebx, %ebx
.L3:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%ebx, %rdx
	movslq	20(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%eax, (%r12,%rbx,4)
	addq	$1, %rbx
	leaq	(%rax,%rdx,4), %rax
	addl	$1, (%r15,%rax,4)
	cmpq	$3, %rbx
	jne	.L3
	addl	$1, 12(%rsp)
	movl	16(%rsp), %eax
	addq	$12, %r12
	movl	12(%rsp), %ecx
	cmpl	%ecx, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	ans(%rip), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	0(%rbp), %rsi
	movl	(%rbx), %edx
	cmpl	$1, (%r15,%rsi,4)
	jne	.L6
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L6:
	movslq	4(%rbp), %rsi
	cmpl	$1, 400(%r15,%rsi,4)
	jne	.L7
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L7:
	movslq	8(%rbp), %rsi
	cmpl	$1, 800(%r15,%rsi,4)
	je	.L17
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__printf_chk@PLT
	addq	$12, %rbp
	addq	$4, %rbx
	cmpl	%r13d, 16(%rsp)
	jg	.L10
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	addl	%esi, %edx
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	%edx, (%rbx)
	addl	$1, %r13d
	addq	$12, %rbp
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpl	16(%rsp), %r13d
	jl	.L10
	jmp	.L5
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 1200
cnt:
	.zero	1200
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2520
a:
	.zero	2520
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 840
ans:
	.zero	840
	.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
.LC0:
	.string	"%d"
.LC1:
	.string	"%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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	movl	$0, 12(%rsp)
	leaq	a(%rip), %rbp
	leaq	20(%rsp), %r14
	movq	%rbp, %r12
	leaq	cnt(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%ebx, %ebx
.L3:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%ebx, %rdx
	movslq	20(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%eax, (%r12,%rbx,4)
	addq	$1, %rbx
	leaq	(%rax,%rdx,4), %rax
	addl	$1, (%r15,%rax,4)
	cmpq	$3, %rbx
	jne	.L3
	addl	$1, 12(%rsp)
	movl	16(%rsp), %eax
	addq	$12, %r12
	movl	12(%rsp), %ecx
	cmpl	%ecx, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L5
	leaq	ans(%rip), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	0(%rbp), %rsi
	movl	(%rbx), %edx
	cmpl	$1, (%r15,%rsi,4)
	jne	.L6
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L6:
	movslq	4(%rbp), %rsi
	cmpl	$1, 400(%r15,%rsi,4)
	jne	.L7
	addl	%esi, %edx
	movl	%edx, (%rbx)
.L7:
	movslq	8(%rbp), %rsi
	cmpl	$1, 800(%r15,%rsi,4)
	je	.L17
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__printf_chk@PLT
	addq	$12, %rbp
	addq	$4, %rbx
	cmpl	%r13d, 16(%rsp)
	jg	.L10
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	addl	%esi, %edx
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	%edx, (%rbx)
	addl	$1, %r13d
	addq	$12, %rbp
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpl	16(%rsp), %r13d
	jl	.L10
	jmp	.L5
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 1200
cnt:
	.zero	1200
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2520
a:
	.zero	2520
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 840
ans:
	.zero	840
	.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:
```