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

```c
// AOJ DPL_5_G: Balls and Boxes 7
// n 個の区別できるボールを k 個の区別できない箱に入れる
// とき、可能な入れ方の総数を求めてください。
// ただし、
//    どのボールも、必ずいずれかの箱に入れる。
//    ボールが1つも入っていない箱があってもよい。
// 2019.3.11 bal4u

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

#define MOD 1000000007
int tbl[1001][1001];

int stirling2(int n, int k)
{
	int ans;

	if (k > n || k == 0) return 0;
	if (tbl[n][k]) return tbl[n][k];
	if (k == 1 || k == n) ans = 1;
	else ans = (((long long)k * stirling2(n - 1, k)) % MOD)
		+ stirling2(n - 1, k - 1);
	return tbl[n][k] = ans % MOD;
}

int main()
{
	int n, k, ans;

	scanf("%d%d", &n, &k);
	ans = 0; while (k > 0) {
		ans += stirling2(n, k--);
		if (ans >= MOD) ans -= MOD;
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.text
	.globl	stirling2
	.type	stirling2, @function
stirling2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L2
	cmpl	$0, -40(%rbp)
	jne	.L3
.L2:
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L5:
	cmpl	$1, -40(%rbp)
	je	.L6
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jne	.L7
.L6:
	movl	$1, -20(%rbp)
	jmp	.L8
.L7:
	movl	-40(%rbp), %eax
	movslq	%eax, %rbx
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	stirling2
	cltq
	imulq	%rax, %rbx
	movq	%rbx, %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	%eax, %ebx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	stirling2
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
.L8:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1152921497, %rax, %rax
	shrq	$32, %rax
	sarl	$28, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	stirling2, .-stirling2
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	-20(%rbp), %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	stirling2
	addl	%eax, -12(%rbp)
	cmpl	$1000000006, -12(%rbp)
	jle	.L10
	subl	$1000000007, -12(%rbp)
.L10:
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jg	.L11
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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	stirling2
	.type	stirling2, @function
stirling2:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	jg	.L20
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	%esi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	testl	%esi, %esi
	je	.L10
	movslq	%edi, %r12
	movslq	%esi, %r13
	leaq	tbl(%rip), %r14
	movl	%edi, %ebp
	imulq	$1001, %r12, %rax
	addq	%r13, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L1
	cmpl	$1, %esi
	je	.L11
	cmpl	%edi, %esi
	jne	.L25
.L11:
	movl	$1, %eax
.L3:
	imulq	$1001, %r12, %r12
	addq	%r13, %r12
	movl	%eax, (%r14,%r12,4)
.L1:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	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
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	leal	-1(%rdi), %r10d
	leal	-1(%rsi), %r9d
	xorl	%r15d, %r15d
	cmpl	%r10d, %esi
	jg	.L4
	movslq	%r10d, %rcx
	movq	%r13, %r15
	imulq	$1001, %rcx, %rax
	addq	%r13, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L26
	movl	$1, %eax
	cmpl	%r10d, %esi
	jne	.L27
.L6:
	imulq	$1001, %rcx, %rcx
	movabsq	$-8543223828751151131, %rdx
	addq	%r13, %rcx
	movl	%eax, (%r14,%rcx,4)
	movq	%r15, %rax
	imulq	%rdx
	leaq	(%rdx,%r15), %rax
	movq	%r15, %rdx
	sarq	$29, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subl	%eax, %r15d
.L4:
	testl	%r9d, %r9d
	je	.L7
	movslq	%r10d, %rcx
	movslq	%r9d, %r8
	imulq	$1001, %rcx, %rax
	addq	%r8, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L28
	movl	$1, %eax
	movl	$1, %edx
	cmpl	$1, %r9d
	jne	.L29
.L9:
	imulq	$1001, %rcx, %rcx
	addl	%edx, %r15d
	addq	%r8, %rcx
	movl	%eax, (%r14,%rcx,4)
.L7:
	movslq	%r15d, %rax
	movl	%r15d, %edx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %edx
	sarq	$60, %rax
	subl	%edx, %eax
	imull	$1000000007, %eax, %edx
	movl	%r15d, %eax
	subl	%edx, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_def_cfa_offset 96
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	leal	-2(%rbp), %edi
	movl	%r9d, %esi
	movq	%r8, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movl	%edi, 4(%rsp)
	call	stirling2
	movl	4(%rsp), %edi
	leal	-2(%rbx), %esi
	movslq	%eax, %rbp
	call	stirling2
	movq	16(%rsp), %r8
	movq	8(%rsp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movl	%eax, %r9d
	imulq	%r8, %rbp
	movq	%rbp, %rax
	imulq	%rdx
	movq	%rbp, %rax
	sarq	$63, %rax
	addq	%rbp, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rbp
	addl	%ebp, %r9d
	movslq	%r9d, %rax
	movl	%r9d, %edx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %edx
	sarq	$60, %rax
	subl	%edx, %eax
	imull	$1000000007, %eax, %edx
	movl	%r9d, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	leal	-2(%rdi), %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 4(%rsp)
	movl	%r10d, 16(%rsp)
	movl	%edi, 8(%rsp)
	call	stirling2
	movl	4(%rsp), %esi
	movl	8(%rsp), %edi
	movslq	%eax, %r15
	call	stirling2
	imulq	%r13, %r15
	movq	24(%rsp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movl	%eax, %r8d
	movl	16(%rsp), %r10d
	movl	4(%rsp), %r9d
	movq	%r15, %rax
	imulq	%rdx
	movq	%r15, %rax
	sarq	$63, %rax
	addq	%r15, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r15
	addl	%r15d, %r8d
	movslq	%r8d, %rax
	movl	%r8d, %edx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %edx
	sarq	$60, %rax
	subl	%edx, %eax
	imull	$1000000007, %eax, %edx
	movl	%r8d, %eax
	subl	%edx, %eax
	movslq	%eax, %r15
	imulq	%r13, %r15
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	addl	%eax, %r15d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	movabsq	$-8543223828751151131, %rdx
	movslq	%eax, %rcx
	imulq	%r13, %rcx
	movq	%rcx, %rax
	movl	%ecx, %r15d
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$29, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subl	%eax, %r15d
	jmp	.L4
	.cfi_endproc
.LFE39:
	.size	stirling2, .-stirling2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\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	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rdx
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %ecx
	xorl	%r11d, %r11d
	testl	%ecx, %ecx
	jle	.L31
	leaq	tbl(%rip), %r8
	movl	$1000000007, %r9d
	.p2align 4,,10
	.p2align 3
.L47:
	movl	48(%rsp), %r12d
	leal	-1(%rcx), %ebp
	movl	%ebp, 52(%rsp)
	cmpl	%ecx, %r12d
	jl	.L52
	movslq	%r12d, %rbx
	movslq	%ecx, %r14
	imulq	$1001, %rbx, %rax
	addq	%r14, %rax
	movslq	(%r8,%rax,4), %r13
	testl	%r13d, %r13d
	jne	.L75
	cmpl	$1, %ecx
	je	.L53
	cmpl	%ecx, %r12d
	je	.L53
	leal	-1(%r12), %eax
	movslq	%eax, %r15
	cmpl	%ecx, %eax
	jl	.L74
	imulq	$1001, %r15, %rdx
	addq	%r14, %rdx
	movslq	(%r8,%rdx,4), %r13
	testl	%r13d, %r13d
	jne	.L74
	cmpl	%ecx, %eax
	jne	.L76
	movl	$1, %eax
	movslq	%ebp, %r10
.L36:
	cltd
	idivl	%r9d
	imulq	$1001, %r15, %rax
	addq	%r14, %rax
	movslq	%edx, %r13
	movl	%r13d, (%r8,%rax,4)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%ebp, %ecx
.L32:
	leal	-1000000007(%r11), %eax
	cmpl	$1000000006, %r11d
	cmovg	%eax, %r11d
	testl	%ebp, %ebp
	jg	.L47
.L31:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L77
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	movl	$1, %eax
.L34:
	imulq	$1001, %rbx, %rbx
	addl	%eax, %r11d
	movl	%ebp, %ecx
	addq	%r14, %rbx
	movl	%eax, (%r8,%rbx,4)
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L75:
	addl	%r13d, %r11d
	movl	%ebp, %ecx
	jmp	.L32
.L74:
	movslq	%ebp, %r10
.L35:
	movabsq	$-8543223828751151131, %rax
	imulq	%r14, %r13
	imulq	%r13
	leaq	(%rdx,%r13), %rax
	movq	%r13, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %r13
	imulq	$1001, %r15, %rax
	addq	%r10, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L48
	movl	$1, %eax
	cmpl	$1, %ebp
	jne	.L78
.L41:
	cltd
	imulq	$1001, %r15, %r15
	idivl	%r9d
	addq	%r10, %r15
	movl	%edx, (%r8,%r15,4)
.L48:
	addl	%r13d, %edx
	movl	52(%rsp), %ebp
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %ecx
	sarq	$60, %rax
	subl	%ecx, %eax
	imull	$1000000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L34
.L78:
	leal	-2(%r12), %esi
	leal	-2(%rcx), %eax
	movl	%esi, 24(%rsp)
	movl	%eax, 40(%rsp)
	cmpl	%esi, %ebp
	jg	.L42
	movslq	%esi, %rax
	movq	%rax, 8(%rsp)
	imulq	$1001, %rax, %rax
	addq	%r10, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L42
	movl	$1, %eax
	cmpl	%esi, %ebp
	jne	.L79
.L43:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	%r10, %rax
	movl	%edx, (%r8,%rax,4)
.L42:
	movslq	%edx, %rax
	movl	$1000000007, %ebp
	movl	40(%rsp), %edi
	imulq	%r10, %rax
	cqto
	idivq	%rbp
	movq	%rdx, 16(%rsp)
	testl	%edi, %edi
	je	.L60
	movslq	24(%rsp), %rax
	movslq	%edi, %rsi
	movq	%rsi, 32(%rsp)
	movq	%rax, 8(%rsp)
	imulq	$1001, %rax, %rax
	addq	%rsi, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L44
	subl	$1, %edi
	movl	$1, %eax
	jne	.L80
.L45:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	32(%rsp), %rax
	movl	%edx, (%r8,%rax,4)
.L44:
	movl	16(%rsp), %eax
	addl	%edx, %eax
	jmp	.L41
.L76:
	leal	-2(%r12), %edi
	movl	%edi, 40(%rsp)
	cmpl	%ecx, %edi
	jl	.L55
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	imulq	$1001, %rax, %rax
	addq	%r14, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L37
	movl	$1, %eax
	cmpl	%ecx, %edi
	jne	.L81
.L38:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	%r14, %rax
	movl	%edx, (%r8,%rax,4)
.L37:
	movslq	%edx, %rax
	movl	$1000000007, %edi
	movslq	%ebp, %r10
	imulq	%r14, %rax
	cqto
	idivq	%rdi
	movq	%rdx, 16(%rsp)
	cmpl	40(%rsp), %ebp
	jg	.L39
	movslq	40(%rsp), %rax
	movq	%rax, 8(%rsp)
	movq	%rax, %rdi
	imulq	$1001, %rax, %rax
	addq	%r10, %rax
	movl	(%r8,%rax,4), %r13d
	testl	%r13d, %r13d
	jne	.L39
	cmpl	$1, %ebp
	je	.L57
	cmpl	%edi, %ebp
	je	.L57
	leal	-3(%r12), %edi
	movl	%ebp, %esi
	movq	%r10, 32(%rsp)
	movl	%ecx, 40(%rsp)
	movl	%edi, 24(%rsp)
	call	stirling2
	movl	40(%rsp), %ecx
	movl	24(%rsp), %edi
	movl	%eax, %r13d
	leal	-2(%rcx), %esi
	call	stirling2
	movq	32(%rsp), %r10
	movl	40(%rsp), %ecx
	movl	$1000000007, %edi
	movl	%eax, %esi
	movslq	%r13d, %rax
	leaq	tbl(%rip), %r8
	movl	$1000000007, %r9d
	imulq	%r10, %rax
	cqto
	idivq	%rdi
	leal	(%rsi,%rdx), %eax
.L40:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	%r10, %rax
	movl	%edx, (%r8,%rax,4)
	movl	%edx, %r13d
.L39:
	movl	16(%rsp), %eax
	addl	%r13d, %eax
	jmp	.L36
.L60:
	xorl	%edx, %edx
	jmp	.L44
.L55:
	xorl	%edx, %edx
	jmp	.L37
.L57:
	movl	$1, %eax
	jmp	.L40
.L81:
	movl	%ecx, %esi
	leal	-3(%r12), %edi
	movl	%ecx, 32(%rsp)
	movl	%edi, 24(%rsp)
	call	stirling2
	movl	24(%rsp), %edi
	movl	%ebp, %esi
	movl	%eax, 16(%rsp)
	call	stirling2
	movl	$1000000007, %edi
	movl	32(%rsp), %ecx
	movl	$1000000007, %r9d
	movl	%eax, %r10d
	movslq	16(%rsp), %rax
	leaq	tbl(%rip), %r8
	imulq	%r14, %rax
	cqto
	idivq	%rdi
	leal	(%r10,%rdx), %eax
	jmp	.L38
.L79:
	leal	-3(%r12), %edi
	movl	%ebp, %esi
	movl	%ecx, 44(%rsp)
	movq	%r10, 32(%rsp)
	movl	%edi, 16(%rsp)
	call	stirling2
	movl	40(%rsp), %esi
	movl	16(%rsp), %edi
	movl	%eax, %ebp
	call	stirling2
	movq	32(%rsp), %r10
	movl	$1000000007, %edi
	movl	44(%rsp), %ecx
	movl	%eax, %esi
	movslq	%ebp, %rax
	movl	$1000000007, %r9d
	imulq	%r10, %rax
	leaq	tbl(%rip), %r8
	cqto
	idivq	%rdi
	leal	(%rsi,%rdx), %eax
	jmp	.L43
.L80:
	movl	40(%rsp), %esi
	leal	-3(%r12), %edi
	movq	%r10, 24(%rsp)
	movl	%ecx, 44(%rsp)
	movl	%edi, 40(%rsp)
	call	stirling2
	movl	44(%rsp), %ecx
	movl	40(%rsp), %edi
	movl	%eax, %r12d
	leal	-3(%rcx), %esi
	call	stirling2
	movq	24(%rsp), %r10
	movl	$1000000007, %r9d
	leaq	tbl(%rip), %r8
	movl	%eax, %ecx
	movslq	%r12d, %rax
	imulq	32(%rsp), %rax
	cqto
	idivq	%rbp
	leal	(%rcx,%rdx), %eax
	jmp	.L45
.L77:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.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	stirling2
	.type	stirling2, @function
stirling2:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	jg	.L20
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	%esi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	testl	%esi, %esi
	je	.L10
	movslq	%edi, %r12
	movslq	%esi, %r13
	leaq	tbl(%rip), %r14
	movl	%edi, %ebp
	imulq	$1001, %r12, %rax
	addq	%r13, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L1
	cmpl	$1, %esi
	je	.L11
	cmpl	%edi, %esi
	jne	.L25
.L11:
	movl	$1, %eax
.L3:
	imulq	$1001, %r12, %r12
	addq	%r13, %r12
	movl	%eax, (%r14,%r12,4)
.L1:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	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
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	leal	-1(%rdi), %r10d
	leal	-1(%rsi), %r9d
	xorl	%r15d, %r15d
	cmpl	%r10d, %esi
	jg	.L4
	movslq	%r10d, %rcx
	movq	%r13, %r15
	imulq	$1001, %rcx, %rax
	addq	%r13, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L26
	movl	$1, %eax
	cmpl	%r10d, %esi
	jne	.L27
.L6:
	imulq	$1001, %rcx, %rcx
	movabsq	$-8543223828751151131, %rdx
	addq	%r13, %rcx
	movl	%eax, (%r14,%rcx,4)
	movq	%r15, %rax
	imulq	%rdx
	leaq	(%rdx,%r15), %rax
	movq	%r15, %rdx
	sarq	$29, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subl	%eax, %r15d
.L4:
	testl	%r9d, %r9d
	je	.L7
	movslq	%r10d, %rcx
	movslq	%r9d, %r8
	imulq	$1001, %rcx, %rax
	addq	%r8, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L28
	movl	$1, %eax
	movl	$1, %edx
	cmpl	$1, %r9d
	jne	.L29
.L9:
	imulq	$1001, %rcx, %rcx
	addl	%edx, %r15d
	addq	%r8, %rcx
	movl	%eax, (%r14,%rcx,4)
.L7:
	movslq	%r15d, %rax
	movl	%r15d, %edx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %edx
	sarq	$60, %rax
	subl	%edx, %eax
	imull	$1000000007, %eax, %edx
	movl	%r15d, %eax
	subl	%edx, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_def_cfa_offset 96
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	leal	-2(%rbp), %edi
	movl	%r9d, %esi
	movq	%r8, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movl	%edi, 4(%rsp)
	call	stirling2
	movl	4(%rsp), %edi
	leal	-2(%rbx), %esi
	movslq	%eax, %rbp
	call	stirling2
	movq	16(%rsp), %r8
	movq	8(%rsp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movl	%eax, %r9d
	imulq	%r8, %rbp
	movq	%rbp, %rax
	imulq	%rdx
	movq	%rbp, %rax
	sarq	$63, %rax
	addq	%rbp, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rbp
	addl	%ebp, %r9d
	movslq	%r9d, %rax
	movl	%r9d, %edx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %edx
	sarq	$60, %rax
	subl	%edx, %eax
	imull	$1000000007, %eax, %edx
	movl	%r9d, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	leal	-2(%rdi), %edi
	movq	%rcx, 24(%rsp)
	movl	%r9d, 4(%rsp)
	movl	%r10d, 16(%rsp)
	movl	%edi, 8(%rsp)
	call	stirling2
	movl	4(%rsp), %esi
	movl	8(%rsp), %edi
	movslq	%eax, %r15
	call	stirling2
	imulq	%r13, %r15
	movq	24(%rsp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movl	%eax, %r8d
	movl	16(%rsp), %r10d
	movl	4(%rsp), %r9d
	movq	%r15, %rax
	imulq	%rdx
	movq	%r15, %rax
	sarq	$63, %rax
	addq	%r15, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r15
	addl	%r15d, %r8d
	movslq	%r8d, %rax
	movl	%r8d, %edx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %edx
	sarq	$60, %rax
	subl	%edx, %eax
	imull	$1000000007, %eax, %edx
	movl	%r8d, %eax
	subl	%edx, %eax
	movslq	%eax, %r15
	imulq	%r13, %r15
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	addl	%eax, %r15d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	movabsq	$-8543223828751151131, %rdx
	movslq	%eax, %rcx
	imulq	%r13, %rcx
	movq	%rcx, %rax
	movl	%ecx, %r15d
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$29, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subl	%eax, %r15d
	jmp	.L4
	.cfi_endproc
.LFE39:
	.size	stirling2, .-stirling2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\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	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rdx
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %ecx
	xorl	%r11d, %r11d
	testl	%ecx, %ecx
	jle	.L31
	leaq	tbl(%rip), %r8
	movl	$1000000007, %r9d
	.p2align 4,,10
	.p2align 3
.L47:
	movl	48(%rsp), %r12d
	leal	-1(%rcx), %ebp
	movl	%ebp, 52(%rsp)
	cmpl	%ecx, %r12d
	jl	.L52
	movslq	%r12d, %rbx
	movslq	%ecx, %r14
	imulq	$1001, %rbx, %rax
	addq	%r14, %rax
	movslq	(%r8,%rax,4), %r13
	testl	%r13d, %r13d
	jne	.L75
	cmpl	$1, %ecx
	je	.L53
	cmpl	%ecx, %r12d
	je	.L53
	leal	-1(%r12), %eax
	movslq	%eax, %r15
	cmpl	%ecx, %eax
	jl	.L74
	imulq	$1001, %r15, %rdx
	addq	%r14, %rdx
	movslq	(%r8,%rdx,4), %r13
	testl	%r13d, %r13d
	jne	.L74
	cmpl	%ecx, %eax
	jne	.L76
	movl	$1, %eax
	movslq	%ebp, %r10
.L36:
	cltd
	idivl	%r9d
	imulq	$1001, %r15, %rax
	addq	%r14, %rax
	movslq	%edx, %r13
	movl	%r13d, (%r8,%rax,4)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%ebp, %ecx
.L32:
	leal	-1000000007(%r11), %eax
	cmpl	$1000000006, %r11d
	cmovg	%eax, %r11d
	testl	%ebp, %ebp
	jg	.L47
.L31:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L77
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	movl	$1, %eax
.L34:
	imulq	$1001, %rbx, %rbx
	addl	%eax, %r11d
	movl	%ebp, %ecx
	addq	%r14, %rbx
	movl	%eax, (%r8,%rbx,4)
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L75:
	addl	%r13d, %r11d
	movl	%ebp, %ecx
	jmp	.L32
.L74:
	movslq	%ebp, %r10
.L35:
	movabsq	$-8543223828751151131, %rax
	imulq	%r14, %r13
	imulq	%r13
	leaq	(%rdx,%r13), %rax
	movq	%r13, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %r13
	imulq	$1001, %r15, %rax
	addq	%r10, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L48
	movl	$1, %eax
	cmpl	$1, %ebp
	jne	.L78
.L41:
	cltd
	imulq	$1001, %r15, %r15
	idivl	%r9d
	addq	%r10, %r15
	movl	%edx, (%r8,%r15,4)
.L48:
	addl	%r13d, %edx
	movl	52(%rsp), %ebp
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1152921497, %rax, %rax
	sarl	$31, %ecx
	sarq	$60, %rax
	subl	%ecx, %eax
	imull	$1000000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L34
.L78:
	leal	-2(%r12), %esi
	leal	-2(%rcx), %eax
	movl	%esi, 24(%rsp)
	movl	%eax, 40(%rsp)
	cmpl	%esi, %ebp
	jg	.L42
	movslq	%esi, %rax
	movq	%rax, 8(%rsp)
	imulq	$1001, %rax, %rax
	addq	%r10, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L42
	movl	$1, %eax
	cmpl	%esi, %ebp
	jne	.L79
.L43:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	%r10, %rax
	movl	%edx, (%r8,%rax,4)
.L42:
	movslq	%edx, %rax
	movl	$1000000007, %ebp
	movl	40(%rsp), %edi
	imulq	%r10, %rax
	cqto
	idivq	%rbp
	movq	%rdx, 16(%rsp)
	testl	%edi, %edi
	je	.L60
	movslq	24(%rsp), %rax
	movslq	%edi, %rsi
	movq	%rsi, 32(%rsp)
	movq	%rax, 8(%rsp)
	imulq	$1001, %rax, %rax
	addq	%rsi, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L44
	subl	$1, %edi
	movl	$1, %eax
	jne	.L80
.L45:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	32(%rsp), %rax
	movl	%edx, (%r8,%rax,4)
.L44:
	movl	16(%rsp), %eax
	addl	%edx, %eax
	jmp	.L41
.L76:
	leal	-2(%r12), %edi
	movl	%edi, 40(%rsp)
	cmpl	%ecx, %edi
	jl	.L55
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	imulq	$1001, %rax, %rax
	addq	%r14, %rax
	movl	(%r8,%rax,4), %edx
	testl	%edx, %edx
	jne	.L37
	movl	$1, %eax
	cmpl	%ecx, %edi
	jne	.L81
.L38:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	%r14, %rax
	movl	%edx, (%r8,%rax,4)
.L37:
	movslq	%edx, %rax
	movl	$1000000007, %edi
	movslq	%ebp, %r10
	imulq	%r14, %rax
	cqto
	idivq	%rdi
	movq	%rdx, 16(%rsp)
	cmpl	40(%rsp), %ebp
	jg	.L39
	movslq	40(%rsp), %rax
	movq	%rax, 8(%rsp)
	movq	%rax, %rdi
	imulq	$1001, %rax, %rax
	addq	%r10, %rax
	movl	(%r8,%rax,4), %r13d
	testl	%r13d, %r13d
	jne	.L39
	cmpl	$1, %ebp
	je	.L57
	cmpl	%edi, %ebp
	je	.L57
	leal	-3(%r12), %edi
	movl	%ebp, %esi
	movq	%r10, 32(%rsp)
	movl	%ecx, 40(%rsp)
	movl	%edi, 24(%rsp)
	call	stirling2
	movl	40(%rsp), %ecx
	movl	24(%rsp), %edi
	movl	%eax, %r13d
	leal	-2(%rcx), %esi
	call	stirling2
	movq	32(%rsp), %r10
	movl	40(%rsp), %ecx
	movl	$1000000007, %edi
	movl	%eax, %esi
	movslq	%r13d, %rax
	leaq	tbl(%rip), %r8
	movl	$1000000007, %r9d
	imulq	%r10, %rax
	cqto
	idivq	%rdi
	leal	(%rsi,%rdx), %eax
.L40:
	cltd
	idivl	%r9d
	imulq	$1001, 8(%rsp), %rax
	addq	%r10, %rax
	movl	%edx, (%r8,%rax,4)
	movl	%edx, %r13d
.L39:
	movl	16(%rsp), %eax
	addl	%r13d, %eax
	jmp	.L36
.L60:
	xorl	%edx, %edx
	jmp	.L44
.L55:
	xorl	%edx, %edx
	jmp	.L37
.L57:
	movl	$1, %eax
	jmp	.L40
.L81:
	movl	%ecx, %esi
	leal	-3(%r12), %edi
	movl	%ecx, 32(%rsp)
	movl	%edi, 24(%rsp)
	call	stirling2
	movl	24(%rsp), %edi
	movl	%ebp, %esi
	movl	%eax, 16(%rsp)
	call	stirling2
	movl	$1000000007, %edi
	movl	32(%rsp), %ecx
	movl	$1000000007, %r9d
	movl	%eax, %r10d
	movslq	16(%rsp), %rax
	leaq	tbl(%rip), %r8
	imulq	%r14, %rax
	cqto
	idivq	%rdi
	leal	(%r10,%rdx), %eax
	jmp	.L38
.L79:
	leal	-3(%r12), %edi
	movl	%ebp, %esi
	movl	%ecx, 44(%rsp)
	movq	%r10, 32(%rsp)
	movl	%edi, 16(%rsp)
	call	stirling2
	movl	40(%rsp), %esi
	movl	16(%rsp), %edi
	movl	%eax, %ebp
	call	stirling2
	movq	32(%rsp), %r10
	movl	$1000000007, %edi
	movl	44(%rsp), %ecx
	movl	%eax, %esi
	movslq	%ebp, %rax
	movl	$1000000007, %r9d
	imulq	%r10, %rax
	leaq	tbl(%rip), %r8
	cqto
	idivq	%rdi
	leal	(%rsi,%rdx), %eax
	jmp	.L43
.L80:
	movl	40(%rsp), %esi
	leal	-3(%r12), %edi
	movq	%r10, 24(%rsp)
	movl	%ecx, 44(%rsp)
	movl	%edi, 40(%rsp)
	call	stirling2
	movl	44(%rsp), %ecx
	movl	40(%rsp), %edi
	movl	%eax, %r12d
	leal	-3(%rcx), %esi
	call	stirling2
	movq	24(%rsp), %r10
	movl	$1000000007, %r9d
	leaq	tbl(%rip), %r8
	movl	%eax, %ecx
	movslq	%r12d, %rax
	imulq	32(%rsp), %rax
	cqto
	idivq	%rbp
	leal	(%rcx,%rdx), %eax
	jmp	.L45
.L77:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

// AOJ DPL_5_G: Balls and Boxes 7
// n 個の区別できるボールを k 個の区別できない箱に入れる
// とき、可能な入れ方の総数を求めてください。
// ただし、
//    どのボールも、必ずいずれかの箱に入れる。
//    ボールが1つも入っていない箱があってもよい。
// 2019.3.11 bal4u

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

#define MOD 1000000007
int tbl[1001][1001];

int stirling2(int n, int k)
{
	int ans;

	if (k > n || k == 0) return 0;
	if (tbl[n][k]) return tbl[n][k];
	if (k == 1 || k == n) ans = 1;
	else ans = (((long long)k * stirling2(n - 1, k)) % MOD)
		+ stirling2(n - 1, k - 1);
	return tbl[n][k] = ans % MOD;
}

int main()
{
	int n, k, ans;

	scanf("%d%d", &n, &k);
	ans = 0; while (k > 0) {
		ans += stirling2(n, k--);
		if (ans >= MOD) ans -= MOD;
	}
	printf("%d\n", ans);
	return 0;
}

3 5

5

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

```c
// AOJ DPL_5_G: Balls and Boxes 7
// n 個の区別できるボールを k 個の区別できない箱に入れる
// とき、可能な入れ方の総数を求めてください。
// ただし、
//    どのボールも、必ずいずれかの箱に入れる。
//    ボールが1つも入っていない箱があってもよい。
// 2019.3.11 bal4u

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

