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

```c
#include <stdio.h>          // 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;
}```

Assembly Code:

```assembly
	.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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.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
```assembly
	.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:
```
```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;
}```
Given the following C 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;
}```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

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 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;
}```

Assembly Code:

```assembly
	.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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.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:
```