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

```c
#define rep(i,n) for(i=0;i<n;++i)
a[1<<18],v[1<<18][3],n,m,q,c,i,j;main(){scanf("%d%d%d",&n,&m,&q);rep(i,n)rep(j,2)v[i][j]=(i+n+1-2*j)%n;rep(i,m){scanf("%d",a+i);rep(j,a[i])c=v[c][a[i]&1];v[c][2]=1;rep(j,2)v[v[c][j^1]][j]=v[c][j];c=v[c][0];}rep(i,q)scanf("%d",&c),printf("%d\n",1-v[c][2]);exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1048576
a:
	.zero	1048576
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 3145728
v:
	.zero	3145728
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.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%d%d"
.LC1:
	.string	"%d"
.LC2:
	.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
	leaq	q(%rip), %rax
	movq	%rax, %rcx
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	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	.L2
.L5:
	movl	$0, j(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	addl	%edx, %eax
	leal	1(%rax), %edx
	movl	j(%rip), %eax
	leal	(%rax,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	n(%rip), %edi
	movl	i(%rip), %ecx
	movl	j(%rip), %esi
	cltd
	idivl	%edi
	movl	%edx, %edi
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L3:
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jle	.L4
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	$0, i(%rip)
	jmp	.L6
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, j(%rip)
	jmp	.L7
.L8:
	movl	c(%rip), %eax
	movl	i(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	andl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, c(%rip)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+v(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, j(%rip)
	jmp	.L9
.L10:
	movl	c(%rip), %edi
	movl	j(%rip), %r8d
	movl	c(%rip), %eax
	movl	j(%rip), %edx
	xorl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	j(%rip), %esi
	movslq	%r8d, %r8
	movslq	%edi, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movslq	%esi, %rsi
	movslq	%ecx, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L9:
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jle	.L10
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, c(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	$0, i(%rip)
	jmp	.L12
.L13:
	leaq	c(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %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)
.L12:
	movl	i(%rip), %edx
	movl	q(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	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%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	leaq	q(%rip), %rcx
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	m(%rip), %rdx
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	scanf@PLT
	movl	n(%rip), %esi
	testl	%esi, %esi
	jle	.L2
	leal	-1(%rsi), %ecx
	leaq	v(%rip), %r8
	leal	-1(%rsi,%rsi), %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	leal	2(%rcx), %eax
	addq	$12, %r8
	cltd
	idivl	%esi
	movl	%ecx, %eax
	addl	$1, %ecx
	movl	%edx, %edi
	cltd
	idivl	%esi
	movd	%edi, %xmm0
	movd	%edx, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -12(%r8)
	cmpl	%ecx, %r9d
	jne	.L3
	movl	$2, j(%rip)
.L2:
	movl	m(%rip), %edx
	xorl	%eax, %eax
	movl	$0, i(%rip)
	leaq	v(%rip), %rbp
	leaq	a(%rip), %r12
	leaq	.LC1(%rip), %rbx
	testl	%edx, %edx
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbx, %rdi
	leaq	(%r12,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	i(%rip), %rax
	movl	(%r12,%rax,4), %ecx
	movq	%rax, %rsi
	movslq	c(%rip), %rax
	testl	%ecx, %ecx
	jle	.L8
	movl	%ecx, %edi
	xorl	%edx, %edx
	andl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	(%rax,%rax,2), %rax
	addl	$1, %edx
	addq	%rdi, %rax
	movslq	0(%rbp,%rax,4), %rax
	cmpl	%edx, %ecx
	jne	.L9
.L8:
	movl	$2, j(%rip)
	leaq	(%rax,%rax,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rcx
	movl	$1, 8(%rax)
	movl	(%rax), %eax
	movq	%rcx, %rdx
	leaq	(%rcx,%rcx,2), %rcx
	movl	%eax, 0(%rbp,%rcx,4)
	movslq	%eax, %rcx
	movl	%eax, c(%rip)
	leaq	(%rcx,%rcx,2), %rcx
	leal	1(%rsi), %eax
	cmpl	m(%rip), %eax
	movl	%edx, 4(%rbp,%rcx,4)
	movl	%eax, i(%rip)
	jl	.L4
.L10:
	movl	q(%rip), %eax
	leaq	v(%rip), %rbp
	movl	$0, i(%rip)
	leaq	.LC1(%rip), %rbx
	leaq	c(%rip), %r14
	leaq	.LC2(%rip), %r13
	movl	$1, %r12d
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	c(%rip), %rax
	movl	%r12d, %esi
	movq	%r13, %rdi
	leaq	(%rax,%rax,2), %rax
	subl	8(%rbp,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	q(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L5
.L6:
	xorl	%edi, %edi
	call	exit@PLT
	.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	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 3145728
v:
	.zero	3145728
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1048576
a:
	.zero	1048576
	.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%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	leaq	q(%rip), %rcx
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	m(%rip), %rdx
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	scanf@PLT
	movl	n(%rip), %esi
	testl	%esi, %esi
	jle	.L2
	leal	-1(%rsi), %ecx
	leaq	v(%rip), %r8
	leal	-1(%rsi,%rsi), %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	leal	2(%rcx), %eax
	addq	$12, %r8
	cltd
	idivl	%esi
	movl	%ecx, %eax
	addl	$1, %ecx
	movl	%edx, %edi
	cltd
	idivl	%esi
	movd	%edi, %xmm0
	movd	%edx, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -12(%r8)
	cmpl	%ecx, %r9d
	jne	.L3
	movl	$2, j(%rip)
.L2:
	movl	m(%rip), %edx
	xorl	%eax, %eax
	movl	$0, i(%rip)
	leaq	v(%rip), %rbp
	leaq	a(%rip), %r12
	leaq	.LC1(%rip), %rbx
	testl	%edx, %edx
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbx, %rdi
	leaq	(%r12,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	i(%rip), %rax
	movl	(%r12,%rax,4), %ecx
	movq	%rax, %rsi
	movslq	c(%rip), %rax
	testl	%ecx, %ecx
	jle	.L8
	movl	%ecx, %edi
	xorl	%edx, %edx
	andl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	(%rax,%rax,2), %rax
	addl	$1, %edx
	addq	%rdi, %rax
	movslq	0(%rbp,%rax,4), %rax
	cmpl	%edx, %ecx
	jne	.L9
.L8:
	movl	$2, j(%rip)
	leaq	(%rax,%rax,2), %rax
	leaq	0(%rbp,%rax,4), %rax
	movslq	4(%rax), %rcx
	movl	$1, 8(%rax)
	movl	(%rax), %eax
	movq	%rcx, %rdx
	leaq	(%rcx,%rcx,2), %rcx
	movl	%eax, 0(%rbp,%rcx,4)
	movslq	%eax, %rcx
	movl	%eax, c(%rip)
	leaq	(%rcx,%rcx,2), %rcx
	leal	1(%rsi), %eax
	cmpl	m(%rip), %eax
	movl	%edx, 4(%rbp,%rcx,4)
	movl	%eax, i(%rip)
	jl	.L4
.L10:
	movl	q(%rip), %eax
	leaq	v(%rip), %rbp
	movl	$0, i(%rip)
	leaq	.LC1(%rip), %rbx
	leaq	c(%rip), %r14
	leaq	.LC2(%rip), %r13
	movl	$1, %r12d
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	c(%rip), %rax
	movl	%r12d, %esi
	movq	%r13, %rdi
	leaq	(%rax,%rax,2), %rax
	subl	8(%rbp,%rax,4), %esi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	q(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L5
.L6:
	xorl	%edi, %edi
	call	exit@PLT
	.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	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 3145728
v:
	.zero	3145728
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1048576
a:
	.zero	1048576
	.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:

#define rep(i,n) for(i=0;i<n;++i)
a[1<<18],v[1<<18][3],n,m,q,c,i,j;main(){scanf("%d%d%d",&n,&m,&q);rep(i,n)rep(j,2)v[i][j]=(i+n+1-2*j)%n;rep(i,m){scanf("%d",a+i);rep(j,a[i])c=v[c][a[i]&1];v[c][2]=1;rep(j,2)v[v[c][j^1]][j]=v[c][j];c=v[c][0];}rep(i,q)scanf("%d",&c),printf("%d\n",1-v[c][2]);exit(0);}
10 5 3
2 6 5 18 3
3 0 5

1
0
1

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

```c
#define rep(i,n) for(i=0;i<n;++i)
a[1<<18],v[1<<18][3],n,m,q,c,i,j;main(){scanf("%d%d%d",&n,&m,&q);rep(i,n)rep(j,2)v[i][j]=(i+n+1-2*j)%n;rep(i,m){scanf("%d",a+i);rep(j,a[i])c=v[c][a[i]&1];v[c][2]=1;rep(j,2)v[v[c][j^1]][j]=v[c][j];c=v[c][0];}rep(i,q)scanf("%d",&c),printf("%d\n",1-v[c][2]);exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1048576
a:
	.zero	1048576
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 3145728
v:
	.zero	3145728
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.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%d%d"
.LC1:
	.string	"%d"
.LC2:
	.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
	leaq	q(%rip), %rax
	movq	%rax, %rcx
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	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	.L2
.L5:
	movl	$0, j(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	addl	%edx, %eax
	leal	1(%rax), %edx
	movl	j(%rip), %eax
	leal	(%rax,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	n(%rip), %edi
	movl	i(%rip), %ecx
	movl	j(%rip), %esi
	cltd
	idivl	%edi
	movl	%edx, %edi
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L3:
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jle	.L4
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	$0, i(%rip)
	jmp	.L6
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, j(%rip)
	jmp	.L7
.L8:
	movl	c(%rip), %eax
	movl	i(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	andl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, c(%rip)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+v(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, j(%rip)
	jmp	.L9
.L10:
	movl	c(%rip), %edi
	movl	j(%rip), %r8d
	movl	c(%rip), %eax
	movl	j(%rip), %edx
	xorl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	j(%rip), %esi
	movslq	%r8d, %r8
	movslq	%edi, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movslq	%esi, %rsi
	movslq	%ecx, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L9:
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jle	.L10
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, c(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	$0, i(%rip)
	jmp	.L12
.L13:
	leaq	c(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %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)
.L12:
	movl	i(%rip), %edx
	movl	q(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1048576
a:
	.zero	1048576
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 3145728
v:
	.zero	3145728
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.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%d%d"
.LC1:
	.string	"%d"
.LC2:
	.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
	leaq	q(%rip), %rax
	movq	%rax, %rcx
	leaq	m(%rip), %rax
	movq	%rax, %rdx
	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	.L2
.L5:
	movl	$0, j(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	addl	%edx, %eax
	leal	1(%rax), %edx
	movl	j(%rip), %eax
	leal	(%rax,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	n(%rip), %edi
	movl	i(%rip), %ecx
	movl	j(%rip), %esi
	cltd
	idivl	%edi
	movl	%edx, %edi
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L3:
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jle	.L4
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	$0, i(%rip)
	jmp	.L6
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, j(%rip)
	jmp	.L7
.L8:
	movl	c(%rip), %eax
	movl	i(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	andl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, c(%rip)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+v(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, j(%rip)
	jmp	.L9
.L10:
	movl	c(%rip), %edi
	movl	j(%rip), %r8d
	movl	c(%rip), %eax
	movl	j(%rip), %edx
	xorl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	j(%rip), %esi
	movslq	%r8d, %r8
	movslq	%edi, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movslq	%esi, %rsi
	movslq	%ecx, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	v(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L9:
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jle	.L10
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, c(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	$0, i(%rip)
	jmp	.L12
.L13:
	leaq	c(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	c(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %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)
.L12:
	movl	i(%rip), %edx
	movl	q(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	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:
