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

```c
#include <stdio.h>
#include <math.h>
#define NUM 1000000
int prime(int n){
	int i;
	if(n==1)
		return 0;
	for(i=2;i<=sqrt(n);i++){
		if(n%i==0)
			return 0;
	}
	return 1;
}

int main(void)
{
	int a,d,n,c,i;
	while(scanf("%d %d %d",&a,&d,&n)&&a+d+n){
		c=0;
		for(i=0;a+i*d<NUM;i++){
			if(prime(a+i*d))
				c++;
			if(c==n){
				printf("%d\n",a+i*d);
				break;
			}
		}
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	prime
	.type	prime, @function
prime:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L21
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L19
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L21
	addl	$1, %ecx
.L6:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L12
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	ret
.L19:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L4
.L26:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L11
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L4:
	movapd	%xmm1, %xmm0
	movl	%edi, 12(%rsp)
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L26
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	.LC1(%rip), %r14
	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	.LC2(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %r13
	leaq	48(%rsp), %r12
	leaq	44(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L39
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	movl	52(%rsp), %esi
	leal	(%r15,%rdi), %eax
	addl	%esi, %eax
	je	.L39
	xorl	%r8d, %r8d
	cmpl	$999999, %r15d
	pxor	%xmm2, %xmm2
	jg	.L38
	.p2align 4,,10
	.p2align 3
.L37:
	cmpl	$1, %r15d
	je	.L29
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L63
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	addl	$1, %ecx
.L32:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L35
.L33:
	addl	$1, %r8d
.L29:
	cmpl	%r8d, %esi
	je	.L66
	addl	%edi, %r15d
	cmpl	$999999, %r15d
	jle	.L37
	jmp	.L38
.L66:
	movl	%r15d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L39:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	addq	$72, %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
.L63:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L30
.L68:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L30:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%edi, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %r8d
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %edi
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L68
	jmp	.L33
.L67:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	prime
	.type	prime, @function
prime:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L21
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L19
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L21
	addl	$1, %ecx
.L6:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L12
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	ret
.L19:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L4
.L26:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L11
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L4:
	movapd	%xmm1, %xmm0
	movl	%edi, 12(%rsp)
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L26
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	.LC1(%rip), %r14
	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	.LC2(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %r13
	leaq	48(%rsp), %r12
	leaq	44(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L39
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	movl	52(%rsp), %esi
	leal	(%r15,%rdi), %eax
	addl	%esi, %eax
	je	.L39
	xorl	%r8d, %r8d
	cmpl	$999999, %r15d
	pxor	%xmm2, %xmm2
	jg	.L38
	.p2align 4,,10
	.p2align 3
.L37:
	cmpl	$1, %r15d
	je	.L29
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L63
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	addl	$1, %ecx
.L32:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L35
.L33:
	addl	$1, %r8d
.L29:
	cmpl	%r8d, %esi
	je	.L66
	addl	%edi, %r15d
	cmpl	$999999, %r15d
	jle	.L37
	jmp	.L38
.L66:
	movl	%r15d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L39:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	addq	$72, %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
.L63:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L30
.L68:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L30:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%edi, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %r8d
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %edi
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L68
	jmp	.L33
.L67:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	prime
	.type	prime, @function
prime:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L21
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L19
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L21
	addl	$1, %ecx
.L6:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L12
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	ret
.L19:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L4
.L26:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L11
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L4:
	movapd	%xmm1, %xmm0
	movl	%edi, 12(%rsp)
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L26
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	.LC1(%rip), %r14
	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	.LC2(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %r13
	leaq	48(%rsp), %r12
	leaq	44(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L39
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	movl	52(%rsp), %esi
	leal	(%r15,%rdi), %eax
	addl	%esi, %eax
	je	.L39
	xorl	%r8d, %r8d
	cmpl	$999999, %r15d
	pxor	%xmm2, %xmm2
	jg	.L38
	.p2align 4,,10
	.p2align 3
.L37:
	cmpl	$1, %r15d
	je	.L29
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L63
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	addl	$1, %ecx
.L32:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L35
.L33:
	addl	$1, %r8d
.L29:
	cmpl	%r8d, %esi
	je	.L66
	addl	%edi, %r15d
	cmpl	$999999, %r15d
	jle	.L37
	jmp	.L38
.L66:
	movl	%r15d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L39:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	addq	$72, %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
.L63:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L30
.L68:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L30:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%edi, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %r8d
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %edi
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L68
	jmp	.L33
.L67:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:
```
```c
#include <stdio.h>
#include <math.h>
#define NUM 1000000
int prime(int n){
	int i;
	if(n==1)
		return 0;
	for(i=2;i<=sqrt(n);i++){
		if(n%i==0)
			return 0;
	}
	return 1;
}

int main(void)
{
	int a,d,n,c,i;
	while(scanf("%d %d %d",&a,&d,&n)&&a+d+n){
		c=0;
		for(i=0;a+i*d<NUM;i++){
			if(prime(a+i*d))
				c++;
			if(c==n){
				printf("%d\n",a+i*d);
				break;
			}
		}
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <math.h>
#define NUM 1000000
int prime(int n){
	int i;
	if(n==1)
		return 0;
	for(i=2;i<=sqrt(n);i++){
		if(n%i==0)
			return 0;
	}
	return 1;
}

int main(void)
{
	int a,d,n,c,i;
	while(scanf("%d %d %d",&a,&d,&n)&&a+d+n){
		c=0;
		for(i=0;a+i*d<NUM;i++){
			if(prime(a+i*d))
				c++;
			if(c==n){
				printf("%d\n",a+i*d);
				break;
			}
		}
	}
	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:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <math.h>
#define NUM 1000000
int prime(int n){
	int i;
	if(n==1)
		return 0;
	for(i=2;i<=sqrt(n);i++){
		if(n%i==0)
			return 0;
	}
	return 1;
}

int main(void)
{
	int a,d,n,c,i;
	while(scanf("%d %d %d",&a,&d,&n)&&a+d+n){
		c=0;
		for(i=0;a+i*d<NUM;i++){
			if(prime(a+i*d))
				c++;
			if(c==n){
				printf("%d\n",a+i*d);
				break;
			}
		}
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	prime
	.type	prime, @function
prime:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L21
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L19
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L21
	addl	$1, %ecx
.L6:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L12
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	ret
.L19:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L4
.L26:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L11
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L4:
	movapd	%xmm1, %xmm0
	movl	%edi, 12(%rsp)
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L26
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	.LC1(%rip), %r14
	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	.LC2(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %r13
	leaq	48(%rsp), %r12
	leaq	44(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L39
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	movl	52(%rsp), %esi
	leal	(%r15,%rdi), %eax
	addl	%esi, %eax
	je	.L39
	xorl	%r8d, %r8d
	cmpl	$999999, %r15d
	pxor	%xmm2, %xmm2
	jg	.L38
	.p2align 4,,10
	.p2align 3
.L37:
	cmpl	$1, %r15d
	je	.L29
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L63
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	addl	$1, %ecx
.L32:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L35
.L33:
	addl	$1, %r8d
.L29:
	cmpl	%r8d, %esi
	je	.L66
	addl	%edi, %r15d
	cmpl	$999999, %r15d
	jle	.L37
	jmp	.L38
.L66:
	movl	%r15d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L39:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	addq	$72, %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
.L63:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L30
.L68:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L30:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%edi, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %r8d
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %edi
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L68
	jmp	.L33
.L67:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	prime
	.type	prime, @function
prime:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L21
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L19
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L21
	addl	$1, %ecx
.L6:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L12
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	ret
.L19:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L4
.L26:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L11
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L4:
	movapd	%xmm1, %xmm0
	movl	%edi, 12(%rsp)
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L26
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	.LC1(%rip), %r14
	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	.LC2(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %r13
	leaq	48(%rsp), %r12
	leaq	44(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L39
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	movl	52(%rsp), %esi
	leal	(%r15,%rdi), %eax
	addl	%esi, %eax
	je	.L39
	xorl	%r8d, %r8d
	cmpl	$999999, %r15d
	pxor	%xmm2, %xmm2
	jg	.L38
	.p2align 4,,10
	.p2align 3
.L37:
	cmpl	$1, %r15d
	je	.L29
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L63
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	addl	$1, %ecx
.L32:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L35
.L33:
	addl	$1, %r8d
.L29:
	cmpl	%r8d, %esi
	je	.L66
	addl	%edi, %r15d
	cmpl	$999999, %r15d
	jle	.L37
	jmp	.L38
.L66:
	movl	%r15d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L39:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	addq	$72, %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
.L63:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L30
.L68:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L29
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L30:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%edi, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %r8d
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %edi
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L68
	jmp	.L33
.L67:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:
```