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

```c
#define IN_MAX 10000
char primes[IN_MAX+1];
int prime[300];
int table[IN_MAX+1];

void createtable(){
  int i=2,j,n=0;
  primes[1]=1;
  for(;i<=IN_MAX;i++)
    if(!primes[i])
      for(j=i*2;j<=IN_MAX;j+=i)
        primes[j]=1;

  for(i=2;i<=IN_MAX;i++)
    if(!primes[i])prime[n++]=i;
    
  for(i=0;i<n;i++){
    int x=prime[i];
    table[x]++;
    for(j=i+1;;j++){
      x+=prime[j];
      if(x>IN_MAX)break;
      table[x]++;
    }
  }
}

int main(){
  int n;
  createtable();
  while(1){
    scanf("%d",&n);
    if(!n)return 0;
    printf("%d\n",table[n]);
  }
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	createtable
	.type	createtable, @function
createtable:
.LFB0:
	.cfi_startproc
	endbr64
	movb	$1, 1+primes(%rip)
	movl	$4, %esi
	movl	$2, %edx
	leaq	primes(%rip), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$10001, %rdx
	je	.L22
.L4:
	cmpb	$0, (%rcx,%rdx)
	jne	.L2
	cmpq	$10000, %rsi
	ja	.L2
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$10000, %eax
	jle	.L3
	jmp	.L2
.L22:
	movl	$2, %eax
	xorl	%esi, %esi
	leaq	prime(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%esi, %rdx
	addl	$1, %esi
	movl	%eax, (%rdi,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$10001, %rax
	jne	.L6
	leaq	prime(%rip), %r8
	xorl	%r9d, %r9d
	leaq	table(%rip), %rdi
	testl	%esi, %esi
	je	.L23
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	(%r8), %rdx
	addl	$1, %r9d
	movq	%rdx, %rax
	addl	4(%r8), %eax
	addl	$1, (%rdi,%rdx,4)
	movq	%r8, %rdx
	cmpl	$10000, %eax
	jg	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%eax, %rcx
	addl	8(%rdx), %eax
	addq	$4, %rdx
	addl	$1, (%rdi,%rcx,4)
	cmpl	$10000, %eax
	jle	.L8
.L10:
	addq	$4, %r8
	cmpl	%r9d, %esi
	jne	.L9
	ret
.L23:
	ret
	.cfi_endproc
.LFE0:
	.size	createtable, .-createtable
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	table(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	call	createtable
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movl	0(%r13,%rax,4), %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L26:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L25
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	table
	.bss
	.align 32
	.type	table, @object
	.size	table, 40004
table:
	.zero	40004
	.globl	prime
	.align 32
	.type	prime, @object
	.size	prime, 1200
prime:
	.zero	1200
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 10001
primes:
	.zero	10001
	.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
	.p2align 4
	.globl	createtable
	.type	createtable, @function
createtable:
.LFB0:
	.cfi_startproc
	endbr64
	movb	$1, 1+primes(%rip)
	movl	$4, %esi
	movl	$2, %edx
	leaq	primes(%rip), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$10001, %rdx
	je	.L22
.L4:
	cmpb	$0, (%rcx,%rdx)
	jne	.L2
	cmpq	$10000, %rsi
	ja	.L2
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$10000, %eax
	jle	.L3
	jmp	.L2
.L22:
	movl	$2, %eax
	xorl	%esi, %esi
	leaq	prime(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%esi, %rdx
	addl	$1, %esi
	movl	%eax, (%rdi,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$10001, %rax
	jne	.L6
	leaq	prime(%rip), %r8
	xorl	%r9d, %r9d
	leaq	table(%rip), %rdi
	testl	%esi, %esi
	je	.L23
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	(%r8), %rdx
	addl	$1, %r9d
	movq	%rdx, %rax
	addl	4(%r8), %eax
	addl	$1, (%rdi,%rdx,4)
	movq	%r8, %rdx
	cmpl	$10000, %eax
	jg	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%eax, %rcx
	addl	8(%rdx), %eax
	addq	$4, %rdx
	addl	$1, (%rdi,%rcx,4)
	cmpl	$10000, %eax
	jle	.L8
.L10:
	addq	$4, %r8
	cmpl	%r9d, %esi
	jne	.L9
	ret
.L23:
	ret
	.cfi_endproc
.LFE0:
	.size	createtable, .-createtable
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	table(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	call	createtable
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movl	0(%r13,%rax,4), %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L26:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L25
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	table
	.bss
	.align 32
	.type	table, @object
	.size	table, 40004
table:
	.zero	40004
	.globl	prime
	.align 32
	.type	prime, @object
	.size	prime, 1200
prime:
	.zero	1200
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 10001
primes:
	.zero	10001
	.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
	.p2align 4
	.globl	createtable
	.type	createtable, @function
createtable:
.LFB0:
	.cfi_startproc
	endbr64
	movb	$1, 1+primes(%rip)
	movl	$4, %esi
	movl	$2, %edx
	leaq	primes(%rip), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$10001, %rdx
	je	.L22
.L4:
	cmpb	$0, (%rcx,%rdx)
	jne	.L2
	cmpq	$10000, %rsi
	ja	.L2
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$10000, %eax
	jle	.L3
	jmp	.L2
.L22:
	movl	$2, %eax
	xorl	%esi, %esi
	leaq	prime(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%esi, %rdx
	addl	$1, %esi
	movl	%eax, (%rdi,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$10001, %rax
	jne	.L6
	leaq	prime(%rip), %r8
	xorl	%r9d, %r9d
	leaq	table(%rip), %rdi
	testl	%esi, %esi
	je	.L23
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	(%r8), %rdx
	addl	$1, %r9d
	movq	%rdx, %rax
	addl	4(%r8), %eax
	addl	$1, (%rdi,%rdx,4)
	movq	%r8, %rdx
	cmpl	$10000, %eax
	jg	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%eax, %rcx
	addl	8(%rdx), %eax
	addq	$4, %rdx
	addl	$1, (%rdi,%rcx,4)
	cmpl	$10000, %eax
	jle	.L8
.L10:
	addq	$4, %r8
	cmpl	%r9d, %esi
	jne	.L9
	ret
.L23:
	ret
	.cfi_endproc
.LFE0:
	.size	createtable, .-createtable
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	table(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	call	createtable
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movl	0(%r13,%rax,4), %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L26:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L25
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	table
	.bss
	.align 32
	.type	table, @object
	.size	table, 40004
table:
	.zero	40004
	.globl	prime
	.align 32
	.type	prime, @object
	.size	prime, 1200
prime:
	.zero	1200
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 10001
primes:
	.zero	10001
	.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 IN_MAX 10000
char primes[IN_MAX+1];
int prime[300];
int table[IN_MAX+1];

void createtable(){
  int i=2,j,n=0;
  primes[1]=1;
  for(;i<=IN_MAX;i++)
    if(!primes[i])
      for(j=i*2;j<=IN_MAX;j+=i)
        primes[j]=1;

  for(i=2;i<=IN_MAX;i++)
    if(!primes[i])prime[n++]=i;
    
  for(i=0;i<n;i++){
    int x=prime[i];
    table[x]++;
    for(j=i+1;;j++){
      x+=prime[j];
      if(x>IN_MAX)break;
      table[x]++;
    }
  }
}

int main(){
  int n;
  createtable();
  while(1){
    scanf("%d",&n);
    if(!n)return 0;
    printf("%d\n",table[n]);
  }
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define IN_MAX 10000
char primes[IN_MAX+1];
int prime[300];
int table[IN_MAX+1];

void createtable(){
  int i=2,j,n=0;
  primes[1]=1;
  for(;i<=IN_MAX;i++)
    if(!primes[i])
      for(j=i*2;j<=IN_MAX;j+=i)
        primes[j]=1;

  for(i=2;i<=IN_MAX;i++)
    if(!primes[i])prime[n++]=i;
    
  for(i=0;i<n;i++){
    int x=prime[i];
    table[x]++;
    for(j=i+1;;j++){
      x+=prime[j];
      if(x>IN_MAX)break;
      table[x]++;
    }
  }
}

int main(){
  int n;
  createtable();
  while(1){
    scanf("%d",&n);
    if(!n)return 0;
    printf("%d\n",table[n]);
  }
}```

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:

2
3
17
41
20
666
24
53
0
 2
3
17
41
20
666
24
56
0
 2
3
17
41
20
666
24
20
0
 2
3
17
41
20
666
46
53
0
 2
3
17
70
20
666
24
56
0
 2
3
17
34
20
666
24
20
0
 2
6
17
34
20
666
24
20
0
 2
3
2
41
20
666
46
53
0
 2
6
17
34
20
666
24
17
0
 2
3
2
41
20
1171
46
53
0

2028
2030
2139
2342
2153
7649
2208
2413
 2028
2030
2139
2342
2153
7649
2208
2438
 2028
2030
2139
2342
2153
7649
2208
2153
 2028
2030
2139
2342
2153
7649
2371
2413
 2028
2030
2139
2557
2153
7649
2208
2438
 2028
2030
2139
2281
2153
7649
2208
2153
 2028
2063
2139
2281
2153
7649
2208
2153
 2028
2030
2028
2342
2153
7649
2371
2413
 2028
2063
2139
2281
2153
7649
2208
2139
 2028
2030
2028
2342
2153
2
2371
2413

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

```c
#define IN_MAX 10000
char primes[IN_MAX+1];
int prime[300];
int table[IN_MAX+1];

void createtable(){
  int i=2,j,n=0;
  primes[1]=1;
  for(;i<=IN_MAX;i++)
    if(!primes[i])
      for(j=i*2;j<=IN_MAX;j+=i)
        primes[j]=1;

  for(i=2;i<=IN_MAX;i++)
    if(!primes[i])prime[n++]=i;
    
  for(i=0;i<n;i++){
    int x=prime[i];
    table[x]++;
    for(j=i+1;;j++){
      x+=prime[j];
      if(x>IN_MAX)break;
      table[x]++;
    }
  }
}

int main(){
  int n;
  createtable();
  while(1){
    scanf("%d",&n);
    if(!n)return 0;
    printf("%d\n",table[n]);
  }
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	createtable
	.type	createtable, @function
createtable:
.LFB0:
	.cfi_startproc
	endbr64
	movb	$1, 1+primes(%rip)
	movl	$4, %esi
	movl	$2, %edx
	leaq	primes(%rip), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$10001, %rdx
	je	.L22
.L4:
	cmpb	$0, (%rcx,%rdx)
	jne	.L2
	cmpq	$10000, %rsi
	ja	.L2
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$10000, %eax
	jle	.L3
	jmp	.L2
.L22:
	movl	$2, %eax
	xorl	%esi, %esi
	leaq	prime(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%esi, %rdx
	addl	$1, %esi
	movl	%eax, (%rdi,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$10001, %rax
	jne	.L6
	leaq	prime(%rip), %r8
	xorl	%r9d, %r9d
	leaq	table(%rip), %rdi
	testl	%esi, %esi
	je	.L23
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	(%r8), %rdx
	addl	$1, %r9d
	movq	%rdx, %rax
	addl	4(%r8), %eax
	addl	$1, (%rdi,%rdx,4)
	movq	%r8, %rdx
	cmpl	$10000, %eax
	jg	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%eax, %rcx
	addl	8(%rdx), %eax
	addq	$4, %rdx
	addl	$1, (%rdi,%rcx,4)
	cmpl	$10000, %eax
	jle	.L8
.L10:
	addq	$4, %r8
	cmpl	%r9d, %esi
	jne	.L9
	ret
.L23:
	ret
	.cfi_endproc
.LFE0:
	.size	createtable, .-createtable
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	table(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	call	createtable
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movl	0(%r13,%rax,4), %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L26:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L25
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	table
	.bss
	.align 32
	.type	table, @object
	.size	table, 40004
table:
	.zero	40004
	.globl	prime
	.align 32
	.type	prime, @object
	.size	prime, 1200
prime:
	.zero	1200
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 10001
primes:
	.zero	10001
	.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
	.p2align 4
	.globl	createtable
	.type	createtable, @function
createtable:
.LFB0:
	.cfi_startproc
	endbr64
	movb	$1, 1+primes(%rip)
	movl	$4, %esi
	movl	$2, %edx
	leaq	primes(%rip), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$10001, %rdx
	je	.L22
.L4:
	cmpb	$0, (%rcx,%rdx)
	jne	.L2
	cmpq	$10000, %rsi
	ja	.L2
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$10000, %eax
	jle	.L3
	jmp	.L2
.L22:
	movl	$2, %eax
	xorl	%esi, %esi
	leaq	prime(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%esi, %rdx
	addl	$1, %esi
	movl	%eax, (%rdi,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$10001, %rax
	jne	.L6
	leaq	prime(%rip), %r8
	xorl	%r9d, %r9d
	leaq	table(%rip), %rdi
	testl	%esi, %esi
	je	.L23
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	(%r8), %rdx
	addl	$1, %r9d
	movq	%rdx, %rax
	addl	4(%r8), %eax
	addl	$1, (%rdi,%rdx,4)
	movq	%r8, %rdx
	cmpl	$10000, %eax
	jg	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%eax, %rcx
	addl	8(%rdx), %eax
	addq	$4, %rdx
	addl	$1, (%rdi,%rcx,4)
	cmpl	$10000, %eax
	jle	.L8
.L10:
	addq	$4, %r8
	cmpl	%r9d, %esi
	jne	.L9
	ret
.L23:
	ret
	.cfi_endproc
.LFE0:
	.size	createtable, .-createtable
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	table(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	call	createtable
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movl	0(%r13,%rax,4), %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L26:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L25
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	table
	.bss
	.align 32
	.type	table, @object
	.size	table, 40004
table:
	.zero	40004
	.globl	prime
	.align 32
	.type	prime, @object
	.size	prime, 1200
prime:
	.zero	1200
	.globl	primes
	.align 32
	.type	primes, @object
	.size	primes, 10001
primes:
	.zero	10001
	.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:
```