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

```c
// AOJ 2706: Let's Solve Geometric Problems
// 2017.10.9 bal4u@uu

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

#define SIZE  20
int factor[SIZE], size;

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 };

void prime_factor(int n)
{
  int i, d;
  int sw;
  int *pp;

  size = 0;
  if ((n & 1) == 0) {
    factor[size++] = 2;
    do n >>= 1;
    while ((n & 1) == 0);
  }
  for (pp = ptbl; n > 1 && *pp > 0; pp++) {
    if (n % *pp) continue;
    d = *pp;
    factor[size++] = d;
    do n /= d;
    while (n % d == 0);
  }
  if (n > 1) {
    d = (int)sqrt(n);
    for (i = 1009, sw = 0; n > 1; ) {
      if (i > d) {
        factor[size++] = n;
        break;
      }
      if (n % i == 0) {
        factor[size++] = i;
        do n /= i;
        while (n % i == 0);
      }
      if (sw) { i += 2, sw = 0; }
      else    { i += 4, sw = 1; }
    }
  }
}

int gcd(int a, int b)
{
	int r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

int main()
{
	int p, q, i, ans;

	scanf("%d%d", &p, &q);
	i = gcd(p, q), p /= i, q /= i;
	prime_factor(q);
	for (ans = 1, i = 0; i < size; i++) ans *= factor[i];
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	factor
	.bss
	.align 32
	.type	factor, @object
	.size	factor, 80
factor:
	.zero	80
	.globl	size
	.align 4
	.type	size, @object
	.size	size, 4
size:
	.zero	4
	.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	prime_factor
	.type	prime_factor, @function
prime_factor:
.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	$0, size(%rip)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L2
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	factor(%rip), %rax
	movl	$2, (%rdx,%rax)
.L3:
	sarl	-36(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
.L2:
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L9:
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L7
	jmp	.L6
.L17:
	nop
.L6:
	addq	$4, -8(%rbp)
.L4:
	cmpl	$1, -36(%rbp)
	jle	.L8
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	.L9
.L8:
	cmpl	$1, -36(%rbp)
	jle	.L18
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-36(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	$1009, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L11
.L16:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L12
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	jmp	.L18
.L12:
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L13
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L14
.L13:
	cmpl	$0, -16(%rbp)
	je	.L15
	addl	$2, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L11
.L15:
	addl	$4, -20(%rbp)
	movl	$1, -16(%rbp)
.L11:
	cmpl	$1, -36(%rbp)
	jg	.L16
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	prime_factor, .-prime_factor
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	jmp	.L20
.L21:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L20:
	cmpl	$0, -24(%rbp)
	jne	.L21
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	prime_factor
	movl	$1, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L24
.L25:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	factor(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L24:
	movl	size(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L25
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	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	prime_factor
	.type	prime_factor, @function
prime_factor:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	andl	$1, %edi
	jne	.L2
	movl	$1, size(%rip)
	movl	$2, factor(%rip)
	.p2align 4,,10
	.p2align 3
.L3:
	sarl	%ebx
	movl	%ebx, %r8d
	andl	$1, %r8d
	je	.L3
.L4:
	movslq	%r8d, %rbp
	xorl	%edi, %edi
	leaq	ptbl(%rip), %rsi
	leaq	factor(%rip), %r9
	cmpl	$1, %ebx
	jle	.L1
.L5:
	movl	(%rsi), %ecx
	testl	%ecx, %ecx
	jle	.L44
.L10:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L45
	movl	4(%rsi), %ecx
	addq	$4, %rsi
	testl	%ecx, %ecx
	jg	.L10
.L44:
	testb	%dil, %dil
	je	.L26
	movl	%ebp, size(%rip)
.L20:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L40
	sqrtsd	%xmm0, %xmm0
.L23:
	cvttsd2sil	%xmm0, %r8d
	movslq	%ebp, %rdi
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	movl	$1009, %ecx
	leaq	factor(%rip), %r9
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L49:
	addl	$2, %ecx
	xorl	%esi, %esi
	cmpl	$1, %ebx
	jle	.L46
.L18:
	cmpl	%ecx, %r8d
	jl	.L47
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L48
.L14:
	testl	%esi, %esi
	jne	.L49
	addl	$4, %ecx
	movl	$1, %esi
	cmpl	$1, %ebx
	jg	.L18
.L46:
	testb	%r10b, %r10b
	je	.L1
.L42:
	movl	%edi, size(%rip)
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L45:
	.cfi_restore_state
	movl	%ecx, (%r9,%rbp,4)
	leal	1(%rbp), %edi
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L8
	addq	$4, %rsi
	cmpl	$1, %ebx
	jle	.L42
	movslq	%edi, %rbp
	movl	$1, %edi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$0, size(%rip)
	xorl	%r8d, %r8d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%ecx, (%r9,%rdi,4)
	leal	1(%rdi), %r10d
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L15
	movslq	%r10d, %rdi
	movl	$1, %r10d
	jmp	.L14
.L47:
	testb	%r10b, %r10b
	cmove	%rbp, %rdi
	leal	1(%rdi), %eax
	movl	%eax, size(%rip)
	leaq	factor(%rip), %rax
	movl	%ebx, (%rax,%rdi,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movslq	%r8d, %rbp
	jmp	.L20
.L40:
	call	sqrt@PLT
	jmp	.L23
	.cfi_endproc
.LFE23:
	.size	prime_factor, .-prime_factor
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	testl	%esi, %esi
	je	.L53
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L52
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edi
	movl	(%rsp), %esi
	testl	%edi, %edi
	je	.L61
	movl	%edi, %edx
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L57
.L56:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	movl	%eax, (%rsp)
	movl	%edi, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	prime_factor
	movl	size(%rip), %edx
	testl	%edx, %edx
	jle	.L62
	leaq	factor(%rip), %rax
	leal	-1(%rdx), %ecx
	leaq	4(%rax), %rdx
	leaq	(%rdx,%rcx,4), %rcx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L59:
	imull	(%rax), %edx
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L59
.L58:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L66
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L61:
	.cfi_restore_state
	movl	%esi, %ecx
	jmp	.L56
.L62:
	movl	$1, %edx
	jmp	.L58
.L66:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	.globl	size
	.bss
	.align 4
	.type	size, @object
	.size	size, 4
size:
	.zero	4
	.globl	factor
	.align 32
	.type	factor, @object
	.size	factor, 80
factor:
	.zero	80
	.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	prime_factor
	.type	prime_factor, @function
prime_factor:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	andl	$1, %edi
	jne	.L2
	movl	$1, size(%rip)
	movl	$2, factor(%rip)
	.p2align 4,,10
	.p2align 3
.L3:
	sarl	%ebx
	movl	%ebx, %r8d
	andl	$1, %r8d
	je	.L3
.L4:
	movslq	%r8d, %rbp
	xorl	%edi, %edi
	leaq	ptbl(%rip), %rsi
	leaq	factor(%rip), %r9
	cmpl	$1, %ebx
	jle	.L1
.L5:
	movl	(%rsi), %ecx
	testl	%ecx, %ecx
	jle	.L44
.L10:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L45
	movl	4(%rsi), %ecx
	addq	$4, %rsi
	testl	%ecx, %ecx
	jg	.L10
.L44:
	testb	%dil, %dil
	je	.L26
	movl	%ebp, size(%rip)
.L20:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L40
	sqrtsd	%xmm0, %xmm0
.L23:
	cvttsd2sil	%xmm0, %r8d
	movslq	%ebp, %rdi
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	movl	$1009, %ecx
	leaq	factor(%rip), %r9
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L49:
	addl	$2, %ecx
	xorl	%esi, %esi
	cmpl	$1, %ebx
	jle	.L46
.L18:
	cmpl	%ecx, %r8d
	jl	.L47
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L48
.L14:
	testl	%esi, %esi
	jne	.L49
	addl	$4, %ecx
	movl	$1, %esi
	cmpl	$1, %ebx
	jg	.L18
.L46:
	testb	%r10b, %r10b
	je	.L1
.L42:
	movl	%edi, size(%rip)
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L45:
	.cfi_restore_state
	movl	%ecx, (%r9,%rbp,4)
	leal	1(%rbp), %edi
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L8
	addq	$4, %rsi
	cmpl	$1, %ebx
	jle	.L42
	movslq	%edi, %rbp
	movl	$1, %edi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$0, size(%rip)
	xorl	%r8d, %r8d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%ecx, (%r9,%rdi,4)
	leal	1(%rdi), %r10d
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %ebx
	idivl	%ecx
	testl	%edx, %edx
	je	.L15
	movslq	%r10d, %rdi
	movl	$1, %r10d
	jmp	.L14
.L47:
	testb	%r10b, %r10b
	cmove	%rbp, %rdi
	leal	1(%rdi), %eax
	movl	%eax, size(%rip)
	leaq	factor(%rip), %rax
	movl	%ebx, (%rax,%rdi,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movslq	%r8d, %rbp
	jmp	.L20
.L40:
	call	sqrt@PLT
	jmp	.L23
	.cfi_endproc
.LFE23:
	.size	prime_factor, .-prime_factor
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	testl	%esi, %esi
	je	.L53
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L52
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edi
	movl	(%rsp), %esi
	testl	%edi, %edi
	je	.L61
	movl	%edi, %edx
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L57
.L56:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	movl	%eax, (%rsp)
	movl	%edi, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edi
	movl	%eax, 4(%rsp)
	call	prime_factor
	movl	size(%rip), %edx
	testl	%edx, %edx
	jle	.L62
	leaq	factor(%rip), %rax
	leal	-1(%rdx), %ecx
	leaq	4(%rax), %rdx
	leaq	(%rdx,%rcx,4), %rcx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L59:
	imull	(%rax), %edx
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L59
.L58:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L66
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L61:
	.cfi_restore_state
	movl	%esi, %ecx
	jmp	.L56
.L62:
	movl	$1, %edx
	jmp	.L58
.L66:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	.globl	size
	.bss
	.align 4
	.type	size, @object
	.size	size, 4
size:
	.zero	4
	.globl	factor
	.align 32
	.type	factor, @object
	.size	factor, 80
factor:
	.zero	80
	.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 2706: Let's Solve Geometric Problems
// 2017.10.9 bal4u@uu

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

#define SIZE  20
int factor[SIZE], size;

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 };

void prime_factor(int n)
{
  int i, d;
  int sw;
  int *pp;

  size = 0;
  if ((n & 1) == 0) {
    factor[size++] = 2;
    do n >>= 1;
    while ((n & 1) == 0);
  }
  for (pp = ptbl; n > 1 && *pp > 0; pp++) {
    if (n % *pp) continue;
    d = *pp;
    factor[size++] = d;
    do n /= d;
    while (n % d == 0);
  }
  if (n > 1) {
    d = (int)sqrt(n);
    for (i = 1009, sw = 0; n > 1; ) {
      if (i > d) {
        factor[size++] = n;
        break;
      }
      if (n % i == 0) {
        factor[size++] = i;
        do n /= i;
        while (n % i == 0);
      }
      if (sw) { i += 2, sw = 0; }
      else    { i += 4, sw = 1; }
    }
  }
}

int gcd(int a, int b)
{
	int r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

int main()
{
	int p, q, i, ans;

	scanf("%d%d", &p, &q);
	i = gcd(p, q), p /= i, q /= i;
	prime_factor(q);
	for (ans = 1, i = 0; i < size; i++) ans *= factor[i];
	printf("%d\n", ans);
	return 0;
}
1 3
 1 6
 3 2
 4 5
 3 10
 3 14
 2 14
 2 17
 3 11
 2 39

3
 6
 2
 5
 10
 14
 7
 17
 11
 39

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

```c
// AOJ 2706: Let's Solve Geometric Problems
// 2017.10.9 bal4u@uu

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

#define SIZE  20
int factor[SIZE], size;

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 };

void prime_factor(int n)
{
  int i, d;
  int sw;
  int *pp;

  size = 0;
  if ((n & 1) == 0) {
    factor[size++] = 2;
    do n >>= 1;
    while ((n & 1) == 0);
  }
  for (pp = ptbl; n > 1 && *pp > 0; pp++) {
    if (n % *pp) continue;
    d = *pp;
    factor[size++] = d;
    do n /= d;
    while (n % d == 0);
  }
  if (n > 1) {
    d = (int)sqrt(n);
    for (i = 1009, sw = 0; n > 1; ) {
      if (i > d) {
        factor[size++] = n;
        break;
      }
      if (n % i == 0) {
        factor[size++] = i;
        do n /= i;
        while (n % i == 0);
      }
      if (sw) { i += 2, sw = 0; }
      else    { i += 4, sw = 1; }
    }
  }
}

int gcd(int a, int b)
{
	int r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

int main()
{
	int p, q, i, ans;

	scanf("%d%d", &p, &q);
	i = gcd(p, q), p /= i, q /= i;
	prime_factor(q);
	for (ans = 1, i = 0; i < size; i++) ans *= factor[i];
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	factor
	.bss
	.align 32
	.type	factor, @object
	.size	factor, 80
factor:
	.zero	80
	.globl	size
	.align 4
	.type	size, @object
	.size	size, 4
size:
	.zero	4
	.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	prime_factor
	.type	prime_factor, @function
prime_factor:
.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	$0, size(%rip)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L2
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	factor(%rip), %rax
	movl	$2, (%rdx,%rax)
.L3:
	sarl	-36(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
.L2:
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L9:
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L7
	jmp	.L6
.L17:
	nop
.L6:
	addq	$4, -8(%rbp)
.L4:
	cmpl	$1, -36(%rbp)
	jle	.L8
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	.L9
.L8:
	cmpl	$1, -36(%rbp)
	jle	.L18
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-36(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	$1009, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L11
.L16:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L12
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	jmp	.L18
.L12:
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L13
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L14
.L13:
	cmpl	$0, -16(%rbp)
	je	.L15
	addl	$2, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L11
.L15:
	addl	$4, -20(%rbp)
	movl	$1, -16(%rbp)
.L11:
	cmpl	$1, -36(%rbp)
	jg	.L16
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	prime_factor, .-prime_factor
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	jmp	.L20
.L21:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L20:
	cmpl	$0, -24(%rbp)
	jne	.L21
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	prime_factor
	movl	$1, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L24
.L25:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	factor(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L24:
	movl	size(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L25
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	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	factor
	.bss
	.align 32
	.type	factor, @object
	.size	factor, 80
factor:
	.zero	80
	.globl	size
	.align 4
	.type	size, @object
	.size	size, 4
size:
	.zero	4
	.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	prime_factor
	.type	prime_factor, @function
prime_factor:
.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	$0, size(%rip)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L2
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	factor(%rip), %rax
	movl	$2, (%rdx,%rax)
.L3:
	sarl	-36(%rbp)
	movl	-36(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
.L2:
	leaq	ptbl(%rip), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L9:
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	-36(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L7
	jmp	.L6
.L17:
	nop
.L6:
	addq	$4, -8(%rbp)
.L4:
	cmpl	$1, -36(%rbp)
	jle	.L8
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jg	.L9
.L8:
	cmpl	$1, -36(%rbp)
	jle	.L18
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-36(%rbp), %xmm1
	movq	%xmm1, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	$1009, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L11
.L16:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L12
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	jmp	.L18
.L12:
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L13
	movl	size(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, size(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	factor(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L14
.L13:
	cmpl	$0, -16(%rbp)
	je	.L15
	addl	$2, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L11
.L15:
	addl	$4, -20(%rbp)
	movl	$1, -16(%rbp)
.L11:
	cmpl	$1, -36(%rbp)
	jg	.L16
.L18:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	prime_factor, .-prime_factor
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	jmp	.L20
.L21:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L20:
	cmpl	$0, -24(%rbp)
	jne	.L21
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-24(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	prime_factor
	movl	$1, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L24
.L25:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	factor(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L24:
	movl	size(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L25
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	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:
