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

```c
n,m,a,b,c,d[100010],r,i;
main(){
  while(scanf("%d %d %d %d %d",&n,&a,&b,&c,&m),n){
    for(i=0;i<n;i++)scanf("%d",&d[i]);
    for(i=r=0;i<10001;i++){
      if(d[r]==m)r++;
      if(r==n)break;
      m=(a*m+b)%c;
    }
    printf("%d\n",r-n?-1:i);
  }
return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	b(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	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
	leaq	d(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rcx
	leaq	m(%rip), %r9
	movq	%r13, %rdx
	xorl	%eax, %eax
	leaq	c(%rip), %r8
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	call	scanf@PLT
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	je	.L27
	movl	$0, i(%rip)
	jle	.L3
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %ecx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ecx, %eax
	jl	.L4
.L3:
	movl	m(%rip), %edx
	xorl	%r15d, %r15d
	xorl	%r11d, %r11d
	xorl	%edi, %edi
	movl	a(%rip), %r10d
	movl	b(%rip), %r9d
	xorl	%esi, %esi
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	c(%rip), %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	addl	$1, %esi
	movl	$1, %r15d
	imull	%r10d, %eax
	addl	%r9d, %eax
	cltd
	idivl	%r8d
	cmpl	$10001, %esi
	je	.L28
	movl	%esi, %r12d
.L10:
	movslq	%edi, %rax
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L5
	addl	$1, %edi
	movl	$1, %r11d
.L5:
	cmpl	%ecx, %edi
	jne	.L6
	testb	%r15b, %r15b
	je	.L7
	movl	%r12d, i(%rip)
	movl	%edx, m(%rip)
.L7:
	testb	%r11b, %r11b
	je	.L9
	movl	%edi, r(%rip)
.L9:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L28:
	movl	$10001, i(%rip)
	movl	%edx, m(%rip)
	testb	%r11b, %r11b
	je	.L11
	movl	%edi, r(%rip)
.L11:
	movl	$-1, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400040
d:
	.zero	400040
	.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	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
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	b(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	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
	leaq	d(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rcx
	leaq	m(%rip), %r9
	movq	%r13, %rdx
	xorl	%eax, %eax
	leaq	c(%rip), %r8
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	call	scanf@PLT
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	je	.L27
	movl	$0, i(%rip)
	jle	.L3
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %ecx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ecx, %eax
	jl	.L4
.L3:
	movl	m(%rip), %edx
	xorl	%r15d, %r15d
	xorl	%r11d, %r11d
	xorl	%edi, %edi
	movl	a(%rip), %r10d
	movl	b(%rip), %r9d
	xorl	%esi, %esi
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	c(%rip), %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	addl	$1, %esi
	movl	$1, %r15d
	imull	%r10d, %eax
	addl	%r9d, %eax
	cltd
	idivl	%r8d
	cmpl	$10001, %esi
	je	.L28
	movl	%esi, %r12d
.L10:
	movslq	%edi, %rax
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L5
	addl	$1, %edi
	movl	$1, %r11d
.L5:
	cmpl	%ecx, %edi
	jne	.L6
	testb	%r15b, %r15b
	je	.L7
	movl	%r12d, i(%rip)
	movl	%edx, m(%rip)
.L7:
	testb	%r11b, %r11b
	je	.L9
	movl	%edi, r(%rip)
.L9:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L28:
	movl	$10001, i(%rip)
	movl	%edx, m(%rip)
	testb	%r11b, %r11b
	je	.L11
	movl	%edi, r(%rip)
.L11:
	movl	$-1, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400040
d:
	.zero	400040
	.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	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
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	b(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	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
	leaq	d(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rcx
	leaq	m(%rip), %r9
	movq	%r13, %rdx
	xorl	%eax, %eax
	leaq	c(%rip), %r8
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	call	scanf@PLT
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	je	.L27
	movl	$0, i(%rip)
	jle	.L3
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %ecx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ecx, %eax
	jl	.L4
.L3:
	movl	m(%rip), %edx
	xorl	%r15d, %r15d
	xorl	%r11d, %r11d
	xorl	%edi, %edi
	movl	a(%rip), %r10d
	movl	b(%rip), %r9d
	xorl	%esi, %esi
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	c(%rip), %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	addl	$1, %esi
	movl	$1, %r15d
	imull	%r10d, %eax
	addl	%r9d, %eax
	cltd
	idivl	%r8d
	cmpl	$10001, %esi
	je	.L28
	movl	%esi, %r12d
.L10:
	movslq	%edi, %rax
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L5
	addl	$1, %edi
	movl	$1, %r11d
.L5:
	cmpl	%ecx, %edi
	jne	.L6
	testb	%r15b, %r15b
	je	.L7
	movl	%r12d, i(%rip)
	movl	%edx, m(%rip)
.L7:
	testb	%r11b, %r11b
	je	.L9
	movl	%edi, r(%rip)
.L9:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L28:
	movl	$10001, i(%rip)
	movl	%edx, m(%rip)
	testb	%r11b, %r11b
	je	.L11
	movl	%edi, r(%rip)
.L11:
	movl	$-1, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400040
d:
	.zero	400040
	.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	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
	.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
n,m,a,b,c,d[100010],r,i;
main(){
  while(scanf("%d %d %d %d %d",&n,&a,&b,&c,&m),n){
    for(i=0;i<n;i++)scanf("%d",&d[i]);
    for(i=r=0;i<10001;i++){
      if(d[r]==m)r++;
      if(r==n)break;
      m=(a*m+b)%c;
    }
    printf("%d\n",r-n?-1:i);
  }
return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
n,m,a,b,c,d[100010],r,i;
main(){
  while(scanf("%d %d %d %d %d",&n,&a,&b,&c,&m),n){
    for(i=0;i<n;i++)scanf("%d",&d[i]);
    for(i=r=0;i<10001;i++){
      if(d[r]==m)r++;
      if(r==n)break;
      m=(a*m+b)%c;
    }
    printf("%d\n",r-n?-1: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:

1 5 7 11 10
10
2 5 7 11 10
2 4
2 1 1 256 0
128 255
2 0 0 1 0
1234 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 1 10000 0
1 0
2 1 2 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
10
2 5 5 11 10
2 4
2 1 1 256 0
128 255
2 0 0 1 0
1234 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 1 10000 0
1 0
3 1 2 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
10
2 5 5 11 10
2 4
2 1 0 256 0
128 255
2 0 0 1 0
1234 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 1 10000 0
1 0
3 1 2 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
10
2 5 5 11 20
2 4
2 1 0 256 0
128 255
2 0 0 1 0
1751 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 1 10000 0
1 0
3 1 1 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
10
2 5 7 11 10
2 4
2 1 1 256 0
128 255
2 0 0 1 0
1234 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 2 10000 0
1 0
2 1 1 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
11
2 5 5 11 10
2 4
2 1 1 256 0
128 255
2 0 0 1 0
1234 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 1 10000 0
1 0
3 1 2 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
20
2 5 5 11 10
2 4
2 1 0 256 0
128 255
2 0 0 1 0
1264 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 1 10000 0
1 0
3 1 2 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
10
2 5 5 11 10
2 4
2 1 0 256 0
128 255
2 0 0 1 0
1751 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 0 10000 0
1 0
3 1 1 10000 0
2 1
0 0 0 0 0
 1 5 7 11 10
10
2 5 3 11 10
2 4
2 1 1 256 0
128 255
2 0 0 1 0
1234 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 2 10000 0
1 0
2 1 1 10000 0
2 1
0 0 0 0 0
 1 5 7 5 10
10
2 1 5 11 10
2 4
2 1 0 256 0
128 255
2 0 0 1 0
1234 5678
2 1 1 100 0
99 98
2 1 1 100 0
99 99
2 1 1 10000 0
1 0
3 1 2 10000 0
2 1
0 0 0 0 0

0
3
255
-1
198
199
10000
-1
 0
-1
255
-1
198
199
10000
-1
 0
-1
-1
-1
198
199
10000
-1
 0
3
-1
-1
198
199
10000
-1
 0
3
255
-1
198
199
-1
-1
 -1
-1
255
-1
198
199
10000
-1
 -1
-1
-1
-1
198
199
10000
-1
 0
-1
-1
-1
198
199
-1
-1
 0
-1
255
-1
198
199
-1
-1
 0
12
-1
-1
198
199
10000
-1

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

```c
n,m,a,b,c,d[100010],r,i;
main(){
  while(scanf("%d %d %d %d %d",&n,&a,&b,&c,&m),n){
    for(i=0;i<n;i++)scanf("%d",&d[i]);
    for(i=r=0;i<10001;i++){
      if(d[r]==m)r++;
      if(r==n)break;
      m=(a*m+b)%c;
    }
    printf("%d\n",r-n?-1:i);
  }
return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	b(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	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
	leaq	d(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rcx
	leaq	m(%rip), %r9
	movq	%r13, %rdx
	xorl	%eax, %eax
	leaq	c(%rip), %r8
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	call	scanf@PLT
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	je	.L27
	movl	$0, i(%rip)
	jle	.L3
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %ecx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ecx, %eax
	jl	.L4
.L3:
	movl	m(%rip), %edx
	xorl	%r15d, %r15d
	xorl	%r11d, %r11d
	xorl	%edi, %edi
	movl	a(%rip), %r10d
	movl	b(%rip), %r9d
	xorl	%esi, %esi
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	c(%rip), %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	addl	$1, %esi
	movl	$1, %r15d
	imull	%r10d, %eax
	addl	%r9d, %eax
	cltd
	idivl	%r8d
	cmpl	$10001, %esi
	je	.L28
	movl	%esi, %r12d
.L10:
	movslq	%edi, %rax
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L5
	addl	$1, %edi
	movl	$1, %r11d
.L5:
	cmpl	%ecx, %edi
	jne	.L6
	testb	%r15b, %r15b
	je	.L7
	movl	%r12d, i(%rip)
	movl	%edx, m(%rip)
.L7:
	testb	%r11b, %r11b
	je	.L9
	movl	%edi, r(%rip)
.L9:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L28:
	movl	$10001, i(%rip)
	movl	%edx, m(%rip)
	testb	%r11b, %r11b
	je	.L11
	movl	%edi, r(%rip)
.L11:
	movl	$-1, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400040
d:
	.zero	400040
	.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	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
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	b(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	a(%rip), %r13
	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
	leaq	d(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rcx
	leaq	m(%rip), %r9
	movq	%r13, %rdx
	xorl	%eax, %eax
	leaq	c(%rip), %r8
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	call	scanf@PLT
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	je	.L27
	movl	$0, i(%rip)
	jle	.L3
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %ecx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%ecx, %eax
	jl	.L4
.L3:
	movl	m(%rip), %edx
	xorl	%r15d, %r15d
	xorl	%r11d, %r11d
	xorl	%edi, %edi
	movl	a(%rip), %r10d
	movl	b(%rip), %r9d
	xorl	%esi, %esi
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	c(%rip), %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edx, %eax
	addl	$1, %esi
	movl	$1, %r15d
	imull	%r10d, %eax
	addl	%r9d, %eax
	cltd
	idivl	%r8d
	cmpl	$10001, %esi
	je	.L28
	movl	%esi, %r12d
.L10:
	movslq	%edi, %rax
	cmpl	%edx, (%rbx,%rax,4)
	jne	.L5
	addl	$1, %edi
	movl	$1, %r11d
.L5:
	cmpl	%ecx, %edi
	jne	.L6
	testb	%r15b, %r15b
	je	.L7
	movl	%r12d, i(%rip)
	movl	%edx, m(%rip)
.L7:
	testb	%r11b, %r11b
	je	.L9
	movl	%edi, r(%rip)
.L9:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L28:
	movl	$10001, i(%rip)
	movl	%edx, m(%rip)
	testb	%r11b, %r11b
	je	.L11
	movl	%edi, r(%rip)
.L11:
	movl	$-1, %esi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400040
d:
	.zero	400040
	.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	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
	.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:
```