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

```c
// Aizu 2101: Perfect Number
// 2017.9.20 bal4u@uu

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

int ptbl[] = {
         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, 0 };

int pseudo_factorization(int n)
{
	int s, i, d, p, sw;
	int *pp;

	 s = 1;
	 if ((n & 1) == 0) {
	    p = 2;  
		do n >>= 1, p <<= 1;
	    while ((n & 1) == 0);
		s *= p-1;
	}
	if (n <= 1) return s;
	for (pp = ptbl; *pp > 0; pp++) {
		if (n % *pp) continue;
		p = d = *pp;  
		do n /= d, p *= d;
		while (n % d == 0);
		s *= (p-1) / (d-1);
	}
	if (n > 1) {
		int b = (int)sqrt((double)n);
		for (i = 1009, sw = 0; n > 1; ) {
			if (i > b) { s *= (n+1); break; }
			if (n % i == 0) {
				p = i;  
				do n /= i, p *= i;
				while (n % i == 0);
				s *= (p-1)/(i-1);
			}
			if (sw) i += 2, sw = 0;
			else    i += 4, sw = 1;
		}
	}
	return s;
}

int main()
{
	int n, d;
	char *ans[3] = { "abundant number", "perfect number", "deficient number" };

	while (scanf("%d", &n) && n) {
		d = (n << 1) - pseudo_factorization(n);
		if (d > 0) d = 1; else if (d < 0) d = -1;
		puts(ans[d+1]);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 672
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
	.long	0
	.text
	.globl	pseudo_factorization
	.type	pseudo_factorization, @function
pseudo_factorization:
.LFB0:
	.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
	movl	%edi, -36(%rbp)
	movl	$1, -32(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L2
	movl	$2, -24(%rbp)
.L3:
	sarl	-36(%rbp)
	sall	-24(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
.L2:
	cmpl	$1, -36(%rbp)
	jg	.L4
	movl	-32(%rbp), %eax
	jmp	.L5
.L4:
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L6
.L10:
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L18
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
.L9:
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	-12(%rbp), %edx
	leal	-1(%rdx), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
	jmp	.L8
.L18:
	nop
.L8:
	addq	$4, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	.L10
	cmpl	$1, -36(%rbp)
	jle	.L11
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-36(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	$1009, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L12
.L17:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L13
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
	jmp	.L11
.L13:
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L14
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
.L15:
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	imull	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L15
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	-28(%rbp), %edx
	leal	-1(%rdx), %edi
	cltd
	idivl	%edi
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
.L14:
	cmpl	$0, -20(%rbp)
	je	.L16
	addl	$2, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L12
.L16:
	addl	$4, -28(%rbp)
	movl	$1, -20(%rbp)
.L12:
	cmpl	$1, -36(%rbp)
	jg	.L17
.L11:
	movl	-32(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	pseudo_factorization, .-pseudo_factorization
	.section	.rodata
.LC0:
	.string	"abundant number"
.LC1:
	.string	"perfect number"
.LC2:
	.string	"deficient number"
.LC3:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -48(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -40(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -32(%rbp)
	jmp	.L20
.L24:
	movl	-56(%rbp), %eax
	leal	(%rax,%rax), %ebx
	movl	-56(%rbp), %eax
	movl	%eax, %edi
	call	pseudo_factorization
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -52(%rbp)
	cmpl	$0, -52(%rbp)
	jle	.L21
	movl	$1, -52(%rbp)
	jmp	.L22
.L21:
	cmpl	$0, -52(%rbp)
	jns	.L22
	movl	$-1, -52(%rbp)
.L22:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-48(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L23
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L24
.L23:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	movq	-8(%rbp), %rbx
	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	pseudo_factorization
	.type	pseudo_factorization, @function
pseudo_factorization:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edi, %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	andl	$1, %r12d
	jne	.L2
	movl	$2, %r12d
	.p2align 4,,10
	.p2align 3
.L3:
	sarl	%ebx
	addl	%r12d, %r12d
	testb	$1, %bl
	je	.L3
	subl	$1, %r12d
.L2:
	cmpl	$1, %ebx
	jle	.L1
	movl	ptbl(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L5
	leaq	ptbl(%rip), %rdi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movl	4(%rdi), %ecx
	addq	$4, %rdi
	testl	%ecx, %ecx
	jle	.L30
.L8:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L6
	movl	%ecx, %esi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebx, %eax
	imull	%ecx, %esi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L7
	leal	-1(%rsi), %eax
	subl	$1, %ecx
	addq	$4, %rdi
	cltd
	idivl	%ecx
	movl	(%rdi), %ecx
	imull	%eax, %r12d
	testl	%ecx, %ecx
	jg	.L8
.L30:
	cmpl	$1, %ebx
	jg	.L5
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L27
	sqrtsd	%xmm0, %xmm0
.L11:
	cvttsd2sil	%xmm0, %r8d
	xorl	%edi, %edi
	movl	$1009, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L33:
	addl	$2, %ecx
	xorl	%edi, %edi
.L16:
	cmpl	$1, %ebx
	jle	.L1
.L17:
	cmpl	%ecx, %r8d
	jl	.L31
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L32
.L13:
	testl	%edi, %edi
	jne	.L33
	addl	$4, %ecx
	movl	$1, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L32:
	movl	%ecx, %esi
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%ebx, %eax
	imull	%ecx, %esi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L14
	leal	-1(%rsi), %eax
	leal	-1(%rcx), %esi
	cltd
	idivl	%esi
	imull	%eax, %r12d
	jmp	.L13
.L31:
	addl	$1, %ebx
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	imull	%ebx, %r12d
	popq	%rbx
	.cfi_def_cfa_offset 16
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	sqrt@PLT
	jmp	.L11
	.cfi_endproc
.LFE23:
	.size	pseudo_factorization, .-pseudo_factorization
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"deficient number"
.LC2:
	.string	"abundant number"
.LC3:
	.string	"perfect number"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC2(%rip), %rdx
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %xmm0
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	leaq	.LC3(%rip), %rax
	leaq	12(%rsp), %r12
	movq	%rax, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movaps	%xmm0, 16(%rsp)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L45:
	movl	12(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L37
	movl	%ebx, %edi
	addl	%ebx, %ebx
	call	pseudo_factorization
	movq	%r13, %rdi
	subl	%eax, %ebx
	testl	%ebx, %ebx
	jg	.L36
	sete	%al
	movzbl	%al, %eax
	movq	16(%rsp,%rax,8), %rdi
.L36:
	call	puts@PLT
.L35:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L45
.L37:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$56, %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
.L46:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 672
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
	.long	0
	.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	pseudo_factorization
	.type	pseudo_factorization, @function
pseudo_factorization:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edi, %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	andl	$1, %r12d
	jne	.L2
	movl	$2, %r12d
	.p2align 4,,10
	.p2align 3
.L3:
	sarl	%ebx
	addl	%r12d, %r12d
	testb	$1, %bl
	je	.L3
	subl	$1, %r12d
.L2:
	cmpl	$1, %ebx
	jle	.L1
	movl	ptbl(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L5
	leaq	ptbl(%rip), %rdi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movl	4(%rdi), %ecx
	addq	$4, %rdi
	testl	%ecx, %ecx
	jle	.L30
.L8:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L6
	movl	%ecx, %esi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebx, %eax
	imull	%ecx, %esi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L7
	leal	-1(%rsi), %eax
	subl	$1, %ecx
	addq	$4, %rdi
	cltd
	idivl	%ecx
	movl	(%rdi), %ecx
	imull	%eax, %r12d
	testl	%ecx, %ecx
	jg	.L8
.L30:
	cmpl	$1, %ebx
	jg	.L5
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L27
	sqrtsd	%xmm0, %xmm0
.L11:
	cvttsd2sil	%xmm0, %r8d
	xorl	%edi, %edi
	movl	$1009, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L33:
	addl	$2, %ecx
	xorl	%edi, %edi
.L16:
	cmpl	$1, %ebx
	jle	.L1
.L17:
	cmpl	%ecx, %r8d
	jl	.L31
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L32
.L13:
	testl	%edi, %edi
	jne	.L33
	addl	$4, %ecx
	movl	$1, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L32:
	movl	%ecx, %esi
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%ebx, %eax
	imull	%ecx, %esi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L14
	leal	-1(%rsi), %eax
	leal	-1(%rcx), %esi
	cltd
	idivl	%esi
	imull	%eax, %r12d
	jmp	.L13
.L31:
	addl	$1, %ebx
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	imull	%ebx, %r12d
	popq	%rbx
	.cfi_def_cfa_offset 16
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	sqrt@PLT
	jmp	.L11
	.cfi_endproc
.LFE23:
	.size	pseudo_factorization, .-pseudo_factorization
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"deficient number"
.LC2:
	.string	"abundant number"
.LC3:
	.string	"perfect number"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC2(%rip), %rdx
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %xmm0
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	leaq	.LC3(%rip), %rax
	leaq	12(%rsp), %r12
	movq	%rax, %xmm1
	punpcklqdq	%xmm1, %xmm0
	movaps	%xmm0, 16(%rsp)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L45:
	movl	12(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L37
	movl	%ebx, %edi
	addl	%ebx, %ebx
	call	pseudo_factorization
	movq	%r13, %rdi
	subl	%eax, %ebx
	testl	%ebx, %ebx
	jg	.L36
	sete	%al
	movzbl	%al, %eax
	movq	16(%rsp,%rax,8), %rdi
.L36:
	call	puts@PLT
.L35:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L45
.L37:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$56, %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
.L46:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 672
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
	.long	0
	.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:

// Aizu 2101: Perfect Number
// 2017.9.20 bal4u@uu

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

int ptbl[] = {
         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, 0 };

int pseudo_factorization(int n)
{
	int s, i, d, p, sw;
	int *pp;

	 s = 1;
	 if ((n & 1) == 0) {
	    p = 2;  
		do n >>= 1, p <<= 1;
	    while ((n & 1) == 0);
		s *= p-1;
	}
	if (n <= 1) return s;
	for (pp = ptbl; *pp > 0; pp++) {
		if (n % *pp) continue;
		p = d = *pp;  
		do n /= d, p *= d;
		while (n % d == 0);
		s *= (p-1) / (d-1);
	}
	if (n > 1) {
		int b = (int)sqrt((double)n);
		for (i = 1009, sw = 0; n > 1; ) {
			if (i > b) { s *= (n+1); break; }
			if (n % i == 0) {
				p = i;  
				do n /= i, p *= i;
				while (n % i == 0);
				s *= (p-1)/(i-1);
			}
			if (sw) i += 2, sw = 0;
			else    i += 4, sw = 1;
		}
	}
	return s;
}

int main()
{
	int n, d;
	char *ans[3] = { "abundant number", "perfect number", "deficient number" };

	while (scanf("%d", &n) && n) {
		d = (n << 1) - pseudo_factorization(n);
		if (d > 0) d = 1; else if (d < 0) d = -1;
		puts(ans[d+1]);
	}
	return 0;
}
1
2
3
4
6
12
16
28
33550336
99999998
99999999
100001000
0
 1
2
5
4
6
12
16
28
820514
99999998
99999999
100001100
0
 1
2
5
4
6
12
18
28
820514
99999998
99999999
100001100
0
 1
1
5
0
6
12
16
28
33550336
99999998
99999999
100001100
0
 1
1
5
4
6
12
18
4
820514
99999998
99999999
100001100
0
 1
2
3
6
6
12
29
28
33550336
99999998
99999999
100001000
0
 1
1
5
4
6
12
18
4
820514
99999998
699564
100001100
0
 1
2
3
6
6
12
29
28
27350355
99999998
99999999
100001000
0
 1
2
5
3
7
12
16
28
33550336
119648219
124798312
100001000
0
 1
2
1
3
6
12
16
28
256736
48969127
99999999
100001100
0

deficient number
deficient number
deficient number
deficient number
perfect number
abundant number
deficient number
perfect number
perfect number
deficient number
deficient number
abundant number
 deficient number
deficient number
deficient number
deficient number
perfect number
abundant number
deficient number
perfect number
deficient number
deficient number
deficient number
abundant number
 deficient number
deficient number
deficient number
deficient number
perfect number
abundant number
abundant number
perfect number
deficient number
deficient number
deficient number
abundant number
 deficient number
deficient number
deficient number
 deficient number
deficient number
deficient number
deficient number
perfect number
abundant number
abundant number
deficient number
deficient number
deficient number
deficient number
abundant number
 deficient number
deficient number
deficient number
perfect number
perfect number
abundant number
deficient number
perfect number
perfect number
deficient number
deficient number
abundant number
 deficient number
deficient number
deficient number
deficient number
perfect number
abundant number
abundant number
deficient number
deficient number
deficient number
abundant number
abundant number
 deficient number
deficient number
deficient number
perfect number
perfect number
abundant number
deficient number
perfect number
deficient number
deficient number
deficient number
abundant number
 deficient number
deficient number
deficient number
deficient number
deficient number
abundant number
deficient number
perfect number
perfect number
deficient number
deficient number
abundant number
 deficient number
deficient number
deficient number
deficient number
perfect number
abundant number
deficient number
perfect number
abundant number
deficient number
deficient number
abundant number

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

```c
// Aizu 2101: Perfect Number
// 2017.9.20 bal4u@uu

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

