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>
#define Max 50000
int main(void)
{
	int n,i,j;
	int prime[Max]={1,1,0};
	for(i=2;i*i<Max;i++){					//エラトステネスの篩
		for(j=2;i*j<Max;j++){
			prime[i*j]=1;
		}
	}
	while(scanf("%d",&n)){
		if(n==0) break;
		int count=0;
		for(i=2;2*i<=n;i++){				//i≦jかつj=n-i⇒i≦n/2
			j=n-i;
			if(prime [i]==0 && prime[j]==0) count++;
		}
		printf("%d\n",count);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3424, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200016(%rbp), %rax
	movl	$200000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -200016(%rbp)
	movl	$1, -200012(%rbp)
	movl	$2, -200028(%rbp)
	jmp	.L2
.L5:
	movl	$2, -200024(%rbp)
	jmp	.L3
.L4:
	movl	-200028(%rbp), %eax
	imull	-200024(%rbp), %eax
	cltq
	movl	$1, -200016(%rbp,%rax,4)
	addl	$1, -200024(%rbp)
.L3:
	movl	-200028(%rbp), %eax
	imull	-200024(%rbp), %eax
	cmpl	$49999, %eax
	jle	.L4
	addl	$1, -200028(%rbp)
.L2:
	movl	-200028(%rbp), %eax
	imull	%eax, %eax
	cmpl	$49999, %eax
	jle	.L5
	jmp	.L6
.L12:
	movl	-200032(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	$0, -200020(%rbp)
	movl	$2, -200028(%rbp)
	jmp	.L9
.L11:
	movl	-200032(%rbp), %eax
	subl	-200028(%rbp), %eax
	movl	%eax, -200024(%rbp)
	movl	-200028(%rbp), %eax
	cltq
	movl	-200016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-200024(%rbp), %eax
	cltq
	movl	-200016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	addl	$1, -200020(%rbp)
.L10:
	addl	$1, -200028(%rbp)
.L9:
	movl	-200028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-200032(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-200020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L12
	jmp	.L8
.L15:
	nop
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196640
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200064
	movl	$200000, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	movq	%rcx, %rdi
	call	memset@PLT
	movl	$2, %edx
	movl	$4, %edi
	movq	%rax, %rcx
	movq	.LC0(%rip), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %esi
	movq	%rdi, %rax
	cmpq	$49999, %rdi
	ja	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$1, (%rcx,%rax,4)
	addq	%rdx, %rax
	cmpl	$49999, %eax
	jle	.L3
.L5:
	leal	1(%rsi), %eax
	addq	$2, %rdi
	addq	$1, %rdx
	imull	%eax, %eax
	cmpl	$49999, %eax
	jle	.L2
	leaq	12(%rsp), %rbp
	leaq	.LC2(%rip), %rbx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L6
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L6
	cmpl	$3, %esi
	jle	.L13
	leal	-3(%rsi), %ecx
	leal	-2(%rsi), %eax
	subl	$4, %esi
	xorl	%r8d, %r8d
	shrl	%esi
	leaq	24(%rsp), %rdx
	subl	%esi, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdx), %esi
	testl	%esi, %esi
	jne	.L8
	movslq	%eax, %rsi
	cmpl	$1, 16(%rsp,%rsi,4)
	adcl	$0, %r8d
.L8:
	subl	$1, %eax
	addq	$4, %rdx
	cmpl	%eax, %ecx
	jne	.L9
.L7:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196640
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200064
	movl	$200000, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	movq	%rcx, %rdi
	call	memset@PLT
	movl	$2, %edx
	movl	$4, %edi
	movq	%rax, %rcx
	movq	.LC0(%rip), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %esi
	movq	%rdi, %rax
	cmpq	$49999, %rdi
	ja	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$1, (%rcx,%rax,4)
	addq	%rdx, %rax
	cmpl	$49999, %eax
	jle	.L3
.L5:
	leal	1(%rsi), %eax
	addq	$2, %rdi
	addq	$1, %rdx
	imull	%eax, %eax
	cmpl	$49999, %eax
	jle	.L2
	leaq	12(%rsp), %rbp
	leaq	.LC2(%rip), %rbx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L6
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L6
	cmpl	$3, %esi
	jle	.L13
	leal	-3(%rsi), %ecx
	leal	-2(%rsi), %eax
	subl	$4, %esi
	xorl	%r8d, %r8d
	shrl	%esi
	leaq	24(%rsp), %rdx
	subl	%esi, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdx), %esi
	testl	%esi, %esi
	jne	.L8
	movslq	%eax, %rsi
	cmpl	$1, 16(%rsp,%rsi,4)
	adcl	$0, %r8d
.L8:
	subl	$1, %eax
	addq	$4, %rdx
	cmpl	%eax, %ecx
	jne	.L9
.L7:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L7
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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>
#define Max 50000
int main(void)
{
	int n,i,j;
	int prime[Max]={1,1,0};
	for(i=2;i*i<Max;i++){					//エラトステネスの篩
		for(j=2;i*j<Max;j++){
			prime[i*j]=1;
		}
	}
	while(scanf("%d",&n)){
		if(n==0) break;
		int count=0;
		for(i=2;2*i<=n;i++){				//i≦jかつj=n-i⇒i≦n/2
			j=n-i;
			if(prime [i]==0 && prime[j]==0) count++;
		}
		printf("%d\n",count);
	}
	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>
#define Max 50000
int main(void)
{
	int n,i,j;
	int prime[Max]={1,1,0};
	for(i=2;i*i<Max;i++){					//エラトステネスの篩
		for(j=2;i*j<Max;j++){
			prime[i*j]=1;
		}
	}
	while(scanf("%d",&n)){
		if(n==0) break;
		int count=0;
		for(i=2;2*i<=n;i++){				//i≦jかつj=n-i⇒i≦n/2
			j=n-i;
			if(prime [i]==0 && prime[j]==0) count++;
		}
		printf("%d\n",count);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3424, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200016(%rbp), %rax
	movl	$200000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -200016(%rbp)
	movl	$1, -200012(%rbp)
	movl	$2, -200028(%rbp)
	jmp	.L2
.L5:
	movl	$2, -200024(%rbp)
	jmp	.L3
.L4:
	movl	-200028(%rbp), %eax
	imull	-200024(%rbp), %eax
	cltq
	movl	$1, -200016(%rbp,%rax,4)
	addl	$1, -200024(%rbp)
.L3:
	movl	-200028(%rbp), %eax
	imull	-200024(%rbp), %eax
	cmpl	$49999, %eax
	jle	.L4
	addl	$1, -200028(%rbp)
.L2:
	movl	-200028(%rbp), %eax
	imull	%eax, %eax
	cmpl	$49999, %eax
	jle	.L5
	jmp	.L6
.L12:
	movl	-200032(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	$0, -200020(%rbp)
	movl	$2, -200028(%rbp)
	jmp	.L9
.L11:
	movl	-200032(%rbp), %eax
	subl	-200028(%rbp), %eax
	movl	%eax, -200024(%rbp)
	movl	-200028(%rbp), %eax
	cltq
	movl	-200016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-200024(%rbp), %eax
	cltq
	movl	-200016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	addl	$1, -200020(%rbp)
.L10:
	addl	$1, -200028(%rbp)
.L9:
	movl	-200028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-200032(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-200020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L12
	jmp	.L8
.L15:
	nop
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3424, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200016(%rbp), %rax
	movl	$200000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -200016(%rbp)
	movl	$1, -200012(%rbp)
	movl	$2, -200028(%rbp)
	jmp	.L2
.L5:
	movl	$2, -200024(%rbp)
	jmp	.L3
.L4:
	movl	-200028(%rbp), %eax
	imull	-200024(%rbp), %eax
	cltq
	movl	$1, -200016(%rbp,%rax,4)
	addl	$1, -200024(%rbp)
.L3:
	movl	-200028(%rbp), %eax
	imull	-200024(%rbp), %eax
	cmpl	$49999, %eax
	jle	.L4
	addl	$1, -200028(%rbp)
.L2:
	movl	-200028(%rbp), %eax
	imull	%eax, %eax
	cmpl	$49999, %eax
	jle	.L5
	jmp	.L6
.L12:
	movl	-200032(%rbp), %eax
	testl	%eax, %eax
	je	.L15
	movl	$0, -200020(%rbp)
	movl	$2, -200028(%rbp)
	jmp	.L9
.L11:
	movl	-200032(%rbp), %eax
	subl	-200028(%rbp), %eax
	movl	%eax, -200024(%rbp)
	movl	-200028(%rbp), %eax
	cltq
	movl	-200016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-200024(%rbp), %eax
	cltq
	movl	-200016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	addl	$1, -200020(%rbp)
.L10:
	addl	$1, -200028(%rbp)
.L9:
	movl	-200028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-200032(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-200020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L12
	jmp	.L8
.L15:
	nop
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
