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

```c
// AOJ 1060: No Story
// 2017.10.7 bal4u@uu
// 2017.12.15

#include <stdio.h>
#include <math.h>

#define MAX 48624			// ptbl[0] = 3, ptbl[5000] = 48623
int power[100], sz;
char tbl[MAX+2];

int psz;
int ptbl[50012] = {			// ptbl[166] = 997
         3,   5,   7,  11,  13,  17,  19,  23,  29,
   31,  37,  41,  43,  47,  53,  59,  61,  67,  71,
   73,  79,  83,  89,  97, 101, 103, 107, 109, 113,
  127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
  179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
  233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
  283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
  353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
  419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
  467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
  547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
  607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
  661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
  739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
  811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
  877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
  947, 953, 967, 971, 977, 983, 991, 997 };

void sieve()
{
	int i, j, k;

	for (i = 0; i < 167; i++) {
		k = ptbl[i];
		for (j = k*k; j < MAX; j += k) tbl[j] = 1;
	}
	for (psz = 166, i = 997; i <= MAX; i += 2) if (!tbl[i]) ptbl[psz++] = i;
}

void prime_factor(long long n)
{
    int i, a, k;
    int *pp;

    sz = 0;
    if (!(n & 1)) {
        power[sz] = 0;
        do n >>= 1, power[sz]++;
        while (!(n & 1));
        sz++;
    }
	if (n <= 1) return;
	if (n <= MAX && !tbl[n]) { power[sz++] = 1; return; }
    k = (int)sqrt((double)n);
	for (pp = ptbl; n > 1 && *pp; pp++) {
        if (*pp > k || n <= MAX && !tbl[n]) { power[sz++] = 1; return; }
		if (n % *pp) continue;
		a = *pp, power[sz] = 0;
		do n /= a, power[sz]++;
	    while (n % a == 0);
		sz++;
	}
	if (n <= 1) return;
	for (i = 48623; n > 1; i+=2) {
        if (i > k) { power[sz++] = 1; break; }
        if (n % i == 0) {
            power[sz] = 0;
            do n /= i, power[sz]++;
            while (n % i == 0);
            sz++;
        }
    }
}

int main()
{
	long long n, ans;
	int i;

	sieve();
	while (scanf("%lld", &n) && n > 0) {
		if (n == 1) { puts("1"); continue; }
		if (n <= MAX && (n & 1) && !tbl[n]) { puts("2"); continue; }
        prime_factor(n);
		for (ans = 1, i = 0; i < sz; i++) ans = ans * (1 + (power[i] << 1));
        printf("%lld\n", (ans+1)>>1);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	power
	.bss
	.align 32
	.type	power, @object
	.size	power, 400
power:
	.zero	400
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 48626
tbl:
	.zero	48626
	.globl	psz
	.align 4
	.type	psz, @object
	.size	psz, 4
psz:
	.zero	4
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 200048
ptbl:
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.long	179
	.long	181
	.long	191
	.long	193
	.long	197
	.long	199
	.long	211
	.long	223
	.long	227
	.long	229
	.long	233
	.long	239
	.long	241
	.long	251
	.long	257
	.long	263
	.long	269
	.long	271
	.long	277
	.long	281
	.long	283
	.long	293
	.long	307
	.long	311
	.long	313
	.long	317
	.long	331
	.long	337
	.long	347
	.long	349
	.long	353
	.long	359
	.long	367
	.long	373
	.long	379
	.long	383
	.long	389
	.long	397
	.long	401
	.long	409
	.long	419
	.long	421
	.long	431
	.long	433
	.long	439
	.long	443
	.long	449
	.long	457
	.long	461
	.long	463
	.long	467
	.long	479
	.long	487
	.long	491
	.long	499
	.long	503
	.long	509
	.long	521
	.long	523
	.long	541
	.long	547
	.long	557
	.long	563
	.long	569
	.long	571
	.long	577
	.long	587
	.long	593
	.long	599
	.long	601
	.long	607
	.long	613
	.long	617
	.long	619
	.long	631
	.long	641
	.long	643
	.long	647
	.long	653
	.long	659
	.long	661
	.long	673
	.long	677
	.long	683
	.long	691
	.long	701
	.long	709
	.long	719
	.long	727
	.long	733
	.long	739
	.long	743
	.long	751
	.long	757
	.long	761
	.long	769
	.long	773
	.long	787
	.long	797
	.long	809
	.long	811
	.long	821
	.long	823
	.long	827
	.long	829
	.long	839
	.long	853
	.long	857
	.long	859
	.long	863
	.long	877
	.long	881
	.long	883
	.long	887
	.long	907
	.long	911
	.long	919
	.long	929
	.long	937
	.long	941
	.long	947
	.long	953
	.long	967
	.long	971
	.long	977
	.long	983
	.long	991
	.long	997
	.zero	199380
	.text
	.globl	sieve
	.type	sieve, @function
sieve:
.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)
	jmp	.L2
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ptbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L3:
	cmpl	$48623, -8(%rbp)
	jle	.L4
	addl	$1, -12(%rbp)
.L2:
	cmpl	$166, -12(%rbp)
	jle	.L5
	movl	$166, psz(%rip)
	movl	$997, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L7
	movl	psz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, psz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ptbl(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$2, -12(%rbp)
.L6:
	cmpl	$48624, -12(%rbp)
	jle	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sieve, .-sieve
	.globl	prime_factor
	.type	prime_factor, @function
prime_factor:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -40(%rbp)
	movl	$0, sz(%rip)
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L10
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	sarq	-40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L11
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
.L10:
	cmpq	$1, -40(%rbp)
	jle	.L29
	cmpq	$48624, -40(%rbp)
	jg	.L14
	leaq	tbl(%rip), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L14:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-40(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L15
.L22:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L16
	cmpq	$48624, -40(%rbp)
	jg	.L17
	leaq	tbl(%rip), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L17
.L16:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L17:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L30
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L20
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
	jmp	.L19
.L30:
	nop
.L19:
	addq	$4, -8(%rbp)
.L15:
	cmpq	$1, -40(%rbp)
	jle	.L21
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L22
.L21:
	cmpq	$1, -40(%rbp)
	jle	.L31
	movl	$48623, -20(%rbp)
	jmp	.L24
.L28:
	movl	-20(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L25
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L25:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L26
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L27:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L27
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
.L26:
	addl	$2, -20(%rbp)
.L24:
	cmpq	$1, -40(%rbp)
	jg	.L28
	jmp	.L9
.L29:
	nop
	jmp	.L9
.L31:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	prime_factor, .-prime_factor
	.section	.rodata
.LC0:
	.string	"1"
.LC1:
	.string	"2"
.LC2:
	.string	"%lld\n"
.LC3:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	sieve
	jmp	.L33
.L39:
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L34
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L33
.L34:
	movq	-24(%rbp), %rax
	cmpq	$48624, %rax
	jg	.L35
	movq	-24(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L35
	movq	-24(%rbp), %rax
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L35
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L33
.L35:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	prime_factor
	movq	$1, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L36
.L37:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	movq	-16(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -28(%rbp)
.L36:
	movl	sz(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L37
	movq	-16(%rbp), %rax
	addq	$1, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L33:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L38
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L39
.L38:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	sieve
	.type	sieve, @function
sieve:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	tbl(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	1(%r13), %rcx
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	ptbl(%rip), %rbx
	movq	%rbx, %r12
	leaq	668(%rbx), %rbp
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rcx, %rdi
	movl	$48623, %edx
	movl	$1, %esi
	call	memset@PLT
	movq	%rax, %rcx
.L7:
	addq	$4, %r12
	cmpq	%rbp, %r12
	je	.L21
.L3:
	movslq	(%r12), %rdx
	movl	%edx, %eax
	imull	%edx, %eax
	cmpl	$48623, %eax
	jg	.L7
	cmpl	$1, %edx
	je	.L5
	cltq
	.p2align 4,,10
	.p2align 3
.L6:
	movb	$1, 0(%r13,%rax)
	addq	%rdx, %rax
	cmpl	$48623, %eax
	jle	.L6
	addq	$4, %r12
	cmpq	%rbp, %r12
	jne	.L3
.L21:
	movl	$997, %eax
	xorl	%ecx, %ecx
	movl	$166, %edx
	movl	$166, psz(%rip)
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$0, 0(%r13,%rax)
	jne	.L9
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, (%rbx,%rcx,4)
	movl	$1, %ecx
.L9:
	addq	$2, %rax
	cmpq	$48625, %rax
	jne	.L10
	testb	%cl, %cl
	je	.L1
	movl	%edx, psz(%rip)
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	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
.LFE23:
	.size	sieve, .-sieve
	.p2align 4
	.globl	prime_factor
	.type	prime_factor, @function
prime_factor:
.LFB24:
	.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
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	andl	$1, %edi
	movl	$0, sz(%rip)
	jne	.L46
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L24:
	sarq	%rbx
	movl	%eax, %edx
	addl	$1, %eax
	testb	$1, %bl
	je	.L24
	movl	%edx, power(%rip)
	movl	$2, %r13d
	movl	$1, %r12d
	movl	$1, sz(%rip)
	cmpq	$1, %rbx
	jg	.L66
.L22:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	movl	$1, %r13d
	xorl	%r12d, %r12d
	cmpq	$1, %rbx
	jle	.L22
.L66:
	cmpq	$48624, %rbx
	jg	.L26
	leaq	tbl(%rip), %rax
	cmpb	$0, (%rax,%rbx)
	je	.L67
.L26:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rbx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L62
	sqrtsd	%xmm0, %xmm0
.L29:
	cvttsd2sil	%xmm0, %r10d
	movl	%r12d, %r9d
	xorl	%esi, %esi
	leaq	ptbl(%rip), %r8
	leaq	power(%rip), %r11
	leaq	tbl(%rip), %rbp
.L30:
	movslq	(%r8), %rcx
	testl	%ecx, %ecx
	je	.L68
.L37:
	cmpl	%r10d, %ecx
	jg	.L65
	cmpq	$48624, %rbx
	jg	.L33
	cmpb	$0, 0(%rbp,%rbx)
	je	.L65
.L33:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L69
	movslq	4(%r8), %rcx
	addq	$4, %r8
	testl	%ecx, %ecx
	jne	.L37
.L68:
	testb	%sil, %sil
	movl	$48623, %ecx
	cmove	%r12d, %r9d
	xorl	%esi, %esi
	movl	%r9d, %r8d
.L44:
	cmpl	%ecx, %r10d
	jl	.L70
.L39:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L71
	addq	$2, %rcx
	cmpl	%ecx, %r10d
	jge	.L39
.L70:
	testb	%sil, %sil
	cmove	%r9d, %r8d
	leal	1(%r8), %eax
	movslq	%r8d, %r8
	movl	%eax, sz(%rip)
	movl	$1, (%r11,%r8,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L69:
	.cfi_restore_state
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L35:
	movq	%rbx, %rax
	movl	%esi, %edi
	addl	$1, %esi
	cqto
	idivq	%rcx
	cqto
	movq	%rax, %rbx
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L35
	movslq	%r9d, %rax
	addq	$4, %r8
	addl	$1, %r9d
	movl	%edi, (%r11,%rax,4)
	cmpq	$1, %rbx
	jle	.L72
	movl	$1, %esi
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L65:
	testb	%sil, %sil
	je	.L32
	leal	1(%r9), %r13d
	movslq	%r9d, %r12
.L32:
	movl	%r13d, sz(%rip)
	movl	$1, (%r11,%r12,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L67:
	.cfi_restore_state
	leaq	power(%rip), %rax
	movl	%r13d, sz(%rip)
	movl	$1, (%rax,%r12,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L71:
	.cfi_restore_state
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rbx, %rax
	movl	%esi, %edi
	addl	$1, %esi
	cqto
	idivq	%rcx
	cqto
	movq	%rax, %rbx
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L42
	movslq	%r8d, %rax
	addq	$2, %rcx
	addl	$1, %r8d
	movl	%edi, (%r11,%rax,4)
	cmpq	$1, %rbx
	jle	.L43
	movl	$1, %esi
	jmp	.L44
.L72:
	movl	%r9d, sz(%rip)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L43:
	.cfi_restore_state
	movl	%r8d, sz(%rip)
	jmp	.L22
.L62:
	call	sqrt@PLT
	jmp	.L29
	.cfi_endproc
.LFE24:
	.size	prime_factor, .-prime_factor
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"1"
.LC2:
	.string	"2"
.LC3:
	.string	"%lld\n"
.LC4:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	tbl(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	4+power(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC3(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC4(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	call	sieve
	.p2align 4,,10
	.p2align 3
.L74:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L80
	movq	(%rsp), %rdi
	testq	%rdi, %rdi
	jle	.L80
	cmpq	$1, %rdi
	je	.L92
	cmpq	$48624, %rdi
	jg	.L77
	testb	$1, %dil
	je	.L77
	cmpb	$0, (%r14,%rdi)
	je	.L93
.L77:
	call	prime_factor
	movl	sz(%rip), %edx
	testl	%edx, %edx
	jle	.L83
	subl	$1, %edx
	leaq	power(%rip), %rax
	leaq	0(%r13,%rdx,4), %rsi
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L79:
	movl	(%rax), %ecx
	addq	$4, %rax
	leal	1(%rcx,%rcx), %ecx
	movslq	%ecx, %rcx
	imulq	%rcx, %rdx
	cmpq	%rax, %rsi
	jne	.L79
.L78:
	addq	$1, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	sarq	%rdx
	call	__printf_chk@PLT
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L93:
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L80:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L94
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L92:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L74
.L83:
	movl	$1, %edx
	jmp	.L78
.L94:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 200048
ptbl:
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.long	179
	.long	181
	.long	191
	.long	193
	.long	197
	.long	199
	.long	211
	.long	223
	.long	227
	.long	229
	.long	233
	.long	239
	.long	241
	.long	251
	.long	257
	.long	263
	.long	269
	.long	271
	.long	277
	.long	281
	.long	283
	.long	293
	.long	307
	.long	311
	.long	313
	.long	317
	.long	331
	.long	337
	.long	347
	.long	349
	.long	353
	.long	359
	.long	367
	.long	373
	.long	379
	.long	383
	.long	389
	.long	397
	.long	401
	.long	409
	.long	419
	.long	421
	.long	431
	.long	433
	.long	439
	.long	443
	.long	449
	.long	457
	.long	461
	.long	463
	.long	467
	.long	479
	.long	487
	.long	491
	.long	499
	.long	503
	.long	509
	.long	521
	.long	523
	.long	541
	.long	547
	.long	557
	.long	563
	.long	569
	.long	571
	.long	577
	.long	587
	.long	593
	.long	599
	.long	601
	.long	607
	.long	613
	.long	617
	.long	619
	.long	631
	.long	641
	.long	643
	.long	647
	.long	653
	.long	659
	.long	661
	.long	673
	.long	677
	.long	683
	.long	691
	.long	701
	.long	709
	.long	719
	.long	727
	.long	733
	.long	739
	.long	743
	.long	751
	.long	757
	.long	761
	.long	769
	.long	773
	.long	787
	.long	797
	.long	809
	.long	811
	.long	821
	.long	823
	.long	827
	.long	829
	.long	839
	.long	853
	.long	857
	.long	859
	.long	863
	.long	877
	.long	881
	.long	883
	.long	887
	.long	907
	.long	911
	.long	919
	.long	929
	.long	937
	.long	941
	.long	947
	.long	953
	.long	967
	.long	971
	.long	977
	.long	983
	.long	991
	.long	997
	.zero	199380
	.globl	psz
	.bss
	.align 4
	.type	psz, @object
	.size	psz, 4
psz:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 48626
tbl:
	.zero	48626
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	power
	.align 32
	.type	power, @object
	.size	power, 400
power:
	.zero	400
	.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	sieve
	.type	sieve, @function
sieve:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	tbl(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	1(%r13), %rcx
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	ptbl(%rip), %rbx
	movq	%rbx, %r12
	leaq	668(%rbx), %rbp
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rcx, %rdi
	movl	$48623, %edx
	movl	$1, %esi
	call	memset@PLT
	movq	%rax, %rcx
.L7:
	addq	$4, %r12
	cmpq	%rbp, %r12
	je	.L21
.L3:
	movslq	(%r12), %rdx
	movl	%edx, %eax
	imull	%edx, %eax
	cmpl	$48623, %eax
	jg	.L7
	cmpl	$1, %edx
	je	.L5
	cltq
	.p2align 4,,10
	.p2align 3
.L6:
	movb	$1, 0(%r13,%rax)
	addq	%rdx, %rax
	cmpl	$48623, %eax
	jle	.L6
	addq	$4, %r12
	cmpq	%rbp, %r12
	jne	.L3
.L21:
	movl	$997, %eax
	xorl	%ecx, %ecx
	movl	$166, %edx
	movl	$166, psz(%rip)
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$0, 0(%r13,%rax)
	jne	.L9
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, (%rbx,%rcx,4)
	movl	$1, %ecx
.L9:
	addq	$2, %rax
	cmpq	$48625, %rax
	jne	.L10
	testb	%cl, %cl
	je	.L1
	movl	%edx, psz(%rip)
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	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
.LFE23:
	.size	sieve, .-sieve
	.p2align 4
	.globl	prime_factor
	.type	prime_factor, @function
prime_factor:
.LFB24:
	.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
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	andl	$1, %edi
	movl	$0, sz(%rip)
	jne	.L46
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L24:
	sarq	%rbx
	movl	%eax, %edx
	addl	$1, %eax
	testb	$1, %bl
	je	.L24
	movl	%edx, power(%rip)
	movl	$2, %r13d
	movl	$1, %r12d
	movl	$1, sz(%rip)
	cmpq	$1, %rbx
	jg	.L66
.L22:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L46:
	.cfi_restore_state
	movl	$1, %r13d
	xorl	%r12d, %r12d
	cmpq	$1, %rbx
	jle	.L22
.L66:
	cmpq	$48624, %rbx
	jg	.L26
	leaq	tbl(%rip), %rax
	cmpb	$0, (%rax,%rbx)
	je	.L67
.L26:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rbx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L62
	sqrtsd	%xmm0, %xmm0
.L29:
	cvttsd2sil	%xmm0, %r10d
	movl	%r12d, %r9d
	xorl	%esi, %esi
	leaq	ptbl(%rip), %r8
	leaq	power(%rip), %r11
	leaq	tbl(%rip), %rbp
.L30:
	movslq	(%r8), %rcx
	testl	%ecx, %ecx
	je	.L68
.L37:
	cmpl	%r10d, %ecx
	jg	.L65
	cmpq	$48624, %rbx
	jg	.L33
	cmpb	$0, 0(%rbp,%rbx)
	je	.L65
.L33:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L69
	movslq	4(%r8), %rcx
	addq	$4, %r8
	testl	%ecx, %ecx
	jne	.L37
.L68:
	testb	%sil, %sil
	movl	$48623, %ecx
	cmove	%r12d, %r9d
	xorl	%esi, %esi
	movl	%r9d, %r8d
.L44:
	cmpl	%ecx, %r10d
	jl	.L70
.L39:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L71
	addq	$2, %rcx
	cmpl	%ecx, %r10d
	jge	.L39
.L70:
	testb	%sil, %sil
	cmove	%r9d, %r8d
	leal	1(%r8), %eax
	movslq	%r8d, %r8
	movl	%eax, sz(%rip)
	movl	$1, (%r11,%r8,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L69:
	.cfi_restore_state
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L35:
	movq	%rbx, %rax
	movl	%esi, %edi
	addl	$1, %esi
	cqto
	idivq	%rcx
	cqto
	movq	%rax, %rbx
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L35
	movslq	%r9d, %rax
	addq	$4, %r8
	addl	$1, %r9d
	movl	%edi, (%r11,%rax,4)
	cmpq	$1, %rbx
	jle	.L72
	movl	$1, %esi
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L65:
	testb	%sil, %sil
	je	.L32
	leal	1(%r9), %r13d
	movslq	%r9d, %r12
.L32:
	movl	%r13d, sz(%rip)
	movl	$1, (%r11,%r12,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L67:
	.cfi_restore_state
	leaq	power(%rip), %rax
	movl	%r13d, sz(%rip)
	movl	$1, (%rax,%r12,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L71:
	.cfi_restore_state
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rbx, %rax
	movl	%esi, %edi
	addl	$1, %esi
	cqto
	idivq	%rcx
	cqto
	movq	%rax, %rbx
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L42
	movslq	%r8d, %rax
	addq	$2, %rcx
	addl	$1, %r8d
	movl	%edi, (%r11,%rax,4)
	cmpq	$1, %rbx
	jle	.L43
	movl	$1, %esi
	jmp	.L44
.L72:
	movl	%r9d, sz(%rip)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L43:
	.cfi_restore_state
	movl	%r8d, sz(%rip)
	jmp	.L22
.L62:
	call	sqrt@PLT
	jmp	.L29
	.cfi_endproc
.LFE24:
	.size	prime_factor, .-prime_factor
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"1"
.LC2:
	.string	"2"
.LC3:
	.string	"%lld\n"
.LC4:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	tbl(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	4+power(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC3(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC4(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	call	sieve
	.p2align 4,,10
	.p2align 3
.L74:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L80
	movq	(%rsp), %rdi
	testq	%rdi, %rdi
	jle	.L80
	cmpq	$1, %rdi
	je	.L92
	cmpq	$48624, %rdi
	jg	.L77
	testb	$1, %dil
	je	.L77
	cmpb	$0, (%r14,%rdi)
	je	.L93
.L77:
	call	prime_factor
	movl	sz(%rip), %edx
	testl	%edx, %edx
	jle	.L83
	subl	$1, %edx
	leaq	power(%rip), %rax
	leaq	0(%r13,%rdx,4), %rsi
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L79:
	movl	(%rax), %ecx
	addq	$4, %rax
	leal	1(%rcx,%rcx), %ecx
	movslq	%ecx, %rcx
	imulq	%rcx, %rdx
	cmpq	%rax, %rsi
	jne	.L79
.L78:
	addq	$1, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	sarq	%rdx
	call	__printf_chk@PLT
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L93:
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L80:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L94
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L92:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L74
.L83:
	movl	$1, %edx
	jmp	.L78
.L94:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 200048
ptbl:
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.long	179
	.long	181
	.long	191
	.long	193
	.long	197
	.long	199
	.long	211
	.long	223
	.long	227
	.long	229
	.long	233
	.long	239
	.long	241
	.long	251
	.long	257
	.long	263
	.long	269
	.long	271
	.long	277
	.long	281
	.long	283
	.long	293
	.long	307
	.long	311
	.long	313
	.long	317
	.long	331
	.long	337
	.long	347
	.long	349
	.long	353
	.long	359
	.long	367
	.long	373
	.long	379
	.long	383
	.long	389
	.long	397
	.long	401
	.long	409
	.long	419
	.long	421
	.long	431
	.long	433
	.long	439
	.long	443
	.long	449
	.long	457
	.long	461
	.long	463
	.long	467
	.long	479
	.long	487
	.long	491
	.long	499
	.long	503
	.long	509
	.long	521
	.long	523
	.long	541
	.long	547
	.long	557
	.long	563
	.long	569
	.long	571
	.long	577
	.long	587
	.long	593
	.long	599
	.long	601
	.long	607
	.long	613
	.long	617
	.long	619
	.long	631
	.long	641
	.long	643
	.long	647
	.long	653
	.long	659
	.long	661
	.long	673
	.long	677
	.long	683
	.long	691
	.long	701
	.long	709
	.long	719
	.long	727
	.long	733
	.long	739
	.long	743
	.long	751
	.long	757
	.long	761
	.long	769
	.long	773
	.long	787
	.long	797
	.long	809
	.long	811
	.long	821
	.long	823
	.long	827
	.long	829
	.long	839
	.long	853
	.long	857
	.long	859
	.long	863
	.long	877
	.long	881
	.long	883
	.long	887
	.long	907
	.long	911
	.long	919
	.long	929
	.long	937
	.long	941
	.long	947
	.long	953
	.long	967
	.long	971
	.long	977
	.long	983
	.long	991
	.long	997
	.zero	199380
	.globl	psz
	.bss
	.align 4
	.type	psz, @object
	.size	psz, 4
psz:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 48626
tbl:
	.zero	48626
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	power
	.align 32
	.type	power, @object
	.size	power, 400
power:
	.zero	400
	.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:

// AOJ 1060: No Story
// 2017.10.7 bal4u@uu
// 2017.12.15

#include <stdio.h>
#include <math.h>

#define MAX 48624			// ptbl[0] = 3, ptbl[5000] = 48623
int power[100], sz;
char tbl[MAX+2];

int psz;
int ptbl[50012] = {			// ptbl[166] = 997
         3,   5,   7,  11,  13,  17,  19,  23,  29,
   31,  37,  41,  43,  47,  53,  59,  61,  67,  71,
   73,  79,  83,  89,  97, 101, 103, 107, 109, 113,
  127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
  179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
  233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
  283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
  353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
  419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
  467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
  547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
  607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
  661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
  739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
  811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
  877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
  947, 953, 967, 971, 977, 983, 991, 997 };

void sieve()
{
	int i, j, k;

	for (i = 0; i < 167; i++) {
		k = ptbl[i];
		for (j = k*k; j < MAX; j += k) tbl[j] = 1;
	}
	for (psz = 166, i = 997; i <= MAX; i += 2) if (!tbl[i]) ptbl[psz++] = i;
}

void prime_factor(long long n)
{
    int i, a, k;
    int *pp;

    sz = 0;
    if (!(n & 1)) {
        power[sz] = 0;
        do n >>= 1, power[sz]++;
        while (!(n & 1));
        sz++;
    }
	if (n <= 1) return;
	if (n <= MAX && !tbl[n]) { power[sz++] = 1; return; }
    k = (int)sqrt((double)n);
	for (pp = ptbl; n > 1 && *pp; pp++) {
        if (*pp > k || n <= MAX && !tbl[n]) { power[sz++] = 1; return; }
		if (n % *pp) continue;
		a = *pp, power[sz] = 0;
		do n /= a, power[sz]++;
	    while (n % a == 0);
		sz++;
	}
	if (n <= 1) return;
	for (i = 48623; n > 1; i+=2) {
        if (i > k) { power[sz++] = 1; break; }
        if (n % i == 0) {
            power[sz] = 0;
            do n /= i, power[sz]++;
            while (n % i == 0);
            sz++;
        }
    }
}

int main()
{
	long long n, ans;
	int i;

	sieve();
	while (scanf("%lld", &n) && n > 0) {
		if (n == 1) { puts("1"); continue; }
		if (n <= MAX && (n & 1) && !tbl[n]) { puts("2"); continue; }
        prime_factor(n);
		for (ans = 1, i = 0; i < sz; i++) ans = ans * (1 + (power[i] << 1));
        printf("%lld\n", (ans+1)>>1);
	}
	return 0;
}
12
11
2
0
 12
9
3
0
 12
8
2
0
 12
9
0
0
 12
0
3
0
 12
15
2
0
 12
9
1
0
 12
8
1
0
 12
9
4
0
 12
11
4
0

8
2
2
 8
3
2
 8
4
2
 8
3
 8
 8
5
2
 8
3
1
 8
4
1
 8
3
3
 8
2
3

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

```c
// AOJ 1060: No Story
// 2017.10.7 bal4u@uu
// 2017.12.15

#include <stdio.h>
#include <math.h>

#define MAX 48624			// ptbl[0] = 3, ptbl[5000] = 48623
int power[100], sz;
char tbl[MAX+2];

int psz;
int ptbl[50012] = {			// ptbl[166] = 997
         3,   5,   7,  11,  13,  17,  19,  23,  29,
   31,  37,  41,  43,  47,  53,  59,  61,  67,  71,
   73,  79,  83,  89,  97, 101, 103, 107, 109, 113,
  127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
  179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
  233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
  283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
  353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
  419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
  467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
  547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
  607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
  661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
  739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
  811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
  877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
  947, 953, 967, 971, 977, 983, 991, 997 };

void sieve()
{
	int i, j, k;

	for (i = 0; i < 167; i++) {
		k = ptbl[i];
		for (j = k*k; j < MAX; j += k) tbl[j] = 1;
	}
	for (psz = 166, i = 997; i <= MAX; i += 2) if (!tbl[i]) ptbl[psz++] = i;
}

void prime_factor(long long n)
{
    int i, a, k;
    int *pp;

    sz = 0;
    if (!(n & 1)) {
        power[sz] = 0;
        do n >>= 1, power[sz]++;
        while (!(n & 1));
        sz++;
    }
	if (n <= 1) return;
	if (n <= MAX && !tbl[n]) { power[sz++] = 1; return; }
    k = (int)sqrt((double)n);
	for (pp = ptbl; n > 1 && *pp; pp++) {
        if (*pp > k || n <= MAX && !tbl[n]) { power[sz++] = 1; return; }
		if (n % *pp) continue;
		a = *pp, power[sz] = 0;
		do n /= a, power[sz]++;
	    while (n % a == 0);
		sz++;
	}
	if (n <= 1) return;
	for (i = 48623; n > 1; i+=2) {
        if (i > k) { power[sz++] = 1; break; }
        if (n % i == 0) {
            power[sz] = 0;
            do n /= i, power[sz]++;
            while (n % i == 0);
            sz++;
        }
    }
}

int main()
{
	long long n, ans;
	int i;

	sieve();
	while (scanf("%lld", &n) && n > 0) {
		if (n == 1) { puts("1"); continue; }
		if (n <= MAX && (n & 1) && !tbl[n]) { puts("2"); continue; }
        prime_factor(n);
		for (ans = 1, i = 0; i < sz; i++) ans = ans * (1 + (power[i] << 1));
        printf("%lld\n", (ans+1)>>1);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	power
	.bss
	.align 32
	.type	power, @object
	.size	power, 400
power:
	.zero	400
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 48626
tbl:
	.zero	48626
	.globl	psz
	.align 4
	.type	psz, @object
	.size	psz, 4
psz:
	.zero	4
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 200048
ptbl:
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.long	179
	.long	181
	.long	191
	.long	193
	.long	197
	.long	199
	.long	211
	.long	223
	.long	227
	.long	229
	.long	233
	.long	239
	.long	241
	.long	251
	.long	257
	.long	263
	.long	269
	.long	271
	.long	277
	.long	281
	.long	283
	.long	293
	.long	307
	.long	311
	.long	313
	.long	317
	.long	331
	.long	337
	.long	347
	.long	349
	.long	353
	.long	359
	.long	367
	.long	373
	.long	379
	.long	383
	.long	389
	.long	397
	.long	401
	.long	409
	.long	419
	.long	421
	.long	431
	.long	433
	.long	439
	.long	443
	.long	449
	.long	457
	.long	461
	.long	463
	.long	467
	.long	479
	.long	487
	.long	491
	.long	499
	.long	503
	.long	509
	.long	521
	.long	523
	.long	541
	.long	547
	.long	557
	.long	563
	.long	569
	.long	571
	.long	577
	.long	587
	.long	593
	.long	599
	.long	601
	.long	607
	.long	613
	.long	617
	.long	619
	.long	631
	.long	641
	.long	643
	.long	647
	.long	653
	.long	659
	.long	661
	.long	673
	.long	677
	.long	683
	.long	691
	.long	701
	.long	709
	.long	719
	.long	727
	.long	733
	.long	739
	.long	743
	.long	751
	.long	757
	.long	761
	.long	769
	.long	773
	.long	787
	.long	797
	.long	809
	.long	811
	.long	821
	.long	823
	.long	827
	.long	829
	.long	839
	.long	853
	.long	857
	.long	859
	.long	863
	.long	877
	.long	881
	.long	883
	.long	887
	.long	907
	.long	911
	.long	919
	.long	929
	.long	937
	.long	941
	.long	947
	.long	953
	.long	967
	.long	971
	.long	977
	.long	983
	.long	991
	.long	997
	.zero	199380
	.text
	.globl	sieve
	.type	sieve, @function
sieve:
.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)
	jmp	.L2
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ptbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L3:
	cmpl	$48623, -8(%rbp)
	jle	.L4
	addl	$1, -12(%rbp)
.L2:
	cmpl	$166, -12(%rbp)
	jle	.L5
	movl	$166, psz(%rip)
	movl	$997, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L7
	movl	psz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, psz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ptbl(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$2, -12(%rbp)
.L6:
	cmpl	$48624, -12(%rbp)
	jle	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sieve, .-sieve
	.globl	prime_factor
	.type	prime_factor, @function
prime_factor:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -40(%rbp)
	movl	$0, sz(%rip)
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L10
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	sarq	-40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L11
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
.L10:
	cmpq	$1, -40(%rbp)
	jle	.L29
	cmpq	$48624, -40(%rbp)
	jg	.L14
	leaq	tbl(%rip), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L14:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-40(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L15
.L22:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L16
	cmpq	$48624, -40(%rbp)
	jg	.L17
	leaq	tbl(%rip), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L17
.L16:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L17:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L30
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L20
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
	jmp	.L19
.L30:
	nop
.L19:
	addq	$4, -8(%rbp)
.L15:
	cmpq	$1, -40(%rbp)
	jle	.L21
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L22
.L21:
	cmpq	$1, -40(%rbp)
	jle	.L31
	movl	$48623, -20(%rbp)
	jmp	.L24
.L28:
	movl	-20(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L25
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L25:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L26
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L27:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L27
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
.L26:
	addl	$2, -20(%rbp)
.L24:
	cmpq	$1, -40(%rbp)
	jg	.L28
	jmp	.L9
.L29:
	nop
	jmp	.L9
.L31:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	prime_factor, .-prime_factor
	.section	.rodata
.LC0:
	.string	"1"
.LC1:
	.string	"2"
.LC2:
	.string	"%lld\n"
.LC3:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	sieve
	jmp	.L33
.L39:
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L34
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L33
.L34:
	movq	-24(%rbp), %rax
	cmpq	$48624, %rax
	jg	.L35
	movq	-24(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L35
	movq	-24(%rbp), %rax
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L35
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L33
.L35:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	prime_factor
	movq	$1, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L36
.L37:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	movq	-16(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -28(%rbp)
.L36:
	movl	sz(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L37
	movq	-16(%rbp), %rax
	addq	$1, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L33:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L38
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L39
.L38:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	power
	.bss
	.align 32
	.type	power, @object
	.size	power, 400
power:
	.zero	400
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 48626
tbl:
	.zero	48626
	.globl	psz
	.align 4
	.type	psz, @object
	.size	psz, 4
psz:
	.zero	4
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 200048
ptbl:
	.long	3
	.long	5
	.long	7
	.long	11
	.long	13
	.long	17
	.long	19
	.long	23
	.long	29
	.long	31
	.long	37
	.long	41
	.long	43
	.long	47
	.long	53
	.long	59
	.long	61
	.long	67
	.long	71
	.long	73
	.long	79
	.long	83
	.long	89
	.long	97
	.long	101
	.long	103
	.long	107
	.long	109
	.long	113
	.long	127
	.long	131
	.long	137
	.long	139
	.long	149
	.long	151
	.long	157
	.long	163
	.long	167
	.long	173
	.long	179
	.long	181
	.long	191
	.long	193
	.long	197
	.long	199
	.long	211
	.long	223
	.long	227
	.long	229
	.long	233
	.long	239
	.long	241
	.long	251
	.long	257
	.long	263
	.long	269
	.long	271
	.long	277
	.long	281
	.long	283
	.long	293
	.long	307
	.long	311
	.long	313
	.long	317
	.long	331
	.long	337
	.long	347
	.long	349
	.long	353
	.long	359
	.long	367
	.long	373
	.long	379
	.long	383
	.long	389
	.long	397
	.long	401
	.long	409
	.long	419
	.long	421
	.long	431
	.long	433
	.long	439
	.long	443
	.long	449
	.long	457
	.long	461
	.long	463
	.long	467
	.long	479
	.long	487
	.long	491
	.long	499
	.long	503
	.long	509
	.long	521
	.long	523
	.long	541
	.long	547
	.long	557
	.long	563
	.long	569
	.long	571
	.long	577
	.long	587
	.long	593
	.long	599
	.long	601
	.long	607
	.long	613
	.long	617
	.long	619
	.long	631
	.long	641
	.long	643
	.long	647
	.long	653
	.long	659
	.long	661
	.long	673
	.long	677
	.long	683
	.long	691
	.long	701
	.long	709
	.long	719
	.long	727
	.long	733
	.long	739
	.long	743
	.long	751
	.long	757
	.long	761
	.long	769
	.long	773
	.long	787
	.long	797
	.long	809
	.long	811
	.long	821
	.long	823
	.long	827
	.long	829
	.long	839
	.long	853
	.long	857
	.long	859
	.long	863
	.long	877
	.long	881
	.long	883
	.long	887
	.long	907
	.long	911
	.long	919
	.long	929
	.long	937
	.long	941
	.long	947
	.long	953
	.long	967
	.long	971
	.long	977
	.long	983
	.long	991
	.long	997
	.zero	199380
	.text
	.globl	sieve
	.type	sieve, @function
sieve:
.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)
	jmp	.L2
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ptbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L3:
	cmpl	$48623, -8(%rbp)
	jle	.L4
	addl	$1, -12(%rbp)
.L2:
	cmpl	$166, -12(%rbp)
	jle	.L5
	movl	$166, psz(%rip)
	movl	$997, -12(%rbp)
	jmp	.L6
.L8:
	movl	-12(%rbp), %eax
	cltq
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L7
	movl	psz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, psz(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ptbl(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	addl	$2, -12(%rbp)
.L6:
	cmpl	$48624, -12(%rbp)
	jle	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sieve, .-sieve
	.globl	prime_factor
	.type	prime_factor, @function
prime_factor:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -40(%rbp)
	movl	$0, sz(%rip)
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L10
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	sarq	-40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L11
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
.L10:
	cmpq	$1, -40(%rbp)
	jle	.L29
	cmpq	$48624, -40(%rbp)
	jg	.L14
	leaq	tbl(%rip), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L14
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L14:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-40(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L15
.L22:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L16
	cmpq	$48624, -40(%rbp)
	jg	.L17
	leaq	tbl(%rip), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L17
.L16:
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L17:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L30
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L20
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
	jmp	.L19
.L30:
	nop
.L19:
	addq	$4, -8(%rbp)
.L15:
	cmpq	$1, -40(%rbp)
	jle	.L21
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L22
.L21:
	cmpq	$1, -40(%rbp)
	jle	.L31
	movl	$48623, -20(%rbp)
	jmp	.L24
.L28:
	movl	-20(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L25
	movl	sz(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, sz(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L9
.L25:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L26
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	$0, (%rdx,%rax)
.L27:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -40(%rbp)
	movl	sz(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	power(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	je	.L27
	movl	sz(%rip), %eax
	addl	$1, %eax
	movl	%eax, sz(%rip)
.L26:
	addl	$2, -20(%rbp)
.L24:
	cmpq	$1, -40(%rbp)
	jg	.L28
	jmp	.L9
.L29:
	nop
	jmp	.L9
.L31:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	prime_factor, .-prime_factor
	.section	.rodata
.LC0:
	.string	"1"
.LC1:
	.string	"2"
.LC2:
	.string	"%lld\n"
.LC3:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, %eax
	call	sieve
	jmp	.L33
.L39:
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L34
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L33
.L34:
	movq	-24(%rbp), %rax
	cmpq	$48624, %rax
	jg	.L35
	movq	-24(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L35
	movq	-24(%rbp), %rax
	leaq	tbl(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L35
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L33
.L35:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	prime_factor
	movq	$1, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L36
.L37:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	power(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	movq	-16(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	addl	$1, -28(%rbp)
.L36:
	movl	sz(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L37
	movq	-16(%rbp), %rax
	addq	$1, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L33:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L38
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L39
.L38:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
