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>          // printf(), scanf()
#include <stdbool.h>

#define MAX_N 50000
#define MAX_SQRT_N 224
#define MAX_P 5140

bool f[MAX_N + 1];
int count[MAX_N + 1];
int primes[MAX_P];
int np;

int
main(int argc, char **argv)
{
	int i, j;

	for (i = 0; i <= MAX_N; ++i)
		f[i] = true;

	np = 0;
	for (i = 2; i <= MAX_N; ++i)
	{
		if (f[i])
		{
			primes[np++] = i;
			if (i <= MAX_SQRT_N)
			{
				for (j = i + i; j <= MAX_N; j += i)
					f[j] = false;
			}
		}
	}

	for (i = 0; primes[i] <= MAX_N / 2; ++i)
	{
		for (j = i; primes[i] + primes[j] <= MAX_N; ++j)
			count[primes[i] + primes[j]]++;
	}

	while (true)
	{
		int n;
		scanf("%d", &n);
		if (n == 0)
			break;

		printf("%d\n", count[n]);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	f
	.bss
	.align 32
	.type	f, @object
	.size	f, 50001
f:
	.zero	50001
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 200004
count:
	.zero	200004
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 20560
primes:
	.zero	20560
	.globl	np
	.align 4
	.type	np, @object
	.size	np, 4
np:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -16(%rbp)
.L2:
	cmpl	$50000, -16(%rbp)
	jle	.L3
	movl	$0, np(%rip)
	movl	$2, -16(%rbp)
	jmp	.L4
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L5
	movl	np(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, np(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	primes(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	cmpl	$224, -16(%rbp)
	jg	.L5
	movl	-16(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
.L6:
	cmpl	$50000, -12(%rbp)
	jle	.L7
.L5:
	addl	$1, -16(%rbp)
.L4:
	cmpl	$50000, -16(%rbp)
	jle	.L8
	movl	$0, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	count(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	count(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	cmpl	$50000, %eax
	jle	.L11
	addl	$1, -16(%rbp)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$25000, %eax
	jle	.L12
.L15:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	jmp	.L17
.L13:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	count(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L17:
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$50001, %edx
	movl	$1, %esi
	leaq	f(%rip), %r8
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r8, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	memset@PLT
	movl	$4, %edi
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	movq	%rax, %r8
	movl	$3, %edx
	movl	$0, np(%rip)
	movl	$2, %eax
	leaq	primes(%rip), %r11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %edx
	addq	$2, %rdi
	addq	$1, %rax
.L6:
	movzbl	(%r8,%rax), %esi
	testb	%sil, %sil
	je	.L2
	movl	%eax, (%r11,%rcx,4)
	leal	1(%rcx), %r9d
	cmpq	$224, %rax
	jbe	.L28
	movl	%esi, %r10d
	movslq	%r9d, %rcx
.L2:
	cmpl	$50001, %edx
	jne	.L4
	testb	%r10b, %r10b
	je	.L7
	movl	%ecx, np(%rip)
.L7:
	movl	primes(%rip), %esi
	leaq	primes(%rip), %rdi
	leaq	count(%rip), %rcx
	cmpl	$25000, %esi
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdi), %eax
	movq	%rdi, %rdx
	addl	%esi, %eax
	cmpl	$50000, %eax
	jg	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	cltq
	addq	$4, %rdx
	addl	$1, (%rcx,%rax,4)
	movl	(%rdx), %eax
	addl	%esi, %eax
	cmpl	$50000, %eax
	jle	.L10
.L11:
	movl	4(%rdi), %esi
	addq	$4, %rdi
	cmpl	$25000, %esi
	jle	.L9
.L8:
	leaq	4(%rsp), %rbp
	leaq	.LC0(%rip), %rbx
	leaq	count(%rip), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	movl	0(%r13,%rax,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L29
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L28:
	.cfi_restore_state
	movq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$0, (%r8,%rcx)
	addq	%rax, %rcx
	cmpl	$50000, %ecx
	jle	.L3
	movl	%esi, %r10d
	movslq	%r9d, %rcx
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	np
	.bss
	.align 4
	.type	np, @object
	.size	np, 4
np:
	.zero	4
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 20560
primes:
	.zero	20560
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 200004
count:
	.zero	200004
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 50001
f:
	.zero	50001
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$50001, %edx
	movl	$1, %esi
	leaq	f(%rip), %r8
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r8, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	memset@PLT
	movl	$4, %edi
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	movq	%rax, %r8
	movl	$3, %edx
	movl	$0, np(%rip)
	movl	$2, %eax
	leaq	primes(%rip), %r11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %edx
	addq	$2, %rdi
	addq	$1, %rax
.L6:
	movzbl	(%r8,%rax), %esi
	testb	%sil, %sil
	je	.L2
	movl	%eax, (%r11,%rcx,4)
	leal	1(%rcx), %r9d
	cmpq	$224, %rax
	jbe	.L28
	movl	%esi, %r10d
	movslq	%r9d, %rcx
.L2:
	cmpl	$50001, %edx
	jne	.L4
	testb	%r10b, %r10b
	je	.L7
	movl	%ecx, np(%rip)
.L7:
	movl	primes(%rip), %esi
	leaq	primes(%rip), %rdi
	leaq	count(%rip), %rcx
	cmpl	$25000, %esi
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdi), %eax
	movq	%rdi, %rdx
	addl	%esi, %eax
	cmpl	$50000, %eax
	jg	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	cltq
	addq	$4, %rdx
	addl	$1, (%rcx,%rax,4)
	movl	(%rdx), %eax
	addl	%esi, %eax
	cmpl	$50000, %eax
	jle	.L10
.L11:
	movl	4(%rdi), %esi
	addq	$4, %rdi
	cmpl	$25000, %esi
	jle	.L9
.L8:
	leaq	4(%rsp), %rbp
	leaq	.LC0(%rip), %rbx
	leaq	count(%rip), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	movl	0(%r13,%rax,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L29
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L28:
	.cfi_restore_state
	movq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$0, (%r8,%rcx)
	addq	%rax, %rcx
	cmpl	$50000, %ecx
	jle	.L3
	movl	%esi, %r10d
	movslq	%r9d, %rcx
	jmp	.L4
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	np
	.bss
	.align 4
	.type	np, @object
	.size	np, 4
np:
	.zero	4
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 20560
primes:
	.zero	20560
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 200004
count:
	.zero	200004
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 50001
f:
	.zero	50001
	.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>          // printf(), scanf()
#include <stdbool.h>

#define MAX_N 50000
#define MAX_SQRT_N 224
#define MAX_P 5140

bool f[MAX_N + 1];
int count[MAX_N + 1];
int primes[MAX_P];
int np;

int
main(int argc, char **argv)
{
	int i, j;

	for (i = 0; i <= MAX_N; ++i)
		f[i] = true;

	np = 0;
	for (i = 2; i <= MAX_N; ++i)
	{
		if (f[i])
		{
			primes[np++] = i;
			if (i <= MAX_SQRT_N)
			{
				for (j = i + i; j <= MAX_N; j += i)
					f[j] = false;
			}
		}
	}

	for (i = 0; primes[i] <= MAX_N / 2; ++i)
	{
		for (j = i; primes[i] + primes[j] <= MAX_N; ++j)
			count[primes[i] + primes[j]]++;
	}

	while (true)
	{
		int n;
		scanf("%d", &n);
		if (n == 0)
			break;

		printf("%d\n", count[n]);
	}

	return 0;
}
10
22
0
 10
34
0
 10
28
0
 10
31
0
 10
3
0
 10
0
0
 10
48
0
 10
106
0
 10
140
0
 10
160
0

2
3
 2
4
 2
2
 2
1
 2
0
 2
 2
5
 2
6
 2
7
 2
8

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>          // printf(), scanf()
#include <stdbool.h>

#define MAX_N 50000
#define MAX_SQRT_N 224
#define MAX_P 5140

bool f[MAX_N + 1];
int count[MAX_N + 1];
int primes[MAX_P];
int np;

int
main(int argc, char **argv)
{
	int i, j;

	for (i = 0; i <= MAX_N; ++i)
		f[i] = true;

	np = 0;
	for (i = 2; i <= MAX_N; ++i)
	{
		if (f[i])
		{
			primes[np++] = i;
			if (i <= MAX_SQRT_N)
			{
				for (j = i + i; j <= MAX_N; j += i)
					f[j] = false;
			}
		}
	}

	for (i = 0; primes[i] <= MAX_N / 2; ++i)
	{
		for (j = i; primes[i] + primes[j] <= MAX_N; ++j)
			count[primes[i] + primes[j]]++;
	}

	while (true)
	{
		int n;
		scanf("%d", &n);
		if (n == 0)
			break;

		printf("%d\n", count[n]);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	f
	.bss
	.align 32
	.type	f, @object
	.size	f, 50001
f:
	.zero	50001
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 200004
count:
	.zero	200004
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 20560
primes:
	.zero	20560
	.globl	np
	.align 4
	.type	np, @object
	.size	np, 4
np:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -16(%rbp)
.L2:
	cmpl	$50000, -16(%rbp)
	jle	.L3
	movl	$0, np(%rip)
	movl	$2, -16(%rbp)
	jmp	.L4
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L5
	movl	np(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, np(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	primes(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	cmpl	$224, -16(%rbp)
	jg	.L5
	movl	-16(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
.L6:
	cmpl	$50000, -12(%rbp)
	jle	.L7
.L5:
	addl	$1, -16(%rbp)
.L4:
	cmpl	$50000, -16(%rbp)
	jle	.L8
	movl	$0, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	count(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	count(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	cmpl	$50000, %eax
	jle	.L11
	addl	$1, -16(%rbp)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$25000, %eax
	jle	.L12
.L15:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	jmp	.L17
.L13:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	count(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L17:
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	f
	.bss
	.align 32
	.type	f, @object
	.size	f, 50001
f:
	.zero	50001
	.globl	count
	.align 32
	.type	count, @object
	.size	count, 200004
count:
	.zero	200004
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 20560
primes:
	.zero	20560
	.globl	np
	.align 4
	.type	np, @object
	.size	np, 4
np:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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)
	movq	%rsi, -48(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -16(%rbp)
.L2:
	cmpl	$50000, -16(%rbp)
	jle	.L3
	movl	$0, np(%rip)
	movl	$2, -16(%rbp)
	jmp	.L4
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	je	.L5
	movl	np(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, np(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	primes(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	cmpl	$224, -16(%rbp)
	jg	.L5
	movl	-16(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	f(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
.L6:
	cmpl	$50000, -12(%rbp)
	jle	.L7
.L5:
	addl	$1, -16(%rbp)
.L4:
	cmpl	$50000, -16(%rbp)
	jle	.L8
	movl	$0, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	count(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	count(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	cmpl	$50000, %eax
	jle	.L11
	addl	$1, -16(%rbp)
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primes(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$25000, %eax
	jle	.L12
.L15:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	jmp	.L17
.L13:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	count(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L17:
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
