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<stdlib.h>
#include<math.h>
 
int prime(int i) {
    int k;
 
    if(i==1)
        return 0;
 
    if(i==2||i==3)
        return 1;
 
    for(k=2;k<=sqrt(i);k++)
        if(i%k==0) return 0;
 
    return 1;
}
 
int main() {
 
    int a,d,n;
    int i,count;
 
    while(1){
        scanf("%d %d %d",&a,&d,&n);
        if(!a&&!d&&!n) break;
        count=0,i=a;
        while(count<n) {
            if(prime(i)) {
                count++;
            }
            i+=d;
            //printf("%d\n",i);
        }
        printf("%d\n",i-d);
    }
 
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	prime
	.type	prime, @function
prime:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L23
	leal	-2(%rdi), %eax
	cmpl	$1, %eax
	jbe	.L25
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L21
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L23
	addl	$1, %ecx
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L13
.L25:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	xorl	%eax, %eax
	ret
.L21:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L5
.L28:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L12
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L5:
	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	.L28
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	.LC2(%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	.LC1(%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
.L46:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	pxor	%xmm2, %xmm2
	movl	52(%rsp), %r8d
	testl	%r15d, %r15d
	jne	.L31
	movl	%edi, %eax
	orl	%r8d, %eax
	je	.L32
.L31:
	testl	%r8d, %r8d
	jle	.L33
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L45:
	cmpl	$1, %r15d
	je	.L34
	leal	-2(%r15), %eax
	cmpl	$1, %eax
	jbe	.L44
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L58
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	addl	$1, %ecx
.L38:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L43
.L44:
	addl	$1, %esi
.L34:
	addl	%edi, %r15d
	cmpl	%r8d, %esi
	jl	.L45
.L33:
	movl	%r15d, %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	subl	%edi, %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L46
.L32:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	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
.L58:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L36
.L61:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L36:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%edi, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %edi
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %r8d
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L61
	jmp	.L44
.L60:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L23
	leal	-2(%rdi), %eax
	cmpl	$1, %eax
	jbe	.L25
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L21
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L23
	addl	$1, %ecx
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L13
.L25:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	xorl	%eax, %eax
	ret
.L21:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L5
.L28:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L12
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L5:
	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	.L28
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	.LC2(%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	.LC1(%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
.L46:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	pxor	%xmm2, %xmm2
	movl	52(%rsp), %r8d
	testl	%r15d, %r15d
	jne	.L31
	movl	%edi, %eax
	orl	%r8d, %eax
	je	.L32
.L31:
	testl	%r8d, %r8d
	jle	.L33
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L45:
	cmpl	$1, %r15d
	je	.L34
	leal	-2(%r15), %eax
	cmpl	$1, %eax
	jbe	.L44
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L58
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	addl	$1, %ecx
.L38:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L43
.L44:
	addl	$1, %esi
.L34:
	addl	%edi, %r15d
	cmpl	%r8d, %esi
	jl	.L45
.L33:
	movl	%r15d, %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	subl	%edi, %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L46
.L32:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	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
.L58:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L36
.L61:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L36:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%edi, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %edi
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %r8d
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L61
	jmp	.L44
.L60:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L23
	leal	-2(%rdi), %eax
	cmpl	$1, %eax
	jbe	.L25
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L21
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L23
	addl	$1, %ecx
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L13
.L25:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	xorl	%eax, %eax
	ret
.L21:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L5
.L28:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L12
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L5:
	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	.L28
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	.LC2(%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	.LC1(%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
.L46:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	pxor	%xmm2, %xmm2
	movl	52(%rsp), %r8d
	testl	%r15d, %r15d
	jne	.L31
	movl	%edi, %eax
	orl	%r8d, %eax
	je	.L32
.L31:
	testl	%r8d, %r8d
	jle	.L33
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L45:
	cmpl	$1, %r15d
	je	.L34
	leal	-2(%r15), %eax
	cmpl	$1, %eax
	jbe	.L44
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L58
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	addl	$1, %ecx
.L38:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L43
.L44:
	addl	$1, %esi
.L34:
	addl	%edi, %r15d
	cmpl	%r8d, %esi
	jl	.L45
.L33:
	movl	%r15d, %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	subl	%edi, %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L46
.L32:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	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
.L58:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L36
.L61:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L36:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%edi, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %edi
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %r8d
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L61
	jmp	.L44
.L60:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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<stdlib.h>
#include<math.h>
 
int prime(int i) {
    int k;
 
    if(i==1)
        return 0;
 
    if(i==2||i==3)
        return 1;
 
    for(k=2;k<=sqrt(i);k++)
        if(i%k==0) return 0;
 
    return 1;
}
 
int main() {
 
    int a,d,n;
    int i,count;
 
    while(1){
        scanf("%d %d %d",&a,&d,&n);
        if(!a&&!d&&!n) break;
        count=0,i=a;
        while(count<n) {
            if(prime(i)) {
                count++;
            }
            i+=d;
            //printf("%d\n",i);
        }
        printf("%d\n",i-d);
    }
 
    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<stdlib.h>
#include<math.h>
 
int prime(int i) {
    int k;
 
    if(i==1)
        return 0;
 
    if(i==2||i==3)
        return 1;
 
    for(k=2;k<=sqrt(i);k++)
        if(i%k==0) return 0;
 
    return 1;
}
 
int main() {
 
    int a,d,n;
    int i,count;
 
    while(1){
        scanf("%d %d %d",&a,&d,&n);
        if(!a&&!d&&!n) break;
        count=0,i=a;
        while(count<n) {
            if(prime(i)) {
                count++;
            }
            i+=d;
            //printf("%d\n",i);
        }
        printf("%d\n",i-d);
    }
 
    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<stdlib.h>
#include<math.h>
 
int prime(int i) {
    int k;
 
    if(i==1)
        return 0;
 
    if(i==2||i==3)
        return 1;
 
    for(k=2;k<=sqrt(i);k++)
        if(i%k==0) return 0;
 
    return 1;
}
 
int main() {
 
    int a,d,n;
    int i,count;
 
    while(1){
        scanf("%d %d %d",&a,&d,&n);
        if(!a&&!d&&!n) break;
        count=0,i=a;
        while(count<n) {
            if(prime(i)) {
                count++;
            }
            i+=d;
            //printf("%d\n",i);
        }
        printf("%d\n",i-d);
    }
 
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	prime
	.type	prime, @function
prime:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L23
	leal	-2(%rdi), %eax
	cmpl	$1, %eax
	jbe	.L25
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L21
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L23
	addl	$1, %ecx
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L13
.L25:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	xorl	%eax, %eax
	ret
.L21:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L5
.L28:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L12
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L5:
	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	.L28
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	.LC2(%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	.LC1(%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
.L46:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	pxor	%xmm2, %xmm2
	movl	52(%rsp), %r8d
	testl	%r15d, %r15d
	jne	.L31
	movl	%edi, %eax
	orl	%r8d, %eax
	je	.L32
.L31:
	testl	%r8d, %r8d
	jle	.L33
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L45:
	cmpl	$1, %r15d
	je	.L34
	leal	-2(%r15), %eax
	cmpl	$1, %eax
	jbe	.L44
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L58
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	addl	$1, %ecx
.L38:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L43
.L44:
	addl	$1, %esi
.L34:
	addl	%edi, %r15d
	cmpl	%r8d, %esi
	jl	.L45
.L33:
	movl	%r15d, %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	subl	%edi, %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L46
.L32:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	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
.L58:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L36
.L61:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L36:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%edi, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %edi
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %r8d
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L61
	jmp	.L44
.L60:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	je	.L23
	leal	-2(%rdi), %eax
	cmpl	$1, %eax
	jbe	.L25
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm1
	ucomisd	%xmm1, %xmm0
	ja	.L21
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L23
	addl	$1, %ecx
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L13
.L25:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	xorl	%eax, %eax
	ret
.L21:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$2, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L5
.L28:
	movl	12(%rsp), %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	je	.L12
	movsd	(%rsp), %xmm1
	addl	$1, %ebx
.L5:
	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	.L28
	movl	$1, %eax
.L1:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L12:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L1
	.cfi_endproc
.LFE39:
	.size	prime, .-prime
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.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	.LC2(%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	.LC1(%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
.L46:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r15d
	movl	48(%rsp), %edi
	pxor	%xmm2, %xmm2
	movl	52(%rsp), %r8d
	testl	%r15d, %r15d
	jne	.L31
	movl	%edi, %eax
	orl	%r8d, %eax
	je	.L32
.L31:
	testl	%r8d, %r8d
	jle	.L33
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L45:
	cmpl	$1, %r15d
	je	.L34
	leal	-2(%r15), %eax
	cmpl	$1, %eax
	jbe	.L44
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r15d, %xmm1
	ucomisd	%xmm1, %xmm2
	ja	.L58
	sqrtsd	%xmm1, %xmm1
	movl	$2, %ecx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	addl	$1, %ecx
.L38:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm1
	jnb	.L43
.L44:
	addl	$1, %esi
.L34:
	addl	%edi, %r15d
	cmpl	%r8d, %esi
	jl	.L45
.L33:
	movl	%r15d, %edx
	movq	%r14, %rsi
	xorl	%eax, %eax
	subl	%edi, %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L46
.L32:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	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
.L58:
	.cfi_restore_state
	movl	$2, %ecx
	jmp	.L36
.L61:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L34
	movsd	8(%rsp), %xmm1
	addl	$1, %ecx
.L36:
	movapd	%xmm1, %xmm0
	movl	%ecx, 28(%rsp)
	movl	%esi, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%edi, 16(%rsp)
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movl	16(%rsp), %edi
	pxor	%xmm2, %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %r8d
	movl	24(%rsp), %esi
	cvtsi2sdl	%ecx, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L61
	jmp	.L44
.L60:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
```