int ptbl[] = {
         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, 0 };

int pseudo_factorization(int n)
{
	int s, i, d, p, sw;
	int *pp;

	 s = 1;
	 if ((n & 1) == 0) {
	    p = 2;  
		do n >>= 1, p <<= 1;
	    while ((n & 1) == 0);
		s *= p-1;
	}
	if (n <= 1) return s;
	for (pp = ptbl; *pp > 0; pp++) {
		if (n % *pp) continue;
		p = d = *pp;  
		do n /= d, p *= d;
		while (n % d == 0);
		s *= (p-1) / (d-1);
	}
	if (n > 1) {
		int b = (int)sqrt((double)n);
		for (i = 1009, sw = 0; n > 1; ) {
			if (i > b) { s *= (n+1); break; }
			if (n % i == 0) {
				p = i;  
				do n /= i, p *= i;
				while (n % i == 0);
				s *= (p-1)/(i-1);
			}
			if (sw) i += 2, sw = 0;
			else    i += 4, sw = 1;
		}
	}
	return s;
}

int main()
{
	int n, d;
	char *ans[3] = { "abundant number", "perfect number", "deficient number" };

	while (scanf("%d", &n) && n) {
		d = (n << 1) - pseudo_factorization(n);
		if (d > 0) d = 1; else if (d < 0) d = -1;
		puts(ans[d+1]);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 672
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
	.long	0
	.text
	.globl	pseudo_factorization
	.type	pseudo_factorization, @function
pseudo_factorization:
.LFB0:
	.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
	movl	%edi, -36(%rbp)
	movl	$1, -32(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L2
	movl	$2, -24(%rbp)
.L3:
	sarl	-36(%rbp)
	sall	-24(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
.L2:
	cmpl	$1, -36(%rbp)
	jg	.L4
	movl	-32(%rbp), %eax
	jmp	.L5
.L4:
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L6
.L10:
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L18
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
.L9:
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	-12(%rbp), %edx
	leal	-1(%rdx), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
	jmp	.L8
.L18:
	nop
.L8:
	addq	$4, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	.L10
	cmpl	$1, -36(%rbp)
	jle	.L11
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-36(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	$1009, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L12
.L17:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L13
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
	jmp	.L11
.L13:
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L14
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
.L15:
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	imull	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L15
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	-28(%rbp), %edx
	leal	-1(%rdx), %edi
	cltd
	idivl	%edi
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
.L14:
	cmpl	$0, -20(%rbp)
	je	.L16
	addl	$2, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L12
.L16:
	addl	$4, -28(%rbp)
	movl	$1, -20(%rbp)
.L12:
	cmpl	$1, -36(%rbp)
	jg	.L17
.L11:
	movl	-32(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	pseudo_factorization, .-pseudo_factorization
	.section	.rodata
.LC0:
	.string	"abundant number"
.LC1:
	.string	"perfect number"
.LC2:
	.string	"deficient number"
.LC3:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -48(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -40(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -32(%rbp)
	jmp	.L20
.L24:
	movl	-56(%rbp), %eax
	leal	(%rax,%rax), %ebx
	movl	-56(%rbp), %eax
	movl	%eax, %edi
	call	pseudo_factorization
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -52(%rbp)
	cmpl	$0, -52(%rbp)
	jle	.L21
	movl	$1, -52(%rbp)
	jmp	.L22
.L21:
	cmpl	$0, -52(%rbp)
	jns	.L22
	movl	$-1, -52(%rbp)
.L22:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-48(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L23
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L24
.L23:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	movq	-8(%rbp), %rbx
	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	ptbl
	.data
	.align 32
	.type	ptbl, @object
	.size	ptbl, 672
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
	.long	0
	.text
	.globl	pseudo_factorization
	.type	pseudo_factorization, @function
pseudo_factorization:
.LFB0:
	.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
	movl	%edi, -36(%rbp)
	movl	$1, -32(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L2
	movl	$2, -24(%rbp)
.L3:
	sarl	-36(%rbp)
	sall	-24(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
.L2:
	cmpl	$1, -36(%rbp)
	jg	.L4
	movl	-32(%rbp), %eax
	jmp	.L5
.L4:
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L6
.L10:
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L18
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
.L9:
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	-12(%rbp), %edx
	leal	-1(%rdx), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
	jmp	.L8
.L18:
	nop
.L8:
	addq	$4, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	.L10
	cmpl	$1, -36(%rbp)
	jle	.L11
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-36(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	$1009, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L12
.L17:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L13
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
	jmp	.L11
.L13:
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L14
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
.L15:
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	imull	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L15
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	-28(%rbp), %edx
	leal	-1(%rdx), %edi
	cltd
	idivl	%edi
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -32(%rbp)
.L14:
	cmpl	$0, -20(%rbp)
	je	.L16
	addl	$2, -28(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L12
.L16:
	addl	$4, -28(%rbp)
	movl	$1, -20(%rbp)
.L12:
	cmpl	$1, -36(%rbp)
	jg	.L17
.L11:
	movl	-32(%rbp), %eax
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	pseudo_factorization, .-pseudo_factorization
	.section	.rodata
.LC0:
	.string	"abundant number"
.LC1:
	.string	"perfect number"
.LC2:
	.string	"deficient number"
.LC3:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -48(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -40(%rbp)
	leaq	.LC2(%rip), %rax
	movq	%rax, -32(%rbp)
	jmp	.L20
.L24:
	movl	-56(%rbp), %eax
	leal	(%rax,%rax), %ebx
	movl	-56(%rbp), %eax
	movl	%eax, %edi
	call	pseudo_factorization
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -52(%rbp)
	cmpl	$0, -52(%rbp)
	jle	.L21
	movl	$1, -52(%rbp)
	jmp	.L22
.L21:
	cmpl	$0, -52(%rbp)
	jns	.L22
	movl	$-1, -52(%rbp)
.L22:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-48(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L20:
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L23
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L24
.L23:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	movq	-8(%rbp), %rbx
	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:
