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

```c
N,pi[1000],pj[1000],pk[1000],r[1000],a,b,c,v[301],i,j;
main(){
	for(;scanf("%d%d%d",&a,&b,&c),a|b|c;){
		scanf("%d",&N);
		for(i=0;i<N;i++)
			scanf("%d%d%d%d",pi+i,pj+i,pk+i,r+i);
		for(i=1;i<=a+b+c;i++)
			v[i]=2;
		for(i=0;i<N;i++)
			if(r[i])
				v[pi[i]]=v[pj[i]]=v[pk[i]]=1;
		for(i=0;i<N;i++)
			if(!r[i]){
				if(v[pi[i]]==1&&v[pj[i]]==1)
					v[pk[i]]=0;
				if(v[pj[i]]==1&&v[pk[i]]==1)
					v[pi[i]]=0;
				if(v[pk[i]]==1&&v[pi[i]]==1)
					v[pj[i]]=0;
			}
		for(i=1;i<=a+b+c;i++)
			printf("%d\n",v[i]);
	}
	exit(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	pi
	.align 32
	.type	pi, @object
	.size	pi, 4000
pi:
	.zero	4000
	.globl	pj
	.align 32
	.type	pj, @object
	.size	pj, 4000
pj:
	.zero	4000
	.globl	pk
	.align 32
	.type	pk, @object
	.size	pk, 4000
pk:
	.zero	4000
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 4000
r:
	.zero	4000
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1204
v:
	.zero	1204
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.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
	jmp	.L2
.L17:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	leaq	(%rdx,%rax), %rsi
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	leaq	pi(%rip), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L4
	movl	$1, i(%rip)
	jmp	.L5
.L6:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$2, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	addl	%eax, %edx
	movl	c(%rip), %eax
	addl	%eax, %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	$0, i(%rip)
	jmp	.L7
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L8
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	$1, (%rcx,%rax)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pj(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%eax, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	v(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movl	i(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	pi(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L7:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L9
	movl	$0, i(%rip)
	jmp	.L10
.L14:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L12:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L13:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	$1, i(%rip)
	jmp	.L15
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L15:
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	addl	%eax, %edx
	movl	c(%rip), %eax
	addl	%eax, %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L16
.L2:
	leaq	c(%rip), %rax
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	orl	%eax, %edx
	movl	c(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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%d%d%d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	c(%rip), %r15
	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	pi(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rcx
	leaq	b(%rip), %rdx
	leaq	a(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	call	scanf@PLT
	movl	a(%rip), %eax
	orl	b(%rip), %eax
	orl	c(%rip), %eax
	je	.L34
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	N(%rip), %rdx
	movl	$0, i(%rip)
	testl	%edx, %edx
	jle	.L3
	xorl	%eax, %eax
	leaq	r(%rip), %r14
	leaq	pk(%rip), %r13
	leaq	pj(%rip), %r12
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	salq	$2, %rax
	leaq	(%r12,%rax), %rdx
	leaq	0(%r13,%rax), %rcx
	leaq	(%rbx,%rax), %rsi
	leaq	(%r14,%rax), %r8
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movslq	N(%rip), %rdx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L4
.L3:
	movl	b(%rip), %edi
	addl	a(%rip), %edi
	addl	c(%rip), %edi
	testl	%edi, %edi
	jle	.L5
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L25
	movl	%edi, %ecx
	leaq	4+v(%rip), %rax
	shrl	$2, %ecx
	leaq	16(%rax), %rsi
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L7:
	movdqa	.LC2(%rip), %xmm0
	addq	$16, %rax
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L7
	movl	%edi, %ecx
	andl	$-4, %ecx
	leal	1(%rcx), %eax
	cmpl	%ecx, %edi
	je	.L8
.L6:
	movslq	%eax, %rcx
	leaq	v(%rip), %rbp
	movl	$2, 0(%rbp,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%edi, %ecx
	jg	.L8
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	$2, 0(%rbp,%rcx,4)
	cmpl	%edi, %eax
	jg	.L8
	cltq
	movl	$2, 0(%rbp,%rax,4)
.L8:
	testl	%edx, %edx
	jle	.L9
.L23:
	xorl	%eax, %eax
	leaq	r(%rip), %r14
	leaq	v(%rip), %rcx
	leaq	pk(%rip), %r9
	leaq	pj(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%r14,%rax,4), %esi
	testl	%esi, %esi
	je	.L10
	movslq	(%r9,%rax,4), %rsi
	movl	$1, (%rcx,%rsi,4)
	movslq	(%r8,%rax,4), %rsi
	movl	$1, (%rcx,%rsi,4)
	movslq	(%rbx,%rax,4), %rsi
	movl	$1, (%rcx,%rsi,4)
.L10:
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L11
	xorl	%eax, %eax
	leaq	pj(%rip), %r11
	leaq	v(%rip), %rsi
	leaq	pk(%rip), %r10
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L37:
	movl	(%rsi,%rcx,4), %ecx
	cmpl	$1, %ebp
	je	.L35
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L36
.L18:
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L13
	movslq	(%rbx,%rax,4), %r9
	movslq	(%r11,%rax,4), %r8
	movslq	(%r10,%rax,4), %rcx
	cmpl	$1, (%rsi,%r9,4)
	movl	(%rsi,%r8,4), %ebp
	jne	.L37
	cmpl	$1, %ebp
	je	.L38
	cmpl	$1, (%rsi,%rcx,4)
	jne	.L13
	addq	$1, %rax
	movl	$0, (%rsi,%r8,4)
	cmpq	%rdx, %rax
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L36:
	movl	$1, i(%rip)
	testl	%edi, %edi
	jle	.L2
.L19:
	movl	$1, %eax
	leaq	v(%rip), %rbp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L20:
	cltq
	movq	%r12, %rdi
	movl	0(%rbp,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	movl	b(%rip), %edx
	addl	a(%rip), %edx
	addl	c(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jle	.L20
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L35:
	cmpl	$1, %ecx
	jne	.L13
	movl	$0, (%rsi,%r9,4)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L38:
	movl	$0, (%rsi,%rcx,4)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L34:
	xorl	%edi, %edi
	call	exit@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%edx, %edx
	jg	.L23
	movl	$1, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$1, i(%rip)
	jmp	.L19
.L25:
	movl	$1, %eax
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1204
v:
	.zero	1204
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 4000
r:
	.zero	4000
	.globl	pk
	.align 32
	.type	pk, @object
	.size	pk, 4000
pk:
	.zero	4000
	.globl	pj
	.align 32
	.type	pj, @object
	.size	pj, 4000
pj:
	.zero	4000
	.globl	pi
	.align 32
	.type	pi, @object
	.size	pi, 4000
pi:
	.zero	4000
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.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%d%d%d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	c(%rip), %r15
	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	pi(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rcx
	leaq	b(%rip), %rdx
	leaq	a(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	call	scanf@PLT
	movl	a(%rip), %eax
	orl	b(%rip), %eax
	orl	c(%rip), %eax
	je	.L34
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	N(%rip), %rdx
	movl	$0, i(%rip)
	testl	%edx, %edx
	jle	.L3
	xorl	%eax, %eax
	leaq	r(%rip), %r14
	leaq	pk(%rip), %r13
	leaq	pj(%rip), %r12
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	salq	$2, %rax
	leaq	(%r12,%rax), %rdx
	leaq	0(%r13,%rax), %rcx
	leaq	(%rbx,%rax), %rsi
	leaq	(%r14,%rax), %r8
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movslq	N(%rip), %rdx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L4
.L3:
	movl	b(%rip), %edi
	addl	a(%rip), %edi
	addl	c(%rip), %edi
	testl	%edi, %edi
	jle	.L5
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L25
	movl	%edi, %ecx
	leaq	4+v(%rip), %rax
	shrl	$2, %ecx
	leaq	16(%rax), %rsi
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L7:
	movdqa	.LC2(%rip), %xmm0
	addq	$16, %rax
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L7
	movl	%edi, %ecx
	andl	$-4, %ecx
	leal	1(%rcx), %eax
	cmpl	%ecx, %edi
	je	.L8
.L6:
	movslq	%eax, %rcx
	leaq	v(%rip), %rbp
	movl	$2, 0(%rbp,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%edi, %ecx
	jg	.L8
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	$2, 0(%rbp,%rcx,4)
	cmpl	%edi, %eax
	jg	.L8
	cltq
	movl	$2, 0(%rbp,%rax,4)
.L8:
	testl	%edx, %edx
	jle	.L9
.L23:
	xorl	%eax, %eax
	leaq	r(%rip), %r14
	leaq	v(%rip), %rcx
	leaq	pk(%rip), %r9
	leaq	pj(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%r14,%rax,4), %esi
	testl	%esi, %esi
	je	.L10
	movslq	(%r9,%rax,4), %rsi
	movl	$1, (%rcx,%rsi,4)
	movslq	(%r8,%rax,4), %rsi
	movl	$1, (%rcx,%rsi,4)
	movslq	(%rbx,%rax,4), %rsi
	movl	$1, (%rcx,%rsi,4)
.L10:
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L11
	xorl	%eax, %eax
	leaq	pj(%rip), %r11
	leaq	v(%rip), %rsi
	leaq	pk(%rip), %r10
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L37:
	movl	(%rsi,%rcx,4), %ecx
	cmpl	$1, %ebp
	je	.L35
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L36
.L18:
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L13
	movslq	(%rbx,%rax,4), %r9
	movslq	(%r11,%rax,4), %r8
	movslq	(%r10,%rax,4), %rcx
	cmpl	$1, (%rsi,%r9,4)
	movl	(%rsi,%r8,4), %ebp
	jne	.L37
	cmpl	$1, %ebp
	je	.L38
	cmpl	$1, (%rsi,%rcx,4)
	jne	.L13
	addq	$1, %rax
	movl	$0, (%rsi,%r8,4)
	cmpq	%rdx, %rax
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L36:
	movl	$1, i(%rip)
	testl	%edi, %edi
	jle	.L2
.L19:
	movl	$1, %eax
	leaq	v(%rip), %rbp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L20:
	cltq
	movq	%r12, %rdi
	movl	0(%rbp,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	movl	b(%rip), %edx
	addl	a(%rip), %edx
	addl	c(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jle	.L20
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L35:
	cmpl	$1, %ecx
	jne	.L13
	movl	$0, (%rsi,%r9,4)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L38:
	movl	$0, (%rsi,%rcx,4)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L34:
	xorl	%edi, %edi
	call	exit@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%edx, %edx
	jg	.L23
	movl	$1, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$1, i(%rip)
	jmp	.L19
.L25:
	movl	$1, %eax
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1204
v:
	.zero	1204
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 4000
r:
	.zero	4000
	.globl	pk
	.align 32
	.type	pk, @object
	.size	pk, 4000
pk:
	.zero	4000
	.globl	pj
	.align 32
	.type	pj, @object
	.size	pj, 4000
pj:
	.zero	4000
	.globl	pi
	.align 32
	.type	pi, @object
	.size	pi, 4000
pi:
	.zero	4000
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.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:

N,pi[1000],pj[1000],pk[1000],r[1000],a,b,c,v[301],i,j;
main(){
	for(;scanf("%d%d%d",&a,&b,&c),a|b|c;){
		scanf("%d",&N);
		for(i=0;i<N;i++)
			scanf("%d%d%d%d",pi+i,pj+i,pk+i,r+i);
		for(i=1;i<=a+b+c;i++)
			v[i]=2;
		for(i=0;i<N;i++)
			if(r[i])
				v[pi[i]]=v[pj[i]]=v[pk[i]]=1;
		for(i=0;i<N;i++)
			if(!r[i]){
				if(v[pi[i]]==1&&v[pj[i]]==1)
					v[pk[i]]=0;
				if(v[pj[i]]==1&&v[pk[i]]==1)
					v[pi[i]]=0;
				if(v[pk[i]]==1&&v[pi[i]]==1)
					v[pj[i]]=0;
			}
		for(i=1;i<=a+b+c;i++)
			printf("%d\n",v[i]);
	}
	exit(0);
}
2 2 2
4
2 4 5 0
2 3 6 0
1 4 5 0
2 3 2 1
0 0 0
 2 2 2
4
2 4 5 0
2 3 6 0
1 4 5 0
2 3 2 0
0 0 0
 3 2 2
4
2 4 5 0
2 3 6 0
1 4 5 0
2 3 5 1
0 0 0
 2 2 2
4
3 4 5 0
2 3 6 0
1 4 4 1
2 3 2 0
0 0 0
 2 2 2
4
2 4 5 0
1 3 6 0
1 4 5 0
2 3 2 1
0 0 0
 3 2 2
4
2 4 5 0
2 4 6 0
1 4 5 0
2 3 5 1
0 0 0
 2 2 3
4
2 4 5 0
2 1 6 0
1 4 5 0
4 3 5 1
0 0 0
 2 2 4
4
3 1 1 0
4 3 4 0
1 4 0 0
1 3 2 0
0 0 0
 1 2 4
4
3 1 1 0
5 3 4 0
1 4 1 0
1 3 0 0
0 0 0
 2 2 2
4
2 4 5 0
2 3 6 0
1 4 5 0
1 3 5 1
0 0 0

2
1
1
2
2
0
 2
2
2
2
2
2
 2
1
1
0
1
0
2
 1
2
2
1
2
2
 2
1
1
2
2
2
 2
1
1
0
1
2
2
 0
0
1
1
1
2
2
 2
2
2
2
2
2
2
2
 2
2
2
2
2
2
2
 1
2
1
0
1
2

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

```c
N,pi[1000],pj[1000],pk[1000],r[1000],a,b,c,v[301],i,j;
main(){
	for(;scanf("%d%d%d",&a,&b,&c),a|b|c;){
		scanf("%d",&N);
		for(i=0;i<N;i++)
			scanf("%d%d%d%d",pi+i,pj+i,pk+i,r+i);
		for(i=1;i<=a+b+c;i++)
			v[i]=2;
		for(i=0;i<N;i++)
			if(r[i])
				v[pi[i]]=v[pj[i]]=v[pk[i]]=1;
		for(i=0;i<N;i++)
			if(!r[i]){
				if(v[pi[i]]==1&&v[pj[i]]==1)
					v[pk[i]]=0;
				if(v[pj[i]]==1&&v[pk[i]]==1)
					v[pi[i]]=0;
				if(v[pk[i]]==1&&v[pi[i]]==1)
					v[pj[i]]=0;
			}
		for(i=1;i<=a+b+c;i++)
			printf("%d\n",v[i]);
	}
	exit(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	pi
	.align 32
	.type	pi, @object
	.size	pi, 4000
pi:
	.zero	4000
	.globl	pj
	.align 32
	.type	pj, @object
	.size	pj, 4000
pj:
	.zero	4000
	.globl	pk
	.align 32
	.type	pk, @object
	.size	pk, 4000
pk:
	.zero	4000
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 4000
r:
	.zero	4000
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1204
v:
	.zero	1204
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.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
	jmp	.L2
.L17:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	leaq	(%rdx,%rax), %rsi
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	leaq	pi(%rip), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L4
	movl	$1, i(%rip)
	jmp	.L5
.L6:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$2, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	addl	%eax, %edx
	movl	c(%rip), %eax
	addl	%eax, %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	$0, i(%rip)
	jmp	.L7
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L8
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	$1, (%rcx,%rax)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pj(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%eax, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	v(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movl	i(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	pi(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L7:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L9
	movl	$0, i(%rip)
	jmp	.L10
.L14:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L12:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L13:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	$1, i(%rip)
	jmp	.L15
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L15:
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	addl	%eax, %edx
	movl	c(%rip), %eax
	addl	%eax, %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L16
.L2:
	leaq	c(%rip), %rax
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	orl	%eax, %edx
	movl	c(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	pi
	.align 32
	.type	pi, @object
	.size	pi, 4000
pi:
	.zero	4000
	.globl	pj
	.align 32
	.type	pj, @object
	.size	pj, 4000
pj:
	.zero	4000
	.globl	pk
	.align 32
	.type	pk, @object
	.size	pk, 4000
pk:
	.zero	4000
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 4000
r:
	.zero	4000
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 1204
v:
	.zero	1204
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.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
	jmp	.L2
.L17:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	leaq	(%rdx,%rax), %rsi
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdi
	leaq	pi(%rip), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L4
	movl	$1, i(%rip)
	jmp	.L5
.L6:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$2, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	addl	%eax, %edx
	movl	c(%rip), %eax
	addl	%eax, %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	$0, i(%rip)
	jmp	.L7
.L9:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L8
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %edx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	$1, (%rcx,%rax)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pj(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%eax, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	v(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movl	i(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	pi(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	(%rcx,%rax), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L7:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L9
	movl	$0, i(%rip)
	jmp	.L10
.L14:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L12
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L12:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L13:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pk(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pi(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pj(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	$1, i(%rip)
	jmp	.L15
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L15:
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	addl	%eax, %edx
	movl	c(%rip), %eax
	addl	%eax, %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jge	.L16
.L2:
	leaq	c(%rip), %rax
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	orl	%eax, %edx
	movl	c(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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:
