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

```c
// AOJ 2446: Enumeration
// 2017.11.26 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

long long a[22];
int p[22];

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

int main()
{
	int n, i, j, f, lim;
	long long m, t;
	double ans, pp;

	scanf("%d%lld", &n, &m);
	for (i = 0; i < n; i++) scanf("%lld", a+i);
	for (i = 0; i < n; i++) scanf("%d", p+i);
	
	ans = 0;
	for (lim = 1 << n, i = 1; i < lim; i++) {
		f = 0, pp = 1;
		for (j = 0; j < n; j++) if ((i >> j) & 1) { f++, pp *= p[j]/100.0; }
		for (t = 1, j = 0; j < n; j++) {
			if ((i >> j) & 1) {
//				t = t / gcd(t, a[j]) * a[j];
				t /= gcd(t, a[j]);
				if (t > (1LL<<62)/a[j]) { t = -1; break; }
				t *= a[j];
			}
		}
		if (t > 0) {
			if (f & 1) ans += pp * (m / t);
			else       ans -= pp * (m / t);
		}
	}
	printf("%.10lf\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 176
a:
	.zero	176
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 88
p:
	.zero	88
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L3
	movq	-24(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d"
.LC6:
	.string	"%.10lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -56(%rbp)
	jmp	.L6
.L7:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -56(%rbp)
.L6:
	movl	-60(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L7
	movl	$0, -56(%rbp)
	jmp	.L8
.L9:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -56(%rbp)
.L8:
	movl	-60(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L9
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-60(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	$1, -56(%rbp)
	jmp	.L10
.L21:
	movl	$0, -48(%rbp)
	movsd	.LC4(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L11
.L13:
	movl	-52(%rbp), %eax
	movl	-56(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	addl	$1, -48(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC5(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	-16(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
.L12:
	addl	$1, -52(%rbp)
.L11:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L13
	movq	$1, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L14
.L18:
	movl	-52(%rbp), %eax
	movl	-56(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movabsq	$4611686018427387904, %rax
	cqto
	idivq	%rsi
	cmpq	%rax, -32(%rbp)
	jle	.L16
	movq	$-1, -32(%rbp)
	jmp	.L17
.L16:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-32(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
.L15:
	addl	$1, -52(%rbp)
.L14:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L18
.L17:
	cmpq	$0, -32(%rbp)
	jle	.L19
	movl	-48(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	movq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	mulsd	-16(%rbp), %xmm0
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	jmp	.L19
.L20:
	movq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-16(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
.L19:
	addl	$1, -56(%rbp)
.L10:
	movl	-56(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L21
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.align 8
.LC5:
	.long	0
	.long	1079574528
	.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	gcd
	.type	gcd, @function
gcd:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rsi, %rdx
	testq	%rsi, %rsi
	je	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdx, %r8
	cqto
	idivq	%r8
	movq	%r8, %rax
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rdi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%lld"
.LC3:
	.string	"%lld"
.LC4:
	.string	"%d"
.LC6:
	.string	"%.10lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L8
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	addq	$8, %rbp
	cmpl	%ebx, %ecx
	jg	.L9
	testl	%ecx, %ecx
	jle	.L8
	leaq	p(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC4(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	addq	$4, %rbp
	cmpl	%ebx, %ecx
	jg	.L10
.L8:
	movl	$1, %r14d
	sall	%cl, %r14d
	cmpl	$1, %r14d
	jle	.L23
	movq	32(%rsp), %rax
	pxor	%xmm3, %xmm3
	movsd	.LC5(%rip), %xmm2
	movl	$1, %r9d
	leaq	p(%rip), %r12
	leaq	a(%rip), %r13
	movabsq	$4611686018427387904, %rbp
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	testl	%ecx, %ecx
	jle	.L40
	movsd	.LC0(%rip), %xmm1
	movslq	%ecx, %r10
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L14:
	btl	%eax, %r9d
	jnc	.L13
	pxor	%xmm0, %xmm0
	addl	$1, %ebx
	cvtsi2sdl	(%r12,%rax,4), %xmm0
	divsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
.L13:
	addq	$1, %rax
	cmpq	%rax, %r10
	jne	.L14
	xorl	%edi, %edi
	movl	$1, %r8d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rdi
	cmpq	%rdi, %r10
	je	.L41
.L19:
	btl	%edi, %r9d
	jnc	.L15
	movq	0(%r13,%rdi,8), %r11
	testq	%r11, %r11
	je	.L24
	movq	%r11, %rdx
	movq	%r8, %r15
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r15, %rax
	movq	%rdx, %r15
	cqto
	idivq	%r15
	testq	%rdx, %rdx
	jne	.L17
	movq	%r8, %rax
	cqto
	idivq	%r15
	movq	%rax, %r8
.L16:
	movq	%rbp, %rax
	cqto
	idivq	%r11
	cmpq	%r8, %rax
	jl	.L18
	addq	$1, %rdi
	imulq	%r11, %r8
	cmpq	%rdi, %r10
	jne	.L19
.L41:
	testq	%r8, %r8
	jle	.L18
	movq	8(%rsp), %rax
	pxor	%xmm0, %xmm0
	cqto
	idivq	%r8
	andl	$1, %ebx
	cvtsi2sdq	%rax, %xmm0
	mulsd	%xmm1, %xmm0
	je	.L20
	addsd	%xmm0, %xmm3
.L18:
	addl	$1, %r9d
	cmpl	%r9d, %r14d
	jne	.L12
.L11:
	movapd	%xmm3, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$56, %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
.L24:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L16
.L40:
	pxor	%xmm0, %xmm0
	cvtsi2sdq	8(%rsp), %xmm0
.L20:
	addl	$1, %r9d
	subsd	%xmm0, %xmm3
	cmpl	%r9d, %r14d
	jne	.L12
	jmp	.L11
.L23:
	pxor	%xmm3, %xmm3
	jmp	.L11
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 88
p:
	.zero	88
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 176
a:
	.zero	176
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC5:
	.long	0
	.long	1079574528
	.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	gcd
	.type	gcd, @function
gcd:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rsi, %rdx
	testq	%rsi, %rsi
	je	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdx, %r8
	cqto
	idivq	%r8
	movq	%r8, %rax
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rdi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%lld"
.LC3:
	.string	"%lld"
.LC4:
	.string	"%d"
.LC6:
	.string	"%.10lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L8
	leaq	a(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	addq	$8, %rbp
	cmpl	%ebx, %ecx
	jg	.L9
	testl	%ecx, %ecx
	jle	.L8
	leaq	p(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC4(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	addq	$4, %rbp
	cmpl	%ebx, %ecx
	jg	.L10
.L8:
	movl	$1, %r14d
	sall	%cl, %r14d
	cmpl	$1, %r14d
	jle	.L23
	movq	32(%rsp), %rax
	pxor	%xmm3, %xmm3
	movsd	.LC5(%rip), %xmm2
	movl	$1, %r9d
	leaq	p(%rip), %r12
	leaq	a(%rip), %r13
	movabsq	$4611686018427387904, %rbp
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	testl	%ecx, %ecx
	jle	.L40
	movsd	.LC0(%rip), %xmm1
	movslq	%ecx, %r10
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L14:
	btl	%eax, %r9d
	jnc	.L13
	pxor	%xmm0, %xmm0
	addl	$1, %ebx
	cvtsi2sdl	(%r12,%rax,4), %xmm0
	divsd	%xmm2, %xmm0
	mulsd	%xmm0, %xmm1
.L13:
	addq	$1, %rax
	cmpq	%rax, %r10
	jne	.L14
	xorl	%edi, %edi
	movl	$1, %r8d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rdi
	cmpq	%rdi, %r10
	je	.L41
.L19:
	btl	%edi, %r9d
	jnc	.L15
	movq	0(%r13,%rdi,8), %r11
	testq	%r11, %r11
	je	.L24
	movq	%r11, %rdx
	movq	%r8, %r15
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r15, %rax
	movq	%rdx, %r15
	cqto
	idivq	%r15
	testq	%rdx, %rdx
	jne	.L17
	movq	%r8, %rax
	cqto
	idivq	%r15
	movq	%rax, %r8
.L16:
	movq	%rbp, %rax
	cqto
	idivq	%r11
	cmpq	%r8, %rax
	jl	.L18
	addq	$1, %rdi
	imulq	%r11, %r8
	cmpq	%rdi, %r10
	jne	.L19
.L41:
	testq	%r8, %r8
	jle	.L18
	movq	8(%rsp), %rax
	pxor	%xmm0, %xmm0
	cqto
	idivq	%r8
	andl	$1, %ebx
	cvtsi2sdq	%rax, %xmm0
	mulsd	%xmm1, %xmm0
	je	.L20
	addsd	%xmm0, %xmm3
.L18:
	addl	$1, %r9d
	cmpl	%r9d, %r14d
	jne	.L12
.L11:
	movapd	%xmm3, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$56, %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
.L24:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L16
.L40:
	pxor	%xmm0, %xmm0
	cvtsi2sdq	8(%rsp), %xmm0
.L20:
	addl	$1, %r9d
	subsd	%xmm0, %xmm3
	cmpl	%r9d, %r14d
	jne	.L12
	jmp	.L11
.L23:
	pxor	%xmm3, %xmm3
	jmp	.L11
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 88
p:
	.zero	88
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 176
a:
	.zero	176
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC5:
	.long	0
	.long	1079574528
	.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 2446: Enumeration
// 2017.11.26 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

long long a[22];
int p[22];

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

int main()
{
	int n, i, j, f, lim;
	long long m, t;
	double ans, pp;

	scanf("%d%lld", &n, &m);
	for (i = 0; i < n; i++) scanf("%lld", a+i);
	for (i = 0; i < n; i++) scanf("%d", p+i);
	
	ans = 0;
	for (lim = 1 << n, i = 1; i < lim; i++) {
		f = 0, pp = 1;
		for (j = 0; j < n; j++) if ((i >> j) & 1) { f++, pp *= p[j]/100.0; }
		for (t = 1, j = 0; j < n; j++) {
			if ((i >> j) & 1) {
//				t = t / gcd(t, a[j]) * a[j];
				t /= gcd(t, a[j]);
				if (t > (1LL<<62)/a[j]) { t = -1; break; }
				t *= a[j];
			}
		}
		if (t > 0) {
			if (f & 1) ans += pp * (m / t);
			else       ans -= pp * (m / t);
		}
	}
	printf("%.10lf\n", ans);
	return 0;
}
2 15
3 5
50 72
 4 100
1 3 5 7
80 60 40 20
 4 210
2 2 5 7
80 60 40 20
 2 15
3 5
32 72
 4 100
1 3 8 7
80 60 40 20
 2 210
2 2 5 7
80 60 40 20
 2 15
3 5
32 64
 4 100
1 3 14 7
80 60 40 20
 2 115
2 2 5 7
80 60 40 20
 2 7
3 5
32 64

4.3000000000
 85.7040000000
 108.6528000000
 3.5296000000
 85.1760000000
 12.2325000000
 3.3152000000
 84.7952000000
 6.6405000000
 1.2800000000

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

```c
// AOJ 2446: Enumeration
// 2017.11.26 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

long long a[22];
int p[22];

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

int main()
{
	int n, i, j, f, lim;
	long long m, t;
	double ans, pp;

	scanf("%d%lld", &n, &m);
	for (i = 0; i < n; i++) scanf("%lld", a+i);
	for (i = 0; i < n; i++) scanf("%d", p+i);
	
	ans = 0;
	for (lim = 1 << n, i = 1; i < lim; i++) {
		f = 0, pp = 1;
		for (j = 0; j < n; j++) if ((i >> j) & 1) { f++, pp *= p[j]/100.0; }
		for (t = 1, j = 0; j < n; j++) {
			if ((i >> j) & 1) {
//				t = t / gcd(t, a[j]) * a[j];
				t /= gcd(t, a[j]);
				if (t > (1LL<<62)/a[j]) { t = -1; break; }
				t *= a[j];
			}
		}
		if (t > 0) {
			if (f & 1) ans += pp * (m / t);
			else       ans -= pp * (m / t);
		}
	}
	printf("%.10lf\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 176
a:
	.zero	176
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 88
p:
	.zero	88
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L3
	movq	-24(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d"
.LC6:
	.string	"%.10lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -56(%rbp)
	jmp	.L6
.L7:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -56(%rbp)
.L6:
	movl	-60(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L7
	movl	$0, -56(%rbp)
	jmp	.L8
.L9:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -56(%rbp)
.L8:
	movl	-60(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L9
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-60(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	$1, -56(%rbp)
	jmp	.L10
.L21:
	movl	$0, -48(%rbp)
	movsd	.LC4(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L11
.L13:
	movl	-52(%rbp), %eax
	movl	-56(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	addl	$1, -48(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC5(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	-16(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
.L12:
	addl	$1, -52(%rbp)
.L11:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L13
	movq	$1, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L14
.L18:
	movl	-52(%rbp), %eax
	movl	-56(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movabsq	$4611686018427387904, %rax
	cqto
	idivq	%rsi
	cmpq	%rax, -32(%rbp)
	jle	.L16
	movq	$-1, -32(%rbp)
	jmp	.L17
.L16:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-32(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
.L15:
	addl	$1, -52(%rbp)
.L14:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L18
.L17:
	cmpq	$0, -32(%rbp)
	jle	.L19
	movl	-48(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	movq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	mulsd	-16(%rbp), %xmm0
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	jmp	.L19
.L20:
	movq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-16(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
.L19:
	addl	$1, -56(%rbp)
.L10:
	movl	-56(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L21
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.align 8
.LC5:
	.long	0
	.long	1079574528
	.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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 176
a:
	.zero	176
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 88
p:
	.zero	88
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L3
	movq	-24(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d"
.LC6:
	.string	"%.10lf\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -56(%rbp)
	jmp	.L6
.L7:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -56(%rbp)
.L6:
	movl	-60(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L7
	movl	$0, -56(%rbp)
	jmp	.L8
.L9:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -56(%rbp)
.L8:
	movl	-60(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L9
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-60(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	$1, -56(%rbp)
	jmp	.L10
.L21:
	movl	$0, -48(%rbp)
	movsd	.LC4(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L11
.L13:
	movl	-52(%rbp), %eax
	movl	-56(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L12
	addl	$1, -48(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	.LC5(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	-16(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
.L12:
	addl	$1, -52(%rbp)
.L11:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L13
	movq	$1, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L14
.L18:
	movl	-52(%rbp), %eax
	movl	-56(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movabsq	$4611686018427387904, %rax
	cqto
	idivq	%rsi
	cmpq	%rax, -32(%rbp)
	jle	.L16
	movq	$-1, -32(%rbp)
	jmp	.L17
.L16:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-32(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
.L15:
	addl	$1, -52(%rbp)
.L14:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L18
.L17:
	cmpq	$0, -32(%rbp)
	jle	.L19
	movl	-48(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	movq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	mulsd	-16(%rbp), %xmm0
	movsd	-24(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	jmp	.L19
.L20:
	movq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-16(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
.L19:
	addl	$1, -56(%rbp)
.L10:
	movl	-56(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L21
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.long	0
	.long	1072693248
	.align 8
.LC5:
	.long	0
	.long	1079574528
	.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:
