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

```c
/*
AizuOnline A1276
Title Prime Gap
*/
#include <stdio.h>
#define PRIME_10MANTH 1299709
#define SQRT_PRIME_10MANTH 1140
#define SQRT_SQRT_PRIME_10MANTH 31

int N;

char prime_f[1299709];

//

int prime_table[]={2,3,5,7,11,13,17,19,23,29,31};
// up to sqrt(sqrt(PRIME_10MANTH))

int isprime(int n)
{
  return(prime_f[n]);
}



void make_furui()
{
  int i,j,p;

  prime_f[0]=prime_f[1]=0;
  for(i=0;i<=SQRT_PRIME_10MANTH;i++)
    prime_f[i]=1;
  for(i=0;i<sizeof(prime_table)/sizeof(int);i++)
    {
      p = prime_table[i];
      prime_f[p]=1;
      for(j=2;prime_table[i]*j<SQRT_PRIME_10MANTH;j++)
	prime_f[p*j]=0;
    }
  //printf("*\n");
}
int next_prime(int x,int limit)
{
        for(++x;x<=limit;x++)
                if(isprime(x))
                        return(x);
        return(0);  // no more prime number
}
void make_furui2()
{
  int i,j,p;

  for(i=SQRT_PRIME_10MANTH;i<=PRIME_10MANTH;i++)
          prime_f[i]=1;
  p=1;
  while(p=next_prime(p,SQRT_PRIME_10MANTH))
  {
          //printf("*%d\n",p);

          prime_f[p]=1;
          for(j=2;p*j<PRIME_10MANTH;j++)
                  prime_f[p*j]=0;
  }
  //printf("*\n");
}

int solve(int N)
{
        int i,j;

        if(isprime(N))
                return(0);
        i=N;
        while(!isprime(i))
                i++;
        j=N;
        while(!isprime(j))
                j--;
        return(i-j);
}
main()
{
        int ret;

        make_furui();
        make_furui2();

        while(EOF!=scanf("%d",&N) && N)
        {
                ret=solve(N);
                printf("%d\n",ret);
        }

return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	prime_f
	.align 32
	.type	prime_f, @object
	.size	prime_f, 1299709
prime_f:
	.zero	1299709
	.globl	prime_table
	.data
	.align 32
	.type	prime_table, @object
	.size	prime_table, 44
prime_table:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.text
	.globl	isprime
	.type	isprime, @function
isprime:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isprime, .-isprime
	.globl	make_furui
	.type	make_furui, @function
make_furui:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movb	$0, 1+prime_f(%rip)
	movzbl	1+prime_f(%rip), %eax
	movb	%al, prime_f(%rip)
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -12(%rbp)
.L4:
	cmpl	$1140, -12(%rbp)
	jle	.L5
	movl	$0, -12(%rbp)
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	prime_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$2, -8(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	prime_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-8(%rbp), %eax
	cmpl	$1139, %eax
	jle	.L8
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	$10, %eax
	jbe	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	make_furui, .-make_furui
	.globl	next_prime
	.type	next_prime, @function
next_prime:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	addl	$1, -4(%rbp)
	jmp	.L11
.L14:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	jmp	.L13
.L12:
	addl	$1, -4(%rbp)
.L11:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L14
	movl	$0, %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	next_prime, .-next_prime
	.globl	make_furui2
	.type	make_furui2, @function
make_furui2:
.LFB3:
	.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	$1140, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -12(%rbp)
.L16:
	cmpl	$1299709, -12(%rbp)
	jle	.L17
	movl	$1, -4(%rbp)
	jmp	.L18
.L21:
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$2, -8(%rbp)
	jmp	.L19
.L20:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L19:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cmpl	$1299708, %eax
	jle	.L20
.L18:
	movl	-4(%rbp), %eax
	movl	$1140, %esi
	movl	%eax, %edi
	call	next_prime
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L21
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	make_furui2, .-make_furui2
	.globl	solve
	.type	solve, @function
solve:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L23
	movl	$0, %eax
	jmp	.L24
.L23:
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L25
.L26:
	addl	$1, -8(%rbp)
.L25:
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L26
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L27
.L28:
	subl	$1, -4(%rbp)
.L27:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L28
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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	$0, %eax
	call	make_furui
	movl	$0, %eax
	call	make_furui2
	jmp	.L30
.L32:
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	solve
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L30:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L31
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L32
.L31:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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	isprime
	.type	isprime, @function
isprime:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	prime_f(%rip), %rax
	movsbl	(%rax,%rdi), %eax
	ret
	.cfi_endproc
.LFE23:
	.size	isprime, .-isprime
	.p2align 4
	.globl	make_furui
	.type	make_furui, @function
make_furui:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	prime_f(%rip), %rsi
	movl	$142, %ecx
	movabsq	$72340172838076673, %rax
	movq	%rsi, %rdi
	rep stosq
	movl	$16843009, (%rdi)
	leaq	prime_table(%rip), %rdi
	movb	$1, 1140+prime_f(%rip)
	leaq	44(%rdi), %r10
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	(%rdi), %r9
	leal	(%r9,%r9), %ecx
	movb	$1, (%rsi,%r9)
	cmpl	$1139, %ecx
	jg	.L4
	movl	$2, %edx
	movl	$2, %eax
	cmpl	$1, %r9d
	je	.L5
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %edx
.L5:
	cltq
	movb	$0, (%rsi,%rax)
	leal	1(%rdx), %eax
	cmpl	$1139, %edx
	jne	.L9
.L4:
	addq	$4, %rdi
	cmpq	%r10, %rdi
	jne	.L7
.L15:
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movb	$0, (%rsi,%rax)
	addq	%r9, %rax
	cmpl	$1139, %eax
	jle	.L6
	addq	$4, %rdi
	cmpq	%r10, %rdi
	jne	.L7
	jmp	.L15
	.cfi_endproc
.LFE24:
	.size	make_furui, .-make_furui
	.p2align 4
	.globl	next_prime
	.type	next_prime, @function
next_prime:
.LFB25:
	.cfi_startproc
	endbr64
	addl	$1, %edi
	cmpl	%esi, %edi
	jg	.L19
	movslq	%edi, %rdi
	leaq	prime_f(%rip), %rdx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$1, %rdi
	cmpl	%edi, %esi
	jl	.L19
.L18:
	cmpb	$0, (%rdx,%rdi)
	movl	%edi, %eax
	je	.L21
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	next_prime, .-next_prime
	.p2align 4
	.globl	make_furui2
	.type	make_furui2, @function
make_furui2:
.LFB26:
	.cfi_startproc
	endbr64
	movl	$1, %esi
	leaq	1140+prime_f(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$1298570, %edx
	call	memset@PLT
	movl	$4, %esi
	movl	$2, %eax
	movl	$2, %ecx
	leaq	prime_f(%rip), %rdi
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L36:
	addq	$1, %rax
	addq	$2, %rsi
.L23:
	addl	$1, %ecx
	cmpb	$0, (%rdi,%rax)
	jne	.L26
.L28:
	cmpl	$1141, %ecx
	jne	.L36
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	movb	$1, (%rdi,%rax)
	movq	%rsi, %rdx
	cmpq	$1299708, %rsi
	ja	.L28
	.p2align 4,,10
	.p2align 3
.L24:
	movb	$0, (%rdi,%rdx)
	addq	%rax, %rdx
	cmpl	$1299708, %edx
	jle	.L24
	jmp	.L28
	.cfi_endproc
.LFE26:
	.size	make_furui2, .-make_furui2
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB27:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdx
	leaq	prime_f(%rip), %rcx
	xorl	%eax, %eax
	cmpb	$0, (%rcx,%rdx)
	jne	.L37
	leal	1(%rdi), %edx
	subq	$1, %rcx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%edx, %eax
	addq	$1, %rdx
	cmpb	$0, (%rcx,%rdx)
	je	.L39
	subl	$1, %edi
	leaq	1+prime_f(%rip), %rsi
	movslq	%edi, %rdx
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%edx, %ecx
	subq	$1, %rdx
	cmpb	$0, (%rsi,%rdx)
	je	.L40
	subl	%ecx, %eax
.L37:
	ret
	.cfi_endproc
.LFE27:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	prime_f(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-1(%r13), %r15
	leaq	1(%r13), %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %r12
	leaq	N(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	make_furui
	xorl	%eax, %eax
	call	make_furui2
	.p2align 4,,10
	.p2align 3
.L45:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L49
	movl	N(%rip), %eax
	testl	%eax, %eax
	je	.L49
	movslq	%eax, %rcx
	xorl	%edx, %edx
	cmpb	$0, 0(%r13,%rcx)
	jne	.L46
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%ecx, %edx
	addq	$1, %rcx
	cmpb	$0, (%r15,%rcx)
	je	.L47
	subl	$1, %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%eax, %ecx
	subq	$1, %rax
	cmpb	$0, (%r14,%rax)
	je	.L48
	subl	%ecx, %edx
.L46:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L49:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	prime_table
	.data
	.align 32
	.type	prime_table, @object
	.size	prime_table, 44
prime_table:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.globl	prime_f
	.bss
	.align 32
	.type	prime_f, @object
	.size	prime_f, 1299709
prime_f:
	.zero	1299709
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	isprime
	.type	isprime, @function
isprime:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	prime_f(%rip), %rax
	movsbl	(%rax,%rdi), %eax
	ret
	.cfi_endproc
.LFE23:
	.size	isprime, .-isprime
	.p2align 4
	.globl	make_furui
	.type	make_furui, @function
make_furui:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	prime_f(%rip), %rsi
	movl	$142, %ecx
	movabsq	$72340172838076673, %rax
	movq	%rsi, %rdi
	rep stosq
	movl	$16843009, (%rdi)
	leaq	prime_table(%rip), %rdi
	movb	$1, 1140+prime_f(%rip)
	leaq	44(%rdi), %r10
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	(%rdi), %r9
	leal	(%r9,%r9), %ecx
	movb	$1, (%rsi,%r9)
	cmpl	$1139, %ecx
	jg	.L4
	movl	$2, %edx
	movl	$2, %eax
	cmpl	$1, %r9d
	je	.L5
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %edx
.L5:
	cltq
	movb	$0, (%rsi,%rax)
	leal	1(%rdx), %eax
	cmpl	$1139, %edx
	jne	.L9
.L4:
	addq	$4, %rdi
	cmpq	%r10, %rdi
	jne	.L7
.L15:
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movb	$0, (%rsi,%rax)
	addq	%r9, %rax
	cmpl	$1139, %eax
	jle	.L6
	addq	$4, %rdi
	cmpq	%r10, %rdi
	jne	.L7
	jmp	.L15
	.cfi_endproc
.LFE24:
	.size	make_furui, .-make_furui
	.p2align 4
	.globl	next_prime
	.type	next_prime, @function
next_prime:
.LFB25:
	.cfi_startproc
	endbr64
	addl	$1, %edi
	cmpl	%esi, %edi
	jg	.L19
	movslq	%edi, %rdi
	leaq	prime_f(%rip), %rdx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$1, %rdi
	cmpl	%edi, %esi
	jl	.L19
.L18:
	cmpb	$0, (%rdx,%rdi)
	movl	%edi, %eax
	je	.L21
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	next_prime, .-next_prime
	.p2align 4
	.globl	make_furui2
	.type	make_furui2, @function
make_furui2:
.LFB26:
	.cfi_startproc
	endbr64
	movl	$1, %esi
	leaq	1140+prime_f(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$1298570, %edx
	call	memset@PLT
	movl	$4, %esi
	movl	$2, %eax
	movl	$2, %ecx
	leaq	prime_f(%rip), %rdi
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L36:
	addq	$1, %rax
	addq	$2, %rsi
.L23:
	addl	$1, %ecx
	cmpb	$0, (%rdi,%rax)
	jne	.L26
.L28:
	cmpl	$1141, %ecx
	jne	.L36
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	movb	$1, (%rdi,%rax)
	movq	%rsi, %rdx
	cmpq	$1299708, %rsi
	ja	.L28
	.p2align 4,,10
	.p2align 3
.L24:
	movb	$0, (%rdi,%rdx)
	addq	%rax, %rdx
	cmpl	$1299708, %edx
	jle	.L24
	jmp	.L28
	.cfi_endproc
.LFE26:
	.size	make_furui2, .-make_furui2
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB27:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdx
	leaq	prime_f(%rip), %rcx
	xorl	%eax, %eax
	cmpb	$0, (%rcx,%rdx)
	jne	.L37
	leal	1(%rdi), %edx
	subq	$1, %rcx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%edx, %eax
	addq	$1, %rdx
	cmpb	$0, (%rcx,%rdx)
	je	.L39
	subl	$1, %edi
	leaq	1+prime_f(%rip), %rsi
	movslq	%edi, %rdx
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%edx, %ecx
	subq	$1, %rdx
	cmpb	$0, (%rsi,%rdx)
	je	.L40
	subl	%ecx, %eax
.L37:
	ret
	.cfi_endproc
.LFE27:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	prime_f(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-1(%r13), %r15
	leaq	1(%r13), %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %r12
	leaq	N(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	make_furui
	xorl	%eax, %eax
	call	make_furui2
	.p2align 4,,10
	.p2align 3
.L45:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L49
	movl	N(%rip), %eax
	testl	%eax, %eax
	je	.L49
	movslq	%eax, %rcx
	xorl	%edx, %edx
	cmpb	$0, 0(%r13,%rcx)
	jne	.L46
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%ecx, %edx
	addq	$1, %rcx
	cmpb	$0, (%r15,%rcx)
	je	.L47
	subl	$1, %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%eax, %ecx
	subq	$1, %rax
	cmpb	$0, (%r14,%rax)
	je	.L48
	subl	%ecx, %edx
.L46:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L49:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	prime_table
	.data
	.align 32
	.type	prime_table, @object
	.size	prime_table, 44
prime_table:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.globl	prime_f
	.bss
	.align 32
	.type	prime_f, @object
	.size	prime_f, 1299709
prime_f:
	.zero	1299709
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

/*
AizuOnline A1276
Title Prime Gap
*/
#include <stdio.h>
#define PRIME_10MANTH 1299709
#define SQRT_PRIME_10MANTH 1140
#define SQRT_SQRT_PRIME_10MANTH 31

int N;

char prime_f[1299709];

//

int prime_table[]={2,3,5,7,11,13,17,19,23,29,31};
// up to sqrt(sqrt(PRIME_10MANTH))

int isprime(int n)
{
  return(prime_f[n]);
}



void make_furui()
{
  int i,j,p;

  prime_f[0]=prime_f[1]=0;
  for(i=0;i<=SQRT_PRIME_10MANTH;i++)
    prime_f[i]=1;
  for(i=0;i<sizeof(prime_table)/sizeof(int);i++)
    {
      p = prime_table[i];
      prime_f[p]=1;
      for(j=2;prime_table[i]*j<SQRT_PRIME_10MANTH;j++)
	prime_f[p*j]=0;
    }
  //printf("*\n");
}
int next_prime(int x,int limit)
{
        for(++x;x<=limit;x++)
                if(isprime(x))
                        return(x);
        return(0);  // no more prime number
}
void make_furui2()
{
  int i,j,p;

  for(i=SQRT_PRIME_10MANTH;i<=PRIME_10MANTH;i++)
          prime_f[i]=1;
  p=1;
  while(p=next_prime(p,SQRT_PRIME_10MANTH))
  {
          //printf("*%d\n",p);

          prime_f[p]=1;
          for(j=2;p*j<PRIME_10MANTH;j++)
                  prime_f[p*j]=0;
  }
  //printf("*\n");
}

int solve(int N)
{
        int i,j;

        if(isprime(N))
                return(0);
        i=N;
        while(!isprime(i))
                i++;
        j=N;
        while(!isprime(j))
                j--;
        return(i-j);
}
main()
{
        int ret;

        make_furui();
        make_furui2();

        while(EOF!=scanf("%d",&N) && N)
        {
                ret=solve(N);
                printf("%d\n",ret);
        }

return(0);
}
10
11
27
2
296421
0
 10
11
27
2
338424
0
 10
11
27
2
525306
0
 10
11
27
2
245198
0
 10
11
27
2
199792
0
 10
11
47
2
199792
0
 10
15
55
2
199792
0
 10
15
55
2
76071
0
 10
11
53
2
338424
0
 10
0
27
2
199792
0

4
0
6
0
60
 4
0
6
0
8
 4
0
6
0
14
 4
0
6
0
26
 4
0
6
0
16
 4
0
0
0
16
 4
4
6
0
16
 4
4
6
0
40
 4
0
0
0
8
 4

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

```c
/*
AizuOnline A1276
Title Prime Gap
*/
#include <stdio.h>
#define PRIME_10MANTH 1299709
#define SQRT_PRIME_10MANTH 1140
#define SQRT_SQRT_PRIME_10MANTH 31

int N;

char prime_f[1299709];

//

int prime_table[]={2,3,5,7,11,13,17,19,23,29,31};
// up to sqrt(sqrt(PRIME_10MANTH))

int isprime(int n)
{
  return(prime_f[n]);
}



void make_furui()
{
  int i,j,p;

  prime_f[0]=prime_f[1]=0;
  for(i=0;i<=SQRT_PRIME_10MANTH;i++)
    prime_f[i]=1;
  for(i=0;i<sizeof(prime_table)/sizeof(int);i++)
    {
      p = prime_table[i];
      prime_f[p]=1;
      for(j=2;prime_table[i]*j<SQRT_PRIME_10MANTH;j++)
	prime_f[p*j]=0;
    }
  //printf("*\n");
}
int next_prime(int x,int limit)
{
        for(++x;x<=limit;x++)
                if(isprime(x))
                        return(x);
        return(0);  // no more prime number
}
void make_furui2()
{
  int i,j,p;

  for(i=SQRT_PRIME_10MANTH;i<=PRIME_10MANTH;i++)
          prime_f[i]=1;
  p=1;
  while(p=next_prime(p,SQRT_PRIME_10MANTH))
  {
          //printf("*%d\n",p);

          prime_f[p]=1;
          for(j=2;p*j<PRIME_10MANTH;j++)
                  prime_f[p*j]=0;
  }
  //printf("*\n");
}

int solve(int N)
{
        int i,j;

        if(isprime(N))
                return(0);
        i=N;
        while(!isprime(i))
                i++;
        j=N;
        while(!isprime(j))
                j--;
        return(i-j);
}
main()
{
        int ret;

        make_furui();
        make_furui2();

        while(EOF!=scanf("%d",&N) && N)
        {
                ret=solve(N);
                printf("%d\n",ret);
        }

return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	prime_f
	.align 32
	.type	prime_f, @object
	.size	prime_f, 1299709
prime_f:
	.zero	1299709
	.globl	prime_table
	.data
	.align 32
	.type	prime_table, @object
	.size	prime_table, 44
prime_table:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.text
	.globl	isprime
	.type	isprime, @function
isprime:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isprime, .-isprime
	.globl	make_furui
	.type	make_furui, @function
make_furui:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movb	$0, 1+prime_f(%rip)
	movzbl	1+prime_f(%rip), %eax
	movb	%al, prime_f(%rip)
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -12(%rbp)
.L4:
	cmpl	$1140, -12(%rbp)
	jle	.L5
	movl	$0, -12(%rbp)
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	prime_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$2, -8(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	prime_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-8(%rbp), %eax
	cmpl	$1139, %eax
	jle	.L8
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	$10, %eax
	jbe	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	make_furui, .-make_furui
	.globl	next_prime
	.type	next_prime, @function
next_prime:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	addl	$1, -4(%rbp)
	jmp	.L11
.L14:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	jmp	.L13
.L12:
	addl	$1, -4(%rbp)
.L11:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L14
	movl	$0, %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	next_prime, .-next_prime
	.globl	make_furui2
	.type	make_furui2, @function
make_furui2:
.LFB3:
	.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	$1140, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -12(%rbp)
.L16:
	cmpl	$1299709, -12(%rbp)
	jle	.L17
	movl	$1, -4(%rbp)
	jmp	.L18
.L21:
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$2, -8(%rbp)
	jmp	.L19
.L20:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L19:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cmpl	$1299708, %eax
	jle	.L20
.L18:
	movl	-4(%rbp), %eax
	movl	$1140, %esi
	movl	%eax, %edi
	call	next_prime
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L21
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	make_furui2, .-make_furui2
	.globl	solve
	.type	solve, @function
solve:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L23
	movl	$0, %eax
	jmp	.L24
.L23:
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L25
.L26:
	addl	$1, -8(%rbp)
.L25:
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L26
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L27
.L28:
	subl	$1, -4(%rbp)
.L27:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L28
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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	$0, %eax
	call	make_furui
	movl	$0, %eax
	call	make_furui2
	jmp	.L30
.L32:
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	solve
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L30:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L31
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L32
.L31:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	prime_f
	.align 32
	.type	prime_f, @object
	.size	prime_f, 1299709
prime_f:
	.zero	1299709
	.globl	prime_table
	.data
	.align 32
	.type	prime_table, @object
	.size	prime_table, 44
prime_table:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.text
	.globl	isprime
	.type	isprime, @function
isprime:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isprime, .-isprime
	.globl	make_furui
	.type	make_furui, @function
make_furui:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movb	$0, 1+prime_f(%rip)
	movzbl	1+prime_f(%rip), %eax
	movb	%al, prime_f(%rip)
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -12(%rbp)
.L4:
	cmpl	$1140, -12(%rbp)
	jle	.L5
	movl	$0, -12(%rbp)
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	prime_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$2, -8(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	prime_table(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-8(%rbp), %eax
	cmpl	$1139, %eax
	jle	.L8
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	$10, %eax
	jbe	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	make_furui, .-make_furui
	.globl	next_prime
	.type	next_prime, @function
next_prime:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	addl	$1, -4(%rbp)
	jmp	.L11
.L14:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L12
	movl	-4(%rbp), %eax
	jmp	.L13
.L12:
	addl	$1, -4(%rbp)
.L11:
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L14
	movl	$0, %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	next_prime, .-next_prime
	.globl	make_furui2
	.type	make_furui2, @function
make_furui2:
.LFB3:
	.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	$1140, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -12(%rbp)
.L16:
	cmpl	$1299709, -12(%rbp)
	jle	.L17
	movl	$1, -4(%rbp)
	jmp	.L18
.L21:
	movl	-4(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	$2, -8(%rbp)
	jmp	.L19
.L20:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cltq
	leaq	prime_f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L19:
	movl	-4(%rbp), %eax
	imull	-8(%rbp), %eax
	cmpl	$1299708, %eax
	jle	.L20
.L18:
	movl	-4(%rbp), %eax
	movl	$1140, %esi
	movl	%eax, %edi
	call	next_prime
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L21
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	make_furui2, .-make_furui2
	.globl	solve
	.type	solve, @function
solve:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L23
	movl	$0, %eax
	jmp	.L24
.L23:
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L25
.L26:
	addl	$1, -8(%rbp)
.L25:
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L26
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L27
.L28:
	subl	$1, -4(%rbp)
.L27:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isprime
	testl	%eax, %eax
	je	.L28
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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	$0, %eax
	call	make_furui
	movl	$0, %eax
	call	make_furui2
	jmp	.L30
.L32:
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	solve
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L30:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L31
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L32
.L31:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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:
