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

```c
#define M 32768
p[M+1];main(i,j,n){p[1]=1;for(;i<=M;i++)if(!p[i])for(j=i*2;j<=M;j+=i)p[j]=1;for(;scanf("%d",&n),n;printf("%d\n",j))for(i=2,j=0;i<=n/2;i++)if(!p[i]&&!p[n-i])j++;return 0;}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB0:
	.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
	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
	movl	$1, 4+p(%rip)
	movl	%edx, 12(%rsp)
	cmpl	$32768, %edi
	jg	.L2
	movslq	%edi, %rdx
	leal	(%rdi,%rdi), %ecx
	leaq	p(%rip), %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jg	.L2
.L5:
	movl	(%rsi,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L3
	cmpl	$32768, %ecx
	jg	.L3
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, (%rsi,%rax,4)
	addq	%rdx, %rax
	cmpl	$32768, %eax
	jle	.L4
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jle	.L5
.L2:
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	p(%rip), %r13
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L9
	movl	%edi, %ecx
	movl	$2, %eax
	xorl	%esi, %esi
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	cmpl	$3, %edi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movl	0(%r13,%rax,4), %edx
	testl	%edx, %edx
	jne	.L7
	movl	%edi, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	cmpl	$1, 0(%r13,%rdx,4)
	adcl	$0, %esi
.L7:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L8
.L10:
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 131076
p:
	.zero	131076
	.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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	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
	movl	$1, 4+p(%rip)
	movl	%edx, 12(%rsp)
	cmpl	$32768, %edi
	jg	.L2
	movslq	%edi, %rdx
	leal	(%rdi,%rdi), %ecx
	leaq	p(%rip), %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jg	.L2
.L5:
	movl	(%rsi,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L3
	cmpl	$32768, %ecx
	jg	.L3
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, (%rsi,%rax,4)
	addq	%rdx, %rax
	cmpl	$32768, %eax
	jle	.L4
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jle	.L5
.L2:
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	p(%rip), %r13
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L9
	movl	%edi, %ecx
	movl	$2, %eax
	xorl	%esi, %esi
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	cmpl	$3, %edi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movl	0(%r13,%rax,4), %edx
	testl	%edx, %edx
	jne	.L7
	movl	%edi, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	cmpl	$1, 0(%r13,%rdx,4)
	adcl	$0, %esi
.L7:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L8
.L10:
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 131076
p:
	.zero	131076
	.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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	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
	movl	$1, 4+p(%rip)
	movl	%edx, 12(%rsp)
	cmpl	$32768, %edi
	jg	.L2
	movslq	%edi, %rdx
	leal	(%rdi,%rdi), %ecx
	leaq	p(%rip), %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jg	.L2
.L5:
	movl	(%rsi,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L3
	cmpl	$32768, %ecx
	jg	.L3
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, (%rsi,%rax,4)
	addq	%rdx, %rax
	cmpl	$32768, %eax
	jle	.L4
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jle	.L5
.L2:
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	p(%rip), %r13
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L9
	movl	%edi, %ecx
	movl	$2, %eax
	xorl	%esi, %esi
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	cmpl	$3, %edi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movl	0(%r13,%rax,4), %edx
	testl	%edx, %edx
	jne	.L7
	movl	%edi, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	cmpl	$1, 0(%r13,%rdx,4)
	adcl	$0, %esi
.L7:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L8
.L10:
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 131076
p:
	.zero	131076
	.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
#define M 32768
p[M+1];main(i,j,n){p[1]=1;for(;i<=M;i++)if(!p[i])for(j=i*2;j<=M;j+=i)p[j]=1;for(;scanf("%d",&n),n;printf("%d\n",j))for(i=2,j=0;i<=n/2;i++)if(!p[i]&&!p[n-i])j++;return 0;}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define M 32768
p[M+1];main(i,j,n){p[1]=1;for(;i<=M;i++)if(!p[i])for(j=i*2;j<=M;j+=i)p[j]=1;for(;scanf("%d",&n),n;printf("%d\n",j))for(i=2,j=0;i<=n/2;i++)if(!p[i]&&!p[n-i])j++;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:

6
1
12
0
 6
10
8
0
 6
4
12
0
 6
1
3
0
 6
4
2
0
 6
0
2
0
 6
4
0
0
 6
2
14
0
 6
1
0
0
 6
16
0
0

1
0
1
 1
2
1
 1
1
1
 1
0
0
 1
1
0
 1
 1
1
 1
0
2
 1
0
 1
2

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

```c
#define M 32768
p[M+1];main(i,j,n){p[1]=1;for(;i<=M;i++)if(!p[i])for(j=i*2;j<=M;j+=i)p[j]=1;for(;scanf("%d",&n),n;printf("%d\n",j))for(i=2,j=0;i<=n/2;i++)if(!p[i]&&!p[n-i])j++;return 0;}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB0:
	.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
	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
	movl	$1, 4+p(%rip)
	movl	%edx, 12(%rsp)
	cmpl	$32768, %edi
	jg	.L2
	movslq	%edi, %rdx
	leal	(%rdi,%rdi), %ecx
	leaq	p(%rip), %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jg	.L2
.L5:
	movl	(%rsi,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L3
	cmpl	$32768, %ecx
	jg	.L3
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, (%rsi,%rax,4)
	addq	%rdx, %rax
	cmpl	$32768, %eax
	jle	.L4
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jle	.L5
.L2:
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	p(%rip), %r13
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L9
	movl	%edi, %ecx
	movl	$2, %eax
	xorl	%esi, %esi
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	cmpl	$3, %edi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movl	0(%r13,%rax,4), %edx
	testl	%edx, %edx
	jne	.L7
	movl	%edi, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	cmpl	$1, 0(%r13,%rdx,4)
	adcl	$0, %esi
.L7:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L8
.L10:
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 131076
p:
	.zero	131076
	.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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	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
	movl	$1, 4+p(%rip)
	movl	%edx, 12(%rsp)
	cmpl	$32768, %edi
	jg	.L2
	movslq	%edi, %rdx
	leal	(%rdi,%rdi), %ecx
	leaq	p(%rip), %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jg	.L2
.L5:
	movl	(%rsi,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L3
	cmpl	$32768, %ecx
	jg	.L3
	movslq	%ecx, %rax
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, (%rsi,%rax,4)
	addq	%rdx, %rax
	cmpl	$32768, %eax
	jle	.L4
	addq	$1, %rdx
	addl	$2, %ecx
	cmpl	$32768, %edx
	jle	.L5
.L2:
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	p(%rip), %r13
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	je	.L9
	movl	%edi, %ecx
	movl	$2, %eax
	xorl	%esi, %esi
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	cmpl	$3, %edi
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movl	0(%r13,%rax,4), %edx
	testl	%edx, %edx
	jne	.L7
	movl	%edi, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	cmpl	$1, 0(%r13,%rdx,4)
	adcl	$0, %esi
.L7:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L8
.L10:
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 131076
p:
	.zero	131076
	.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:
```