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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

//階乗,二項係数
//*
ll fact[100010];
ll invfact[100010];
void makefact(int n,ll m){
	fact[0]=1;
	rep(i,0,n)fact[i+1]=fact[i]*(i+1)%m;
	invfact[n]=invp(fact[n],m);
	for(int i=n;i>0;i--)invfact[i-1]=invfact[i]*i%m;
}
ll choose(int n,int r,int m){return n<0||r<0||n-r<0?0:fact[n]*invfact[r]%m*invfact[n-r]%m;}
//*/

int main(){
	makefact(2000,MOD);
	int n,m;
	scanf("%d%d",&n,&m);
	printf("%lld\n",choose(m,n,MOD));
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	pom
	.type	pom, @function
pom:
.LFB0:
	.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)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L2
.L5:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L4
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L4:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L5
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	pom, .-pom
	.globl	fact
	.bss
	.align 32
	.type	fact, @object
	.size	fact, 800080
fact:
	.zero	800080
	.globl	invfact
	.align 32
	.type	invfact, @object
	.size	invfact, 800080
invfact:
	.zero	800080
	.text
	.globl	makefact
	.type	makefact, @function
makefact:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	$1, fact(%rip)
	movq	$0, -8(%rbp)
	jmp	.L8
.L9:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	addq	$1, %rdx
	imulq	%rdx, %rax
	movq	-8(%rbp), %rdx
	leaq	1(%rdx), %rcx
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rsi
	leaq	0(,%rcx,8), %rdx
	leaq	fact(%rip), %rax
	movq	%rsi, (%rdx,%rax)
	addq	$1, -8(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L9
	movq	-32(%rbp), %rax
	movl	%eax, %esi
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%esi, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	pom
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	invfact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	leal	-1(%rdx), %ecx
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rsi
	movslq	%ecx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	%rsi, (%rdx,%rax)
	subl	$1, -12(%rbp)
.L10:
	cmpl	$0, -12(%rbp)
	jg	.L11
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	makefact, .-makefact
	.globl	choose
	.type	choose, @function
choose:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	cmpl	$0, -4(%rbp)
	js	.L13
	cmpl	$0, -8(%rbp)
	js	.L13
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	testl	%eax, %eax
	js	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	invfact(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	(%rdx,%rax), %rax
	imulq	%rcx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	jmp	.L15
.L13:
	movl	$0, %eax
.L15:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	choose, .-choose
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000007, %esi
	movl	$2000, %edi
	call	makefact
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	movl	$1000000007, %edx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	choose
	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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	pom
	.type	pom, @function
pom:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movslq	%edx, %r8
	movl	$1, %r9d
	cqto
	idivq	%r8
	movq	%rdx, %rcx
	testq	%rsi, %rsi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %sil
	je	.L3
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L3:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L4
.L1:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	pom, .-pom
	.p2align 4
	.globl	makefact
	.type	makefact, @function
makefact:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %r9d
	movq	%rsi, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	fact(%rip), %r11
	movslq	%r9d, %rsi
	leaq	-2(%rdi), %r8
	movslq	%edi, %r10
	movq	$1, fact(%rip)
	testq	%rsi, %rsi
	jle	.L12
	movl	$1, %edx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rcx
	movq	%rdx, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, (%r11,%rcx,8)
	cmpq	%rsi, %rcx
	jne	.L13
	movq	%rdx, %rax
	cqto
	idivq	%r10
	movq	%rdx, %r11
	testq	%r8, %r8
	je	.L32
.L21:
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L17:
	testb	$1, %r8b
	je	.L16
	movq	%rbx, %rax
	imulq	%r11, %rax
	cqto
	idivq	%r10
	movq	%rdx, %rbx
.L16:
	movq	%r11, %rax
	movq	%r8, %rcx
	imulq	%r11, %rax
	shrq	$63, %rcx
	addq	%r8, %rcx
	cqto
	idivq	%r10
	sarq	%rcx
	movq	%rcx, %r8
	movq	%rdx, %r11
	jne	.L17
	leaq	invfact(%rip), %rax
	movq	%rbx, (%rax,%rsi,8)
	testl	%r9d, %r9d
	jle	.L11
.L18:
	movq	(%rax,%rsi,8), %rdx
	movq	%rsi, %rcx
	leaq	-8+invfact(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rdx, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, (%rsi,%rcx,8)
	subq	$1, %rcx
	testl	%ecx, %ecx
	jg	.L19
.L11:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	movq	(%r11,%rsi,8), %rax
	cqto
	idivq	%r10
	movq	%rdx, %r11
	testq	%r8, %r8
	jne	.L21
	leaq	invfact(%rip), %rax
	movq	$1, (%rax,%rsi,8)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	leaq	invfact(%rip), %rax
	movq	$1, (%rax,%rsi,8)
	jmp	.L18
	.cfi_endproc
.LFE24:
	.size	makefact, .-makefact
	.p2align 4
	.globl	choose
	.type	choose, @function
choose:
.LFB25:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	xorl	%r8d, %r8d
	orl	%esi, %eax
	js	.L33
	movl	%edi, %r9d
	subl	%esi, %r9d
	js	.L33
	leaq	invfact(%rip), %r8
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movslq	%edx, %rcx
	leaq	fact(%rip), %rax
	movslq	%r9d, %r9
	movq	(%rax,%rdi,8), %rax
	imulq	(%r8,%rsi,8), %rax
	cqto
	idivq	%rcx
	movq	(%r8,%r9,8), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %r8
.L33:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE25:
	.size	choose, .-choose
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1000000007, %esi
	movl	$2000, %edi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	makefact
	leaq	4(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movslq	4(%rsp), %rcx
	xorl	%edx, %edx
	movl	%eax, %edi
	orl	%ecx, %edi
	js	.L38
	movl	%ecx, %esi
	subl	%eax, %esi
	js	.L38
	movslq	%eax, %rdx
	leaq	invfact(%rip), %rdi
	leaq	fact(%rip), %rax
	movslq	%esi, %rsi
	movq	(%rax,%rcx,8), %rax
	imulq	(%rdi,%rdx,8), %rax
	movl	$1000000007, %ecx
	cqto
	idivq	%rcx
	movq	(%rdi,%rsi,8), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
.L38:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	invfact
	.bss
	.align 32
	.type	invfact, @object
	.size	invfact, 800080
invfact:
	.zero	800080
	.globl	fact
	.align 32
	.type	fact, @object
	.size	fact, 800080
fact:
	.zero	800080
	.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	pom
	.type	pom, @function
pom:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movslq	%edx, %r8
	movl	$1, %r9d
	cqto
	idivq	%r8
	movq	%rdx, %rcx
	testq	%rsi, %rsi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %sil
	je	.L3
	movq	%r9, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L3:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rsi, %rax
	shrq	$63, %rax
	addq	%rax, %rsi
	sarq	%rsi
	movq	%rdx, %rcx
	jne	.L4
.L1:
	movq	%r9, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	pom, .-pom
	.p2align 4
	.globl	makefact
	.type	makefact, @function
makefact:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %r9d
	movq	%rsi, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	fact(%rip), %r11
	movslq	%r9d, %rsi
	leaq	-2(%rdi), %r8
	movslq	%edi, %r10
	movq	$1, fact(%rip)
	testq	%rsi, %rsi
	jle	.L12
	movl	$1, %edx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$1, %rcx
	movq	%rdx, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, (%r11,%rcx,8)
	cmpq	%rsi, %rcx
	jne	.L13
	movq	%rdx, %rax
	cqto
	idivq	%r10
	movq	%rdx, %r11
	testq	%r8, %r8
	je	.L32
.L21:
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L17:
	testb	$1, %r8b
	je	.L16
	movq	%rbx, %rax
	imulq	%r11, %rax
	cqto
	idivq	%r10
	movq	%rdx, %rbx
.L16:
	movq	%r11, %rax
	movq	%r8, %rcx
	imulq	%r11, %rax
	shrq	$63, %rcx
	addq	%r8, %rcx
	cqto
	idivq	%r10
	sarq	%rcx
	movq	%rcx, %r8
	movq	%rdx, %r11
	jne	.L17
	leaq	invfact(%rip), %rax
	movq	%rbx, (%rax,%rsi,8)
	testl	%r9d, %r9d
	jle	.L11
.L18:
	movq	(%rax,%rsi,8), %rdx
	movq	%rsi, %rcx
	leaq	-8+invfact(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rdx, %rax
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, (%rsi,%rcx,8)
	subq	$1, %rcx
	testl	%ecx, %ecx
	jg	.L19
.L11:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	movq	(%r11,%rsi,8), %rax
	cqto
	idivq	%r10
	movq	%rdx, %r11
	testq	%r8, %r8
	jne	.L21
	leaq	invfact(%rip), %rax
	movq	$1, (%rax,%rsi,8)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	leaq	invfact(%rip), %rax
	movq	$1, (%rax,%rsi,8)
	jmp	.L18
	.cfi_endproc
.LFE24:
	.size	makefact, .-makefact
	.p2align 4
	.globl	choose
	.type	choose, @function
choose:
.LFB25:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	xorl	%r8d, %r8d
	orl	%esi, %eax
	js	.L33
	movl	%edi, %r9d
	subl	%esi, %r9d
	js	.L33
	leaq	invfact(%rip), %r8
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movslq	%edx, %rcx
	leaq	fact(%rip), %rax
	movslq	%r9d, %r9
	movq	(%rax,%rdi,8), %rax
	imulq	(%r8,%rsi,8), %rax
	cqto
	idivq	%rcx
	movq	(%r8,%r9,8), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %r8
.L33:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE25:
	.size	choose, .-choose
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1000000007, %esi
	movl	$2000, %edi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	makefact
	leaq	4(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movslq	4(%rsp), %rcx
	xorl	%edx, %edx
	movl	%eax, %edi
	orl	%ecx, %edi
	js	.L38
	movl	%ecx, %esi
	subl	%eax, %esi
	js	.L38
	movslq	%eax, %rdx
	leaq	invfact(%rip), %rdi
	leaq	fact(%rip), %rax
	movslq	%esi, %rsi
	movq	(%rax,%rcx,8), %rax
	imulq	(%rdi,%rdx,8), %rax
	movl	$1000000007, %ecx
	cqto
	idivq	%rcx
	movq	(%rdi,%rsi,8), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rcx
.L38:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	invfact
	.bss
	.align 32
	.type	invfact, @object
	.size	invfact, 800080
invfact:
	.zero	800080
	.globl	fact
	.align 32
	.type	fact, @object
	.size	fact, 800080
fact:
	.zero	800080
	.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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

//階乗,二項係数
//*
ll fact[100010];
ll invfact[100010];
void makefact(int n,ll m){
	fact[0]=1;
	rep(i,0,n)fact[i+1]=fact[i]*(i+1)%m;
	invfact[n]=invp(fact[n],m);
	for(int i=n;i>0;i--)invfact[i-1]=invfact[i]*i%m;
}
ll choose(int n,int r,int m){return n<0||r<0||n-r<0?0:fact[n]*invfact[r]%m*invfact[n-r]%m;}
//*/

int main(){
	makefact(2000,MOD);
	int n,m;
	scanf("%d%d",&n,&m);
	printf("%lld\n",choose(m,n,MOD));
}

3 5

10

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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

//階乗,二項係数
//*
ll fact[100010];
ll invfact[100010];
void makefact(int n,ll m){
	fact[0]=1;
	rep(i,0,n)fact[i+1]=fact[i]*(i+1)%m;
	invfact[n]=invp(fact[n],m);
	for(int i=n;i>0;i--)invfact[i-1]=invfact[i]*i%m;
}
ll choose(int n,int r,int m){return n<0||r<0||n-r<0?0:fact[n]*invfact[r]%m*invfact[n-r]%m;}
//*/

int main(){
	makefact(2000,MOD);
	int n,m;
	scanf("%d%d",&n,&m);
	printf("%lld\n",choose(m,n,MOD));
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	pom
	.type	pom, @function
pom:
.LFB0:
	.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)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L2
.L5:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L4
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L4:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L5
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	pom, .-pom
	.globl	fact
	.bss
	.align 32
	.type	fact, @object
	.size	fact, 800080
fact:
	.zero	800080
	.globl	invfact
	.align 32
	.type	invfact, @object
	.size	invfact, 800080
invfact:
	.zero	800080
	.text
	.globl	makefact
	.type	makefact, @function
makefact:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	$1, fact(%rip)
	movq	$0, -8(%rbp)
	jmp	.L8
.L9:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	addq	$1, %rdx
	imulq	%rdx, %rax
	movq	-8(%rbp), %rdx
	leaq	1(%rdx), %rcx
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rsi
	leaq	0(,%rcx,8), %rdx
	leaq	fact(%rip), %rax
	movq	%rsi, (%rdx,%rax)
	addq	$1, -8(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L9
	movq	-32(%rbp), %rax
	movl	%eax, %esi
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%esi, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	pom
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	invfact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	leal	-1(%rdx), %ecx
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rsi
	movslq	%ecx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	%rsi, (%rdx,%rax)
	subl	$1, -12(%rbp)
.L10:
	cmpl	$0, -12(%rbp)
	jg	.L11
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	makefact, .-makefact
	.globl	choose
	.type	choose, @function
choose:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	cmpl	$0, -4(%rbp)
	js	.L13
	cmpl	$0, -8(%rbp)
	js	.L13
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	testl	%eax, %eax
	js	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	invfact(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	(%rdx,%rax), %rax
	imulq	%rcx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	jmp	.L15
.L13:
	movl	$0, %eax
.L15:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	choose, .-choose
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000007, %esi
	movl	$2000, %edi
	call	makefact
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	movl	$1000000007, %edx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	choose
	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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	pom
	.type	pom, @function
pom:
.LFB0:
	.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)
	movl	%edx, -36(%rbp)
	movq	$1, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	jmp	.L2
.L5:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L4
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L4:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -24(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jne	.L5
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	pom, .-pom
	.globl	fact
	.bss
	.align 32
	.type	fact, @object
	.size	fact, 800080
fact:
	.zero	800080
	.globl	invfact
	.align 32
	.type	invfact, @object
	.size	invfact, 800080
invfact:
	.zero	800080
	.text
	.globl	makefact
	.type	makefact, @function
makefact:
.LFB1:
	.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	$1, fact(%rip)
	movq	$0, -8(%rbp)
	jmp	.L8
.L9:
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-8(%rbp), %rdx
	addq	$1, %rdx
	imulq	%rdx, %rax
	movq	-8(%rbp), %rdx
	leaq	1(%rdx), %rcx
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rsi
	leaq	0(,%rcx,8), %rdx
	leaq	fact(%rip), %rax
	movq	%rsi, (%rdx,%rax)
	addq	$1, -8(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jl	.L9
	movq	-32(%rbp), %rax
	movl	%eax, %esi
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	%esi, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	pom
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	invfact(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	leal	-1(%rdx), %ecx
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rsi
	movslq	%ecx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	%rsi, (%rdx,%rax)
	subl	$1, -12(%rbp)
.L10:
	cmpl	$0, -12(%rbp)
	jg	.L11
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	makefact, .-makefact
	.globl	choose
	.type	choose, @function
choose:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	cmpl	$0, -4(%rbp)
	js	.L13
	cmpl	$0, -8(%rbp)
	js	.L13
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	testl	%eax, %eax
	js	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	fact(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	invfact(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	invfact(%rip), %rax
	movq	(%rdx,%rax), %rax
	imulq	%rcx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	jmp	.L15
.L13:
	movl	$0, %eax
.L15:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	choose, .-choose
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000007, %esi
	movl	$2000, %edi
	call	makefact
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	movl	$1000000007, %edx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	choose
	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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
