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

```c
// Aizu 1131: Unit Fraction Partition
// 2017.10.24 bal4u@uu

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

#define M 2000000000
#define EPS 1e-9
#define HASHSIZ 34981
typedef struct { int b; double v; } HASH;
HASH hash[HASHSIZ + 2], *hashend = hash + HASHSIZ;

int lookup(double v)
{
	int k = (int)(v * M);
	HASH *hp = hash + k % HASHSIZ;
	while (hp->b) {
		if (fabs(hp->v - v) <= EPS) return hp->b;
		if (++hp == hashend) hp = hash;
	}
	return -1;
}

void insert(double v, int b)
{
	int k = (int)(v * M);
	HASH *hp = hash + k % HASHSIZ;
	while (hp->b) {
		if (fabs(hp->v - v) <= EPS) return;
		if (++hp == hashend) hp = hash;
	}
	hp->v = v, hp->b = b;
}

double tbl[12005];

int bsch(double v)
{
	int m, l = 0, r = 12001;

	while (l < r) {
		m = (l + r) >> 1;
		if (fabs(tbl[m] - v) <= EPS) return m;
		if (tbl[m] > v) l = m + 1; else r = m;
	}
	if (l <= 0) l = 1;
	return l;
}

int ans, a;

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

void rec(double v, int k, int n, int aa)
{
	int i, l, r;

	if (n < 0 || aa > a) return;
	if (fabs(v) <= EPS) { ans++; return; }
	if (n == 0) return;

	l = bsch(v), r = bsch(v / n);
	if (k > l) l = k;
	if ((double)n/l + EPS < v) return;
	k = a / aa+1;
	if (r > k) r = k;
	for (i = l; i <= r; i++) rec(v - 1.0 / i, i, n - 1, aa*i);
}

int main()
{
	int p, q, n, i, l, r;
	double v;

	for (i = 1; i <= 12002; i++) {
		v = 1.0 / i;
		insert(v, i), tbl[i] = v;
	}

	while (scanf("%d%d%d%d", &p, &q, &a, &n) && n > 0) {
		i = gcd(p, q); p /= i, q /= i;
		v = (double)p / q;
//		if (fabs(v-n) <= EPS) { puts("1"); continue; }
		if (v > n) { puts("0"); continue; }
		l = bsch(v), r = bsch(v / n);
		for (ans = 0, i = l; i <= r; i++) {
			rec(v - 1.0 / i, i, n - 1, i);
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	hash
	.bss
	.align 32
	.type	hash, @object
	.size	hash, 559728
hash:
	.zero	559728
	.globl	hashend
	.section	.data.rel.local,"aw"
	.align 8
	.type	hashend, @object
	.size	hashend, 8
hashend:
	.quad	hash+559696
	.text
	.globl	lookup
	.type	lookup, @function
lookup:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$2011627575, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$14, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$34981, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	hash(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L6:
	movq	-8(%rbp), %rax
	movsd	8(%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L8
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	jmp	.L5
.L8:
	addq	$16, -8(%rbp)
	movq	hashend(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L2
	leaq	hash(%rip), %rax
	movq	%rax, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$-1, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	lookup, .-lookup
	.globl	insert
	.type	insert, @function
insert:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movl	%edi, -28(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$2011627575, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$14, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$34981, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	hash(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L14:
	movq	-8(%rbp), %rax
	movsd	8(%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jnb	.L15
	addq	$16, -8(%rbp)
	movq	hashend(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L10
	leaq	hash(%rip), %rax
	movq	%rax, -8(%rbp)
.L10:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movq	-8(%rbp), %rax
	movsd	-24(%rbp), %xmm0
	movsd	%xmm0, 8(%rax)
	movq	-8(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L9
.L15:
	nop
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	insert, .-insert
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 96040
tbl:
	.zero	96040
	.text
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movl	$0, -12(%rbp)
	movl	$12001, -8(%rbp)
	jmp	.L17
.L23:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L27
	movl	-4(%rbp), %eax
	jmp	.L20
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	comisd	-24(%rbp), %xmm0
	jbe	.L28
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L17
.L28:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L17:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L23
	cmpl	$0, -12(%rbp)
	jg	.L24
	movl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	bsch, .-bsch
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB3:
	.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	.L30
.L31:
	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)
.L30:
	cmpl	$0, -24(%rbp)
	jne	.L31
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	gcd, .-gcd
	.globl	rec
	.type	rec, @function
rec:
.LFB4:
	.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
	movsd	%xmm0, -24(%rbp)
	movl	%edi, -28(%rbp)
	movl	%esi, -32(%rbp)
	movl	%edx, -36(%rbp)
	cmpl	$0, -32(%rbp)
	js	.L48
	movl	a(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jg	.L48
	movsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L47
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	jmp	.L33
.L47:
	cmpl	$0, -32(%rbp)
	je	.L49
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -8(%rbp)
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-32(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -4(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L40
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
.L40:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-32(%rbp), %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-8(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	addsd	%xmm0, %xmm1
	movsd	-24(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	ja	.L50
	movl	a(%rip), %eax
	cltd
	idivl	-36(%rbp)
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L43
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
.L43:
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L44
.L45:
	movl	-36(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	leal	-1(%rax), %esi
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-12(%rbp), %xmm2
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movl	-12(%rbp), %ecx
	movl	%ecx, %edi
	movq	%rax, %xmm0
	call	rec
	addl	$1, -12(%rbp)
.L44:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L45
	jmp	.L33
.L48:
	nop
	jmp	.L33
.L49:
	nop
	jmp	.L33
.L50:
	nop
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	rec, .-rec
	.section	.rodata
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
.LC6:
	.string	"%d%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -28(%rbp)
	jmp	.L52
.L53:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-28(%rbp), %xmm1
	movsd	.LC3(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %edi
	movq	%rax, %xmm0
	call	insert
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	-16(%rbp), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L52:
	cmpl	$12002, -28(%rbp)
	jle	.L53
	jmp	.L54
.L60:
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -28(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-36(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-32(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L64
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L54
.L64:
	movq	-16(%rbp), %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -20(%rbp)
	movl	$0, ans(%rip)
	movl	-24(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L57
.L58:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %esi
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-28(%rbp), %xmm2
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movl	-28(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	%ecx, %edi
	movq	%rax, %xmm0
	call	rec
	addl	$1, -28(%rbp)
.L57:
	movl	-28(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L58
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L54:
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rcx, %r8
	leaq	a(%rip), %rcx
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L59
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jg	.L60
.L59:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1105055077
	.align 16
.LC1:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 8
.LC2:
	.long	-400107883
	.long	1041313291
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.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	lookup
	.type	lookup, @function
lookup:
.LFB23:
	.cfi_startproc
	endbr64
	movsd	.LC0(%rip), %xmm1
	movq	.LC1(%rip), %xmm3
	movsd	.LC2(%rip), %xmm2
	mulsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %eax
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$2011627575, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$46, %rdx
	subl	%ecx, %edx
	imull	$34981, %edx, %edx
	subl	%edx, %eax
	movslq	%eax, %rdx
	leaq	hash(%rip), %rax
	salq	$4, %rdx
	addq	%rdx, %rax
	movq	hashend(%rip), %rdx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movsd	8(%rax), %xmm1
	subsd	%xmm0, %xmm1
	andpd	%xmm3, %xmm1
	comisd	%xmm1, %xmm2
	jnb	.L1
	addq	$16, %rax
	leaq	hash(%rip), %rcx
	cmpq	%rax, %rdx
	cmove	%rcx, %rax
.L4:
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jne	.L5
	movl	$-1, %r8d
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	lookup, .-lookup
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB24:
	.cfi_startproc
	endbr64
	movsd	.LC0(%rip), %xmm1
	movq	.LC1(%rip), %xmm3
	movl	%edi, %esi
	movsd	.LC2(%rip), %xmm2
	mulsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %eax
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$2011627575, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$46, %rdx
	subl	%ecx, %edx
	imull	$34981, %edx, %edx
	subl	%edx, %eax
	movslq	%eax, %rdx
	leaq	hash(%rip), %rax
	salq	$4, %rdx
	addq	%rdx, %rax
	movq	hashend(%rip), %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movsd	8(%rax), %xmm1
	subsd	%xmm0, %xmm1
	andpd	%xmm3, %xmm1
	comisd	%xmm1, %xmm2
	jnb	.L8
	addq	$16, %rax
	leaq	hash(%rip), %rcx
	cmpq	%rax, %rdx
	cmove	%rcx, %rax
.L11:
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jne	.L12
	movl	%esi, (%rax)
	movsd	%xmm0, 8(%rax)
.L8:
	ret
	.cfi_endproc
.LFE24:
	.size	insert, .-insert
	.p2align 4
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB25:
	.cfi_startproc
	endbr64
	movq	.LC1(%rip), %xmm4
	movl	$12001, %edx
	xorl	%ecx, %ecx
	leaq	tbl(%rip), %rdi
	movsd	.LC2(%rip), %xmm3
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L19:
	leal	(%rcx,%rdx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	movsd	(%rdi,%rsi,8), %xmm2
	movapd	%xmm2, %xmm1
	subsd	%xmm0, %xmm1
	andpd	%xmm4, %xmm1
	comisd	%xmm1, %xmm3
	jnb	.L14
	comisd	%xmm0, %xmm2
	ja	.L23
	movl	%eax, %edx
.L17:
	cmpl	%edx, %ecx
	jl	.L19
	testl	%ecx, %ecx
	movl	$1, %eax
	cmovg	%ecx, %eax
.L14:
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	leal	1(%rax), %ecx
	jmp	.L17
	.cfi_endproc
.LFE25:
	.size	bsch, .-bsch
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB26:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	testl	%esi, %esi
	je	.L27
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L26
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE26:
	.size	gcd, .-gcd
	.p2align 4
	.globl	rec
	.type	rec, @function
rec:
.LFB27:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	js	.L59
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	a(%rip), %eax
	cmpl	%edx, %eax
	jl	.L29
	movq	.LC1(%rip), %xmm4
	movsd	.LC2(%rip), %xmm3
	movapd	%xmm0, %xmm1
	andpd	%xmm4, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L62
	movl	%esi, %r9d
	testl	%esi, %esi
	je	.L29
	movl	$12001, %ecx
	xorl	%esi, %esi
	leaq	tbl(%rip), %r10
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rcx,%rsi), %edx
	sarl	%edx
	movslq	%edx, %r8
	movsd	(%r10,%r8,8), %xmm2
	movapd	%xmm2, %xmm0
	subsd	%xmm1, %xmm0
	andpd	%xmm4, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L36
	comisd	%xmm1, %xmm2
	ja	.L63
	movl	%edx, %ecx
.L37:
	cmpl	%esi, %ecx
	jg	.L39
	testl	%esi, %esi
	movl	$1, %edx
	cmovg	%esi, %edx
.L36:
	pxor	%xmm6, %xmm6
	movapd	%xmm1, %xmm5
	movl	$12001, %esi
	cvtsi2sdl	%r9d, %xmm6
	xorl	%r8d, %r8d
	leaq	tbl(%rip), %r11
	divsd	%xmm6, %xmm5
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L44:
	leal	(%rsi,%r8), %ecx
	sarl	%ecx
	movslq	%ecx, %r10
	movsd	(%r11,%r10,8), %xmm2
	movapd	%xmm2, %xmm0
	subsd	%xmm5, %xmm0
	andpd	%xmm4, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L41
	comisd	%xmm5, %xmm2
	ja	.L64
	movl	%ecx, %esi
.L42:
	cmpl	%r8d, %esi
	jg	.L44
	testl	%r8d, %r8d
	movl	$1, %ecx
	cmovg	%r8d, %ecx
.L41:
	cmpl	%edx, %edi
	pxor	%xmm0, %xmm0
	cmovge	%edi, %edx
	cvtsi2sdl	%edx, %xmm0
	movl	%edx, %ebp
	divsd	%xmm0, %xmm6
	addsd	%xmm3, %xmm6
	comisd	%xmm6, %xmm1
	ja	.L29
	cltd
	idivl	%ebx
	addl	$1, %eax
	cmpl	%ecx, %eax
	cmovle	%eax, %ecx
	movl	%ecx, %r13d
	cmpl	%ebp, %ecx
	jl	.L29
	movl	%ebx, %r14d
	leal	-1(%r9), %r12d
	imull	%ebp, %r14d
.L45:
	movsd	.LC3(%rip), %xmm2
	movl	%r14d, %edx
	movl	%ebp, %edi
	movl	%r12d, %esi
	addl	$1, %ebp
	movsd	%xmm1, 8(%rsp)
	addl	%ebx, %r14d
	divsd	%xmm0, %xmm2
	movapd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	call	rec
	cmpl	%r13d, %ebp
	jg	.L29
	pxor	%xmm0, %xmm0
	movsd	8(%rsp), %xmm1
	cvtsi2sdl	%ebp, %xmm0
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L62:
	addl	$1, ans(%rip)
.L29:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L59:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
	.p2align 4,,10
	.p2align 3
.L64:
	.cfi_def_cfa_offset 64
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	leal	1(%rcx), %r8d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L63:
	leal	1(%rdx), %esi
	jmp	.L37
	.cfi_endproc
.LFE27:
	.size	rec, .-rec
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
.LC6:
	.string	"%d%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1, %esi
	leaq	hash(%rip), %r8
	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
	leaq	tbl(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	hashend(%rip), %rdx
	movsd	.LC3(%rip), %xmm4
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movsd	.LC0(%rip), %xmm5
	movq	.LC1(%rip), %xmm3
	movsd	.LC2(%rip), %xmm2
	.p2align 4,,10
	.p2align 3
.L70:
	pxor	%xmm0, %xmm0
	movapd	%xmm4, %xmm1
	movl	%esi, %edi
	cvtsi2sdl	%esi, %xmm0
	divsd	%xmm0, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm5, %xmm0
	cvttsd2sil	%xmm0, %eax
	movslq	%eax, %rcx
	movl	%eax, %r9d
	imulq	$2011627575, %rcx, %rcx
	sarl	$31, %r9d
	sarq	$46, %rcx
	subl	%r9d, %ecx
	imull	$34981, %ecx, %ecx
	subl	%ecx, %eax
	cltq
	salq	$4, %rax
	addq	%r8, %rax
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L69:
	movsd	8(%rax), %xmm0
	subsd	%xmm1, %xmm0
	andpd	%xmm3, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L67
	addq	$16, %rax
	leaq	hash(%rip), %rcx
	cmpq	%rdx, %rax
	cmove	%rcx, %rax
.L68:
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jne	.L69
	movl	%edi, (%rax)
	movsd	%xmm1, 8(%rax)
.L67:
	movsd	%xmm1, (%rbx,%rsi,8)
	addq	$1, %rsi
	cmpq	$12003, %rsi
	jne	.L70
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r13
.L71:
	xorl	%eax, %eax
	movq	%r15, %r8
	leaq	a(%rip), %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC6(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L88
	movl	20(%rsp), %esi
	movq	.LC3(%rip), %rax
	testl	%esi, %esi
	movq	%rax, %xmm4
	jle	.L88
	movl	16(%rsp), %edi
	movl	12(%rsp), %r8d
	testl	%edi, %edi
	je	.L91
	movl	%r8d, %eax
	movl	%edi, %ecx
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L92:
	movl	%edx, %ecx
.L73:
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L92
	movl	%r8d, %eax
	pxor	%xmm7, %xmm7
	cltd
	idivl	%ecx
	cvtsi2sdl	%eax, %xmm7
.L72:
	movl	%eax, 12(%rsp)
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm3, %xmm3
	cltd
	cvtsi2sdl	%esi, %xmm3
	idivl	%ecx
	cvtsi2sdl	%eax, %xmm0
	movl	%eax, 16(%rsp)
	divsd	%xmm0, %xmm7
	comisd	%xmm3, %xmm7
	ja	.L108
	movsd	.LC2(%rip), %xmm2
	movl	$12001, %edx
	xorl	%ecx, %ecx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L80:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rdi
	movsd	(%rbx,%rdi,8), %xmm1
	movq	%rdi, %rbp
	movapd	%xmm1, %xmm0
	subsd	%xmm7, %xmm0
	andpd	.LC1(%rip), %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L77
	comisd	%xmm7, %xmm1
	ja	.L109
	movl	%edi, %edx
.L78:
	cmpl	%ecx, %edx
	jg	.L80
	testl	%ecx, %ecx
	movl	$1, %eax
	cmovg	%ecx, %eax
	movl	%eax, %ebp
.L77:
	movapd	%xmm7, %xmm2
	movl	$12001, %edx
	xorl	%edi, %edi
	divsd	%xmm3, %xmm2
	movsd	.LC2(%rip), %xmm3
	jmp	.L83
	.p2align 4,,10
	.p2align 3
.L85:
	leal	(%rdx,%rdi), %ecx
	sarl	%ecx
	movslq	%ecx, %r8
	movsd	(%rbx,%r8,8), %xmm1
	movq	%r8, %r12
	movapd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	andpd	.LC1(%rip), %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L82
	comisd	%xmm2, %xmm1
	ja	.L110
	movl	%r8d, %edx
.L83:
	cmpl	%edi, %edx
	jg	.L85
	testl	%edi, %edi
	movl	$1, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, %r12d
.L82:
	movl	$0, ans(%rip)
	cmpl	%ebp, %r12d
	jge	.L87
	jmp	.L86
	.p2align 4,,10
	.p2align 3
.L111:
	movl	20(%rsp), %esi
.L87:
	pxor	%xmm0, %xmm0
	movapd	%xmm4, %xmm1
	subl	$1, %esi
	movl	%ebp, %edx
	cvtsi2sdl	%ebp, %xmm0
	movl	%ebp, %edi
	addl	$1, %ebp
	divsd	%xmm0, %xmm1
	movapd	%xmm7, %xmm0
	subsd	%xmm1, %xmm0
	call	rec
	movq	.LC3(%rip), %rax
	cmpl	%r12d, %ebp
	movq	%rax, %xmm4
	jle	.L111
.L86:
	movl	ans(%rip), %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L71
.L108:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L71
.L110:
	leal	1(%r8), %edi
	jmp	.L83
.L109:
	leal	1(%rdi), %ecx
	jmp	.L78
.L91:
	movl	%r8d, %ecx
	movapd	%xmm4, %xmm7
	movl	$1, %eax
	jmp	.L72
.L88:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L112
	addq	$40, %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
.L112:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 96040
tbl:
	.zero	96040
	.globl	hashend
	.section	.data.rel.local,"aw"
	.align 8
	.type	hashend, @object
	.size	hashend, 8
hashend:
	.quad	hash+559696
	.globl	hash
	.bss
	.align 32
	.type	hash, @object
	.size	hash, 559728
hash:
	.zero	559728
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1105055077
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC2:
	.long	-400107883
	.long	1041313291
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.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	lookup
	.type	lookup, @function
lookup:
.LFB23:
	.cfi_startproc
	endbr64
	movsd	.LC0(%rip), %xmm1
	movq	.LC1(%rip), %xmm3
	movsd	.LC2(%rip), %xmm2
	mulsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %eax
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$2011627575, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$46, %rdx
	subl	%ecx, %edx
	imull	$34981, %edx, %edx
	subl	%edx, %eax
	movslq	%eax, %rdx
	leaq	hash(%rip), %rax
	salq	$4, %rdx
	addq	%rdx, %rax
	movq	hashend(%rip), %rdx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movsd	8(%rax), %xmm1
	subsd	%xmm0, %xmm1
	andpd	%xmm3, %xmm1
	comisd	%xmm1, %xmm2
	jnb	.L1
	addq	$16, %rax
	leaq	hash(%rip), %rcx
	cmpq	%rax, %rdx
	cmove	%rcx, %rax
.L4:
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jne	.L5
	movl	$-1, %r8d
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	lookup, .-lookup
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB24:
	.cfi_startproc
	endbr64
	movsd	.LC0(%rip), %xmm1
	movq	.LC1(%rip), %xmm3
	movl	%edi, %esi
	movsd	.LC2(%rip), %xmm2
	mulsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %eax
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$2011627575, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$46, %rdx
	subl	%ecx, %edx
	imull	$34981, %edx, %edx
	subl	%edx, %eax
	movslq	%eax, %rdx
	leaq	hash(%rip), %rax
	salq	$4, %rdx
	addq	%rdx, %rax
	movq	hashend(%rip), %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movsd	8(%rax), %xmm1
	subsd	%xmm0, %xmm1
	andpd	%xmm3, %xmm1
	comisd	%xmm1, %xmm2
	jnb	.L8
	addq	$16, %rax
	leaq	hash(%rip), %rcx
	cmpq	%rax, %rdx
	cmove	%rcx, %rax
.L11:
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jne	.L12
	movl	%esi, (%rax)
	movsd	%xmm0, 8(%rax)
.L8:
	ret
	.cfi_endproc
.LFE24:
	.size	insert, .-insert
	.p2align 4
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB25:
	.cfi_startproc
	endbr64
	movq	.LC1(%rip), %xmm4
	movl	$12001, %edx
	xorl	%ecx, %ecx
	leaq	tbl(%rip), %rdi
	movsd	.LC2(%rip), %xmm3
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L19:
	leal	(%rcx,%rdx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	movsd	(%rdi,%rsi,8), %xmm2
	movapd	%xmm2, %xmm1
	subsd	%xmm0, %xmm1
	andpd	%xmm4, %xmm1
	comisd	%xmm1, %xmm3
	jnb	.L14
	comisd	%xmm0, %xmm2
	ja	.L23
	movl	%eax, %edx
.L17:
	cmpl	%edx, %ecx
	jl	.L19
	testl	%ecx, %ecx
	movl	$1, %eax
	cmovg	%ecx, %eax
.L14:
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	leal	1(%rax), %ecx
	jmp	.L17
	.cfi_endproc
.LFE25:
	.size	bsch, .-bsch
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB26:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	testl	%esi, %esi
	je	.L27
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L26
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE26:
	.size	gcd, .-gcd
	.p2align 4
	.globl	rec
	.type	rec, @function
rec:
.LFB27:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	js	.L59
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	a(%rip), %eax
	cmpl	%edx, %eax
	jl	.L29
	movq	.LC1(%rip), %xmm4
	movsd	.LC2(%rip), %xmm3
	movapd	%xmm0, %xmm1
	andpd	%xmm4, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L62
	movl	%esi, %r9d
	testl	%esi, %esi
	je	.L29
	movl	$12001, %ecx
	xorl	%esi, %esi
	leaq	tbl(%rip), %r10
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rcx,%rsi), %edx
	sarl	%edx
	movslq	%edx, %r8
	movsd	(%r10,%r8,8), %xmm2
	movapd	%xmm2, %xmm0
	subsd	%xmm1, %xmm0
	andpd	%xmm4, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L36
	comisd	%xmm1, %xmm2
	ja	.L63
	movl	%edx, %ecx
.L37:
	cmpl	%esi, %ecx
	jg	.L39
	testl	%esi, %esi
	movl	$1, %edx
	cmovg	%esi, %edx
.L36:
	pxor	%xmm6, %xmm6
	movapd	%xmm1, %xmm5
	movl	$12001, %esi
	cvtsi2sdl	%r9d, %xmm6
	xorl	%r8d, %r8d
	leaq	tbl(%rip), %r11
	divsd	%xmm6, %xmm5
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L44:
	leal	(%rsi,%r8), %ecx
	sarl	%ecx
	movslq	%ecx, %r10
	movsd	(%r11,%r10,8), %xmm2
	movapd	%xmm2, %xmm0
	subsd	%xmm5, %xmm0
	andpd	%xmm4, %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L41
	comisd	%xmm5, %xmm2
	ja	.L64
	movl	%ecx, %esi
.L42:
	cmpl	%r8d, %esi
	jg	.L44
	testl	%r8d, %r8d
	movl	$1, %ecx
	cmovg	%r8d, %ecx
.L41:
	cmpl	%edx, %edi
	pxor	%xmm0, %xmm0
	cmovge	%edi, %edx
	cvtsi2sdl	%edx, %xmm0
	movl	%edx, %ebp
	divsd	%xmm0, %xmm6
	addsd	%xmm3, %xmm6
	comisd	%xmm6, %xmm1
	ja	.L29
	cltd
	idivl	%ebx
	addl	$1, %eax
	cmpl	%ecx, %eax
	cmovle	%eax, %ecx
	movl	%ecx, %r13d
	cmpl	%ebp, %ecx
	jl	.L29
	movl	%ebx, %r14d
	leal	-1(%r9), %r12d
	imull	%ebp, %r14d
.L45:
	movsd	.LC3(%rip), %xmm2
	movl	%r14d, %edx
	movl	%ebp, %edi
	movl	%r12d, %esi
	addl	$1, %ebp
	movsd	%xmm1, 8(%rsp)
	addl	%ebx, %r14d
	divsd	%xmm0, %xmm2
	movapd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	call	rec
	cmpl	%r13d, %ebp
	jg	.L29
	pxor	%xmm0, %xmm0
	movsd	8(%rsp), %xmm1
	cvtsi2sdl	%ebp, %xmm0
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L62:
	addl	$1, ans(%rip)
.L29:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L59:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
	.p2align 4,,10
	.p2align 3
.L64:
	.cfi_def_cfa_offset 64
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	leal	1(%rcx), %r8d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L63:
	leal	1(%rdx), %esi
	jmp	.L37
	.cfi_endproc
.LFE27:
	.size	rec, .-rec
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
.LC6:
	.string	"%d%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1, %esi
	leaq	hash(%rip), %r8
	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
	leaq	tbl(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	hashend(%rip), %rdx
	movsd	.LC3(%rip), %xmm4
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movsd	.LC0(%rip), %xmm5
	movq	.LC1(%rip), %xmm3
	movsd	.LC2(%rip), %xmm2
	.p2align 4,,10
	.p2align 3
.L70:
	pxor	%xmm0, %xmm0
	movapd	%xmm4, %xmm1
	movl	%esi, %edi
	cvtsi2sdl	%esi, %xmm0
	divsd	%xmm0, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm5, %xmm0
	cvttsd2sil	%xmm0, %eax
	movslq	%eax, %rcx
	movl	%eax, %r9d
	imulq	$2011627575, %rcx, %rcx
	sarl	$31, %r9d
	sarq	$46, %rcx
	subl	%r9d, %ecx
	imull	$34981, %ecx, %ecx
	subl	%ecx, %eax
	cltq
	salq	$4, %rax
	addq	%r8, %rax
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L69:
	movsd	8(%rax), %xmm0
	subsd	%xmm1, %xmm0
	andpd	%xmm3, %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L67
	addq	$16, %rax
	leaq	hash(%rip), %rcx
	cmpq	%rdx, %rax
	cmove	%rcx, %rax
.L68:
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jne	.L69
	movl	%edi, (%rax)
	movsd	%xmm1, 8(%rax)
.L67:
	movsd	%xmm1, (%rbx,%rsi,8)
	addq	$1, %rsi
	cmpq	$12003, %rsi
	jne	.L70
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r13
.L71:
	xorl	%eax, %eax
	movq	%r15, %r8
	leaq	a(%rip), %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC6(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L88
	movl	20(%rsp), %esi
	movq	.LC3(%rip), %rax
	testl	%esi, %esi
	movq	%rax, %xmm4
	jle	.L88
	movl	16(%rsp), %edi
	movl	12(%rsp), %r8d
	testl	%edi, %edi
	je	.L91
	movl	%r8d, %eax
	movl	%edi, %ecx
	jmp	.L73
	.p2align 4,,10
	.p2align 3
.L92:
	movl	%edx, %ecx
.L73:
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L92
	movl	%r8d, %eax
	pxor	%xmm7, %xmm7
	cltd
	idivl	%ecx
	cvtsi2sdl	%eax, %xmm7
.L72:
	movl	%eax, 12(%rsp)
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm3, %xmm3
	cltd
	cvtsi2sdl	%esi, %xmm3
	idivl	%ecx
	cvtsi2sdl	%eax, %xmm0
	movl	%eax, 16(%rsp)
	divsd	%xmm0, %xmm7
	comisd	%xmm3, %xmm7
	ja	.L108
	movsd	.LC2(%rip), %xmm2
	movl	$12001, %edx
	xorl	%ecx, %ecx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L80:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rdi
	movsd	(%rbx,%rdi,8), %xmm1
	movq	%rdi, %rbp
	movapd	%xmm1, %xmm0
	subsd	%xmm7, %xmm0
	andpd	.LC1(%rip), %xmm0
	comisd	%xmm0, %xmm2
	jnb	.L77
	comisd	%xmm7, %xmm1
	ja	.L109
	movl	%edi, %edx
.L78:
	cmpl	%ecx, %edx
	jg	.L80
	testl	%ecx, %ecx
	movl	$1, %eax
	cmovg	%ecx, %eax
	movl	%eax, %ebp
.L77:
	movapd	%xmm7, %xmm2
	movl	$12001, %edx
	xorl	%edi, %edi
	divsd	%xmm3, %xmm2
	movsd	.LC2(%rip), %xmm3
	jmp	.L83
	.p2align 4,,10
	.p2align 3
.L85:
	leal	(%rdx,%rdi), %ecx
	sarl	%ecx
	movslq	%ecx, %r8
	movsd	(%rbx,%r8,8), %xmm1
	movq	%r8, %r12
	movapd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	andpd	.LC1(%rip), %xmm0
	comisd	%xmm0, %xmm3
	jnb	.L82
	comisd	%xmm2, %xmm1
	ja	.L110
	movl	%r8d, %edx
.L83:
	cmpl	%edi, %edx
	jg	.L85
	testl	%edi, %edi
	movl	$1, %ecx
	cmovg	%edi, %ecx
	movl	%ecx, %r12d
.L82:
	movl	$0, ans(%rip)
	cmpl	%ebp, %r12d
	jge	.L87
	jmp	.L86
	.p2align 4,,10
	.p2align 3
.L111:
	movl	20(%rsp), %esi
.L87:
	pxor	%xmm0, %xmm0
	movapd	%xmm4, %xmm1
	subl	$1, %esi
	movl	%ebp, %edx
	cvtsi2sdl	%ebp, %xmm0
	movl	%ebp, %edi
	addl	$1, %ebp
	divsd	%xmm0, %xmm1
	movapd	%xmm7, %xmm0
	subsd	%xmm1, %xmm0
	call	rec
	movq	.LC3(%rip), %rax
	cmpl	%r12d, %ebp
	movq	%rax, %xmm4
	jle	.L111
.L86:
	movl	ans(%rip), %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L71
.L108:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L71
.L110:
	leal	1(%r8), %edi
	jmp	.L83
.L109:
	leal	1(%rdi), %ecx
	jmp	.L78
.L91:
	movl	%r8d, %ecx
	movapd	%xmm4, %xmm7
	movl	$1, %eax
	jmp	.L72
.L88:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L112
	addq	$40, %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
.L112:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 96040
tbl:
	.zero	96040
	.globl	hashend
	.section	.data.rel.local,"aw"
	.align 8
	.type	hashend, @object
	.size	hashend, 8
hashend:
	.quad	hash+559696
	.globl	hash
	.bss
	.align 32
	.type	hash, @object
	.size	hash, 559728
hash:
	.zero	559728
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1105055077
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC2:
	.long	-400107883
	.long	1041313291
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.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 1131: Unit Fraction Partition
// 2017.10.24 bal4u@uu

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

#define M 2000000000
#define EPS 1e-9
#define HASHSIZ 34981
typedef struct { int b; double v; } HASH;
HASH hash[HASHSIZ + 2], *hashend = hash + HASHSIZ;

int lookup(double v)
{
	int k = (int)(v * M);
	HASH *hp = hash + k % HASHSIZ;
	while (hp->b) {
		if (fabs(hp->v - v) <= EPS) return hp->b;
		if (++hp == hashend) hp = hash;
	}
	return -1;
}

void insert(double v, int b)
{
	int k = (int)(v * M);
	HASH *hp = hash + k % HASHSIZ;
	while (hp->b) {
		if (fabs(hp->v - v) <= EPS) return;
		if (++hp == hashend) hp = hash;
	}
	hp->v = v, hp->b = b;
}

double tbl[12005];

int bsch(double v)
{
	int m, l = 0, r = 12001;

	while (l < r) {
		m = (l + r) >> 1;
		if (fabs(tbl[m] - v) <= EPS) return m;
		if (tbl[m] > v) l = m + 1; else r = m;
	}
	if (l <= 0) l = 1;
	return l;
}

int ans, a;

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

void rec(double v, int k, int n, int aa)
{
	int i, l, r;

	if (n < 0 || aa > a) return;
	if (fabs(v) <= EPS) { ans++; return; }
	if (n == 0) return;

	l = bsch(v), r = bsch(v / n);
	if (k > l) l = k;
	if ((double)n/l + EPS < v) return;
	k = a / aa+1;
	if (r > k) r = k;
	for (i = l; i <= r; i++) rec(v - 1.0 / i, i, n - 1, aa*i);
}

int main()
{
	int p, q, n, i, l, r;
	double v;

	for (i = 1; i <= 12002; i++) {
		v = 1.0 / i;
		insert(v, i), tbl[i] = v;
	}

	while (scanf("%d%d%d%d", &p, &q, &a, &n) && n > 0) {
		i = gcd(p, q); p /= i, q /= i;
		v = (double)p / q;
//		if (fabs(v-n) <= EPS) { puts("1"); continue; }
		if (v > n) { puts("0"); continue; }
		l = bsch(v), r = bsch(v / n);
		for (ans = 0, i = l; i <= r; i++) {
			rec(v - 1.0 / i, i, n - 1, i);
		}
		printf("%d\n", ans);
	}
	return 0;
}
2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 3
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 200 5
2 4 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 2
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 16 5
2 4 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 2
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 3
2 3 300 3
2 3 299 3
2 3 12 2
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
2 3 299 3
2 3 12 2
2 0 12000 7
54 795 22620 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
3 3 299 3
2 3 12 2
2 0 12000 7
54 795 22620 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
3 3 299 3
2 3 7 2
2 0 12000 7
54 795 22620 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 6 120 5
2 3 300 3
3 3 299 3
2 3 7 2
2 0 12000 7
54 781 35092 7
2 4 300 1
2 1 8 5
2 4 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 3 299 3
2 3 12 3
2 3 12000 7
54 795 12000 7
2 3 300 1
2 1 200 5
2 6 54 2
0 0 0 0
 2 3 120 3
2 3 300 3
2 1 299 3
2 3 12 3
2 3 12000 7
54 795 12000 7
2 4 300 1
2 1 200 5
2 4 54 2
0 0 0 0

4
7
6
2
42
1
1
9
3
 4
7
6
2
42
1
1
3
3
 4
7
6
2
42
1
1
2
3
 3
7
6
2
42
1
1
2
3
 3
7
6
2
0
1
1
2
3
 3
7
5
2
0
1
1
2
3
 3
7
5
0
0
1
1
2
3
 3
7
5
0
0
0
1
2
3
 4
7
6
2
42
1
0
9
3
 4
7
2
2
42
1
1
9
3

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

```c
// Aizu 1131: Unit Fraction Partition
// 2017.10.24 bal4u@uu

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

#define M 2000000000
#define EPS 1e-9
#define HASHSIZ 34981
typedef struct { int b; double v; } HASH;
HASH hash[HASHSIZ + 2], *hashend = hash + HASHSIZ;

int lookup(double v)
{
	int k = (int)(v * M);
	HASH *hp = hash + k % HASHSIZ;
	while (hp->b) {
		if (fabs(hp->v - v) <= EPS) return hp->b;
		if (++hp == hashend) hp = hash;
	}
	return -1;
}

void insert(double v, int b)
{
	int k = (int)(v * M);
	HASH *hp = hash + k % HASHSIZ;
	while (hp->b) {
		if (fabs(hp->v - v) <= EPS) return;
		if (++hp == hashend) hp = hash;
	}
	hp->v = v, hp->b = b;
}

double tbl[12005];

int bsch(double v)
{
	int m, l = 0, r = 12001;

	while (l < r) {
		m = (l + r) >> 1;
		if (fabs(tbl[m] - v) <= EPS) return m;
		if (tbl[m] > v) l = m + 1; else r = m;
	}
	if (l <= 0) l = 1;
	return l;
}

int ans, a;

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

void rec(double v, int k, int n, int aa)
{
	int i, l, r;

	if (n < 0 || aa > a) return;
	if (fabs(v) <= EPS) { ans++; return; }
	if (n == 0) return;

	l = bsch(v), r = bsch(v / n);
	if (k > l) l = k;
	if ((double)n/l + EPS < v) return;
	k = a / aa+1;
	if (r > k) r = k;
	for (i = l; i <= r; i++) rec(v - 1.0 / i, i, n - 1, aa*i);
}

