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>
int primetable[1000] = {};
int univcnt = 0;

void settable(){
  int i = 0;
  int j = 0;
  int primeflag = 0;
  for(i=2;i<=1000;i++){
    primeflag = 1;
    for(j=2;j<i;j++){
      if(i % j == 0){
        primeflag = 0;
      }
    }
    if(primeflag){
      primetable[univcnt] = i;
      univcnt++;
    }
  }
}
        
int main(){
  int n = 0;
  int primecnt[1000] = {};
  int i = 0;
  int j = 0;
  int k = 0;
  long long cnt = 1;
  scanf("%d",&n);
  settable();
  for(i=1;i<=n;i++){
    k = i;
    for(j=0;j<univcnt && k != 1;j++){
      while(k % primetable[j] == 0){
        k /= primetable[j];
        primecnt[j]++;
      }
    }
  }
  //printf("%d#",primetable[1]);
  //printf("%d#",primecnt[1]);
  for(i=0;i<univcnt;i++){
    cnt = (cnt * (primecnt[i]+1))%1000000007;
  }
  printf("%lld\n",cnt);
  
        
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	primetable
	.bss
	.align 32
	.type	primetable, @object
	.size	primetable, 4000
primetable:
	.zero	4000
	.globl	univcnt
	.align 4
	.type	univcnt, @object
	.size	univcnt, 4
univcnt:
	.zero	4
	.text
	.globl	settable
	.type	settable, @function
settable:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	$2, -12(%rbp)
	jmp	.L2
.L7:
	movl	$1, -4(%rbp)
	movl	$2, -8(%rbp)
	jmp	.L3
.L5:
	movl	-12(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, -4(%rbp)
.L4:
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L5
	cmpl	$0, -4(%rbp)
	je	.L6
	movl	univcnt(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	primetable(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	univcnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, univcnt(%rip)
.L6:
	addl	$1, -12(%rbp)
.L2:
	cmpl	$1000, -12(%rbp)
	jle	.L7
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	settable, .-settable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4040(%rbp)
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -4036(%rbp)
	movl	$0, -4032(%rbp)
	movl	$0, -4028(%rbp)
	movq	$1, -4024(%rbp)
	leaq	-4040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	settable
	movl	$1, -4036(%rbp)
	jmp	.L9
.L15:
	movl	-4036(%rbp), %eax
	movl	%eax, -4028(%rbp)
	movl	$0, -4032(%rbp)
	jmp	.L10
.L12:
	movl	-4032(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primetable(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4028(%rbp), %eax
	cltd
	idivl	%esi
	movl	%eax, -4028(%rbp)
	movl	-4032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-4032(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L11:
	movl	-4032(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primetable(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4028(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L12
	addl	$1, -4032(%rbp)
.L10:
	movl	univcnt(%rip), %eax
	cmpl	%eax, -4032(%rbp)
	jge	.L13
	cmpl	$1, -4028(%rbp)
	jne	.L11
.L13:
	addl	$1, -4036(%rbp)
.L9:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4036(%rbp)
	jle	.L15
	movl	$0, -4036(%rbp)
	jmp	.L16
.L17:
	movl	-4036(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	addl	$1, %eax
	cltq
	imulq	-4024(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -4024(%rbp)
	movq	-4024(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -4024(%rbp)
	addl	$1, -4036(%rbp)
.L16:
	movl	univcnt(%rip), %eax
	cmpl	%eax, -4036(%rbp)
	jl	.L17
	movq	-4024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	settable
	.type	settable, @function
settable:
.LFB23:
	.cfi_startproc
	endbr64
	movl	univcnt(%rip), %r9d
	xorl	%r10d, %r10d
	movl	$2, %esi
	xorl	%r8d, %r8d
	leaq	primetable(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$1, %edi
	movl	$2, %ecx
	cmpl	$2, %esi
	je	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	cmove	%r8d, %edi
	addl	$1, %ecx
	cmpl	%ecx, %esi
	jne	.L4
	testl	%edi, %edi
	jne	.L7
.L5:
	addl	$1, %esi
	cmpl	$1001, %esi
	jne	.L2
	testb	%r10b, %r10b
	je	.L1
	movl	%r9d, univcnt(%rip)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	%r9d, %rax
	movl	$1, %r10d
	addl	$1, %r9d
	movl	%esi, (%r11,%rax,4)
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	settable, .-settable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$500, %ecx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	12(%rsp), %rsi
	movl	$0, 12(%rsp)
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	call	settable
	movl	12(%rsp), %eax
	movl	univcnt(%rip), %r10d
	testl	%eax, %eax
	jle	.L29
	leal	1(%rax), %r12d
	movl	$2, %ebp
	leaq	-4+primetable(%rip), %r11
	cmpl	$1, %eax
	je	.L29
	.p2align 4,,10
	.p2align 3
.L28:
	testl	%r10d, %r10d
	jle	.L25
	movl	%ebp, %ecx
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%ecx, %eax
	movl	(%r11,%r9,4), %esi
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L27
	movl	-4(%rbx,%r9,4), %eax
	leal	1(%rax), %edi
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%ecx, %eax
	movl	%edi, %r8d
	addl	$1, %edi
	cltd
	idivl	%esi
	cltd
	movl	%eax, %ecx
	idivl	%esi
	testl	%edx, %edx
	je	.L24
	movl	%r8d, -4(%rbx,%r9,4)
.L27:
	cmpl	$1, %ecx
	setne	%dl
	cmpl	%r9d, %r10d
	setg	%al
	addq	$1, %r9
	testb	%al, %dl
	jne	.L30
.L25:
	addl	$1, %ebp
	cmpl	%r12d, %ebp
	jne	.L28
.L29:
	testl	%r10d, %r10d
	jle	.L35
	leal	-1(%r10), %eax
	movl	$1, %edx
	movabsq	$-8543223828751151131, %rsi
	leaq	20(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L32:
	movl	(%rbx), %eax
	addq	$4, %rbx
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpq	%rdi, %rbx
	jne	.L32
.L31:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$4032, %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
.L35:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L31
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	univcnt
	.bss
	.align 4
	.type	univcnt, @object
	.size	univcnt, 4
univcnt:
	.zero	4
	.globl	primetable
	.align 32
	.type	primetable, @object
	.size	primetable, 4000
primetable:
	.zero	4000
	.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
	.p2align 4
	.globl	settable
	.type	settable, @function
settable:
.LFB23:
	.cfi_startproc
	endbr64
	movl	univcnt(%rip), %r9d
	xorl	%r10d, %r10d
	movl	$2, %esi
	xorl	%r8d, %r8d
	leaq	primetable(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$1, %edi
	movl	$2, %ecx
	cmpl	$2, %esi
	je	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	cmove	%r8d, %edi
	addl	$1, %ecx
	cmpl	%ecx, %esi
	jne	.L4
	testl	%edi, %edi
	jne	.L7
.L5:
	addl	$1, %esi
	cmpl	$1001, %esi
	jne	.L2
	testb	%r10b, %r10b
	je	.L1
	movl	%r9d, univcnt(%rip)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	%r9d, %rax
	movl	$1, %r10d
	addl	$1, %r9d
	movl	%esi, (%r11,%rax,4)
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	settable, .-settable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$500, %ecx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	12(%rsp), %rsi
	movl	$0, 12(%rsp)
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	call	settable
	movl	12(%rsp), %eax
	movl	univcnt(%rip), %r10d
	testl	%eax, %eax
	jle	.L29
	leal	1(%rax), %r12d
	movl	$2, %ebp
	leaq	-4+primetable(%rip), %r11
	cmpl	$1, %eax
	je	.L29
	.p2align 4,,10
	.p2align 3
.L28:
	testl	%r10d, %r10d
	jle	.L25
	movl	%ebp, %ecx
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%ecx, %eax
	movl	(%r11,%r9,4), %esi
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L27
	movl	-4(%rbx,%r9,4), %eax
	leal	1(%rax), %edi
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%ecx, %eax
	movl	%edi, %r8d
	addl	$1, %edi
	cltd
	idivl	%esi
	cltd
	movl	%eax, %ecx
	idivl	%esi
	testl	%edx, %edx
	je	.L24
	movl	%r8d, -4(%rbx,%r9,4)
.L27:
	cmpl	$1, %ecx
	setne	%dl
	cmpl	%r9d, %r10d
	setg	%al
	addq	$1, %r9
	testb	%al, %dl
	jne	.L30
.L25:
	addl	$1, %ebp
	cmpl	%r12d, %ebp
	jne	.L28
.L29:
	testl	%r10d, %r10d
	jle	.L35
	leal	-1(%r10), %eax
	movl	$1, %edx
	movabsq	$-8543223828751151131, %rsi
	leaq	20(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L32:
	movl	(%rbx), %eax
	addq	$4, %rbx
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpq	%rdi, %rbx
	jne	.L32
.L31:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$4032, %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
.L35:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L31
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	univcnt
	.bss
	.align 4
	.type	univcnt, @object
	.size	univcnt, 4
univcnt:
	.zero	4
	.globl	primetable
	.align 32
	.type	primetable, @object
	.size	primetable, 4000
primetable:
	.zero	4000
	.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>
int primetable[1000] = {};
int univcnt = 0;

void settable(){
  int i = 0;
  int j = 0;
  int primeflag = 0;
  for(i=2;i<=1000;i++){
    primeflag = 1;
    for(j=2;j<i;j++){
      if(i % j == 0){
        primeflag = 0;
      }
    }
    if(primeflag){
      primetable[univcnt] = i;
      univcnt++;
    }
  }
}
        
int main(){
  int n = 0;
  int primecnt[1000] = {};
  int i = 0;
  int j = 0;
  int k = 0;
  long long cnt = 1;
  scanf("%d",&n);
  settable();
  for(i=1;i<=n;i++){
    k = i;
    for(j=0;j<univcnt && k != 1;j++){
      while(k % primetable[j] == 0){
        k /= primetable[j];
        primecnt[j]++;
      }
    }
  }
  //printf("%d#",primetable[1]);
  //printf("%d#",primecnt[1]);
  for(i=0;i<univcnt;i++){
    cnt = (cnt * (primecnt[i]+1))%1000000007;
  }
  printf("%lld\n",cnt);
  
        
  return 0;
}
8
 0
 15
 18
 2
 4
 9
 5
 10
 7

96
 1
 4032
 14688
 2
 8
 160
 16
 270
 60

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>
int primetable[1000] = {};
int univcnt = 0;

void settable(){
  int i = 0;
  int j = 0;
  int primeflag = 0;
  for(i=2;i<=1000;i++){
    primeflag = 1;
    for(j=2;j<i;j++){
      if(i % j == 0){
        primeflag = 0;
      }
    }
    if(primeflag){
      primetable[univcnt] = i;
      univcnt++;
    }
  }
}
        
int main(){
  int n = 0;
  int primecnt[1000] = {};
  int i = 0;
  int j = 0;
  int k = 0;
  long long cnt = 1;
  scanf("%d",&n);
  settable();
  for(i=1;i<=n;i++){
    k = i;
    for(j=0;j<univcnt && k != 1;j++){
      while(k % primetable[j] == 0){
        k /= primetable[j];
        primecnt[j]++;
      }
    }
  }
  //printf("%d#",primetable[1]);
  //printf("%d#",primecnt[1]);
  for(i=0;i<univcnt;i++){
    cnt = (cnt * (primecnt[i]+1))%1000000007;
  }
  printf("%lld\n",cnt);
  
        
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	primetable
	.bss
	.align 32
	.type	primetable, @object
	.size	primetable, 4000
primetable:
	.zero	4000
	.globl	univcnt
	.align 4
	.type	univcnt, @object
	.size	univcnt, 4
univcnt:
	.zero	4
	.text
	.globl	settable
	.type	settable, @function
settable:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	$2, -12(%rbp)
	jmp	.L2
.L7:
	movl	$1, -4(%rbp)
	movl	$2, -8(%rbp)
	jmp	.L3
.L5:
	movl	-12(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, -4(%rbp)
.L4:
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L5
	cmpl	$0, -4(%rbp)
	je	.L6
	movl	univcnt(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	primetable(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	univcnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, univcnt(%rip)
.L6:
	addl	$1, -12(%rbp)
.L2:
	cmpl	$1000, -12(%rbp)
	jle	.L7
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	settable, .-settable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4040(%rbp)
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -4036(%rbp)
	movl	$0, -4032(%rbp)
	movl	$0, -4028(%rbp)
	movq	$1, -4024(%rbp)
	leaq	-4040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	settable
	movl	$1, -4036(%rbp)
	jmp	.L9
.L15:
	movl	-4036(%rbp), %eax
	movl	%eax, -4028(%rbp)
	movl	$0, -4032(%rbp)
	jmp	.L10
.L12:
	movl	-4032(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primetable(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4028(%rbp), %eax
	cltd
	idivl	%esi
	movl	%eax, -4028(%rbp)
	movl	-4032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-4032(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L11:
	movl	-4032(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primetable(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4028(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L12
	addl	$1, -4032(%rbp)
.L10:
	movl	univcnt(%rip), %eax
	cmpl	%eax, -4032(%rbp)
	jge	.L13
	cmpl	$1, -4028(%rbp)
	jne	.L11
.L13:
	addl	$1, -4036(%rbp)
.L9:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4036(%rbp)
	jle	.L15
	movl	$0, -4036(%rbp)
	jmp	.L16
.L17:
	movl	-4036(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	addl	$1, %eax
	cltq
	imulq	-4024(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -4024(%rbp)
	movq	-4024(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -4024(%rbp)
	addl	$1, -4036(%rbp)
.L16:
	movl	univcnt(%rip), %eax
	cmpl	%eax, -4036(%rbp)
	jl	.L17
	movq	-4024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	primetable
	.bss
	.align 32
	.type	primetable, @object
	.size	primetable, 4000
primetable:
	.zero	4000
	.globl	univcnt
	.align 4
	.type	univcnt, @object
	.size	univcnt, 4
univcnt:
	.zero	4
	.text
	.globl	settable
	.type	settable, @function
settable:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	$2, -12(%rbp)
	jmp	.L2
.L7:
	movl	$1, -4(%rbp)
	movl	$2, -8(%rbp)
	jmp	.L3
.L5:
	movl	-12(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, -4(%rbp)
.L4:
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L5
	cmpl	$0, -4(%rbp)
	je	.L6
	movl	univcnt(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	primetable(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	univcnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, univcnt(%rip)
.L6:
	addl	$1, -12(%rbp)
.L2:
	cmpl	$1000, -12(%rbp)
	jle	.L7
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	settable, .-settable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4040(%rbp)
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -4036(%rbp)
	movl	$0, -4032(%rbp)
	movl	$0, -4028(%rbp)
	movq	$1, -4024(%rbp)
	leaq	-4040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	settable
	movl	$1, -4036(%rbp)
	jmp	.L9
.L15:
	movl	-4036(%rbp), %eax
	movl	%eax, -4028(%rbp)
	movl	$0, -4032(%rbp)
	jmp	.L10
.L12:
	movl	-4032(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primetable(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4028(%rbp), %eax
	cltd
	idivl	%esi
	movl	%eax, -4028(%rbp)
	movl	-4032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-4032(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L11:
	movl	-4032(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	primetable(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4028(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L12
	addl	$1, -4032(%rbp)
.L10:
	movl	univcnt(%rip), %eax
	cmpl	%eax, -4032(%rbp)
	jge	.L13
	cmpl	$1, -4028(%rbp)
	jne	.L11
.L13:
	addl	$1, -4036(%rbp)
.L9:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4036(%rbp)
	jle	.L15
	movl	$0, -4036(%rbp)
	jmp	.L16
.L17:
	movl	-4036(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	addl	$1, %eax
	cltq
	imulq	-4024(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -4024(%rbp)
	movq	-4024(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -4024(%rbp)
	addl	$1, -4036(%rbp)
.L16:
	movl	univcnt(%rip), %eax
	cmpl	%eax, -4036(%rbp)
	jl	.L17
	movq	-4024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
