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  a[1000][200000], count[1000] = {0}, data[100000];
int main(){
	int i, j = 0, type, t, x, n, q;
	char s[6];
	scanf("%d %d", &n, &q);

	for(i = 0; i < q; i++){
	    scanf("%d %d", &type, &t);
	    if(type == 0){
	    	scanf("%d", &x);
	    	a[t][count[t]] = x;
	    	count[t]++;
	    } else if(type == 1){
	    	if(count[t] > 0){
	    	    data[j++] = a[t][count[t] - 1];
	    	}
	    } else {
	        if(count[t] > 0){
	    	    count[t]--;
	        }
	    }
	}

	for(i = 0; i < j; i++){
		printf("%d\n", data[i]);
	}

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	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
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	28(%rsp), %rax
	movl	$0, 4(%rsp)
	xorl	%r14d, %r14d
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %r12
	leaq	count(%rip), %rbx
	leaq	a(%rip), %r15
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	24(%rsp), %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	$1, %edx
	je	.L18
	testl	%eax, %eax
	jle	.L4
	subl	$1, %eax
	movl	%eax, (%rbx,%rsi,4)
.L4:
	addl	$1, %r14d
	cmpl	%r14d, 36(%rsp)
	jle	.L19
.L2:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L3
	movq	8(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rdx
	imulq	$200000, %rdx, %rsi
	movslq	(%rbx,%rdx,4), %rdi
	movq	%rdi, %rax
	addq	%rdi, %rsi
	movl	28(%rsp), %edi
	addl	$1, %eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, (%r15,%rsi,4)
	cmpl	%r14d, 36(%rsp)
	jg	.L2
.L19:
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L6
	leaq	data(%rip), %rbx
	leal	-1(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	.LC2(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L7
.L6:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$56, %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
.L18:
	.cfi_restore_state
	testl	%eax, %eax
	jle	.L4
	imulq	$200000, %rsi, %rsi
	subl	$1, %eax
	movslq	4(%rsp), %rdx
	leaq	data(%rip), %rdi
	cltq
	addq	%rax, %rsi
	movl	(%r15,%rsi,4), %eax
	movl	%eax, (%rdi,%rdx,4)
	leal	1(%rdx), %eax
	movl	%eax, 4(%rsp)
	jmp	.L4
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	data
	.bss
	.align 32
	.type	data, @object
	.size	data, 400000
data:
	.zero	400000
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 4000
count:
	.zero	4000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000000
a:
	.zero	800000000
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	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
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	28(%rsp), %rax
	movl	$0, 4(%rsp)
	xorl	%r14d, %r14d
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %r12
	leaq	count(%rip), %rbx
	leaq	a(%rip), %r15
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	24(%rsp), %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	$1, %edx
	je	.L18
	testl	%eax, %eax
	jle	.L4
	subl	$1, %eax
	movl	%eax, (%rbx,%rsi,4)
.L4:
	addl	$1, %r14d
	cmpl	%r14d, 36(%rsp)
	jle	.L19
.L2:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L3
	movq	8(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rdx
	imulq	$200000, %rdx, %rsi
	movslq	(%rbx,%rdx,4), %rdi
	movq	%rdi, %rax
	addq	%rdi, %rsi
	movl	28(%rsp), %edi
	addl	$1, %eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, (%r15,%rsi,4)
	cmpl	%r14d, 36(%rsp)
	jg	.L2
.L19:
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L6
	leaq	data(%rip), %rbx
	leal	-1(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	.LC2(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L7
.L6:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$56, %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
.L18:
	.cfi_restore_state
	testl	%eax, %eax
	jle	.L4
	imulq	$200000, %rsi, %rsi
	subl	$1, %eax
	movslq	4(%rsp), %rdx
	leaq	data(%rip), %rdi
	cltq
	addq	%rax, %rsi
	movl	(%r15,%rsi,4), %eax
	movl	%eax, (%rdi,%rdx,4)
	leal	1(%rdx), %eax
	movl	%eax, 4(%rsp)
	jmp	.L4
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	data
	.bss
	.align 32
	.type	data, @object
	.size	data, 400000
data:
	.zero	400000
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 4000
count:
	.zero	4000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000000
a:
	.zero	800000000
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	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
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	28(%rsp), %rax
	movl	$0, 4(%rsp)
	xorl	%r14d, %r14d
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %r12
	leaq	count(%rip), %rbx
	leaq	a(%rip), %r15
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	24(%rsp), %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	$1, %edx
	je	.L18
	testl	%eax, %eax
	jle	.L4
	subl	$1, %eax
	movl	%eax, (%rbx,%rsi,4)
.L4:
	addl	$1, %r14d
	cmpl	%r14d, 36(%rsp)
	jle	.L19
.L2:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L3
	movq	8(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rdx
	imulq	$200000, %rdx, %rsi
	movslq	(%rbx,%rdx,4), %rdi
	movq	%rdi, %rax
	addq	%rdi, %rsi
	movl	28(%rsp), %edi
	addl	$1, %eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, (%r15,%rsi,4)
	cmpl	%r14d, 36(%rsp)
	jg	.L2
.L19:
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L6
	leaq	data(%rip), %rbx
	leal	-1(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	.LC2(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L7
.L6:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$56, %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
.L18:
	.cfi_restore_state
	testl	%eax, %eax
	jle	.L4
	imulq	$200000, %rsi, %rsi
	subl	$1, %eax
	movslq	4(%rsp), %rdx
	leaq	data(%rip), %rdi
	cltq
	addq	%rax, %rsi
	movl	(%r15,%rsi,4), %eax
	movl	%eax, (%rdi,%rdx,4)
	leal	1(%rdx), %eax
	movl	%eax, 4(%rsp)
	jmp	.L4
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	data
	.bss
	.align 32
	.type	data, @object
	.size	data, 400000
data:
	.zero	400000
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 4000
count:
	.zero	4000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000000
a:
	.zero	800000000
	.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  a[1000][200000], count[1000] = {0}, data[100000];
int main(){
	int i, j = 0, type, t, x, n, q;
	char s[6];
	scanf("%d %d", &n, &q);

	for(i = 0; i < q; i++){
	    scanf("%d %d", &type, &t);
	    if(type == 0){
	    	scanf("%d", &x);
	    	a[t][count[t]] = x;
	    	count[t]++;
	    } else if(type == 1){
	    	if(count[t] > 0){
	    	    data[j++] = a[t][count[t] - 1];
	    	}
	    } else {
	        if(count[t] > 0){
	    	    count[t]--;
	        }
	    }
	}

	for(i = 0; i < j; i++){
		printf("%d\n", data[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  a[1000][200000], count[1000] = {0}, data[100000];
int main(){
	int i, j = 0, type, t, x, n, q;
	char s[6];
	scanf("%d %d", &n, &q);

	for(i = 0; i < q; i++){
	    scanf("%d %d", &type, &t);
	    if(type == 0){
	    	scanf("%d", &x);
	    	a[t][count[t]] = x;
	    	count[t]++;
	    } else if(type == 1){
	    	if(count[t] > 0){
	    	    data[j++] = a[t][count[t] - 1];
	    	}
	    } else {
	        if(count[t] > 0){
	    	    count[t]--;
	        }
	    }
	}

	for(i = 0; i < j; i++){
		printf("%d\n", data[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:

3 9
0 0 0
0 0 2
0 0 3
0 2 4
0 2 5
1 0
1 2
2 0
1 0
 3 9
0 0 0
0 0 2
0 0 3
0 2 4
0 0 5
1 0
1 2
2 0
1 0
 3 9
0 0 0
0 0 2
0 0 3
0 2 4
0 2 5
1 1
1 2
2 0
1 0
 6 9
0 0 0
0 0 2
0 0 3
0 2 4
0 0 5
1 1
1 2
2 0
1 0
 3 9
0 0 0
0 0 2
0 0 1
0 2 4
0 2 9
1 1
1 2
2 0
1 0
 3 9
0 0 1
0 0 2
0 0 6
0 2 4
0 2 5
1 0
1 2
2 0
1 0
 6 9
0 0 0
0 0 2
0 0 1
0 2 4
0 0 5
1 0
1 2
2 0
1 0
 3 9
0 0 0
0 0 2
0 0 1
0 2 4
0 2 9
1 1
1 2
1 0
1 0
 3 12
0 0 1
0 0 2
0 0 6
0 2 4
0 2 5
1 0
1 2
2 0
1 0
 3 9
0 0 0
0 0 2
0 0 1
0 0 4
0 2 9
1 1
1 2
1 0
1 0

3
5
2
 5
4
3
 5
2
 4
3
 9
2
 6
5
2
 5
4
1
 9
1
1
 6
5
2
2
2
2
 9
4
4

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  a[1000][200000], count[1000] = {0}, data[100000];
int main(){
	int i, j = 0, type, t, x, n, q;
	char s[6];
	scanf("%d %d", &n, &q);

	for(i = 0; i < q; i++){
	    scanf("%d %d", &type, &t);
	    if(type == 0){
	    	scanf("%d", &x);
	    	a[t][count[t]] = x;
	    	count[t]++;
	    } else if(type == 1){
	    	if(count[t] > 0){
	    	    data[j++] = a[t][count[t] - 1];
	    	}
	    } else {
	        if(count[t] > 0){
	    	    count[t]--;
	        }
	    }
	}

	for(i = 0; i < j; i++){
		printf("%d\n", data[i]);
	}

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	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
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	28(%rsp), %rax
	movl	$0, 4(%rsp)
	xorl	%r14d, %r14d
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %r12
	leaq	count(%rip), %rbx
	leaq	a(%rip), %r15
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	24(%rsp), %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	$1, %edx
	je	.L18
	testl	%eax, %eax
	jle	.L4
	subl	$1, %eax
	movl	%eax, (%rbx,%rsi,4)
.L4:
	addl	$1, %r14d
	cmpl	%r14d, 36(%rsp)
	jle	.L19
.L2:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L3
	movq	8(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rdx
	imulq	$200000, %rdx, %rsi
	movslq	(%rbx,%rdx,4), %rdi
	movq	%rdi, %rax
	addq	%rdi, %rsi
	movl	28(%rsp), %edi
	addl	$1, %eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, (%r15,%rsi,4)
	cmpl	%r14d, 36(%rsp)
	jg	.L2
.L19:
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L6
	leaq	data(%rip), %rbx
	leal	-1(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	.LC2(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L7
.L6:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$56, %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
.L18:
	.cfi_restore_state
	testl	%eax, %eax
	jle	.L4
	imulq	$200000, %rsi, %rsi
	subl	$1, %eax
	movslq	4(%rsp), %rdx
	leaq	data(%rip), %rdi
	cltq
	addq	%rax, %rsi
	movl	(%r15,%rsi,4), %eax
	movl	%eax, (%rdi,%rdx,4)
	leal	1(%rdx), %eax
	movl	%eax, 4(%rsp)
	jmp	.L4
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	data
	.bss
	.align 32
	.type	data, @object
	.size	data, 400000
data:
	.zero	400000
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 4000
count:
	.zero	4000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000000
a:
	.zero	800000000
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	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
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	leaq	28(%rsp), %rax
	movl	$0, 4(%rsp)
	xorl	%r14d, %r14d
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %r12
	leaq	count(%rip), %rbx
	leaq	a(%rip), %r15
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	24(%rsp), %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	$1, %edx
	je	.L18
	testl	%eax, %eax
	jle	.L4
	subl	$1, %eax
	movl	%eax, (%rbx,%rsi,4)
.L4:
	addl	$1, %r14d
	cmpl	%r14d, 36(%rsp)
	jle	.L19
.L2:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L3
	movq	8(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rdx
	imulq	$200000, %rdx, %rsi
	movslq	(%rbx,%rdx,4), %rdi
	movq	%rdi, %rax
	addq	%rdi, %rsi
	movl	28(%rsp), %edi
	addl	$1, %eax
	movl	%eax, (%rbx,%rdx,4)
	movl	%edi, (%r15,%rsi,4)
	cmpl	%r14d, 36(%rsp)
	jg	.L2
.L19:
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L6
	leaq	data(%rip), %rbx
	leal	-1(%rax), %edx
	leaq	4(%rbx), %rax
	leaq	.LC2(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L7
.L6:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$56, %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
.L18:
	.cfi_restore_state
	testl	%eax, %eax
	jle	.L4
	imulq	$200000, %rsi, %rsi
	subl	$1, %eax
	movslq	4(%rsp), %rdx
	leaq	data(%rip), %rdi
	cltq
	addq	%rax, %rsi
	movl	(%r15,%rsi,4), %eax
	movl	%eax, (%rdi,%rdx,4)
	leal	1(%rdx), %eax
	movl	%eax, 4(%rsp)
	jmp	.L4
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	data
	.bss
	.align 32
	.type	data, @object
	.size	data, 400000
data:
	.zero	400000
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 4000
count:
	.zero	4000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000000
a:
	.zero	800000000
	.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:
```