int main()
{
	int p, q, n, i, l, r;
	double v;

	for (i = 1; i <= 12002; i++) {
		v = 1.0 / i;
		insert(v, i), tbl[i] = v;
	}

	while (scanf("%d%d%d%d", &p, &q, &a, &n) && n > 0) {
		i = gcd(p, q); p /= i, q /= i;
		v = (double)p / q;
//		if (fabs(v-n) <= EPS) { puts("1"); continue; }
		if (v > n) { puts("0"); continue; }
		l = bsch(v), r = bsch(v / n);
		for (ans = 0, i = l; i <= r; i++) {
			rec(v - 1.0 / i, i, n - 1, i);
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	hash
	.bss
	.align 32
	.type	hash, @object
	.size	hash, 559728
hash:
	.zero	559728
	.globl	hashend
	.section	.data.rel.local,"aw"
	.align 8
	.type	hashend, @object
	.size	hashend, 8
hashend:
	.quad	hash+559696
	.text
	.globl	lookup
	.type	lookup, @function
lookup:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$2011627575, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$14, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$34981, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	hash(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L6:
	movq	-8(%rbp), %rax
	movsd	8(%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L8
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	jmp	.L5
.L8:
	addq	$16, -8(%rbp)
	movq	hashend(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L2
	leaq	hash(%rip), %rax
	movq	%rax, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$-1, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	lookup, .-lookup
	.globl	insert
	.type	insert, @function
insert:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movl	%edi, -28(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$2011627575, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$14, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$34981, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	hash(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L14:
	movq	-8(%rbp), %rax
	movsd	8(%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jnb	.L15
	addq	$16, -8(%rbp)
	movq	hashend(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L10
	leaq	hash(%rip), %rax
	movq	%rax, -8(%rbp)
.L10:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movq	-8(%rbp), %rax
	movsd	-24(%rbp), %xmm0
	movsd	%xmm0, 8(%rax)
	movq	-8(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L9
.L15:
	nop
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	insert, .-insert
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 96040
tbl:
	.zero	96040
	.text
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movl	$0, -12(%rbp)
	movl	$12001, -8(%rbp)
	jmp	.L17
.L23:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L27
	movl	-4(%rbp), %eax
	jmp	.L20
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	comisd	-24(%rbp), %xmm0
	jbe	.L28
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L17
.L28:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L17:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L23
	cmpl	$0, -12(%rbp)
	jg	.L24
	movl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	bsch, .-bsch
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB3:
	.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	.L30
.L31:
	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)
.L30:
	cmpl	$0, -24(%rbp)
	jne	.L31
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	gcd, .-gcd
	.globl	rec
	.type	rec, @function
rec:
.LFB4:
	.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
	movsd	%xmm0, -24(%rbp)
	movl	%edi, -28(%rbp)
	movl	%esi, -32(%rbp)
	movl	%edx, -36(%rbp)
	cmpl	$0, -32(%rbp)
	js	.L48
	movl	a(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jg	.L48
	movsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L47
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	jmp	.L33
.L47:
	cmpl	$0, -32(%rbp)
	je	.L49
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -8(%rbp)
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-32(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -4(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L40
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
.L40:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-32(%rbp), %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-8(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	addsd	%xmm0, %xmm1
	movsd	-24(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	ja	.L50
	movl	a(%rip), %eax
	cltd
	idivl	-36(%rbp)
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L43
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
.L43:
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L44
.L45:
	movl	-36(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	leal	-1(%rax), %esi
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-12(%rbp), %xmm2
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movl	-12(%rbp), %ecx
	movl	%ecx, %edi
	movq	%rax, %xmm0
	call	rec
	addl	$1, -12(%rbp)
.L44:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L45
	jmp	.L33
.L48:
	nop
	jmp	.L33
.L49:
	nop
	jmp	.L33
.L50:
	nop
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	rec, .-rec
	.section	.rodata
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
.LC6:
	.string	"%d%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -28(%rbp)
	jmp	.L52
.L53:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-28(%rbp), %xmm1
	movsd	.LC3(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %edi
	movq	%rax, %xmm0
	call	insert
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	-16(%rbp), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L52:
	cmpl	$12002, -28(%rbp)
	jle	.L53
	jmp	.L54
.L60:
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -28(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-36(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-32(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L64
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L54
.L64:
	movq	-16(%rbp), %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -20(%rbp)
	movl	$0, ans(%rip)
	movl	-24(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L57
.L58:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %esi
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-28(%rbp), %xmm2
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movl	-28(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	%ecx, %edi
	movq	%rax, %xmm0
	call	rec
	addl	$1, -28(%rbp)
.L57:
	movl	-28(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L58
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L54:
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rcx, %r8
	leaq	a(%rip), %rcx
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L59
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jg	.L60
.L59:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1105055077
	.align 16
.LC1:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 8
.LC2:
	.long	-400107883
	.long	1041313291
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.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	hash
	.bss
	.align 32
	.type	hash, @object
	.size	hash, 559728
hash:
	.zero	559728
	.globl	hashend
	.section	.data.rel.local,"aw"
	.align 8
	.type	hashend, @object
	.size	hashend, 8
hashend:
	.quad	hash+559696
	.text
	.globl	lookup
	.type	lookup, @function
lookup:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$2011627575, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$14, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$34981, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	hash(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L6:
	movq	-8(%rbp), %rax
	movsd	8(%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L8
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	jmp	.L5
.L8:
	addq	$16, -8(%rbp)
	movq	hashend(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L2
	leaq	hash(%rip), %rax
	movq	%rax, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$-1, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	lookup, .-lookup
	.globl	insert
	.type	insert, @function
insert:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movl	%edi, -28(%rbp)
	movsd	-24(%rbp), %xmm1
	movsd	.LC0(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$2011627575, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$14, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$34981, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	hash(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L10
.L14:
	movq	-8(%rbp), %rax
	movsd	8(%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jnb	.L15
	addq	$16, -8(%rbp)
	movq	hashend(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jne	.L10
	leaq	hash(%rip), %rax
	movq	%rax, -8(%rbp)
.L10:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movq	-8(%rbp), %rax
	movsd	-24(%rbp), %xmm0
	movsd	%xmm0, 8(%rax)
	movq	-8(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L9
.L15:
	nop
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	insert, .-insert
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 96040
tbl:
	.zero	96040
	.text
	.globl	bsch
	.type	bsch, @function
bsch:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movsd	%xmm0, -24(%rbp)
	movl	$0, -12(%rbp)
	movl	$12001, -8(%rbp)
	jmp	.L17
.L23:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	subsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L27
	movl	-4(%rbp), %eax
	jmp	.L20
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	comisd	-24(%rbp), %xmm0
	jbe	.L28
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L17
.L28:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L17:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L23
	cmpl	$0, -12(%rbp)
	jg	.L24
	movl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
.L20:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	bsch, .-bsch
	.globl	ans
	.bss
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB3:
	.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	.L30
.L31:
	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)
.L30:
	cmpl	$0, -24(%rbp)
	jne	.L31
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	gcd, .-gcd
	.globl	rec
	.type	rec, @function
rec:
.LFB4:
	.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
	movsd	%xmm0, -24(%rbp)
	movl	%edi, -28(%rbp)
	movl	%esi, -32(%rbp)
	movl	%edx, -36(%rbp)
	cmpl	$0, -32(%rbp)
	js	.L48
	movl	a(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jg	.L48
	movsd	-24(%rbp), %xmm0
	movq	.LC1(%rip), %xmm1
	andpd	%xmm0, %xmm1
	movsd	.LC2(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jb	.L47
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	jmp	.L33
.L47:
	cmpl	$0, -32(%rbp)
	je	.L49
	movq	-24(%rbp), %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -8(%rbp)
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-32(%rbp), %xmm1
	movsd	-24(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -4(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L40
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
.L40:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-32(%rbp), %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-8(%rbp), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC2(%rip), %xmm0
	addsd	%xmm0, %xmm1
	movsd	-24(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	ja	.L50
	movl	a(%rip), %eax
	cltd
	idivl	-36(%rbp)
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L43
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
.L43:
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L44
.L45:
	movl	-36(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	leal	-1(%rax), %esi
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-12(%rbp), %xmm2
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	-24(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movl	-12(%rbp), %ecx
	movl	%ecx, %edi
	movq	%rax, %xmm0
	call	rec
	addl	$1, -12(%rbp)
.L44:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L45
	jmp	.L33
.L48:
	nop
	jmp	.L33
.L49:
	nop
	jmp	.L33
.L50:
	nop
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	rec, .-rec
	.section	.rodata
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
.LC6:
	.string	"%d%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -28(%rbp)
	jmp	.L52
.L53:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-28(%rbp), %xmm1
	movsd	.LC3(%rip), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %edi
	movq	%rax, %xmm0
	call	insert
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	tbl(%rip), %rax
	movsd	-16(%rbp), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L52:
	cmpl	$12002, -28(%rbp)
	jle	.L53
	jmp	.L54
.L60:
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -28(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-28(%rbp)
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-36(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-32(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L64
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L54
.L64:
	movq	-16(%rbp), %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	-16(%rbp), %xmm0
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	bsch
	movl	%eax, -20(%rbp)
	movl	$0, ans(%rip)
	movl	-24(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L57
.L58:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %esi
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-28(%rbp), %xmm2
	movsd	.LC3(%rip), %xmm0
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	-16(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movl	-28(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	%ecx, %edi
	movq	%rax, %xmm0
	call	rec
	addl	$1, -28(%rbp)
.L57:
	movl	-28(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L58
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L54:
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rcx, %r8
	leaq	a(%rip), %rcx
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L59
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jg	.L60
.L59:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1105055077
	.align 16
.LC1:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 8
.LC2:
	.long	-400107883
	.long	1041313291
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.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:
