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

```c
#include <stdio.h>
#define number 1000000
 
char prime[number];
 
int gcd(int n, int m) {
    if(!m) return n;
    else gcd(m, n%m);
}
 
void Eratosthenes(char prime[]) {
    long i, j;
    prime[1] = 1;
    for(i = 2; i < number; i++ ) {
        if(!prime[i]) {
            //printf("%d\n",i);
            for(j = 2; j*i < number; j++ ) {
                prime[i*j] = 1;
            }
        }
    }
}
 
int main(void) {
    int a, d, n, i, count = 0;
    Eratosthenes(prime);
    while(scanf("%d%d%d",&a,&d,&n), a+d+n) {
        count = 0;
        for(i = 0; a + i*d < number; i++ ) {
            if(!prime[a + i*d]) {
                count++;
                if(count == n) {
                    printf("%d\n",a + i*d);
                    break;
                }
            }
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	prime
	.bss
	.align 32
	.type	prime, @object
	.size	prime, 1000000
prime:
	.zero	1000000
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L2
	movl	-4(%rbp), %eax
	jmp	.L1
.L2:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	Eratosthenes
	.type	Eratosthenes, @function
Eratosthenes:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movb	$1, (%rax)
	movq	$2, -16(%rbp)
	jmp	.L5
.L9:
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L6
	movq	$2, -8(%rbp)
	jmp	.L7
.L8:
	movq	-16(%rbp), %rax
	imulq	-8(%rbp), %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	addq	$1, -8(%rbp)
.L7:
	movq	-8(%rbp), %rax
	imulq	-16(%rbp), %rax
	cmpq	$999999, %rax
	jle	.L8
.L6:
	addq	$1, -16(%rbp)
.L5:
	cmpq	$999999, -16(%rbp)
	jle	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Eratosthenes, .-Eratosthenes
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -12(%rbp)
	leaq	prime(%rip), %rax
	movq	%rax, %rdi
	call	Eratosthenes
	jmp	.L11
.L15:
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L12
.L14:
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	prime(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L13
	addl	$1, -12(%rbp)
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L13
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L13:
	addl	$1, -16(%rbp)
.L12:
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jle	.L14
.L11:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edx, %r8d
.L2:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L11
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	Eratosthenes
	.type	Eratosthenes, @function
Eratosthenes:
.LFB24:
	.cfi_startproc
	endbr64
	movl	$4, %r9d
	movb	$1, 1(%rdi)
	movl	$4, %esi
	movl	$2, %edx
	subq	%rdi, %r9
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rdx
	addq	$2, %rsi
	addq	$2, %r9
	cmpq	$1000000, %rdx
	je	.L18
.L15:
	cmpb	$0, (%rdi,%rdx)
	jne	.L13
	cmpq	$999999, %rsi
	ja	.L13
	movq	%r9, %r8
	leaq	(%rdi,%rsi), %rax
	subq	%rsi, %r8
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$1, (%rax)
	addq	%rdx, %rax
	leaq	(%r8,%rax), %rcx
	cmpq	$999999, %rcx
	jle	.L14
	jmp	.L13
.L18:
	ret
	.cfi_endproc
.LFE24:
	.size	Eratosthenes, .-Eratosthenes
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$4, %esi
	movl	$2, %edx
	leaq	prime(%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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movb	$1, 1+prime(%rip)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$1000000, %rdx
	je	.L42
.L22:
	cmpb	$0, (%r15,%rdx)
	jne	.L20
	cmpq	$999999, %rsi
	ja	.L20
	leaq	(%r15,%rsi), %rax
	.p2align 4,,10
	.p2align 3
.L21:
	movb	$1, (%rax)
	addq	%rdx, %rax
	movq	%rax, %rcx
	subq	%r15, %rcx
	cmpq	$999999, %rcx
	jle	.L21
	jmp	.L20
.L42:
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movslq	16(%rsp), %rsi
	movl	20(%rsp), %ecx
	leal	(%rax,%rsi), %edx
	addl	%ecx, %edx
	je	.L31
	cmpl	$999999, %eax
	jg	.L40
	xorl	%edx, %edx
	cmpl	$1, %esi
	je	.L30
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$1, %rax
	cmpl	$999999, %eax
	jg	.L40
.L30:
	cmpb	$0, (%r15,%rax)
	movl	%eax, %r8d
	jne	.L28
	addl	$1, %edx
	cmpl	%edx, %ecx
	jne	.L28
.L29:
	movl	%r8d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L25:
	addq	%rsi, %rax
	cmpl	$999999, %eax
	jg	.L40
.L26:
	cmpb	$0, (%r15,%rax)
	movl	%eax, %r8d
	jne	.L25
	addl	$1, %edx
	cmpl	%edx, %ecx
	jne	.L25
	jmp	.L29
.L31:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	prime
	.bss
	.align 32
	.type	prime, @object
	.size	prime, 1000000
prime:
	.zero	1000000
	.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
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edx, %r8d
.L2:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L11
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	Eratosthenes
	.type	Eratosthenes, @function
Eratosthenes:
.LFB24:
	.cfi_startproc
	endbr64
	movl	$4, %r9d
	movb	$1, 1(%rdi)
	movl	$4, %esi
	movl	$2, %edx
	subq	%rdi, %r9
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rdx
	addq	$2, %rsi
	addq	$2, %r9
	cmpq	$1000000, %rdx
	je	.L18
.L15:
	cmpb	$0, (%rdi,%rdx)
	jne	.L13
	cmpq	$999999, %rsi
	ja	.L13
	movq	%r9, %r8
	leaq	(%rdi,%rsi), %rax
	subq	%rsi, %r8
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$1, (%rax)
	addq	%rdx, %rax
	leaq	(%r8,%rax), %rcx
	cmpq	$999999, %rcx
	jle	.L14
	jmp	.L13
.L18:
	ret
	.cfi_endproc
.LFE24:
	.size	Eratosthenes, .-Eratosthenes
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$4, %esi
	movl	$2, %edx
	leaq	prime(%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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movb	$1, 1+prime(%rip)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$1000000, %rdx
	je	.L42
.L22:
	cmpb	$0, (%r15,%rdx)
	jne	.L20
	cmpq	$999999, %rsi
	ja	.L20
	leaq	(%r15,%rsi), %rax
	.p2align 4,,10
	.p2align 3
.L21:
	movb	$1, (%rax)
	addq	%rdx, %rax
	movq	%rax, %rcx
	subq	%r15, %rcx
	cmpq	$999999, %rcx
	jle	.L21
	jmp	.L20
.L42:
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movslq	16(%rsp), %rsi
	movl	20(%rsp), %ecx
	leal	(%rax,%rsi), %edx
	addl	%ecx, %edx
	je	.L31
	cmpl	$999999, %eax
	jg	.L40
	xorl	%edx, %edx
	cmpl	$1, %esi
	je	.L30
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$1, %rax
	cmpl	$999999, %eax
	jg	.L40
.L30:
	cmpb	$0, (%r15,%rax)
	movl	%eax, %r8d
	jne	.L28
	addl	$1, %edx
	cmpl	%edx, %ecx
	jne	.L28
.L29:
	movl	%r8d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L25:
	addq	%rsi, %rax
	cmpl	$999999, %eax
	jg	.L40
.L26:
	cmpb	$0, (%r15,%rax)
	movl	%eax, %r8d
	jne	.L25
	addl	$1, %edx
	cmpl	%edx, %ecx
	jne	.L25
	jmp	.L29
.L31:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	prime
	.bss
	.align 32
	.type	prime, @object
	.size	prime, 1000000
prime:
	.zero	1000000
	.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:

#include <stdio.h>
#define number 1000000
 
char prime[number];
 
int gcd(int n, int m) {
    if(!m) return n;
    else gcd(m, n%m);
}
 
void Eratosthenes(char prime[]) {
    long i, j;
    prime[1] = 1;
    for(i = 2; i < number; i++ ) {
        if(!prime[i]) {
            //printf("%d\n",i);
            for(j = 2; j*i < number; j++ ) {
                prime[i*j] = 1;
            }
        }
    }
}
 
int main(void) {
    int a, d, n, i, count = 0;
    Eratosthenes(prime);
    while(scanf("%d%d%d",&a,&d,&n), a+d+n) {
        count = 0;
        for(i = 0; a + i*d < number; i++ ) {
            if(!prime[a + i*d]) {
                count++;
                if(count == n) {
                    printf("%d\n",a + i*d);
                    break;
                }
            }
        }
    }
    return 0;
}
367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 170 40
37 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 50 85
1 1 1
9075 337 210
307 24 79
331 221 177
259 170 40
269 75 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
10208 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 33 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 170 40
37 58 146
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
19 104 185
253 87 85
1 1 1
10208 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 145 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 33 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
73 230 1
19 104 185
253 87 85
1 1 1
10208 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0

92809
6709
12037
103
93523
43579
2
899429
5107
412717
22699
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
22699
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
22699
24919
 92809
6709
12037
103
93523
14503
2
899429
5107
412717
22699
38669
 92809
6709
12037
103
93523
43579
2
925163
5107
412717
22699
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
6199
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
22699
36809
 92809
6709
12037
103
91019
43579
2
925163
5107
412717
22699
25673
 92809
6709
12037
103
93523
94793
2
899429
5107
842341
6199
25673
 92809
6709
12037
73
91019
43579
2
925163
5107
412717
22699
25673

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

```c
#include <stdio.h>
#define number 1000000
 
char prime[number];
 
int gcd(int n, int m) {
    if(!m) return n;
    else gcd(m, n%m);
}
 
void Eratosthenes(char prime[]) {
    long i, j;
    prime[1] = 1;
    for(i = 2; i < number; i++ ) {
        if(!prime[i]) {
            //printf("%d\n",i);
            for(j = 2; j*i < number; j++ ) {
                prime[i*j] = 1;
            }
        }
    }
}
 
int main(void) {
    int a, d, n, i, count = 0;
    Eratosthenes(prime);
    while(scanf("%d%d%d",&a,&d,&n), a+d+n) {
        count = 0;
        for(i = 0; a + i*d < number; i++ ) {
            if(!prime[a + i*d]) {
                count++;
                if(count == n) {
                    printf("%d\n",a + i*d);
                    break;
                }
            }
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	prime
	.bss
	.align 32
	.type	prime, @object
	.size	prime, 1000000
prime:
	.zero	1000000
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L2
	movl	-4(%rbp), %eax
	jmp	.L1
.L2:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	Eratosthenes
	.type	Eratosthenes, @function
Eratosthenes:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movb	$1, (%rax)
	movq	$2, -16(%rbp)
	jmp	.L5
.L9:
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L6
	movq	$2, -8(%rbp)
	jmp	.L7
.L8:
	movq	-16(%rbp), %rax
	imulq	-8(%rbp), %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	addq	$1, -8(%rbp)
.L7:
	movq	-8(%rbp), %rax
	imulq	-16(%rbp), %rax
	cmpq	$999999, %rax
	jle	.L8
.L6:
	addq	$1, -16(%rbp)
.L5:
	cmpq	$999999, -16(%rbp)
	jle	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Eratosthenes, .-Eratosthenes
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -12(%rbp)
	leaq	prime(%rip), %rax
	movq	%rax, %rdi
	call	Eratosthenes
	jmp	.L11
.L15:
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L12
.L14:
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	prime(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L13
	addl	$1, -12(%rbp)
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L13
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L13:
	addl	$1, -16(%rbp)
.L12:
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jle	.L14
.L11:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	prime
	.bss
	.align 32
	.type	prime, @object
	.size	prime, 1000000
prime:
	.zero	1000000
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L2
	movl	-4(%rbp), %eax
	jmp	.L1
.L2:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	Eratosthenes
	.type	Eratosthenes, @function
Eratosthenes:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	addq	$1, %rax
	movb	$1, (%rax)
	movq	$2, -16(%rbp)
	jmp	.L5
.L9:
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L6
	movq	$2, -8(%rbp)
	jmp	.L7
.L8:
	movq	-16(%rbp), %rax
	imulq	-8(%rbp), %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	addq	$1, -8(%rbp)
.L7:
	movq	-8(%rbp), %rax
	imulq	-16(%rbp), %rax
	cmpq	$999999, %rax
	jle	.L8
.L6:
	addq	$1, -16(%rbp)
.L5:
	cmpq	$999999, -16(%rbp)
	jle	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Eratosthenes, .-Eratosthenes
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -12(%rbp)
	leaq	prime(%rip), %rax
	movq	%rax, %rdi
	call	Eratosthenes
	jmp	.L11
.L15:
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L12
.L14:
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	prime(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L13
	addl	$1, -12(%rbp)
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L13
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L13:
	addl	$1, -16(%rbp)
.L12:
	movl	-24(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jle	.L14
.L11:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
