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

```c
#include <stdio.h>
#include <stdlib.h>

#define Q 1000000007
#define N 1001

typedef long long int ll;
ll dp[N][N];
ll fact[N], ifact[N], inv[N];
ll ifp[N][N];

ll power(ll a, ll b){
	ll s=1;
	
	while(b){
		if(b & 1) s = s * a % Q;
		a = a * a % Q;
		b = b >> 1;
	}
	
	return s;
}

int main(void){
	int n, a, b, c, d;
	int i, j, k;
	ll tmp;

	scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
	fact[0] = 1;
	ifact[0] = 1;
	for(i=1; i<N; i++) inv[i]  = power(i, Q-2);
	for(i=1; i<N; i++) fact[i] = i * fact[i-1] % Q;
	for(i=1; i<N; i++) ifact[i] = ifact[i-1] * inv[i] % Q;
	for(i=1; i<N; i++){
		ifp[i][0] = 1;
		for(j=1; j<N; j++){
			ifp[i][j] = ifp[i][j-1] * ifact[i] % Q;
		}
	}
	dp[a-1][0] = 1;
	for(i=a; i<=b; i++){
		dp[i][0] = 1;
		for(j=1; j<=n; j++){
			dp[i][j] = dp[i-1][j];
			for(k=c; k<=d; k++){
				if(k*i > j) break;
				dp[i][j] = (dp[i][j] + dp[i-1][j-i*k]*fact[n-j+i*k]%Q * ifact[n-j]%Q * ifp[i][k]%Q * ifact[k]%Q)%Q;
			}
		}
	}
	
	printf("%lld\n", dp[b][n]);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 8016008
dp:
	.zero	8016008
	.globl	fact
	.align 32
	.type	fact, @object
	.size	fact, 8008
fact:
	.zero	8008
	.globl	ifact
	.align 32
	.type	ifact, @object
	.size	ifact, 8008
ifact:
	.zero	8008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 8008
inv:
	.zero	8008
	.globl	ifp
	.align 32
	.type	ifp, @object
	.size	ifp, 8016008
ifp:
	.zero	8016008
	.text
	.globl	power
	.type	power, @function
power:
.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)
	movq	$1, -8(%rbp)
	jmp	.L2
.L4:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L3
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L3:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	sarq	-32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"%lld\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, fact(%rip)
	movq	$1, ifact(%rip)
	movl	$1, -20(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	cltq
	movl	$1000000005, %esi
	movq	%rax, %rdi
	call	power
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	inv(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L7:
	cmpl	$1000, -20(%rbp)
	jle	.L8
	movl	$1, -20(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	fact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	fact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L9:
	cmpl	$1000, -20(%rbp)
	jle	.L10
	movl	$1, -20(%rbp)
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ifact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	inv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L11:
	cmpl	$1000, -20(%rbp)
	jle	.L12
	movl	$1, -20(%rbp)
	jmp	.L13
.L16:
	movl	-20(%rbp), %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	ifp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	$1, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	ifp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	ifact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L14:
	cmpl	$1000, -16(%rbp)
	jle	.L15
	addl	$1, -20(%rbp)
.L13:
	cmpl	$1000, -20(%rbp)
	jle	.L16
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L17
.L24:
	movl	-20(%rbp), %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	$1, -16(%rbp)
	jmp	.L18
.L23:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L19
.L22:
	movl	-12(%rbp), %eax
	imull	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L27
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	imull	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	fact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-40(%rbp), %edx
	subl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifp(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L19:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L22
	jmp	.L21
.L27:
	nop
.L21:
	addl	$1, -16(%rbp)
.L18:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L23
	addl	$1, -20(%rbp)
.L17:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L24
	movl	-32(%rbp), %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	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	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	power
	.type	power, @function
power:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rdi, %rcx
	movl	$1, %r8d
	movq	%rsi, %rdi
	testq	%rsi, %rsi
	je	.L1
	movabsq	$-8543223828751151131, %r9
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %dil
	je	.L3
	movq	%r8, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r9
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
.L3:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	movq	%rcx, %rsi
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	sarq	%rdi
	movq	%rsi, %rcx
	jne	.L4
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d %d %d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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
	movl	$1, %ebx
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	108(%rsp), %rcx
	leaq	104(%rsp), %rdx
	leaq	100(%rsp), %rsi
	leaq	116(%rsp), %r9
	leaq	112(%rsp), %r8
	call	__isoc99_scanf@PLT
	leaq	inv(%rip), %r10
	movq	$1, fact(%rip)
	movabsq	$-8543223828751151131, %r11
	movq	$1, ifact(%rip)
.L14:
	movq	%rbx, %rcx
	movl	$30, %r9d
	movl	$1, %esi
	movl	$1000000005, %r8d
	.p2align 4,,10
	.p2align 3
.L13:
	testb	$1, %r8b
	je	.L12
	movq	%rsi, %rdi
	imulq	%rcx, %rdi
	movq	%rdi, %rax
	imulq	%r11
	movq	%rdi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rdi), %rsi
	sarq	$29, %rsi
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	subq	%rax, %rdi
	movq	%rdi, %rsi
.L12:
	movq	%rcx, %rdi
	sarq	%r8
	imulq	%rcx, %rdi
	movq	%rdi, %rax
	mulq	%r11
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %rcx
	subl	$1, %r9d
	jne	.L13
	movq	%rsi, (%r10,%rbx,8)
	addq	$1, %rbx
	cmpq	$1001, %rbx
	jne	.L14
	movl	$1, %ecx
	movl	$1, %eax
	leaq	fact(%rip), %rbp
	movabsq	$-8543223828751151131, %rdi
.L15:
	imulq	%rcx, %rax
	movq	%rax, %rsi
	imulq	%rdi
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rsi, %rax
	subq	%rdx, %rax
	movq	%rax, 0(%rbp,%rcx,8)
	addq	$1, %rcx
	cmpq	$1001, %rcx
	jne	.L15
	movl	$8, %ecx
	movl	$1, %eax
	movabsq	$-8543223828751151131, %rdi
.L16:
	imulq	(%r10,%rcx), %rax
	leaq	ifact(%rip), %rbx
	movq	%rax, %rsi
	imulq	%rdi
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rsi, %rax
	subq	%rdx, %rax
	movq	%rax, (%rbx,%rcx)
	addq	$8, %rcx
	cmpq	$8008, %rcx
	jne	.L16
	leaq	16016+ifp(%rip), %rdi
	leaq	8(%rbx), %r10
	movabsq	$-8543223828751151131, %r9
	leaq	8008000(%rdi), %r11
.L18:
	movq	(%r10), %r8
	leaq	-8000(%rdi), %rsi
	movl	$1, %edx
	movq	$1, -8008(%rdi)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rdx, %rcx
	addq	$8, %rsi
	imulq	%r8, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, -8(%rsi)
	movq	%rcx, %rdx
	cmpq	%rdi, %rsi
	jne	.L17
	leaq	8008(%rsi), %rdi
	addq	$8, %r10
	cmpq	%r11, %rdi
	jne	.L18
	movl	104(%rsp), %r12d
	leaq	dp(%rip), %r15
	movl	100(%rsp), %ebx
	leal	-1(%r12), %eax
	movl	%ebx, 32(%rsp)
	cltq
	imulq	$8008, %rax, %rax
	movq	$1, (%r15,%rax)
	movl	108(%rsp), %eax
	movl	%eax, 76(%rsp)
	cmpl	%eax, %r12d
	jg	.L22
	movl	112(%rsp), %eax
	movl	116(%rsp), %ebx
	movslq	%r12d, %rdx
	leaq	-8+ifact(%rip), %r13
	movdqa	.LC3(%rip), %xmm4
	movdqa	.LC4(%rip), %xmm3
	movabsq	$-8543223828751151131, %rdi
	movl	%eax, 36(%rsp)
	movl	%ebx, 12(%rsp)
	movl	%eax, %ebx
	addl	$1, %eax
	movl	%eax, 72(%rsp)
	imull	%r12d, %eax
	imull	%r12d, %ebx
	movl	%eax, 52(%rsp)
	imulq	$8008, %rdx, %rax
	movl	%ebx, 48(%rsp)
	leaq	ifp(%rip), %rbx
	leaq	(%rbx,%rax), %r14
	leaq	-8000(%r15,%rax), %rax
	imulq	$1001, %rdx, %rbx
	movq	%rbx, 80(%rsp)
	movl	76(%rsp), %ebx
	addl	$1, %ebx
	movl	%ebx, 88(%rsp)
	movl	32(%rsp), %ebx
	addl	$1, %ebx
	movl	%ebx, 92(%rsp)
	movq	%r14, %rbx
	movl	%r12d, %r14d
	movq	%rbx, %r12
.L21:
	movq	$1, 8000(%rax)
	movl	32(%rsp), %edx
	testl	%edx, %edx
	jle	.L53
	movl	48(%rsp), %ecx
	leal	-1(%r14), %ebx
	cmpl	$1, %ecx
	jle	.L34
	movl	92(%rsp), %esi
	movl	$1, %edx
	cmpl	%ecx, %esi
	cmovle	%esi, %ecx
	leal	-1(%rcx), %esi
	cmpl	$1, %ecx
	cmovle	%edx, %esi
	cmpl	$4, %ecx
	jle	.L35
	leaq	8008(%rax), %r9
	movl	%esi, %r8d
	movdqa	.LC0(%rip), %xmm1
	xorl	%edx, %edx
	movq	%r9, 64(%rsp)
	shrl	$2, %r8d
	salq	$5, %r8
.L25:
	movdqu	16(%rax,%rdx), %xmm2
	movdqu	(%rax,%rdx), %xmm5
	movdqa	%xmm1, %xmm0
	paddd	%xmm4, %xmm1
	paddd	%xmm3, %xmm0
	movups	%xmm5, (%r9,%rdx)
	movups	%xmm2, 16(%r9,%rdx)
	addq	$32, %rdx
	cmpq	%r8, %rdx
	jne	.L25
	movl	%esi, %eax
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %eax
	movd	%xmm0, %r10d
	leal	1(%rax), %edx
	cmpl	%esi, %eax
	je	.L28
.L24:
	movslq	%ebx, %rsi
	movslq	%r14d, %r8
	leal	1(%rdx), %r10d
	movslq	%edx, %rax
	imulq	$1001, %rsi, %r9
	imulq	$1001, %r8, %r8
	leaq	(%r9,%rax), %rsi
	movq	(%r15,%rsi,8), %rsi
	addq	%r8, %rax
	movq	%rsi, (%r15,%rax,8)
	cmpl	%ecx, %r10d
	jge	.L28
	movslq	%r10d, %r10
	leaq	(%r9,%r10), %rax
	addq	%r8, %r10
	movq	(%r15,%rax,8), %rax
	movq	%rax, (%r15,%r10,8)
	leal	2(%rdx), %r10d
	cmpl	%r10d, %ecx
	jle	.L28
	movslq	%r10d, %r10
	addq	%r10, %r9
	addq	%r10, %r8
	leal	3(%rdx), %r10d
	movq	(%r15,%r9,8), %rax
	movq	%rax, (%r15,%r8,8)
.L28:
	cmpl	32(%rsp), %r10d
	jg	.L27
.L23:
	movslq	%ebx, %rbx
	movslq	%r10d, %rax
	addq	80(%rsp), %rax
	leaq	(%r15,%rax,8), %r11
	imulq	$8008, %rbx, %rax
	movq	%rax, 40(%rsp)
	leaq	ifp(%rip), %rax
	subq	%r12, %rax
	movq	%rax, 56(%rsp)
	imulq	$1001, %rbx, %rax
	movq	%rax, 24(%rsp)
.L31:
	movq	56(%rsp), %rax
	movq	40(%rsp), %rbx
	addq	%r11, %rax
	movq	(%rax,%rbx), %rsi
	movl	12(%rsp), %ebx
	movq	%rsi, (%r11)
	cmpl	%ebx, 36(%rsp)
	jg	.L29
	movl	32(%rsp), %ebx
	leaq	ifact(%rip), %rdx
	movslq	72(%rsp), %r8
	movl	52(%rsp), %r9d
	movl	48(%rsp), %ecx
	subl	%r10d, %ebx
	movslq	%ebx, %rax
	movq	(%rdx,%rax,8), %rax
	movq	%rax, 16(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L54:
	movl	%r9d, %ecx
	addq	$1, %r8
	addl	%r14d, %r9d
	cmpl	%ecx, %r10d
	jl	.L29
.L30:
	movl	%r10d, %eax
	leal	(%rcx,%rbx), %edx
	subl	%ecx, %eax
	movslq	%edx, %rdx
	cltq
	addq	24(%rsp), %rax
	movq	0(%rbp,%rdx,8), %rcx
	imulq	(%r15,%rax,8), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	imulq	16(%rsp), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	imulq	-8(%r12,%r8,8), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	imulq	0(%r13,%r8,8), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	addq	%rsi, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	leaq	(%rdx,%rcx), %rsi
	sarq	$29, %rsi
	sarq	$63, %rax
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	movq	%rcx, %rsi
	subq	%rax, %rsi
	movq	%rsi, (%r11)
	cmpl	%r8d, 12(%rsp)
	jge	.L54
.L29:
	addl	$1, %r10d
	addq	$8, %r11
	cmpl	32(%rsp), %r10d
	jle	.L31
.L27:
	movl	36(%rsp), %ebx
	movq	64(%rsp), %rax
	addl	$1, %r14d
	addq	$8008, %r12
	addl	%ebx, 48(%rsp)
	movl	72(%rsp), %ebx
	addq	$1001, 80(%rsp)
	addl	%ebx, 52(%rsp)
	cmpl	88(%rsp), %r14d
	jne	.L21
.L22:
	movslq	76(%rsp), %rax
	movslq	32(%rsp), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	movq	(%r15,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	addq	$136, %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
.L34:
	.cfi_restore_state
	addq	$8008, %rax
	movl	$1, %r10d
	movq	%rax, 64(%rsp)
	jmp	.L23
.L53:
	addq	$8008, %rax
	movq	%rax, 64(%rsp)
	jmp	.L27
.L35:
	addq	$8008, %rax
	movl	$1, %edx
	movq	%rax, 64(%rsp)
	jmp	.L24
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	ifp
	.bss
	.align 32
	.type	ifp, @object
	.size	ifp, 8016008
ifp:
	.zero	8016008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 8008
inv:
	.zero	8008
	.globl	ifact
	.align 32
	.type	ifact, @object
	.size	ifact, 8008
ifact:
	.zero	8008
	.globl	fact
	.align 32
	.type	fact, @object
	.size	fact, 8008
fact:
	.zero	8008
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 8016008
dp:
	.zero	8016008
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	power
	.type	power, @function
power:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rdi, %rcx
	movl	$1, %r8d
	movq	%rsi, %rdi
	testq	%rsi, %rsi
	je	.L1
	movabsq	$-8543223828751151131, %r9
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %dil
	je	.L3
	movq	%r8, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r9
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
.L3:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	movq	%rcx, %rsi
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	sarq	%rdi
	movq	%rsi, %rcx
	jne	.L4
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d %d %d %d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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
	movl	$1, %ebx
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	108(%rsp), %rcx
	leaq	104(%rsp), %rdx
	leaq	100(%rsp), %rsi
	leaq	116(%rsp), %r9
	leaq	112(%rsp), %r8
	call	__isoc99_scanf@PLT
	leaq	inv(%rip), %r10
	movq	$1, fact(%rip)
	movabsq	$-8543223828751151131, %r11
	movq	$1, ifact(%rip)
.L14:
	movq	%rbx, %rcx
	movl	$30, %r9d
	movl	$1, %esi
	movl	$1000000005, %r8d
	.p2align 4,,10
	.p2align 3
.L13:
	testb	$1, %r8b
	je	.L12
	movq	%rsi, %rdi
	imulq	%rcx, %rdi
	movq	%rdi, %rax
	imulq	%r11
	movq	%rdi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rdi), %rsi
	sarq	$29, %rsi
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	subq	%rax, %rdi
	movq	%rdi, %rsi
.L12:
	movq	%rcx, %rdi
	sarq	%r8
	imulq	%rcx, %rdi
	movq	%rdi, %rax
	mulq	%r11
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %rcx
	subl	$1, %r9d
	jne	.L13
	movq	%rsi, (%r10,%rbx,8)
	addq	$1, %rbx
	cmpq	$1001, %rbx
	jne	.L14
	movl	$1, %ecx
	movl	$1, %eax
	leaq	fact(%rip), %rbp
	movabsq	$-8543223828751151131, %rdi
.L15:
	imulq	%rcx, %rax
	movq	%rax, %rsi
	imulq	%rdi
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rsi, %rax
	subq	%rdx, %rax
	movq	%rax, 0(%rbp,%rcx,8)
	addq	$1, %rcx
	cmpq	$1001, %rcx
	jne	.L15
	movl	$8, %ecx
	movl	$1, %eax
	movabsq	$-8543223828751151131, %rdi
.L16:
	imulq	(%r10,%rcx), %rax
	leaq	ifact(%rip), %rbx
	movq	%rax, %rsi
	imulq	%rdi
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rsi, %rax
	subq	%rdx, %rax
	movq	%rax, (%rbx,%rcx)
	addq	$8, %rcx
	cmpq	$8008, %rcx
	jne	.L16
	leaq	16016+ifp(%rip), %rdi
	leaq	8(%rbx), %r10
	movabsq	$-8543223828751151131, %r9
	leaq	8008000(%rdi), %r11
.L18:
	movq	(%r10), %r8
	leaq	-8000(%rdi), %rsi
	movl	$1, %edx
	movq	$1, -8008(%rdi)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rdx, %rcx
	addq	$8, %rsi
	imulq	%r8, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, -8(%rsi)
	movq	%rcx, %rdx
	cmpq	%rdi, %rsi
	jne	.L17
	leaq	8008(%rsi), %rdi
	addq	$8, %r10
	cmpq	%r11, %rdi
	jne	.L18
	movl	104(%rsp), %r12d
	leaq	dp(%rip), %r15
	movl	100(%rsp), %ebx
	leal	-1(%r12), %eax
	movl	%ebx, 32(%rsp)
	cltq
	imulq	$8008, %rax, %rax
	movq	$1, (%r15,%rax)
	movl	108(%rsp), %eax
	movl	%eax, 76(%rsp)
	cmpl	%eax, %r12d
	jg	.L22
	movl	112(%rsp), %eax
	movl	116(%rsp), %ebx
	movslq	%r12d, %rdx
	leaq	-8+ifact(%rip), %r13
	movdqa	.LC3(%rip), %xmm4
	movdqa	.LC4(%rip), %xmm3
	movabsq	$-8543223828751151131, %rdi
	movl	%eax, 36(%rsp)
	movl	%ebx, 12(%rsp)
	movl	%eax, %ebx
	addl	$1, %eax
	movl	%eax, 72(%rsp)
	imull	%r12d, %eax
	imull	%r12d, %ebx
	movl	%eax, 52(%rsp)
	imulq	$8008, %rdx, %rax
	movl	%ebx, 48(%rsp)
	leaq	ifp(%rip), %rbx
	leaq	(%rbx,%rax), %r14
	leaq	-8000(%r15,%rax), %rax
	imulq	$1001, %rdx, %rbx
	movq	%rbx, 80(%rsp)
	movl	76(%rsp), %ebx
	addl	$1, %ebx
	movl	%ebx, 88(%rsp)
	movl	32(%rsp), %ebx
	addl	$1, %ebx
	movl	%ebx, 92(%rsp)
	movq	%r14, %rbx
	movl	%r12d, %r14d
	movq	%rbx, %r12
.L21:
	movq	$1, 8000(%rax)
	movl	32(%rsp), %edx
	testl	%edx, %edx
	jle	.L53
	movl	48(%rsp), %ecx
	leal	-1(%r14), %ebx
	cmpl	$1, %ecx
	jle	.L34
	movl	92(%rsp), %esi
	movl	$1, %edx
	cmpl	%ecx, %esi
	cmovle	%esi, %ecx
	leal	-1(%rcx), %esi
	cmpl	$1, %ecx
	cmovle	%edx, %esi
	cmpl	$4, %ecx
	jle	.L35
	leaq	8008(%rax), %r9
	movl	%esi, %r8d
	movdqa	.LC0(%rip), %xmm1
	xorl	%edx, %edx
	movq	%r9, 64(%rsp)
	shrl	$2, %r8d
	salq	$5, %r8
.L25:
	movdqu	16(%rax,%rdx), %xmm2
	movdqu	(%rax,%rdx), %xmm5
	movdqa	%xmm1, %xmm0
	paddd	%xmm4, %xmm1
	paddd	%xmm3, %xmm0
	movups	%xmm5, (%r9,%rdx)
	movups	%xmm2, 16(%r9,%rdx)
	addq	$32, %rdx
	cmpq	%r8, %rdx
	jne	.L25
	movl	%esi, %eax
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %eax
	movd	%xmm0, %r10d
	leal	1(%rax), %edx
	cmpl	%esi, %eax
	je	.L28
.L24:
	movslq	%ebx, %rsi
	movslq	%r14d, %r8
	leal	1(%rdx), %r10d
	movslq	%edx, %rax
	imulq	$1001, %rsi, %r9
	imulq	$1001, %r8, %r8
	leaq	(%r9,%rax), %rsi
	movq	(%r15,%rsi,8), %rsi
	addq	%r8, %rax
	movq	%rsi, (%r15,%rax,8)
	cmpl	%ecx, %r10d
	jge	.L28
	movslq	%r10d, %r10
	leaq	(%r9,%r10), %rax
	addq	%r8, %r10
	movq	(%r15,%rax,8), %rax
	movq	%rax, (%r15,%r10,8)
	leal	2(%rdx), %r10d
	cmpl	%r10d, %ecx
	jle	.L28
	movslq	%r10d, %r10
	addq	%r10, %r9
	addq	%r10, %r8
	leal	3(%rdx), %r10d
	movq	(%r15,%r9,8), %rax
	movq	%rax, (%r15,%r8,8)
.L28:
	cmpl	32(%rsp), %r10d
	jg	.L27
.L23:
	movslq	%ebx, %rbx
	movslq	%r10d, %rax
	addq	80(%rsp), %rax
	leaq	(%r15,%rax,8), %r11
	imulq	$8008, %rbx, %rax
	movq	%rax, 40(%rsp)
	leaq	ifp(%rip), %rax
	subq	%r12, %rax
	movq	%rax, 56(%rsp)
	imulq	$1001, %rbx, %rax
	movq	%rax, 24(%rsp)
.L31:
	movq	56(%rsp), %rax
	movq	40(%rsp), %rbx
	addq	%r11, %rax
	movq	(%rax,%rbx), %rsi
	movl	12(%rsp), %ebx
	movq	%rsi, (%r11)
	cmpl	%ebx, 36(%rsp)
	jg	.L29
	movl	32(%rsp), %ebx
	leaq	ifact(%rip), %rdx
	movslq	72(%rsp), %r8
	movl	52(%rsp), %r9d
	movl	48(%rsp), %ecx
	subl	%r10d, %ebx
	movslq	%ebx, %rax
	movq	(%rdx,%rax,8), %rax
	movq	%rax, 16(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L54:
	movl	%r9d, %ecx
	addq	$1, %r8
	addl	%r14d, %r9d
	cmpl	%ecx, %r10d
	jl	.L29
.L30:
	movl	%r10d, %eax
	leal	(%rcx,%rbx), %edx
	subl	%ecx, %eax
	movslq	%edx, %rdx
	cltq
	addq	24(%rsp), %rax
	movq	0(%rbp,%rdx,8), %rcx
	imulq	(%r15,%rax,8), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	imulq	16(%rsp), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	imulq	-8(%r12,%r8,8), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	imulq	0(%r13,%r8,8), %rcx
	movq	%rcx, %rax
	imulq	%rdi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rcx
	addq	%rsi, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	leaq	(%rdx,%rcx), %rsi
	sarq	$29, %rsi
	sarq	$63, %rax
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	movq	%rcx, %rsi
	subq	%rax, %rsi
	movq	%rsi, (%r11)
	cmpl	%r8d, 12(%rsp)
	jge	.L54
.L29:
	addl	$1, %r10d
	addq	$8, %r11
	cmpl	32(%rsp), %r10d
	jle	.L31
.L27:
	movl	36(%rsp), %ebx
	movq	64(%rsp), %rax
	addl	$1, %r14d
	addq	$8008, %r12
	addl	%ebx, 48(%rsp)
	movl	72(%rsp), %ebx
	addq	$1001, 80(%rsp)
	addl	%ebx, 52(%rsp)
	cmpl	88(%rsp), %r14d
	jne	.L21
.L22:
	movslq	76(%rsp), %rax
	movslq	32(%rsp), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	movq	(%r15,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	addq	$136, %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
.L34:
	.cfi_restore_state
	addq	$8008, %rax
	movl	$1, %r10d
	movq	%rax, 64(%rsp)
	jmp	.L23
.L53:
	addq	$8008, %rax
	movq	%rax, 64(%rsp)
	jmp	.L27
.L35:
	addq	$8008, %rax
	movl	$1, %edx
	movq	%rax, 64(%rsp)
	jmp	.L24
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	ifp
	.bss
	.align 32
	.type	ifp, @object
	.size	ifp, 8016008
ifp:
	.zero	8016008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 8008
inv:
	.zero	8008
	.globl	ifact
	.align 32
	.type	ifact, @object
	.size	ifact, 8008
ifact:
	.zero	8008
	.globl	fact
	.align 32
	.type	fact, @object
	.size	fact, 8008
fact:
	.zero	8008
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 8016008
dp:
	.zero	8016008
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:

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

#define Q 1000000007
#define N 1001

typedef long long int ll;
ll dp[N][N];
ll fact[N], ifact[N], inv[N];
ll ifp[N][N];

ll power(ll a, ll b){
	ll s=1;
	
	while(b){
		if(b & 1) s = s * a % Q;
		a = a * a % Q;
		b = b >> 1;
	}
	
	return s;
}

int main(void){
	int n, a, b, c, d;
	int i, j, k;
	ll tmp;

	scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
	fact[0] = 1;
	ifact[0] = 1;
	for(i=1; i<N; i++) inv[i]  = power(i, Q-2);
	for(i=1; i<N; i++) fact[i] = i * fact[i-1] % Q;
	for(i=1; i<N; i++) ifact[i] = ifact[i-1] * inv[i] % Q;
	for(i=1; i<N; i++){
		ifp[i][0] = 1;
		for(j=1; j<N; j++){
			ifp[i][j] = ifp[i][j-1] * ifact[i] % Q;
		}
	}
	dp[a-1][0] = 1;
	for(i=a; i<=b; i++){
		dp[i][0] = 1;
		for(j=1; j<=n; j++){
			dp[i][j] = dp[i-1][j];
			for(k=c; k<=d; k++){
				if(k*i > j) break;
				dp[i][j] = (dp[i][j] + dp[i-1][j-i*k]*fact[n-j+i*k]%Q * ifact[n-j]%Q * ifp[i][k]%Q * ifact[k]%Q)%Q;
			}
		}
	}
	
	printf("%lld\n", dp[b][n]);

	return 0;
}
7 3 4 2 5
 8 2 3 1 3
 1000 1 1000 2 1000
 1000 1 1000 3 1000
 10 3 7 2 5
 7 1 3 1 3
 1000 1 1000 1 1001
 7 1 6 2 5
 0 3 8 2 7
 2 1 3 1 2

0
 280
 860178665
 980205027
 126
 595
 465231251
 105
 1
 2

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

```c
#include <stdio.h>
#include <stdlib.h>

#define Q 1000000007
#define N 1001

typedef long long int ll;
ll dp[N][N];
ll fact[N], ifact[N], inv[N];
ll ifp[N][N];

ll power(ll a, ll b){
	ll s=1;
	
	while(b){
		if(b & 1) s = s * a % Q;
		a = a * a % Q;
		b = b >> 1;
	}
	
	return s;
}

int main(void){
	int n, a, b, c, d;
	int i, j, k;
	ll tmp;

	scanf("%d %d %d %d %d", &n, &a, &b, &c, &d);
	fact[0] = 1;
	ifact[0] = 1;
	for(i=1; i<N; i++) inv[i]  = power(i, Q-2);
	for(i=1; i<N; i++) fact[i] = i * fact[i-1] % Q;
	for(i=1; i<N; i++) ifact[i] = ifact[i-1] * inv[i] % Q;
	for(i=1; i<N; i++){
		ifp[i][0] = 1;
		for(j=1; j<N; j++){
			ifp[i][j] = ifp[i][j-1] * ifact[i] % Q;
		}
	}
	dp[a-1][0] = 1;
	for(i=a; i<=b; i++){
		dp[i][0] = 1;
		for(j=1; j<=n; j++){
			dp[i][j] = dp[i-1][j];
			for(k=c; k<=d; k++){
				if(k*i > j) break;
				dp[i][j] = (dp[i][j] + dp[i-1][j-i*k]*fact[n-j+i*k]%Q * ifact[n-j]%Q * ifp[i][k]%Q * ifact[k]%Q)%Q;
			}
		}
	}
	
	printf("%lld\n", dp[b][n]);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 8016008
dp:
	.zero	8016008
	.globl	fact
	.align 32
	.type	fact, @object
	.size	fact, 8008
fact:
	.zero	8008
	.globl	ifact
	.align 32
	.type	ifact, @object
	.size	ifact, 8008
ifact:
	.zero	8008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 8008
inv:
	.zero	8008
	.globl	ifp
	.align 32
	.type	ifp, @object
	.size	ifp, 8016008
ifp:
	.zero	8016008
	.text
	.globl	power
	.type	power, @function
power:
.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)
	movq	$1, -8(%rbp)
	jmp	.L2
.L4:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L3
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L3:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	sarq	-32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"%lld\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, fact(%rip)
	movq	$1, ifact(%rip)
	movl	$1, -20(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	cltq
	movl	$1000000005, %esi
	movq	%rax, %rdi
	call	power
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	inv(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L7:
	cmpl	$1000, -20(%rbp)
	jle	.L8
	movl	$1, -20(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	fact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	fact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L9:
	cmpl	$1000, -20(%rbp)
	jle	.L10
	movl	$1, -20(%rbp)
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ifact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	inv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L11:
	cmpl	$1000, -20(%rbp)
	jle	.L12
	movl	$1, -20(%rbp)
	jmp	.L13
.L16:
	movl	-20(%rbp), %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	ifp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	$1, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	ifp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	ifact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L14:
	cmpl	$1000, -16(%rbp)
	jle	.L15
	addl	$1, -20(%rbp)
.L13:
	cmpl	$1000, -20(%rbp)
	jle	.L16
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L17
.L24:
	movl	-20(%rbp), %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	$1, -16(%rbp)
	jmp	.L18
.L23:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L19
.L22:
	movl	-12(%rbp), %eax
	imull	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L27
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	imull	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	fact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-40(%rbp), %edx
	subl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifp(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L19:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L22
	jmp	.L21
.L27:
	nop
.L21:
	addl	$1, -16(%rbp)
.L18:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L23
	addl	$1, -20(%rbp)
.L17:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L24
	movl	-32(%rbp), %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	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	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 8016008
dp:
	.zero	8016008
	.globl	fact
	.align 32
	.type	fact, @object
	.size	fact, 8008
fact:
	.zero	8008
	.globl	ifact
	.align 32
	.type	ifact, @object
	.size	ifact, 8008
ifact:
	.zero	8008
	.globl	inv
	.align 32
	.type	inv, @object
	.size	inv, 8008
inv:
	.zero	8008
	.globl	ifp
	.align 32
	.type	ifp, @object
	.size	ifp, 8016008
ifp:
	.zero	8016008
	.text
	.globl	power
	.type	power, @function
power:
.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)
	movq	$1, -8(%rbp)
	jmp	.L2
.L4:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L3
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L3:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	sarq	-32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.string	"%lld\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$1, fact(%rip)
	movq	$1, ifact(%rip)
	movl	$1, -20(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	cltq
	movl	$1000000005, %esi
	movq	%rax, %rdi
	call	power
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	inv(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L7:
	cmpl	$1000, -20(%rbp)
	jle	.L8
	movl	$1, -20(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	fact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	fact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L9:
	cmpl	$1000, -20(%rbp)
	jle	.L10
	movl	$1, -20(%rbp)
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ifact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	inv(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L11:
	cmpl	$1000, -20(%rbp)
	jle	.L12
	movl	$1, -20(%rbp)
	jmp	.L13
.L16:
	movl	-20(%rbp), %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	ifp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	$1, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	ifp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	ifact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L14:
	cmpl	$1000, -16(%rbp)
	jle	.L15
	addl	$1, -20(%rbp)
.L13:
	cmpl	$1000, -20(%rbp)
	jle	.L16
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L17
.L24:
	movl	-20(%rbp), %eax
	cltq
	imulq	$8008, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	$1, (%rax,%rdx)
	movl	$1, -16(%rbp)
	jmp	.L18
.L23:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L19
.L22:
	movl	-12(%rbp), %eax
	imull	-20(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L27
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	imull	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	fact(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-40(%rbp), %edx
	subl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifp(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ifact(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	imulq	%rdx, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L19:
	movl	-24(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L22
	jmp	.L21
.L27:
	nop
.L21:
	addl	$1, -16(%rbp)
.L18:
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L23
	addl	$1, -20(%rbp)
.L17:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L24
	movl	-32(%rbp), %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	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	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
