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

```c
// AOJ 2039: Space Coconut Crab II
// 2017.11.6 bal4u@uu

#include <stdio.h>
#define TM 0
#if TM
#include <time.h>
#endif

#define MAX  30000
char tbl[MAX+1] = {1,1,0,0};		// zero: if prime
int p[3250] = {						// p[39] = 173 = sqrt(MAX), max sz = 3244
 2,   3,  5,  7, 11, 13, 17, 19, 23, 29, 
 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 
 73, 79, 83, 89, 97,101,103,107,109,113, 
127,131,137,139,149,151,157,163,167,173 }; int sz;

void mkprime()
{
	int i, j, k;
	for (i = 0; i <= 39; i++) {
		k = p[i];
		for (j = k<<1; j < MAX; j += k) tbl[j] = 1;
	}
	for (sz = 39, i = 173; i <= MAX; i += 2) if (!tbl[i]) p[sz++] = i;
}

int bsch(int x)
{
	int m, l = 0, r = sz;

    while (l < r) {
        m = (l + r) >> 1;
		if (p[m] == x) return m;
        if (p[m] < x) l = m + 1; else r = m;
    }
	return l-1;
}

int main()
{
	int t, i, j, k, m, n, ans;
#if TM
	clock_t start, end;
	start = clock();
#endif
	mkprime();
	while (scanf("%d", &t) && t > 0) {
		if (!(t & 1)) {
			k = (t>>1)-1;
			if (k > 2 && !(k & 1)) putchar('0');
			else                   putchar('1' - tbl[k]);
			putchar('\n');
		} else {
			ans = 0, m = t/3;
			for (i = 0; i <= m; i++) {
				n = bsch((t-p[i]) >> 1);
				for (j = i; j <= n; j++) {
					if ((k = p[i]+p[j]) >= t) continue;
					if ((k<<1) > t && !tbl[t-k] && t-k >= p[j]) ans++;
				}
			}
			printf("%d\n", ans);
		}
	}
#if TM
	end = clock();
	printf("time %lf\n", (double)(end-start)/CLOCKS_PER_SEC);
#endif
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 30001
tbl:
	.string	"\001\001"
	.string	""
	.string	""
	.zero	29996
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 13000
p:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.zero	12840
	.globl	sz
	.bss
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	mkprime
	.type	mkprime, @function
mkprime:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -12(%rbp)
	jmp	.L2
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L3:
	cmpl	$29999, -8(%rbp)
	jle	.L4
	addl	$1, -12(%rbp)
.L2:
	cmpl	$39, -12(%rbp)
	jle	.L5
	movl	$39, sz(%rip)
	movl	$173, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L7
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$2, -12(%rbp)
.L6:
	cmpl	$30000, -12(%rbp)
	jle	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mkprime, .-mkprime
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB1:
	.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)
	movl	$0, -12(%rbp)
	movl	sz(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L10
.L14:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L11
	movl	-4(%rbp), %eax
	jmp	.L12
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L13:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L14
	movl	-12(%rbp), %eax
	subl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bsch, .-bsch
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	mkprime
	jmp	.L16
.L27:
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L17
	movl	-36(%rbp), %eax
	sarl	%eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	cmpl	$2, -12(%rbp)
	jle	.L18
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L18
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L19
.L18:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %edx
	movl	$49, %eax
	subl	%edx, %eax
	movl	%eax, %edi
	call	putchar@PLT
.L19:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L16
.L17:
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L20
.L25:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	sarl	%eax
	movl	%eax, %edi
	call	bsch
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L21
.L24:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L30
	movl	-12(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L23
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L23
	addl	$1, -24(%rbp)
	jmp	.L23
.L30:
	nop
.L23:
	addl	$1, -28(%rbp)
.L21:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L24
	addl	$1, -32(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L25
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L26
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jg	.L27
.L26:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	mkprime
	.type	mkprime, @function
mkprime:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	tbl(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	2(%r12), %rcx
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	p(%rip), %rbx
	movq	%rbx, %r13
	leaq	160(%rbx), %rbp
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rcx, %rdi
	movl	$29998, %edx
	movl	$1, %esi
	call	memset@PLT
	movq	%rax, %rcx
.L7:
	addq	$4, %r13
	cmpq	%rbp, %r13
	je	.L21
.L3:
	movslq	0(%r13), %rdx
	leal	(%rdx,%rdx), %eax
	cmpl	$29999, %eax
	jg	.L7
	cmpl	$1, %edx
	je	.L5
	cltq
	.p2align 4,,10
	.p2align 3
.L6:
	movb	$1, (%r12,%rax)
	addq	%rdx, %rax
	cmpl	$29999, %eax
	jle	.L6
	addq	$4, %r13
	cmpq	%rbp, %r13
	jne	.L3
.L21:
	movl	$173, %eax
	xorl	%ecx, %ecx
	movl	$39, %edx
	movl	$39, sz(%rip)
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$0, (%r12,%rax)
	jne	.L9
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, (%rbx,%rcx,4)
	movl	$1, %ecx
.L9:
	addq	$2, %rax
	cmpq	$30001, %rax
	jne	.L10
	testb	%cl, %cl
	je	.L1
	movl	%edx, sz(%rip)
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	mkprime, .-mkprime
	.p2align 4
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB24:
	.cfi_startproc
	endbr64
	movl	sz(%rip), %edx
	xorl	%ecx, %ecx
	leaq	p(%rip), %r8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L26:
	leal	(%rcx,%rdx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	%edi, (%r8,%rsi,4)
	je	.L22
	jl	.L28
	movl	%eax, %edx
.L25:
	cmpl	%edx, %ecx
	jl	.L26
	leal	-1(%rcx), %eax
.L22:
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	leal	1(%rax), %ecx
	jmp	.L25
	.cfi_endproc
.LFE24:
	.size	bsch, .-bsch
	.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:
.LFB25:
	.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
	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
	leaq	tbl(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	p(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	mkprime
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L30:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L43
	movl	20(%rsp), %edi
	testl	%edi, %edi
	jle	.L43
	testb	$1, %dil
	jne	.L31
	sarl	%edi
	movq	stdout(%rip), %rsi
	subl	$1, %edi
	cmpl	$2, %edi
	jle	.L32
	testb	$1, %dil
	je	.L59
.L32:
	movslq	%edi, %rdi
	movsbl	0(%rbp,%rdi), %eax
	movl	$49, %edi
	subl	%eax, %edi
	call	putc@PLT
.L33:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L30
.L31:
	movslq	%edi, %r13
	movl	%edi, %eax
	movl	sz(%rip), %r15d
	xorl	%r10d, %r10d
	imulq	$1431655766, %r13, %r13
	sarl	$31, %eax
	leaq	p(%rip), %r11
	xorl	%r12d, %r12d
	shrq	$32, %r13
	subl	%eax, %r13d
	addl	$1, %r13d
	movslq	%r13d, %r13
	.p2align 4,,10
	.p2align 3
.L42:
	movl	(%r11), %ecx
	movl	%edi, %r9d
	movl	%r10d, %r8d
	movl	%r15d, %edx
	xorl	%esi, %esi
	subl	%ecx, %r9d
	sarl	%r9d
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L38:
	leal	(%rdx,%rsi), %eax
	sarl	%eax
	movslq	%eax, %r14
	cmpl	(%rbx,%r14,4), %r9d
	je	.L36
	jg	.L60
	movl	%eax, %edx
.L37:
	cmpl	%esi, %edx
	jg	.L38
	leal	-1(%rsi), %eax
.L36:
	cmpl	%r10d, %eax
	jl	.L39
	subl	%r8d, %eax
	leaq	4+p(%rip), %rsi
	addq	%r10, %rax
	leaq	(%rsi,%rax,4), %r9
	movq	%r11, %rax
	.p2align 4,,10
	.p2align 3
.L41:
	movl	(%rax), %esi
	leal	(%rcx,%rsi), %edx
	cmpl	%edx, %edi
	jle	.L40
	leal	(%rdx,%rdx), %r8d
	cmpl	%edi, %r8d
	jle	.L40
	movl	%edi, %r8d
	subl	%edx, %r8d
	movslq	%r8d, %rdx
	cmpb	$0, 0(%rbp,%rdx)
	jne	.L40
	cmpl	%r8d, %esi
	setle	%dl
	cmpb	$1, %dl
	sbbl	$-1, %r12d
.L40:
	addq	$4, %rax
	cmpq	%r9, %rax
	jne	.L41
.L39:
	addq	$1, %r10
	addq	$4, %r11
	cmpq	%r13, %r10
	jne	.L42
	movl	%r12d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L60:
	leal	1(%rax), %esi
	jmp	.L37
.L59:
	movl	$48, %edi
	call	putc@PLT
	jmp	.L33
.L43:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	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
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	sz
	.bss
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 13000
p:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.zero	12840
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 30001
tbl:
	.string	"\001\001"
	.string	""
	.string	""
	.zero	29996
	.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	mkprime
	.type	mkprime, @function
mkprime:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	tbl(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	2(%r12), %rcx
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	p(%rip), %rbx
	movq	%rbx, %r13
	leaq	160(%rbx), %rbp
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rcx, %rdi
	movl	$29998, %edx
	movl	$1, %esi
	call	memset@PLT
	movq	%rax, %rcx
.L7:
	addq	$4, %r13
	cmpq	%rbp, %r13
	je	.L21
.L3:
	movslq	0(%r13), %rdx
	leal	(%rdx,%rdx), %eax
	cmpl	$29999, %eax
	jg	.L7
	cmpl	$1, %edx
	je	.L5
	cltq
	.p2align 4,,10
	.p2align 3
.L6:
	movb	$1, (%r12,%rax)
	addq	%rdx, %rax
	cmpl	$29999, %eax
	jle	.L6
	addq	$4, %r13
	cmpq	%rbp, %r13
	jne	.L3
.L21:
	movl	$173, %eax
	xorl	%ecx, %ecx
	movl	$39, %edx
	movl	$39, sz(%rip)
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$0, (%r12,%rax)
	jne	.L9
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, (%rbx,%rcx,4)
	movl	$1, %ecx
.L9:
	addq	$2, %rax
	cmpq	$30001, %rax
	jne	.L10
	testb	%cl, %cl
	je	.L1
	movl	%edx, sz(%rip)
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	mkprime, .-mkprime
	.p2align 4
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB24:
	.cfi_startproc
	endbr64
	movl	sz(%rip), %edx
	xorl	%ecx, %ecx
	leaq	p(%rip), %r8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L26:
	leal	(%rcx,%rdx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	%edi, (%r8,%rsi,4)
	je	.L22
	jl	.L28
	movl	%eax, %edx
.L25:
	cmpl	%edx, %ecx
	jl	.L26
	leal	-1(%rcx), %eax
.L22:
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	leal	1(%rax), %ecx
	jmp	.L25
	.cfi_endproc
.LFE24:
	.size	bsch, .-bsch
	.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:
.LFB25:
	.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
	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
	leaq	tbl(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	p(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	call	mkprime
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L30:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L43
	movl	20(%rsp), %edi
	testl	%edi, %edi
	jle	.L43
	testb	$1, %dil
	jne	.L31
	sarl	%edi
	movq	stdout(%rip), %rsi
	subl	$1, %edi
	cmpl	$2, %edi
	jle	.L32
	testb	$1, %dil
	je	.L59
.L32:
	movslq	%edi, %rdi
	movsbl	0(%rbp,%rdi), %eax
	movl	$49, %edi
	subl	%eax, %edi
	call	putc@PLT
.L33:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L30
.L31:
	movslq	%edi, %r13
	movl	%edi, %eax
	movl	sz(%rip), %r15d
	xorl	%r10d, %r10d
	imulq	$1431655766, %r13, %r13
	sarl	$31, %eax
	leaq	p(%rip), %r11
	xorl	%r12d, %r12d
	shrq	$32, %r13
	subl	%eax, %r13d
	addl	$1, %r13d
	movslq	%r13d, %r13
	.p2align 4,,10
	.p2align 3
.L42:
	movl	(%r11), %ecx
	movl	%edi, %r9d
	movl	%r10d, %r8d
	movl	%r15d, %edx
	xorl	%esi, %esi
	subl	%ecx, %r9d
	sarl	%r9d
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L38:
	leal	(%rdx,%rsi), %eax
	sarl	%eax
	movslq	%eax, %r14
	cmpl	(%rbx,%r14,4), %r9d
	je	.L36
	jg	.L60
	movl	%eax, %edx
.L37:
	cmpl	%esi, %edx
	jg	.L38
	leal	-1(%rsi), %eax
.L36:
	cmpl	%r10d, %eax
	jl	.L39
	subl	%r8d, %eax
	leaq	4+p(%rip), %rsi
	addq	%r10, %rax
	leaq	(%rsi,%rax,4), %r9
	movq	%r11, %rax
	.p2align 4,,10
	.p2align 3
.L41:
	movl	(%rax), %esi
	leal	(%rcx,%rsi), %edx
	cmpl	%edx, %edi
	jle	.L40
	leal	(%rdx,%rdx), %r8d
	cmpl	%edi, %r8d
	jle	.L40
	movl	%edi, %r8d
	subl	%edx, %r8d
	movslq	%r8d, %rdx
	cmpb	$0, 0(%rbp,%rdx)
	jne	.L40
	cmpl	%r8d, %esi
	setle	%dl
	cmpb	$1, %dl
	sbbl	$-1, %r12d
.L40:
	addq	$4, %rax
	cmpq	%r9, %rax
	jne	.L41
.L39:
	addq	$1, %r10
	addq	$4, %r11
	cmpq	%r13, %r10
	jne	.L42
	movl	%r12d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L60:
	leal	1(%rax), %esi
	jmp	.L37
.L59:
	movl	$48, %edi
	call	putc@PLT
	jmp	.L33
.L43:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	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
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	sz
	.bss
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 13000
p:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.zero	12840
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 30001
tbl:
	.string	"\001\001"
	.string	""
	.string	""
	.zero	29996
	.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:

// AOJ 2039: Space Coconut Crab II
// 2017.11.6 bal4u@uu

#include <stdio.h>
#define TM 0
#if TM
#include <time.h>
#endif

#define MAX  30000
char tbl[MAX+1] = {1,1,0,0};		// zero: if prime
int p[3250] = {						// p[39] = 173 = sqrt(MAX), max sz = 3244
 2,   3,  5,  7, 11, 13, 17, 19, 23, 29, 
 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 
 73, 79, 83, 89, 97,101,103,107,109,113, 
127,131,137,139,149,151,157,163,167,173 }; int sz;

void mkprime()
{
	int i, j, k;
	for (i = 0; i <= 39; i++) {
		k = p[i];
		for (j = k<<1; j < MAX; j += k) tbl[j] = 1;
	}
	for (sz = 39, i = 173; i <= MAX; i += 2) if (!tbl[i]) p[sz++] = i;
}

int bsch(int x)
{
	int m, l = 0, r = sz;

    while (l < r) {
        m = (l + r) >> 1;
		if (p[m] == x) return m;
        if (p[m] < x) l = m + 1; else r = m;
    }
	return l-1;
}

int main()
{
	int t, i, j, k, m, n, ans;
#if TM
	clock_t start, end;
	start = clock();
#endif
	mkprime();
	while (scanf("%d", &t) && t > 0) {
		if (!(t & 1)) {
			k = (t>>1)-1;
			if (k > 2 && !(k & 1)) putchar('0');
			else                   putchar('1' - tbl[k]);
			putchar('\n');
		} else {
			ans = 0, m = t/3;
			for (i = 0; i <= m; i++) {
				n = bsch((t-p[i]) >> 1);
				for (j = i; j <= n; j++) {
					if ((k = p[i]+p[j]) >= t) continue;
					if ((k<<1) > t && !tbl[t-k] && t-k >= p[j]) ans++;
				}
			}
			printf("%d\n", ans);
		}
	}
#if TM
	end = clock();
	printf("time %lf\n", (double)(end-start)/CLOCKS_PER_SEC);
#endif
	return 0;
}
10
12
15
777
7180
5000
0
 10
2
15
777
7180
5000
0
 10
1
15
149
7180
5000
0
 10
1
15
149
7180
2901
0
 10
1
15
149
7180
6275
0
 10
1
15
149
7180
10757
0
 10
1
42
149
7180
2924
0
 10
1
42
149
635
3334
0
 10
12
15
777
4999
232
0
 10
12
15
1177
7180
5000
0

0
1
2
110
0
0
 0
0
2
110
0
0
 0
0
2
20
0
0
 0
0
2
20
0
791
 0
0
2
20
0
4041
 0
0
2
20
0
9902
 0
0
0
20
0
0
 0
0
0
20
133
0
 0
1
2
110
2780
0
 0
1
2
277
0
0

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

```c
// AOJ 2039: Space Coconut Crab II
// 2017.11.6 bal4u@uu

#include <stdio.h>
#define TM 0
#if TM
#include <time.h>
#endif

#define MAX  30000
char tbl[MAX+1] = {1,1,0,0};		// zero: if prime
int p[3250] = {						// p[39] = 173 = sqrt(MAX), max sz = 3244
 2,   3,  5,  7, 11, 13, 17, 19, 23, 29, 
 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 
 73, 79, 83, 89, 97,101,103,107,109,113, 
127,131,137,139,149,151,157,163,167,173 }; int sz;

void mkprime()
{
	int i, j, k;
	for (i = 0; i <= 39; i++) {
		k = p[i];
		for (j = k<<1; j < MAX; j += k) tbl[j] = 1;
	}
	for (sz = 39, i = 173; i <= MAX; i += 2) if (!tbl[i]) p[sz++] = i;
}

int bsch(int x)
{
	int m, l = 0, r = sz;

    while (l < r) {
        m = (l + r) >> 1;
		if (p[m] == x) return m;
        if (p[m] < x) l = m + 1; else r = m;
    }
	return l-1;
}

int main()
{
	int t, i, j, k, m, n, ans;
#if TM
	clock_t start, end;
	start = clock();
#endif
	mkprime();
	while (scanf("%d", &t) && t > 0) {
		if (!(t & 1)) {
			k = (t>>1)-1;
			if (k > 2 && !(k & 1)) putchar('0');
			else                   putchar('1' - tbl[k]);
			putchar('\n');
		} else {
			ans = 0, m = t/3;
			for (i = 0; i <= m; i++) {
				n = bsch((t-p[i]) >> 1);
				for (j = i; j <= n; j++) {
					if ((k = p[i]+p[j]) >= t) continue;
					if ((k<<1) > t && !tbl[t-k] && t-k >= p[j]) ans++;
				}
			}
			printf("%d\n", ans);
		}
	}
#if TM
	end = clock();
	printf("time %lf\n", (double)(end-start)/CLOCKS_PER_SEC);
#endif
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 30001
tbl:
	.string	"\001\001"
	.string	""
	.string	""
	.zero	29996
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 13000
p:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.zero	12840
	.globl	sz
	.bss
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	mkprime
	.type	mkprime, @function
mkprime:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -12(%rbp)
	jmp	.L2
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L3:
	cmpl	$29999, -8(%rbp)
	jle	.L4
	addl	$1, -12(%rbp)
.L2:
	cmpl	$39, -12(%rbp)
	jle	.L5
	movl	$39, sz(%rip)
	movl	$173, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L7
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$2, -12(%rbp)
.L6:
	cmpl	$30000, -12(%rbp)
	jle	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mkprime, .-mkprime
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB1:
	.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)
	movl	$0, -12(%rbp)
	movl	sz(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L10
.L14:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L11
	movl	-4(%rbp), %eax
	jmp	.L12
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L13:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L14
	movl	-12(%rbp), %eax
	subl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bsch, .-bsch
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	mkprime
	jmp	.L16
.L27:
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L17
	movl	-36(%rbp), %eax
	sarl	%eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	cmpl	$2, -12(%rbp)
	jle	.L18
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L18
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L19
.L18:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %edx
	movl	$49, %eax
	subl	%edx, %eax
	movl	%eax, %edi
	call	putchar@PLT
.L19:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L16
.L17:
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L20
.L25:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	sarl	%eax
	movl	%eax, %edi
	call	bsch
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L21
.L24:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L30
	movl	-12(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L23
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L23
	addl	$1, -24(%rbp)
	jmp	.L23
.L30:
	nop
.L23:
	addl	$1, -28(%rbp)
.L21:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L24
	addl	$1, -32(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L25
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L26
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jg	.L27
.L26:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 30001
tbl:
	.string	"\001\001"
	.string	""
	.string	""
	.zero	29996
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 13000
p:
	.long	2
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.zero	12840
	.globl	sz
	.bss
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	mkprime
	.type	mkprime, @function
mkprime:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -12(%rbp)
	jmp	.L2
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L3:
	cmpl	$29999, -8(%rbp)
	jle	.L4
	addl	$1, -12(%rbp)
.L2:
	cmpl	$39, -12(%rbp)
	jle	.L5
	movl	$39, sz(%rip)
	movl	$173, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L7
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$2, -12(%rbp)
.L6:
	cmpl	$30000, -12(%rbp)
	jle	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	mkprime, .-mkprime
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB1:
	.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)
	movl	$0, -12(%rbp)
	movl	sz(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L10
.L14:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L11
	movl	-4(%rbp), %eax
	jmp	.L12
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L13:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L14
	movl	-12(%rbp), %eax
	subl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bsch, .-bsch
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	mkprime
	jmp	.L16
.L27:
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L17
	movl	-36(%rbp), %eax
	sarl	%eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	cmpl	$2, -12(%rbp)
	jle	.L18
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L18
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L19
.L18:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %edx
	movl	$49, %eax
	subl	%edx, %eax
	movl	%eax, %edi
	call	putchar@PLT
.L19:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L16
.L17:
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L20
.L25:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	sarl	%eax
	movl	%eax, %edi
	call	bsch
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L21
.L24:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L30
	movl	-12(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L23
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L23
	addl	$1, -24(%rbp)
	jmp	.L23
.L30:
	nop
.L23:
	addl	$1, -28(%rbp)
.L21:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L24
	addl	$1, -32(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L25
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L26
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jg	.L27
.L26:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
