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>
#include <math.h>
#include <stdlib.h>

unsigned long long pow10(int n) {
    unsigned long long x;
    for (x = 1; n--;) {
        x *= 10;
    }
    return x;
}

int is_prime(unsigned long long x) {
    unsigned long long i, l;
    for (i = 3, l = sqrt(x) + 1; i < l; i += 2) {
        if (x % i == 0) return 0;
    }
    return 1;
}

long long find_number(int n, int c) {
    unsigned long long i, l, x, d;
    if (c < 0) {
        if (n == 1) {
            return 11;
        }
        else {
            return pow10(n * 2) - 1;
        }
    }

    for (i = pow10(2 * n + 1) - 1, l = pow10(2 * n);
         i > l; i -= 2) {
        for (x = i, d = pow10(2 * n);
             d > 1; x = (x%d)/10, d /= 100) {
            if (x / d != x % 10) break;
        }
        if (d == 1 && x == c && is_prime(i)) {
            return i;
        }
    }
    return pow10(n * 2 + 1) - 1;
}


int main(void) {
    int n, c, i;
    while (scanf("%d%d", &n, &c) == 2 && n) {
        if (n < 10) {
            printf("%llu\n", find_number(n, c));
        }
        else {
            printf("%llu%llu\n", find_number(n / 2, c), find_number(n / 2, c));
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	pow10
	.type	pow10, @function
pow10:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	$1, -8(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, -8(%rbp)
.L2:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jne	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	pow10, .-pow10
	.globl	is_prime
	.type	is_prime, @function
is_prime:
.LFB7:
	.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	%rdi, -24(%rbp)
	movq	$3, -16(%rbp)
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	js	.L6
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	jmp	.L7
.L6:
	movq	%rax, %rdx
	shrq	%rdx
	andl	$1, %eax
	orq	%rax, %rdx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdx, %xmm0
	addsd	%xmm0, %xmm0
	movq	%xmm0, %rax
.L7:
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	.LC0(%rip), %xmm1
	addsd	%xmm1, %xmm0
	comisd	.LC1(%rip), %xmm0
	jnb	.L8
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	jmp	.L9
.L8:
	movsd	.LC1(%rip), %xmm1
	subsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movabsq	$-9223372036854775808, %rax
	xorq	%rax, -8(%rbp)
.L9:
	movq	-8(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L13:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	addq	$2, -16(%rbp)
.L10:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jb	.L13
	movl	$1, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	is_prime, .-is_prime
	.globl	find_number
	.type	find_number, @function
find_number:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	cmpl	$0, -40(%rbp)
	jns	.L15
	cmpl	$1, -36(%rbp)
	jne	.L16
	movl	$11, %eax
	jmp	.L17
.L16:
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
	jmp	.L17
.L15:
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	movq	%rax, -8(%rbp)
	jmp	.L18
.L24:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	movq	%rax, -16(%rbp)
	jmp	.L19
.L22:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rax, %rsi
	movq	-24(%rbp), %rcx
	movabsq	$-3689348814741910323, %rdx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$3, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpq	%rdx, %rsi
	jne	.L25
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rdx, %rax
	movabsq	$-3689348814741910323, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$3, %rax
	movq	%rax, -24(%rbp)
	movq	-16(%rbp), %rax
	shrq	$2, %rax
	movabsq	$2951479051793528259, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$2, %rax
	movq	%rax, -16(%rbp)
.L19:
	cmpq	$1, -16(%rbp)
	ja	.L22
	jmp	.L21
.L25:
	nop
.L21:
	cmpq	$1, -16(%rbp)
	jne	.L23
	movl	-40(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jne	.L23
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	is_prime
	testl	%eax, %eax
	je	.L23
	movq	-32(%rbp), %rax
	jmp	.L17
.L23:
	subq	$2, -32(%rbp)
.L18:
	movq	-32(%rbp), %rax
	cmpq	-8(%rbp), %rax
	ja	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	find_number, .-find_number
	.section	.rodata
.LC2:
	.string	"%llu\n"
.LC3:
	.string	"%llu%llu\n"
.LC4:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	jmp	.L27
.L30:
	movl	-32(%rbp), %eax
	cmpl	$9, %eax
	jg	.L28
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	find_number
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L27
.L28:
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	find_number
	movq	%rax, %rbx
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	find_number
	movq	%rbx, %rdx
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L27:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L29
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L30
.L29:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC1:
	.long	0
	.long	1138753536
	.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
	.type	find_number.part.0, @function
find_number.part.0:
.LFB43:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %r15d
	movl	%esi, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leal	(%r15,%r15), %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%r14d, %eax
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	0(%rbp,%rbp,4), %rbp
	addq	%rbp, %rbp
	subl	$1, %eax
	jnb	.L2
	subq	$1, %rbp
	subl	$1, %r14d
	testl	%r15d, %r15d
	je	.L24
	movl	%r14d, %eax
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	0(%r13,%r13,4), %r13
	addq	%r13, %r13
	subl	$1, %eax
	jnb	.L4
.L3:
	movabsq	$-3689348814741910323, %rbx
	movabsq	$2951479051793528259, %r12
	cmpq	%r13, %rbp
	jbe	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r14d, %eax
	movl	$1, %ecx
	movq	%rbp, %rsi
	testl	%r15d, %r15d
	je	.L21
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%rcx,%rcx,4), %rcx
	addq	%rcx, %rcx
	subl	$1, %eax
	jnb	.L7
	cmpq	$1, %rcx
	jbe	.L8
	movq	%rbp, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rsi
	movq	%rbp, %rax
	mulq	%rbx
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rax
	movq	%rbp, %rdx
	addq	%rax, %rax
	subq	%rax, %rdx
	cmpq	%rdx, %rsi
	jne	.L8
	movq	%rbp, %rsi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r8
	movq	%rsi, %rax
	mulq	%rbx
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rax
	movq	%rsi, %rdx
	addq	%rax, %rax
	subq	%rax, %rdx
	cmpq	%rdx, %r8
	jne	.L8
.L9:
	movq	%rsi, %rax
	xorl	%edx, %edx
	movq	%rcx, %r8
	divq	%rcx
	movq	%rdx, %rax
	mulq	%rbx
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	shrq	$2, %rdx
	shrq	$3, %rsi
	movq	%rdx, %rax
	mulq	%r12
	movq	%rdx, %rcx
	shrq	$2, %rcx
	cmpq	$199, %r8
	ja	.L10
	cmpq	$1, %rcx
	jne	.L8
.L21:
	movslq	%edi, %rax
	cmpq	%rax, %rsi
	je	.L40
.L8:
	subq	$2, %rbp
	cmpq	%r13, %rbp
	ja	.L5
.L6:
	movl	$1, %eax
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L41:
	subl	$1, %r14d
.L22:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	cmpl	$-1, %r14d
	jne	.L41
	subq	$1, %rax
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L40:
	.cfi_restore_state
	testq	%rbp, %rbp
	js	.L11
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rbp, %xmm0
.L12:
	pxor	%xmm2, %xmm2
	ucomisd	%xmm0, %xmm2
	ja	.L36
	sqrtsd	%xmm0, %xmm0
.L15:
	addsd	.LC1(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L16
	cvttsd2siq	%xmm0, %rsi
.L17:
	cmpq	$3, %rsi
	jbe	.L18
	movabsq	$-6148914691236517205, %rax
	movabsq	$6148914691236517205, %rdx
	imulq	%rbp, %rax
	cmpq	%rdx, %rax
	jbe	.L8
	movl	$3, %ecx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rbp, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	.L8
.L19:
	addq	$2, %rcx
	cmpq	%rcx, %rsi
	ja	.L20
.L18:
	movq	%rbp, %rax
	jmp	.L1
.L16:
	subsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rsi
	btcq	$63, %rsi
	jmp	.L17
.L11:
	movq	%rbp, %rax
	movq	%rbp, %rdx
	pxor	%xmm0, %xmm0
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
	jmp	.L12
.L24:
	movl	$1, %r13d
	jmp	.L3
.L36:
	movl	%edi, 12(%rsp)
	call	sqrt@PLT
	movl	12(%rsp), %edi
	jmp	.L15
	.cfi_endproc
.LFE43:
	.size	find_number.part.0, .-find_number.part.0
	.p2align 4
	.globl	pow10
	.type	pow10, @function
pow10:
.LFB39:
	.cfi_startproc
	endbr64
	leal	-1(%rdi), %edx
	movl	$1, %eax
	testl	%edi, %edi
	je	.L45
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	subl	$1, %edx
	jnb	.L44
	ret
	.p2align 4,,10
	.p2align 3
.L45:
	ret
	.cfi_endproc
.LFE39:
	.size	pow10, .-pow10
	.p2align 4
	.globl	is_prime
	.type	is_prime, @function
is_prime:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	testq	%rdi, %rdi
	js	.L48
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdi, %xmm0
.L49:
	pxor	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	.L62
	sqrtsd	%xmm0, %xmm0
.L52:
	addsd	.LC1(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L53
	cvttsd2siq	%xmm0, %rsi
.L54:
	cmpq	$3, %rsi
	jbe	.L58
	movabsq	$-6148914691236517205, %rax
	movabsq	$6148914691236517205, %rdx
	imulq	%rdi, %rax
	cmpq	%rdx, %rax
	jbe	.L60
	movl	$3, %ecx
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L57:
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	.L60
.L56:
	addq	$2, %rcx
	cmpq	%rcx, %rsi
	ja	.L57
.L58:
	movl	$1, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	subsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rsi
	btcq	$63, %rsi
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L60:
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	movq	%rdi, %rax
	movq	%rdi, %rdx
	pxor	%xmm0, %xmm0
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
	jmp	.L49
.L62:
	movq	%rdi, 8(%rsp)
	call	sqrt@PLT
	movq	8(%rsp), %rdi
	jmp	.L52
	.cfi_endproc
.LFE40:
	.size	is_prime, .-is_prime
	.p2align 4
	.globl	find_number
	.type	find_number, @function
find_number:
.LFB41:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	js	.L73
	jmp	find_number.part.0
.L73:
	movl	$11, %eax
	cmpl	$1, %edi
	je	.L64
	leal	-1(%rdi,%rdi), %edx
	testl	%edi, %edi
	je	.L70
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L68:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	subl	$1, %edx
	jnb	.L68
	subq	$1, %rax
	ret
.L64:
	ret
.L70:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	find_number, .-find_number
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%llu\n"
.LC4:
	.string	"%llu%llu\n"
.LC5:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.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	.LC4(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC3(%rip), %r13
	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	.LC5(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L75:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L85
	movl	16(%rsp), %edi
	testl	%edi, %edi
	je	.L85
	movl	20(%rsp), %esi
	cmpl	$9, %edi
	jg	.L76
	testl	%esi, %esi
	js	.L94
	call	find_number.part.0
	movq	%rax, %rdx
.L78:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L76:
	sarl	%edi
	testl	%esi, %esi
	js	.L95
	movl	%esi, 12(%rsp)
	movl	%edi, 8(%rsp)
	call	find_number.part.0
	movl	12(%rsp), %esi
	movl	8(%rsp), %edi
	movq	%rax, %r15
	call	find_number.part.0
	movq	%rax, %rdx
.L84:
	movq	%r15, %rcx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L94:
	movl	$11, %edx
	cmpl	$1, %edi
	je	.L78
	leal	-1(%rdi,%rdi), %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L79:
	leaq	(%rdx,%rdx,4), %rdx
	addq	%rdx, %rdx
	subl	$1, %eax
	jnb	.L79
	subq	$1, %rdx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L95:
	leal	-1(%rdi,%rdi), %ecx
	movl	$1, %eax
	movl	%ecx, %edx
	.p2align 4,,10
	.p2align 3
.L82:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	subl	$1, %edx
	jnb	.L82
	leaq	-1(%rax), %r15
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L83:
	leaq	(%rdx,%rdx,4), %rdx
	addq	%rdx, %rdx
	subl	$1, %ecx
	jnb	.L83
	subq	$1, %rdx
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L85:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L96
	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
.L96:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1138753536
	.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
	.type	find_number.part.0, @function
find_number.part.0:
.LFB43:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %r15d
	movl	%esi, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leal	(%r15,%r15), %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%r14d, %eax
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	0(%rbp,%rbp,4), %rbp
	addq	%rbp, %rbp
	subl	$1, %eax
	jnb	.L2
	subq	$1, %rbp
	subl	$1, %r14d
	testl	%r15d, %r15d
	je	.L24
	movl	%r14d, %eax
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	0(%r13,%r13,4), %r13
	addq	%r13, %r13
	subl	$1, %eax
	jnb	.L4
.L3:
	movabsq	$-3689348814741910323, %rbx
	movabsq	$2951479051793528259, %r12
	cmpq	%r13, %rbp
	jbe	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r14d, %eax
	movl	$1, %ecx
	movq	%rbp, %rsi
	testl	%r15d, %r15d
	je	.L21
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%rcx,%rcx,4), %rcx
	addq	%rcx, %rcx
	subl	$1, %eax
	jnb	.L7
	cmpq	$1, %rcx
	jbe	.L8
	movq	%rbp, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rsi
	movq	%rbp, %rax
	mulq	%rbx
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rax
	movq	%rbp, %rdx
	addq	%rax, %rax
	subq	%rax, %rdx
	cmpq	%rdx, %rsi
	jne	.L8
	movq	%rbp, %rsi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r8
	movq	%rsi, %rax
	mulq	%rbx
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rax
	movq	%rsi, %rdx
	addq	%rax, %rax
	subq	%rax, %rdx
	cmpq	%rdx, %r8
	jne	.L8
.L9:
	movq	%rsi, %rax
	xorl	%edx, %edx
	movq	%rcx, %r8
	divq	%rcx
	movq	%rdx, %rax
	mulq	%rbx
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	shrq	$2, %rdx
	shrq	$3, %rsi
	movq	%rdx, %rax
	mulq	%r12
	movq	%rdx, %rcx
	shrq	$2, %rcx
	cmpq	$199, %r8
	ja	.L10
	cmpq	$1, %rcx
	jne	.L8
.L21:
	movslq	%edi, %rax
	cmpq	%rax, %rsi
	je	.L40
.L8:
	subq	$2, %rbp
	cmpq	%r13, %rbp
	ja	.L5
.L6:
	movl	$1, %eax
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L41:
	subl	$1, %r14d
.L22:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	cmpl	$-1, %r14d
	jne	.L41
	subq	$1, %rax
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L40:
	.cfi_restore_state
	testq	%rbp, %rbp
	js	.L11
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rbp, %xmm0
.L12:
	pxor	%xmm2, %xmm2
	ucomisd	%xmm0, %xmm2
	ja	.L36
	sqrtsd	%xmm0, %xmm0
.L15:
	addsd	.LC1(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L16
	cvttsd2siq	%xmm0, %rsi
.L17:
	cmpq	$3, %rsi
	jbe	.L18
	movabsq	$-6148914691236517205, %rax
	movabsq	$6148914691236517205, %rdx
	imulq	%rbp, %rax
	cmpq	%rdx, %rax
	jbe	.L8
	movl	$3, %ecx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rbp, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	.L8
.L19:
	addq	$2, %rcx
	cmpq	%rcx, %rsi
	ja	.L20
.L18:
	movq	%rbp, %rax
	jmp	.L1
.L16:
	subsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rsi
	btcq	$63, %rsi
	jmp	.L17
.L11:
	movq	%rbp, %rax
	movq	%rbp, %rdx
	pxor	%xmm0, %xmm0
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
	jmp	.L12
.L24:
	movl	$1, %r13d
	jmp	.L3
.L36:
	movl	%edi, 12(%rsp)
	call	sqrt@PLT
	movl	12(%rsp), %edi
	jmp	.L15
	.cfi_endproc
.LFE43:
	.size	find_number.part.0, .-find_number.part.0
	.p2align 4
	.globl	pow10
	.type	pow10, @function
pow10:
.LFB39:
	.cfi_startproc
	endbr64
	leal	-1(%rdi), %edx
	movl	$1, %eax
	testl	%edi, %edi
	je	.L45
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	subl	$1, %edx
	jnb	.L44
	ret
	.p2align 4,,10
	.p2align 3
.L45:
	ret
	.cfi_endproc
.LFE39:
	.size	pow10, .-pow10
	.p2align 4
	.globl	is_prime
	.type	is_prime, @function
is_prime:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	testq	%rdi, %rdi
	js	.L48
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdi, %xmm0
.L49:
	pxor	%xmm1, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	.L62
	sqrtsd	%xmm0, %xmm0
.L52:
	addsd	.LC1(%rip), %xmm0
	movsd	.LC2(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jnb	.L53
	cvttsd2siq	%xmm0, %rsi
.L54:
	cmpq	$3, %rsi
	jbe	.L58
	movabsq	$-6148914691236517205, %rax
	movabsq	$6148914691236517205, %rdx
	imulq	%rdi, %rax
	cmpq	%rdx, %rax
	jbe	.L60
	movl	$3, %ecx
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L57:
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	.L60
.L56:
	addq	$2, %rcx
	cmpq	%rcx, %rsi
	ja	.L57
.L58:
	movl	$1, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	subsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rsi
	btcq	$63, %rsi
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L60:
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	movq	%rdi, %rax
	movq	%rdi, %rdx
	pxor	%xmm0, %xmm0
	shrq	%rax
	andl	$1, %edx
	orq	%rdx, %rax
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm0, %xmm0
	jmp	.L49
.L62:
	movq	%rdi, 8(%rsp)
	call	sqrt@PLT
	movq	8(%rsp), %rdi
	jmp	.L52
	.cfi_endproc
.LFE40:
	.size	is_prime, .-is_prime
	.p2align 4
	.globl	find_number
	.type	find_number, @function
find_number:
.LFB41:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	js	.L73
	jmp	find_number.part.0
.L73:
	movl	$11, %eax
	cmpl	$1, %edi
	je	.L64
	leal	-1(%rdi,%rdi), %edx
	testl	%edi, %edi
	je	.L70
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L68:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	subl	$1, %edx
	jnb	.L68
	subq	$1, %rax
	ret
.L64:
	ret
.L70:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	find_number, .-find_number
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%llu\n"
.LC4:
	.string	"%llu%llu\n"
.LC5:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.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	.LC4(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC3(%rip), %r13
	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	.LC5(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L75:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L85
	movl	16(%rsp), %edi
	testl	%edi, %edi
	je	.L85
	movl	20(%rsp), %esi
	cmpl	$9, %edi
	jg	.L76
	testl	%esi, %esi
	js	.L94
	call	find_number.part.0
	movq	%rax, %rdx
.L78:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L76:
	sarl	%edi
	testl	%esi, %esi
	js	.L95
	movl	%esi, 12(%rsp)
	movl	%edi, 8(%rsp)
	call	find_number.part.0
	movl	12(%rsp), %esi
	movl	8(%rsp), %edi
	movq	%rax, %r15
	call	find_number.part.0
	movq	%rax, %rdx
.L84:
	movq	%r15, %rcx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L94:
	movl	$11, %edx
	cmpl	$1, %edi
	je	.L78
	leal	-1(%rdi,%rdi), %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L79:
	leaq	(%rdx,%rdx,4), %rdx
	addq	%rdx, %rdx
	subl	$1, %eax
	jnb	.L79
	subq	$1, %rdx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L95:
	leal	-1(%rdi,%rdi), %ecx
	movl	$1, %eax
	movl	%ecx, %edx
	.p2align 4,,10
	.p2align 3
.L82:
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	subl	$1, %edx
	jnb	.L82
	leaq	-1(%rax), %r15
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L83:
	leaq	(%rdx,%rdx,4), %rdx
	addq	%rdx, %rdx
	subl	$1, %ecx
	jnb	.L83
	subq	$1, %rdx
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L85:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L96
	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
.L96:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1138753536
	.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>
#include <math.h>
#include <stdlib.h>

unsigned long long pow10(int n) {
    unsigned long long x;
    for (x = 1; n--;) {
        x *= 10;
    }
    return x;
}

int is_prime(unsigned long long x) {
    unsigned long long i, l;
    for (i = 3, l = sqrt(x) + 1; i < l; i += 2) {
        if (x % i == 0) return 0;
    }
    return 1;
}

long long find_number(int n, int c) {
    unsigned long long i, l, x, d;
    if (c < 0) {
        if (n == 1) {
            return 11;
        }
        else {
            return pow10(n * 2) - 1;
        }
    }

    for (i = pow10(2 * n + 1) - 1, l = pow10(2 * n);
         i > l; i -= 2) {
        for (x = i, d = pow10(2 * n);
             d > 1; x = (x%d)/10, d /= 100) {
            if (x / d != x % 10) break;
        }
        if (d == 1 && x == c && is_prime(i)) {
            return i;
        }
    }
    return pow10(n * 2 + 1) - 1;
}


int main(void) {
    int n, c, i;
    while (scanf("%d%d", &n, &c) == 2 && n) {
        if (n < 10) {
            printf("%llu\n", find_number(n, c));
        }
        else {
            printf("%llu%llu\n", find_number(n / 2, c), find_number(n / 2, c));
        }
    }
    return 0;
}
1 0

101

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>
#include <math.h>
#include <stdlib.h>

unsigned long long pow10(int n) {
    unsigned long long x;
    for (x = 1; n--;) {
        x *= 10;
    }
    return x;
}

int is_prime(unsigned long long x) {
    unsigned long long i, l;
    for (i = 3, l = sqrt(x) + 1; i < l; i += 2) {
        if (x % i == 0) return 0;
    }
    return 1;
}

long long find_number(int n, int c) {
    unsigned long long i, l, x, d;
    if (c < 0) {
        if (n == 1) {
            return 11;
        }
        else {
            return pow10(n * 2) - 1;
        }
    }

    for (i = pow10(2 * n + 1) - 1, l = pow10(2 * n);
         i > l; i -= 2) {
        for (x = i, d = pow10(2 * n);
             d > 1; x = (x%d)/10, d /= 100) {
            if (x / d != x % 10) break;
        }
        if (d == 1 && x == c && is_prime(i)) {
            return i;
        }
    }
    return pow10(n * 2 + 1) - 1;
}


int main(void) {
    int n, c, i;
    while (scanf("%d%d", &n, &c) == 2 && n) {
        if (n < 10) {
            printf("%llu\n", find_number(n, c));
        }
        else {
            printf("%llu%llu\n", find_number(n / 2, c), find_number(n / 2, c));
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	pow10
	.type	pow10, @function
pow10:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	$1, -8(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, -8(%rbp)
.L2:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jne	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	pow10, .-pow10
	.globl	is_prime
	.type	is_prime, @function
is_prime:
.LFB7:
	.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	%rdi, -24(%rbp)
	movq	$3, -16(%rbp)
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	js	.L6
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	jmp	.L7
.L6:
	movq	%rax, %rdx
	shrq	%rdx
	andl	$1, %eax
	orq	%rax, %rdx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdx, %xmm0
	addsd	%xmm0, %xmm0
	movq	%xmm0, %rax
.L7:
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	.LC0(%rip), %xmm1
	addsd	%xmm1, %xmm0
	comisd	.LC1(%rip), %xmm0
	jnb	.L8
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	jmp	.L9
.L8:
	movsd	.LC1(%rip), %xmm1
	subsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movabsq	$-9223372036854775808, %rax
	xorq	%rax, -8(%rbp)
.L9:
	movq	-8(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L13:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	addq	$2, -16(%rbp)
.L10:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jb	.L13
	movl	$1, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	is_prime, .-is_prime
	.globl	find_number
	.type	find_number, @function
find_number:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	cmpl	$0, -40(%rbp)
	jns	.L15
	cmpl	$1, -36(%rbp)
	jne	.L16
	movl	$11, %eax
	jmp	.L17
.L16:
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
	jmp	.L17
.L15:
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	movq	%rax, -8(%rbp)
	jmp	.L18
.L24:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	movq	%rax, -16(%rbp)
	jmp	.L19
.L22:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rax, %rsi
	movq	-24(%rbp), %rcx
	movabsq	$-3689348814741910323, %rdx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$3, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpq	%rdx, %rsi
	jne	.L25
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rdx, %rax
	movabsq	$-3689348814741910323, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$3, %rax
	movq	%rax, -24(%rbp)
	movq	-16(%rbp), %rax
	shrq	$2, %rax
	movabsq	$2951479051793528259, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$2, %rax
	movq	%rax, -16(%rbp)
.L19:
	cmpq	$1, -16(%rbp)
	ja	.L22
	jmp	.L21
.L25:
	nop
.L21:
	cmpq	$1, -16(%rbp)
	jne	.L23
	movl	-40(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jne	.L23
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	is_prime
	testl	%eax, %eax
	je	.L23
	movq	-32(%rbp), %rax
	jmp	.L17
.L23:
	subq	$2, -32(%rbp)
.L18:
	movq	-32(%rbp), %rax
	cmpq	-8(%rbp), %rax
	ja	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	find_number, .-find_number
	.section	.rodata
.LC2:
	.string	"%llu\n"
.LC3:
	.string	"%llu%llu\n"
.LC4:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	jmp	.L27
.L30:
	movl	-32(%rbp), %eax
	cmpl	$9, %eax
	jg	.L28
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	find_number
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L27
.L28:
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	find_number
	movq	%rax, %rbx
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	find_number
	movq	%rbx, %rdx
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L27:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L29
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L30
.L29:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC1:
	.long	0
	.long	1138753536
	.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	pow10
	.type	pow10, @function
pow10:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	$1, -8(%rbp)
	jmp	.L2
.L3:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, -8(%rbp)
.L2:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jne	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	pow10, .-pow10
	.globl	is_prime
	.type	is_prime, @function
is_prime:
.LFB7:
	.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	%rdi, -24(%rbp)
	movq	$3, -16(%rbp)
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	js	.L6
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movq	%xmm2, %rax
	jmp	.L7
.L6:
	movq	%rax, %rdx
	shrq	%rdx
	andl	$1, %eax
	orq	%rax, %rdx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdx, %xmm0
	addsd	%xmm0, %xmm0
	movq	%xmm0, %rax
.L7:
	movq	%rax, %xmm0
	call	sqrt@PLT
	movsd	.LC0(%rip), %xmm1
	addsd	%xmm1, %xmm0
	comisd	.LC1(%rip), %xmm0
	jnb	.L8
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	jmp	.L9
.L8:
	movsd	.LC1(%rip), %xmm1
	subsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movabsq	$-9223372036854775808, %rax
	xorq	%rax, -8(%rbp)
.L9:
	movq	-8(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L13:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	addq	$2, -16(%rbp)
.L10:
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jb	.L13
	movl	$1, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	is_prime, .-is_prime
	.globl	find_number
	.type	find_number, @function
find_number:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	cmpl	$0, -40(%rbp)
	jns	.L15
	cmpl	$1, -36(%rbp)
	jne	.L16
	movl	$11, %eax
	jmp	.L17
.L16:
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
	jmp	.L17
.L15:
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	movq	%rax, -8(%rbp)
	jmp	.L18
.L24:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %edi
	call	pow10
	movq	%rax, -16(%rbp)
	jmp	.L19
.L22:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rax, %rsi
	movq	-24(%rbp), %rcx
	movabsq	$-3689348814741910323, %rdx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$3, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpq	%rdx, %rsi
	jne	.L25
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-16(%rbp)
	movq	%rdx, %rax
	movabsq	$-3689348814741910323, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$3, %rax
	movq	%rax, -24(%rbp)
	movq	-16(%rbp), %rax
	shrq	$2, %rax
	movabsq	$2951479051793528259, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$2, %rax
	movq	%rax, -16(%rbp)
.L19:
	cmpq	$1, -16(%rbp)
	ja	.L22
	jmp	.L21
.L25:
	nop
.L21:
	cmpq	$1, -16(%rbp)
	jne	.L23
	movl	-40(%rbp), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jne	.L23
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	is_prime
	testl	%eax, %eax
	je	.L23
	movq	-32(%rbp), %rax
	jmp	.L17
.L23:
	subq	$2, -32(%rbp)
.L18:
	movq	-32(%rbp), %rax
	cmpq	-8(%rbp), %rax
	ja	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	pow10
	subq	$1, %rax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	find_number, .-find_number
	.section	.rodata
.LC2:
	.string	"%llu\n"
.LC3:
	.string	"%llu%llu\n"
.LC4:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	jmp	.L27
.L30:
	movl	-32(%rbp), %eax
	cmpl	$9, %eax
	jg	.L28
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	find_number
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L27
.L28:
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	find_number
	movq	%rax, %rbx
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	find_number
	movq	%rbx, %rdx
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L27:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L29
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L30
.L29:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC1:
	.long	0
	.long	1138753536
	.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:
