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

```c
// Aizu Vol-3 0318: Secret Investigation
// 2017.8.25

#include <stdio.h>

#define A 1
#define B 2
#define C 4
int p[103];

int main()
{
	int N, i, k, x;

	scanf("%d", &N);
	for (i = 1; i <= N; i++) p[i] = 0;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= A;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= B;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= C;
	for (k = 0, i = 1; i <= N; i++)
		if ((!(p[i] & A) || (p[i] & B)) && (p[i] & C)) k++;
	printf("%d\n", k);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 412
p:
	.zero	412
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L3
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$1, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L6
.L7:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$2, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$4, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L9
	movl	$0, -20(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L10
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L12
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$4, %eax
	testl	%eax, %eax
	je	.L12
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L12:
	addl	$1, -12(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rdx
	testl	%edx, %edx
	jle	.L5
	salq	$2, %rdx
	xorl	%esi, %esi
	leaq	4+p(%rip), %rdi
	call	memset@PLT
.L5:
	leaq	16(%rsp), %r14
	movq	%rbp, %rdi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	movq	%r14, %rsi
	leaq	20(%rsp), %r12
	leaq	p(%rip), %rbx
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	orl	$1, (%rbx,%rax,4)
	cmpl	%r13d, 16(%rsp)
	jg	.L3
.L4:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %edx
	leaq	20(%rsp), %r12
	leaq	p(%rip), %rbx
	testl	%edx, %edx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	orl	$2, (%rbx,%rax,4)
	cmpl	%r13d, 16(%rsp)
	jg	.L6
.L7:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	leaq	20(%rsp), %r12
	leaq	p(%rip), %rbx
	testl	%eax, %eax
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	orl	$4, (%rbx,%rax,4)
	cmpl	%r13d, 16(%rsp)
	jg	.L8
.L9:
	movl	12(%rsp), %edx
	movl	$0, 16(%rsp)
	testl	%edx, %edx
	jle	.L11
	leaq	4+p(%rip), %rax
	leal	-1(%rdx), %ecx
	xorl	%edi, %edi
	xorl	%esi, %esi
	leaq	4(%rax), %rdx
	leaq	(%rdx,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rax), %edx
	testb	$1, %dl
	je	.L12
	testb	$2, %dl
	je	.L13
.L12:
	andl	$4, %edx
	je	.L13
	addl	$1, %esi
	movl	$1, %edi
.L13:
	addq	$4, %rax
	cmpq	%rax, %rcx
	jne	.L14
	testb	%dil, %dil
	je	.L11
	movl	%esi, 16(%rsp)
.L11:
	movl	16(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 412
p:
	.zero	412
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rdx
	testl	%edx, %edx
	jle	.L5
	salq	$2, %rdx
	xorl	%esi, %esi
	leaq	4+p(%rip), %rdi
	call	memset@PLT
.L5:
	leaq	16(%rsp), %r14
	movq	%rbp, %rdi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	movq	%r14, %rsi
	leaq	20(%rsp), %r12
	leaq	p(%rip), %rbx
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	orl	$1, (%rbx,%rax,4)
	cmpl	%r13d, 16(%rsp)
	jg	.L3
.L4:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %edx
	leaq	20(%rsp), %r12
	leaq	p(%rip), %rbx
	testl	%edx, %edx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	orl	$2, (%rbx,%rax,4)
	cmpl	%r13d, 16(%rsp)
	jg	.L6
.L7:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	leaq	20(%rsp), %r12
	leaq	p(%rip), %rbx
	testl	%eax, %eax
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rax
	orl	$4, (%rbx,%rax,4)
	cmpl	%r13d, 16(%rsp)
	jg	.L8
.L9:
	movl	12(%rsp), %edx
	movl	$0, 16(%rsp)
	testl	%edx, %edx
	jle	.L11
	leaq	4+p(%rip), %rax
	leal	-1(%rdx), %ecx
	xorl	%edi, %edi
	xorl	%esi, %esi
	leaq	4(%rax), %rdx
	leaq	(%rdx,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rax), %edx
	testb	$1, %dl
	je	.L12
	testb	$2, %dl
	je	.L13
.L12:
	andl	$4, %edx
	je	.L13
	addl	$1, %esi
	movl	$1, %edi
.L13:
	addq	$4, %rax
	cmpq	%rax, %rcx
	jne	.L14
	testb	%dil, %dil
	je	.L11
	movl	%esi, 16(%rsp)
.L11:
	movl	16(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 412
p:
	.zero	412
	.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:

// Aizu Vol-3 0318: Secret Investigation
// 2017.8.25

#include <stdio.h>

#define A 1
#define B 2
#define C 4
int p[103];

int main()
{
	int N, i, k, x;

	scanf("%d", &N);
	for (i = 1; i <= N; i++) p[i] = 0;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= A;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= B;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= C;
	for (k = 0, i = 1; i <= N; i++)
		if ((!(p[i] & A) || (p[i] & B)) && (p[i] & C)) k++;
	printf("%d\n", k);
	return 0;
}
5
3 1 2 3
2 4 5
2 2 4
 5
3 1 2 1
2 4 5
2 3 4
 5
3 1 2 3
2 4 5
2 3 2
 5
3 1 4 3
2 4 5
2 3 4
 100
3 1 100 4
0
2 4 3
 5
3 2 4 3
2 4 5
2 3 4
 100
3 0 100 4
0
2 4 3
 100
3 0 000 4
0
2 4 3
 100
3 1 100 4
-1
2 2 3
 5
3 1 2 5
2 4 5
2 2 4

1
 2
 0
 1
 1
 1
 1
 1
 2
 1

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

```c
// Aizu Vol-3 0318: Secret Investigation
// 2017.8.25

#include <stdio.h>

#define A 1
#define B 2
#define C 4
int p[103];

int main()
{
	int N, i, k, x;

	scanf("%d", &N);
	for (i = 1; i <= N; i++) p[i] = 0;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= A;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= B;
	scanf("%d", &k); for (i = 0; i < k; i++) scanf("%d", &x), p[x] |= C;
	for (k = 0, i = 1; i <= N; i++)
		if ((!(p[i] & A) || (p[i] & B)) && (p[i] & C)) k++;
	printf("%d\n", k);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 412
p:
	.zero	412
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L3
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$1, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L6
.L7:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$2, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$4, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L9
	movl	$0, -20(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L10
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L12
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$4, %eax
	testl	%eax, %eax
	je	.L12
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L12:
	addl	$1, -12(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 412
p:
	.zero	412
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -12(%rbp)
	jmp	.L2
.L3:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L3
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$1, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L6
.L7:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$2, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %ecx
	orl	$4, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L9
	movl	$0, -20(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L10
.L13:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L12
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	andl	$4, %eax
	testl	%eax, %eax
	je	.L12
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L12:
	addl	$1, -12(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L13
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