#define MOD 1000000007
int tbl[1001][1001];

int stirling2(int n, int k)
{
	int ans;

	if (k > n || k == 0) return 0;
	if (tbl[n][k]) return tbl[n][k];
	if (k == 1 || k == n) ans = 1;
	else ans = (((long long)k * stirling2(n - 1, k)) % MOD)
		+ stirling2(n - 1, k - 1);
	return tbl[n][k] = ans % MOD;
}

int main()
{
	int n, k, ans;

	scanf("%d%d", &n, &k);
	ans = 0; while (k > 0) {
		ans += stirling2(n, k--);
		if (ans >= MOD) ans -= MOD;
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.text
	.globl	stirling2
	.type	stirling2, @function
stirling2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L2
	cmpl	$0, -40(%rbp)
	jne	.L3
.L2:
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L5:
	cmpl	$1, -40(%rbp)
	je	.L6
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jne	.L7
.L6:
	movl	$1, -20(%rbp)
	jmp	.L8
.L7:
	movl	-40(%rbp), %eax
	movslq	%eax, %rbx
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	stirling2
	cltq
	imulq	%rax, %rbx
	movq	%rbx, %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	%eax, %ebx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	stirling2
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
.L8:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1152921497, %rax, %rax
	shrq	$32, %rax
	sarl	$28, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	stirling2, .-stirling2
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	-20(%rbp), %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	stirling2
	addl	%eax, -12(%rbp)
	cmpl	$1000000006, -12(%rbp)
	jle	.L10
	subl	$1000000007, -12(%rbp)
.L10:
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jg	.L11
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 4008004
tbl:
	.zero	4008004
	.text
	.globl	stirling2
	.type	stirling2, @function
stirling2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L2
	cmpl	$0, -40(%rbp)
	jne	.L3
.L2:
	movl	$0, %eax
	jmp	.L4
.L3:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L5:
	cmpl	$1, -40(%rbp)
	je	.L6
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jne	.L7
.L6:
	movl	$1, -20(%rbp)
	jmp	.L8
.L7:
	movl	-40(%rbp), %eax
	movslq	%eax, %rbx
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	stirling2
	cltq
	imulq	%rax, %rbx
	movq	%rbx, %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	%eax, %ebx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	stirling2
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
.L8:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1152921497, %rax, %rax
	shrq	$32, %rax
	sarl	$28, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000000007, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-40(%rbp), %edx
	movslq	%edx, %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	stirling2, .-stirling2
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rdx
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	-20(%rbp), %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	stirling2
	addl	%eax, -12(%rbp)
	cmpl	$1000000006, -12(%rbp)
	jle	.L10
	subl	$1000000007, -12(%rbp)
.L10:
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jg	.L11
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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:
