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>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

const i32 mod = 1000000007;

#define ADD(x, a) do{(x) += (a); if ((x) >= mod) (x) -= mod;} while (0)
#define SUB(x, a) do{(x) += mod - (a); if ((x) >= mod) (x) -= mod;} while (0)

i32 inv (i32 a) {
  i32 t = 1;
  while (a > 1) {
    t = (i64) t * (mod - mod / a) % mod;
    a = mod % a;
  }
  return t;
}

i32 mod_pow (i32 r, i32 n) {
  i32 t = 1;
  i32 s = r;
  while (n > 0) {
    if (n & 1) t = (i64) t * s % mod;
    s = (i64) s * s % mod;
    n >>= 1;
  }
  return t;
}

i32 *fact = NULL;
i32 *iFact = NULL;
void init_fact (const i32 n) {
  fact = (i32 *) calloc (n + 1, sizeof (i32));
  fact[0] = 1;
  for (i32 i = 1; i <= n; ++i) {
    fact[i] = (i64) i * fact[i - 1] % mod;
  }
  iFact = (i32 *) calloc (n + 1, sizeof (i32));
  iFact[n] = inv (fact[n]);
  for (i32 i = n - 1; i >= 0; --i) {
    iFact[i] = (i64) (i + 1) * iFact[i + 1] % mod;
  }
}

i32 perm (i32 n, i32 k) {
  if (!(0 <=k && k <= n)) return 0;
  return (i64) fact[n] * iFact[n - k] % mod;
}

i32 comb (i32 n, i32 k) {
  if (!(0 <= k && k <= n)) return 0;
  return (i64) fact[n] * iFact[k] % mod * iFact[n - k] % mod;
}

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) > (0) ? (a) : -(a))

const i32 f = 10000000;

i64 func (i64 n) {
  i64 sum = 0;
  while (n > 0) {
    sum += n / mod;
    n /= mod;
  }
  return sum;
}

i32 calc_fact (i32 n) {
  i32 res = 1;
  while (n > 0) {
    res = (i64) res * n % mod;
    n--;
  }
  return res;
}

i32 calc_comb (i64 n, i64 k) {
  if (func (n) - func (k) - func (n - k) > 0) {
    return 0;
  }
  i32 nu = (i64) mod_pow (mod - 1, n / mod) * calc_fact (n % mod) % mod;
  i32 de = (i64) mod_pow (mod - 1, k / mod) * calc_fact (k % mod) % mod * mod_pow (mod - 1, (n - k) / mod) % mod * calc_fact ((n - k) % mod) % mod;
  return (i64) nu * inv (de) % mod;
}

void run (void) {
  i64 n, m, k;
  scanf ("%" SCNi64 "%" SCNi64 "%" SCNi64, &n, &m, &k);
  //init_fact (n * m);
  i64 ans = 0;
  i32 c = calc_comb (n * m - 2, k - 2);
  for (i32 d = 1; d < m; ++d) {
    ans = (ans + (i64) c * d % mod * (m - d) % mod * n % mod * n) % mod;
  }
  for (i32 d = 1; d < n; ++d) {
    ans = (ans + (i64) c * d % mod * (n - d) % mod * m % mod * m) % mod;
  }
  printf ("%" PRIi64 "\n", ans);
}

void gen (void) {
  
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mod
	.section	.rodata
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.text
	.globl	inv
	.type	inv, @function
inv:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	$1000000007, %esi
	movl	$1000000007, %eax
	cltd
	idivl	-20(%rbp)
	movl	%eax, %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	movl	$1000000007, %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, -20(%rbp)
.L2:
	cmpl	$1, -20(%rbp)
	jg	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	inv, .-inv
	.globl	mod_pow
	.type	mod_pow, @function
mod_pow:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$1, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L8:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -8(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	sarl	-24(%rbp)
.L6:
	cmpl	$0, -24(%rbp)
	jg	.L8
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mod_pow, .-mod_pow
	.globl	fact
	.bss
	.align 8
	.type	fact, @object
	.size	fact, 8
fact:
	.zero	8
	.globl	iFact
	.align 8
	.type	iFact, @object
	.size	iFact, 8
iFact:
	.zero	8
	.text
	.globl	init_fact
	.type	init_fact, @function
init_fact:
.LFB8:
	.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	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, fact(%rip)
	movq	fact(%rip), %rax
	movl	$1, (%rax)
	movl	$1, -24(%rbp)
	jmp	.L11
.L12:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	fact(%rip), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	subq	$4, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	fact(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L12
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, iFact(%rip)
	movq	fact(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movq	iFact(%rip), %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	(%rcx,%rdx), %rbx
	movl	%eax, %edi
	call	inv
	movl	%eax, (%rbx)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L14:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	iFact(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	subl	$1, -20(%rbp)
.L13:
	cmpl	$0, -20(%rbp)
	jns	.L14
	nop
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	init_fact, .-init_fact
	.globl	perm
	.type	perm, @function
perm:
.LFB9:
	.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)
	cmpl	$0, -8(%rbp)
	js	.L16
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L17
.L16:
	movl	$0, %eax
	jmp	.L18
.L17:
	movq	fact(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L18:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	perm, .-perm
	.globl	comb
	.type	comb, @function
comb:
.LFB10:
	.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)
	cmpl	$0, -8(%rbp)
	js	.L20
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L21
.L20:
	movl	$0, %eax
	jmp	.L22
.L21:
	movq	fact(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	iFact(%rip), %rdx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	comb, .-comb
	.globl	f
	.section	.rodata
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.long	10000000
	.text
	.globl	func
	.type	func, @function
func:
.LFB11:
	.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	$0, -8(%rbp)
	jmp	.L24
.L25:
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	addq	%rax, -8(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-24(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -24(%rbp)
.L24:
	cmpq	$0, -24(%rbp)
	jg	.L25
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	func, .-func
	.globl	calc_fact
	.type	calc_fact, @function
calc_fact:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L28
.L29:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	subl	$1, -20(%rbp)
.L28:
	cmpl	$0, -20(%rbp)
	jg	.L29
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	calc_fact, .-calc_fact
	.globl	calc_comb
	.type	calc_comb, @function
calc_comb:
.LFB13:
	.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	$32, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -32(%rbp)
	movq	%rsi, -40(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	func
	movq	%rax, %rbx
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	func
	subq	%rax, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	func
	movq	%rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L32
	movl	$0, %eax
	jmp	.L33
.L32:
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	movslq	%eax, %rbx
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -16(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	movslq	%eax, %rbx
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rsi
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	movslq	%eax, %rbx
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	inv
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L33:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	calc_comb, .-calc_comb
	.section	.rodata
.LC0:
	.string	"%li%li%li"
.LC1:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	movq	-24(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-40(%rbp), %rcx
	movq	-32(%rbp), %rax
	imulq	%rcx, %rax
	subq	$2, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	calc_comb
	movl	%eax, -44(%rbp)
	movl	$1, -52(%rbp)
	jmp	.L35
.L36:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-40(%rbp), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-40(%rbp), %rax
	imulq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
	addl	$1, -52(%rbp)
.L35:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L36
	movl	$1, -48(%rbp)
	jmp	.L37
.L38:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-48(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-40(%rbp), %rax
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-32(%rbp), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-32(%rbp), %rax
	imulq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
	addl	$1, -48(%rbp)
.L37:
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L38
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	run, .-run
	.globl	gen
	.type	gen, @function
gen:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	gen, .-gen
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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	inv
	.type	inv, @function
inv:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %esi
	movl	$1, %r8d
	cmpl	$1, %edi
	jle	.L1
	movl	$-1000000007, %r9d
	movl	$1000000007, %edi
	movabsq	$-8543223828751151131, %r10
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r9d, %eax
	movslq	%r8d, %r8
	cltd
	idivl	%esi
	leal	1000000007(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rax
	movl	%ecx, %r8d
	mulq	%r10
	movl	%edi, %eax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r8d
	cltd
	idivl	%esi
	movl	%edx, %esi
	cmpl	$1, %edx
	jg	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	inv, .-inv
	.p2align 4
	.globl	mod_pow
	.type	mod_pow, @function
mod_pow:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%esi, %ecx
	movl	$1, %r8d
	testl	%esi, %esi
	jle	.L7
	movabsq	$-8543223828751151131, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edi, %rdi
	testb	$1, %cl
	je	.L9
	movslq	%r8d, %r8
	imulq	%rdi, %r8
	movq	%r8, %rax
	imulq	%rsi
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r8d
.L9:
	imulq	%rdi, %rdi
	movq	%rdi, %rax
	imulq	%rsi
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
	sarl	%ecx
	jne	.L10
.L7:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	mod_pow, .-mod_pow
	.p2align 4
	.globl	init_fact
	.type	init_fact, @function
init_fact:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leal	1(%rdi), %r13d
	movl	$4, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movslq	%r13d, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	movq	%r12, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	calloc@PLT
	movq	%rax, fact(%rip)
	movq	%rax, %rbp
	movl	$1, (%rax)
	testl	%ebx, %ebx
	jle	.L17
	movl	%r13d, %edi
	movl	$1, %esi
	movl	$1, %eax
	movabsq	$-8543223828751151131, %r8
	.p2align 4,,10
	.p2align 3
.L18:
	imulq	%rsi, %rax
	movq	%rax, %rcx
	imulq	%r8
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, 0(%rbp,%rsi,4)
	addq	$1, %rsi
	movslq	%ecx, %rax
	cmpq	%rsi, %rdi
	jne	.L18
.L17:
	movq	%r12, %rdi
	movl	$4, %esi
	call	calloc@PLT
	movslq	%ebx, %r9
	movl	$1, %edi
	movl	0(%rbp,%r9,4), %esi
	movq	%rax, iFact(%rip)
	movq	%rax, %r8
	leaq	(%rax,%r9,4), %r12
	cmpl	$1, %esi
	jle	.L19
	movl	$-1000000007, %r11d
	movl	$1000000007, %r10d
	movabsq	$-8543223828751151131, %rbp
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r11d, %eax
	movslq	%edi, %rdi
	cltd
	idivl	%esi
	leal	1000000007(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%rdi, %rcx
	movq	%rcx, %rax
	movl	%ecx, %edi
	mulq	%rbp
	movl	%r10d, %eax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
	cltd
	idivl	%esi
	movl	%edx, %esi
	cmpl	$1, %edx
	jg	.L20
.L19:
	movl	%edi, (%r12)
	subl	$1, %ebx
	js	.L16
	movabsq	$-8543223828751151131, %r10
	leaq	-1(%r9), %rsi
	movl	%ebx, %ebx
	subq	%rbx, %rsi
	.p2align 4,,10
	.p2align 3
.L22:
	movslq	%edi, %rcx
	imulq	%r9, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, -4(%r8,%r9,4)
	subq	$1, %r9
	movl	%ecx, %edi
	cmpq	%r9, %rsi
	jne	.L22
.L16:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	init_fact, .-init_fact
	.p2align 4
	.globl	perm
	.type	perm, @function
perm:
.LFB54:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	js	.L30
	cmpl	%edi, %esi
	jg	.L30
	movl	%edi, %eax
	movq	iFact(%rip), %rdx
	movslq	%edi, %rdi
	subl	%esi, %eax
	cltq
	movslq	(%rdx,%rax,4), %rcx
	movq	fact(%rip), %rax
	movabsq	$-8543223828751151131, %rdx
	movslq	(%rax,%rdi,4), %rax
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%ecx, %eax
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	perm, .-perm
	.p2align 4
	.globl	comb
	.type	comb, @function
comb:
.LFB55:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	testl	%esi, %esi
	js	.L33
	cmpl	%edi, %esi
	jg	.L33
	movq	fact(%rip), %rax
	movq	iFact(%rip), %r9
	movslq	%edi, %rdx
	subl	%r8d, %edi
	movslq	%edi, %rdi
	movslq	(%rax,%rdx,4), %rcx
	movslq	%esi, %rax
	movabsq	$-8543223828751151131, %rsi
	movslq	(%r9,%rax,4), %rax
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movslq	(%r9,%rdi,4), %rax
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%ecx, %eax
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	comb, .-comb
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB56:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	xorl	%r8d, %r8d
	testq	%rdi, %rdi
	jle	.L34
	movabsq	$-8543223828751151131, %rsi
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%rsi
	shrq	$29, %rdx
	addq	%rdx, %r8
	cmpq	$1000000006, %rcx
	jg	.L36
.L34:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE56:
	.size	func, .-func
	.p2align 4
	.globl	calc_fact
	.type	calc_fact, @function
calc_fact:
.LFB57:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L42
	movslq	%edi, %rax
	leal	-1(%rdi), %edx
	movl	$1, %ecx
	movabsq	$-8543223828751151131, %rdi
	leaq	-1(%rax), %rsi
	movq	%rsi, %r8
	subq	%rdx, %r8
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L44:
	subq	$1, %rsi
.L41:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%rdi
	movq	%rsi, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%rsi, %r8
	jne	.L44
	movl	%ecx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	movl	$1, %ecx
	movl	%ecx, %eax
	ret
	.cfi_endproc
.LFE57:
	.size	calc_fact, .-calc_fact
	.p2align 4
	.globl	calc_comb
	.type	calc_comb, @function
calc_comb:
.LFB58:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	movq	%rsi, %rdi
	testq	%r10, %r10
	jle	.L46
	movabsq	$-8543223828751151131, %rsi
	movq	%r10, %rdx
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L47:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%rsi
	shrq	$29, %rdx
	addq	%rdx, %r9
	cmpq	$1000000006, %rcx
	jg	.L47
	testq	%rdi, %rdi
	jle	.L53
.L49:
	movabsq	$-8543223828751151131, %r8
	movq	%rdi, %rdx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%r8
	shrq	$29, %rdx
	addq	%rdx, %rsi
	cmpq	$1000000006, %rcx
	jg	.L54
	subq	%rsi, %r9
.L53:
	movq	%r10, %rsi
	subq	%rdi, %rsi
	testq	%rsi, %rsi
	jle	.L55
.L50:
	movabsq	$-8543223828751151131, %r11
	movq	%rsi, %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%r11
	shrq	$29, %rdx
	addq	%rdx, %r8
	cmpq	$1000000006, %rcx
	jg	.L56
	subq	%r8, %r9
.L55:
	xorl	%eax, %eax
	testq	%r9, %r9
	jg	.L45
	movabsq	$-8543223828751151131, %rdx
	movq	%r10, %rax
	imulq	%rdx
	movq	%r10, %rax
	sarq	$63, %rax
	addq	%r10, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%edx, %r9d
	testl	%edx, %edx
	jle	.L77
.L51:
	movl	$1000000006, %ecx
	movl	$1, %r8d
	movabsq	$-8543223828751151131, %r11
	.p2align 4,,10
	.p2align 3
.L60:
	movslq	%ecx, %rcx
	testb	$1, %r9b
	je	.L59
	movslq	%r8d, %r8
	imulq	%rcx, %r8
	movq	%r8, %rax
	imulq	%r11
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r8d
.L59:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	sarl	%r9d
	jne	.L60
	movslq	%r8d, %r9
.L58:
	movabsq	$-8543223828751151131, %r11
	movq	%r10, %rax
	imulq	%r11
	movq	%r10, %rax
	sarq	$63, %rax
	addq	%r10, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%r10, %rdx
	subq	%rax, %rdx
	testq	%rdx, %rdx
	jle	.L52
	movslq	%edx, %rax
	subl	$1, %edx
	movl	$1, %ecx
	leaq	-1(%rax), %r8
	movq	%r8, %r10
	subq	%rdx, %r10
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L102:
	subq	$1, %r8
.L61:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%r11
	movq	%r8, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%r10, %r8
	jne	.L102
	movslq	%ecx, %rcx
	imulq	%rcx, %r9
.L52:
	movabsq	$-8543223828751151131, %r11
	movq	%r9, %rax
	imulq	%r11
	movq	%r9, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r9), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	movq	%r9, %r8
	subq	%rax, %r8
	movq	%rdi, %rax
	imulq	%r11
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%edx, %r10d
	testl	%edx, %edx
	jle	.L78
	movl	$1000000006, %ecx
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L64:
	movslq	%ecx, %rcx
	testb	$1, %r10b
	je	.L63
	movslq	%r9d, %r9
	imulq	%rcx, %r9
	movq	%r9, %rax
	imulq	%r11
	movq	%r9, %rax
	sarq	$63, %rax
	addq	%r9, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r9d
.L63:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	sarl	%r10d
	jne	.L64
	movslq	%r9d, %r9
.L62:
	movabsq	$-8543223828751151131, %r10
	movq	%rdi, %rax
	imulq	%r10
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %rdx
	testq	%rdi, %rdi
	jle	.L65
	movslq	%edi, %rax
	subl	$1, %edx
	movl	$1, %ecx
	leaq	-1(%rax), %rdi
	movq	%rdi, %r11
	subq	%rdx, %r11
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L103:
	subq	$1, %rdi
.L66:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%r10
	movq	%rdi, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%r11, %rdi
	jne	.L103
	movslq	%ecx, %rcx
	imulq	%rcx, %r9
.L65:
	movabsq	$-8543223828751151131, %r10
	movq	%r9, %rax
	imulq	%r10
	movq	%r9, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r9), %r11
	sarq	$29, %r11
	subq	%rax, %r11
	imulq	$1000000007, %r11, %rax
	movq	%r9, %r11
	subq	%rax, %r11
	movq	%rsi, %rax
	imulq	%r10
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%edx, %r9d
	testl	%edx, %edx
	jle	.L67
	movl	$1000000006, %ecx
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L69:
	movslq	%ecx, %rcx
	testb	$1, %r9b
	je	.L68
	movslq	%edi, %rdi
	imulq	%rcx, %rdi
	movq	%rdi, %rax
	imulq	%r10
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
.L68:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r10
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	sarl	%r9d
	jne	.L69
	movslq	%edi, %rdi
	imulq	%r11, %rdi
	movq	%rdi, %rax
	imulq	%r10
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %r11
.L67:
	movabsq	$-8543223828751151131, %rdi
	movq	%rsi, %rax
	imulq	%rdi
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, %rdx
	testq	%rsi, %rsi
	jle	.L70
	movslq	%esi, %rax
	subl	$1, %edx
	movl	$1, %ecx
	leaq	-1(%rax), %rsi
	movq	%rsi, %r9
	subq	%rdx, %r9
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L104:
	subq	$1, %rsi
.L71:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%rdi
	movq	%rsi, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%rsi, %r9
	jne	.L104
	movslq	%ecx, %rcx
	imulq	%r11, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r11
.L70:
	movl	%r11d, %esi
	cmpq	$1, %r11
	jle	.L72
	movl	$1, %edi
	movl	$-1000000007, %r10d
	movabsq	$-8543223828751151131, %r11
	movl	$1000000007, %r9d
	.p2align 4,,10
	.p2align 3
.L73:
	movl	%r10d, %eax
	movslq	%edi, %rdi
	cltd
	idivl	%esi
	leal	1000000007(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%rdi, %rcx
	movq	%rcx, %rax
	movl	%ecx, %edi
	mulq	%r11
	movl	%r9d, %eax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
	cltd
	idivl	%esi
	movl	%edx, %esi
	cmpl	$1, %edx
	jg	.L73
	movslq	%edi, %rdi
	imulq	%r8, %rdi
	movq	%rdi, %rax
	imulq	%r11
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %r8
.L72:
	movl	%r8d, %eax
.L45:
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	xorl	%r9d, %r9d
	testq	%rsi, %rsi
	jg	.L49
	movq	%r10, %rsi
	subq	%rdi, %rsi
	testq	%rsi, %rsi
	jg	.L50
	movabsq	$-8543223828751151131, %rdx
	movq	%r10, %rax
	imulq	%rdx
	leaq	(%rdx,%r10), %rax
	movq	%r10, %rdx
	sarq	$29, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	movl	%eax, %r9d
	testl	%eax, %eax
	jg	.L51
	movl	$1, %r9d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, %r9d
	jmp	.L58
.L78:
	movl	$1, %r9d
	jmp	.L62
	.cfi_endproc
.LFE58:
	.size	calc_comb, .-calc_comb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%li%li%li"
.LC1:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbp
	movq	8(%rsp), %rbx
	movq	16(%rsp), %rax
	movq	%rbp, %rdi
	imulq	%rbx, %rdi
	leaq	-2(%rax), %rsi
	subq	$2, %rdi
	call	calc_comb
	movslq	%eax, %r10
	cmpq	$1, %rbx
	jle	.L111
	movslq	%r10d, %r11
	leaq	-1(%rbx), %r9
	xorl	%r8d, %r8d
	movabsq	$-8543223828751151131, %rdi
	movq	%r11, %rsi
	.p2align 4,,10
	.p2align 3
.L107:
	movq	%rsi, %rax
	movq	%rsi, %rcx
	imulq	%rdi
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	addq	%r11, %rsi
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r9, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbp, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbp, %rcx
	addq	%r8, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rcx), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	subq	$1, %r9
	jne	.L107
.L106:
	cmpq	$1, %rbp
	jle	.L108
	leaq	-1(%rbp), %rsi
	movq	%r10, %rdi
	movabsq	$-8543223828751151131, %r9
	.p2align 4,,10
	.p2align 3
.L109:
	movq	%rdi, %rax
	movq	%rdi, %rcx
	imulq	%r9
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	addq	%r10, %rdi
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rsi, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbx, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbx, %rcx
	addq	%r8, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rcx), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	subq	$1, %rsi
	jne	.L109
.L108:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L115
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L111:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L106
.L115:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE59:
	.size	run, .-run
	.p2align 4
	.globl	gen
	.type	gen, @function
gen:
.LFB60:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE60:
	.size	gen, .-gen
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB61:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE61:
	.size	main, .-main
	.globl	f
	.section	.rodata
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.long	10000000
	.globl	iFact
	.bss
	.align 8
	.type	iFact, @object
	.size	iFact, 8
iFact:
	.zero	8
	.globl	fact
	.align 8
	.type	fact, @object
	.size	fact, 8
fact:
	.zero	8
	.globl	mod
	.section	.rodata
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.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	inv
	.type	inv, @function
inv:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %esi
	movl	$1, %r8d
	cmpl	$1, %edi
	jle	.L1
	movl	$-1000000007, %r9d
	movl	$1000000007, %edi
	movabsq	$-8543223828751151131, %r10
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r9d, %eax
	movslq	%r8d, %r8
	cltd
	idivl	%esi
	leal	1000000007(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rax
	movl	%ecx, %r8d
	mulq	%r10
	movl	%edi, %eax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r8d
	cltd
	idivl	%esi
	movl	%edx, %esi
	cmpl	$1, %edx
	jg	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	inv, .-inv
	.p2align 4
	.globl	mod_pow
	.type	mod_pow, @function
mod_pow:
.LFB52:
	.cfi_startproc
	endbr64
	movl	%esi, %ecx
	movl	$1, %r8d
	testl	%esi, %esi
	jle	.L7
	movabsq	$-8543223828751151131, %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edi, %rdi
	testb	$1, %cl
	je	.L9
	movslq	%r8d, %r8
	imulq	%rdi, %r8
	movq	%r8, %rax
	imulq	%rsi
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r8d
.L9:
	imulq	%rdi, %rdi
	movq	%rdi, %rax
	imulq	%rsi
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
	sarl	%ecx
	jne	.L10
.L7:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	mod_pow, .-mod_pow
	.p2align 4
	.globl	init_fact
	.type	init_fact, @function
init_fact:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leal	1(%rdi), %r13d
	movl	$4, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movslq	%r13d, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	movq	%r12, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	calloc@PLT
	movq	%rax, fact(%rip)
	movq	%rax, %rbp
	movl	$1, (%rax)
	testl	%ebx, %ebx
	jle	.L17
	movl	%r13d, %edi
	movl	$1, %esi
	movl	$1, %eax
	movabsq	$-8543223828751151131, %r8
	.p2align 4,,10
	.p2align 3
.L18:
	imulq	%rsi, %rax
	movq	%rax, %rcx
	imulq	%r8
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, 0(%rbp,%rsi,4)
	addq	$1, %rsi
	movslq	%ecx, %rax
	cmpq	%rsi, %rdi
	jne	.L18
.L17:
	movq	%r12, %rdi
	movl	$4, %esi
	call	calloc@PLT
	movslq	%ebx, %r9
	movl	$1, %edi
	movl	0(%rbp,%r9,4), %esi
	movq	%rax, iFact(%rip)
	movq	%rax, %r8
	leaq	(%rax,%r9,4), %r12
	cmpl	$1, %esi
	jle	.L19
	movl	$-1000000007, %r11d
	movl	$1000000007, %r10d
	movabsq	$-8543223828751151131, %rbp
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r11d, %eax
	movslq	%edi, %rdi
	cltd
	idivl	%esi
	leal	1000000007(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%rdi, %rcx
	movq	%rcx, %rax
	movl	%ecx, %edi
	mulq	%rbp
	movl	%r10d, %eax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
	cltd
	idivl	%esi
	movl	%edx, %esi
	cmpl	$1, %edx
	jg	.L20
.L19:
	movl	%edi, (%r12)
	subl	$1, %ebx
	js	.L16
	movabsq	$-8543223828751151131, %r10
	leaq	-1(%r9), %rsi
	movl	%ebx, %ebx
	subq	%rbx, %rsi
	.p2align 4,,10
	.p2align 3
.L22:
	movslq	%edi, %rcx
	imulq	%r9, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	movl	%ecx, -4(%r8,%r9,4)
	subq	$1, %r9
	movl	%ecx, %edi
	cmpq	%r9, %rsi
	jne	.L22
.L16:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	init_fact, .-init_fact
	.p2align 4
	.globl	perm
	.type	perm, @function
perm:
.LFB54:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	js	.L30
	cmpl	%edi, %esi
	jg	.L30
	movl	%edi, %eax
	movq	iFact(%rip), %rdx
	movslq	%edi, %rdi
	subl	%esi, %eax
	cltq
	movslq	(%rdx,%rax,4), %rcx
	movq	fact(%rip), %rax
	movabsq	$-8543223828751151131, %rdx
	movslq	(%rax,%rdi,4), %rax
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%ecx, %eax
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	perm, .-perm
	.p2align 4
	.globl	comb
	.type	comb, @function
comb:
.LFB55:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	testl	%esi, %esi
	js	.L33
	cmpl	%edi, %esi
	jg	.L33
	movq	fact(%rip), %rax
	movq	iFact(%rip), %r9
	movslq	%edi, %rdx
	subl	%r8d, %edi
	movslq	%edi, %rdi
	movslq	(%rax,%rdx,4), %rcx
	movslq	%esi, %rax
	movabsq	$-8543223828751151131, %rsi
	movslq	(%r9,%rax,4), %rax
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movslq	(%r9,%rdi,4), %rax
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%ecx, %eax
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	comb, .-comb
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB56:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	xorl	%r8d, %r8d
	testq	%rdi, %rdi
	jle	.L34
	movabsq	$-8543223828751151131, %rsi
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%rsi
	shrq	$29, %rdx
	addq	%rdx, %r8
	cmpq	$1000000006, %rcx
	jg	.L36
.L34:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE56:
	.size	func, .-func
	.p2align 4
	.globl	calc_fact
	.type	calc_fact, @function
calc_fact:
.LFB57:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L42
	movslq	%edi, %rax
	leal	-1(%rdi), %edx
	movl	$1, %ecx
	movabsq	$-8543223828751151131, %rdi
	leaq	-1(%rax), %rsi
	movq	%rsi, %r8
	subq	%rdx, %r8
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L44:
	subq	$1, %rsi
.L41:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%rdi
	movq	%rsi, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%rsi, %r8
	jne	.L44
	movl	%ecx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	movl	$1, %ecx
	movl	%ecx, %eax
	ret
	.cfi_endproc
.LFE57:
	.size	calc_fact, .-calc_fact
	.p2align 4
	.globl	calc_comb
	.type	calc_comb, @function
calc_comb:
.LFB58:
	.cfi_startproc
	endbr64
	movq	%rdi, %r10
	movq	%rsi, %rdi
	testq	%r10, %r10
	jle	.L46
	movabsq	$-8543223828751151131, %rsi
	movq	%r10, %rdx
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L47:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%rsi
	shrq	$29, %rdx
	addq	%rdx, %r9
	cmpq	$1000000006, %rcx
	jg	.L47
	testq	%rdi, %rdi
	jle	.L53
.L49:
	movabsq	$-8543223828751151131, %r8
	movq	%rdi, %rdx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%r8
	shrq	$29, %rdx
	addq	%rdx, %rsi
	cmpq	$1000000006, %rcx
	jg	.L54
	subq	%rsi, %r9
.L53:
	movq	%r10, %rsi
	subq	%rdi, %rsi
	testq	%rsi, %rsi
	jle	.L55
.L50:
	movabsq	$-8543223828751151131, %r11
	movq	%rsi, %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%rdx, %rax
	movq	%rdx, %rcx
	mulq	%r11
	shrq	$29, %rdx
	addq	%rdx, %r8
	cmpq	$1000000006, %rcx
	jg	.L56
	subq	%r8, %r9
.L55:
	xorl	%eax, %eax
	testq	%r9, %r9
	jg	.L45
	movabsq	$-8543223828751151131, %rdx
	movq	%r10, %rax
	imulq	%rdx
	movq	%r10, %rax
	sarq	$63, %rax
	addq	%r10, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%edx, %r9d
	testl	%edx, %edx
	jle	.L77
.L51:
	movl	$1000000006, %ecx
	movl	$1, %r8d
	movabsq	$-8543223828751151131, %r11
	.p2align 4,,10
	.p2align 3
.L60:
	movslq	%ecx, %rcx
	testb	$1, %r9b
	je	.L59
	movslq	%r8d, %r8
	imulq	%rcx, %r8
	movq	%r8, %rax
	imulq	%r11
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r8d
.L59:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	sarl	%r9d
	jne	.L60
	movslq	%r8d, %r9
.L58:
	movabsq	$-8543223828751151131, %r11
	movq	%r10, %rax
	imulq	%r11
	movq	%r10, %rax
	sarq	$63, %rax
	addq	%r10, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%r10, %rdx
	subq	%rax, %rdx
	testq	%rdx, %rdx
	jle	.L52
	movslq	%edx, %rax
	subl	$1, %edx
	movl	$1, %ecx
	leaq	-1(%rax), %r8
	movq	%r8, %r10
	subq	%rdx, %r10
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L102:
	subq	$1, %r8
.L61:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%r11
	movq	%r8, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%r10, %r8
	jne	.L102
	movslq	%ecx, %rcx
	imulq	%rcx, %r9
.L52:
	movabsq	$-8543223828751151131, %r11
	movq	%r9, %rax
	imulq	%r11
	movq	%r9, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r9), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	movq	%r9, %r8
	subq	%rax, %r8
	movq	%rdi, %rax
	imulq	%r11
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%edx, %r10d
	testl	%edx, %edx
	jle	.L78
	movl	$1000000006, %ecx
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L64:
	movslq	%ecx, %rcx
	testb	$1, %r10b
	je	.L63
	movslq	%r9d, %r9
	imulq	%rcx, %r9
	movq	%r9, %rax
	imulq	%r11
	movq	%r9, %rax
	sarq	$63, %rax
	addq	%r9, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %r9d
.L63:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	sarl	%r10d
	jne	.L64
	movslq	%r9d, %r9
.L62:
	movabsq	$-8543223828751151131, %r10
	movq	%rdi, %rax
	imulq	%r10
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %rdx
	testq	%rdi, %rdi
	jle	.L65
	movslq	%edi, %rax
	subl	$1, %edx
	movl	$1, %ecx
	leaq	-1(%rax), %rdi
	movq	%rdi, %r11
	subq	%rdx, %r11
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L103:
	subq	$1, %rdi
.L66:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%r10
	movq	%rdi, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%r11, %rdi
	jne	.L103
	movslq	%ecx, %rcx
	imulq	%rcx, %r9
.L65:
	movabsq	$-8543223828751151131, %r10
	movq	%r9, %rax
	imulq	%r10
	movq	%r9, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r9), %r11
	sarq	$29, %r11
	subq	%rax, %r11
	imulq	$1000000007, %r11, %rax
	movq	%r9, %r11
	subq	%rax, %r11
	movq	%rsi, %rax
	imulq	%r10
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	movl	%edx, %r9d
	testl	%edx, %edx
	jle	.L67
	movl	$1000000006, %ecx
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L69:
	movslq	%ecx, %rcx
	testb	$1, %r9b
	je	.L68
	movslq	%edi, %rdi
	imulq	%rcx, %rdi
	movq	%rdi, %rax
	imulq	%r10
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
.L68:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r10
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	sarl	%r9d
	jne	.L69
	movslq	%edi, %rdi
	imulq	%r11, %rdi
	movq	%rdi, %rax
	imulq	%r10
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %r11
.L67:
	movabsq	$-8543223828751151131, %rdi
	movq	%rsi, %rax
	imulq	%rdi
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, %rdx
	testq	%rsi, %rsi
	jle	.L70
	movslq	%esi, %rax
	subl	$1, %edx
	movl	$1, %ecx
	leaq	-1(%rax), %rsi
	movq	%rsi, %r9
	subq	%rdx, %r9
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L104:
	subq	$1, %rsi
.L71:
	movslq	%ecx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	mulq	%rdi
	movq	%rsi, %rax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %ecx
	cmpq	%rsi, %r9
	jne	.L104
	movslq	%ecx, %rcx
	imulq	%r11, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r11
.L70:
	movl	%r11d, %esi
	cmpq	$1, %r11
	jle	.L72
	movl	$1, %edi
	movl	$-1000000007, %r10d
	movabsq	$-8543223828751151131, %r11
	movl	$1000000007, %r9d
	.p2align 4,,10
	.p2align 3
.L73:
	movl	%r10d, %eax
	movslq	%edi, %rdi
	cltd
	idivl	%esi
	leal	1000000007(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	%rdi, %rcx
	movq	%rcx, %rax
	movl	%ecx, %edi
	mulq	%r11
	movl	%r9d, %eax
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rdx
	subl	%edx, %edi
	cltd
	idivl	%esi
	movl	%edx, %esi
	cmpl	$1, %edx
	jg	.L73
	movslq	%edi, %rdi
	imulq	%r8, %rdi
	movq	%rdi, %rax
	imulq	%r11
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %r8
.L72:
	movl	%r8d, %eax
.L45:
	ret
	.p2align 4,,10
	.p2align 3
.L46:
	xorl	%r9d, %r9d
	testq	%rsi, %rsi
	jg	.L49
	movq	%r10, %rsi
	subq	%rdi, %rsi
	testq	%rsi, %rsi
	jg	.L50
	movabsq	$-8543223828751151131, %rdx
	movq	%r10, %rax
	imulq	%rdx
	leaq	(%rdx,%r10), %rax
	movq	%r10, %rdx
	sarq	$29, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	movl	%eax, %r9d
	testl	%eax, %eax
	jg	.L51
	movl	$1, %r9d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, %r9d
	jmp	.L58
.L78:
	movl	$1, %r9d
	jmp	.L62
	.cfi_endproc
.LFE58:
	.size	calc_comb, .-calc_comb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%li%li%li"
.LC1:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB59:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbp
	movq	8(%rsp), %rbx
	movq	16(%rsp), %rax
	movq	%rbp, %rdi
	imulq	%rbx, %rdi
	leaq	-2(%rax), %rsi
	subq	$2, %rdi
	call	calc_comb
	movslq	%eax, %r10
	cmpq	$1, %rbx
	jle	.L111
	movslq	%r10d, %r11
	leaq	-1(%rbx), %r9
	xorl	%r8d, %r8d
	movabsq	$-8543223828751151131, %rdi
	movq	%r11, %rsi
	.p2align 4,,10
	.p2align 3
.L107:
	movq	%rsi, %rax
	movq	%rsi, %rcx
	imulq	%rdi
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	addq	%r11, %rsi
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r9, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbp, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbp, %rcx
	addq	%r8, %rcx
	movq	%rcx, %rax
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rcx), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	subq	$1, %r9
	jne	.L107
.L106:
	cmpq	$1, %rbp
	jle	.L108
	leaq	-1(%rbp), %rsi
	movq	%r10, %rdi
	movabsq	$-8543223828751151131, %r9
	.p2align 4,,10
	.p2align 3
.L109:
	movq	%rdi, %rax
	movq	%rdi, %rcx
	imulq	%r9
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	addq	%r10, %rdi
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rsi, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbx, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbx, %rcx
	addq	%r8, %rcx
	movq	%rcx, %rax
	imulq	%r9
	movq	%rcx, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rcx), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	subq	$1, %rsi
	jne	.L109
.L108:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L115
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L111:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L106
.L115:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE59:
	.size	run, .-run
	.p2align 4
	.globl	gen
	.type	gen, @function
gen:
.LFB60:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE60:
	.size	gen, .-gen
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB61:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE61:
	.size	main, .-main
	.globl	f
	.section	.rodata
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.long	10000000
	.globl	iFact
	.bss
	.align 8
	.type	iFact, @object
	.size	iFact, 8
iFact:
	.zero	8
	.globl	fact
	.align 8
	.type	fact, @object
	.size	fact, 8
fact:
	.zero	8
	.globl	mod
	.section	.rodata
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.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>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

const i32 mod = 1000000007;

#define ADD(x, a) do{(x) += (a); if ((x) >= mod) (x) -= mod;} while (0)
#define SUB(x, a) do{(x) += mod - (a); if ((x) >= mod) (x) -= mod;} while (0)

i32 inv (i32 a) {
  i32 t = 1;
  while (a > 1) {
    t = (i64) t * (mod - mod / a) % mod;
    a = mod % a;
  }
  return t;
}

i32 mod_pow (i32 r, i32 n) {
  i32 t = 1;
  i32 s = r;
  while (n > 0) {
    if (n & 1) t = (i64) t * s % mod;
    s = (i64) s * s % mod;
    n >>= 1;
  }
  return t;
}

i32 *fact = NULL;
i32 *iFact = NULL;
void init_fact (const i32 n) {
  fact = (i32 *) calloc (n + 1, sizeof (i32));
  fact[0] = 1;
  for (i32 i = 1; i <= n; ++i) {
    fact[i] = (i64) i * fact[i - 1] % mod;
  }
  iFact = (i32 *) calloc (n + 1, sizeof (i32));
  iFact[n] = inv (fact[n]);
  for (i32 i = n - 1; i >= 0; --i) {
    iFact[i] = (i64) (i + 1) * iFact[i + 1] % mod;
  }
}

i32 perm (i32 n, i32 k) {
  if (!(0 <=k && k <= n)) return 0;
  return (i64) fact[n] * iFact[n - k] % mod;
}

i32 comb (i32 n, i32 k) {
  if (!(0 <= k && k <= n)) return 0;
  return (i64) fact[n] * iFact[k] % mod * iFact[n - k] % mod;
}

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) > (0) ? (a) : -(a))

const i32 f = 10000000;

i64 func (i64 n) {
  i64 sum = 0;
  while (n > 0) {
    sum += n / mod;
    n /= mod;
  }
  return sum;
}

i32 calc_fact (i32 n) {
  i32 res = 1;
  while (n > 0) {
    res = (i64) res * n % mod;
    n--;
  }
  return res;
}

i32 calc_comb (i64 n, i64 k) {
  if (func (n) - func (k) - func (n - k) > 0) {
    return 0;
  }
  i32 nu = (i64) mod_pow (mod - 1, n / mod) * calc_fact (n % mod) % mod;
  i32 de = (i64) mod_pow (mod - 1, k / mod) * calc_fact (k % mod) % mod * mod_pow (mod - 1, (n - k) / mod) % mod * calc_fact ((n - k) % mod) % mod;
  return (i64) nu * inv (de) % mod;
}

void run (void) {
  i64 n, m, k;
  scanf ("%" SCNi64 "%" SCNi64 "%" SCNi64, &n, &m, &k);
  //init_fact (n * m);
  i64 ans = 0;
  i32 c = calc_comb (n * m - 2, k - 2);
  for (i32 d = 1; d < m; ++d) {
    ans = (ans + (i64) c * d % mod * (m - d) % mod * n % mod * n) % mod;
  }
  for (i32 d = 1; d < n; ++d) {
    ans = (ans + (i64) c * d % mod * (n - d) % mod * m % mod * m) % mod;
  }
  printf ("%" PRIi64 "\n", ans);
}

void gen (void) {
  
}

int main (void) {
  run();
  return 0;
}

100 100 4270
 100 100 619
 100 101 619
 110 101 619
 110 101 767
 110 111 767
 110 111 32
 110 111 3
 100 111 3
 110 101 3

600569999
 22903271
 540551573
 276779273
 629598785
 235468303
 100550006
 864350703
 25289126
 105547536

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>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

const i32 mod = 1000000007;

#define ADD(x, a) do{(x) += (a); if ((x) >= mod) (x) -= mod;} while (0)
#define SUB(x, a) do{(x) += mod - (a); if ((x) >= mod) (x) -= mod;} while (0)

i32 inv (i32 a) {
  i32 t = 1;
  while (a > 1) {
    t = (i64) t * (mod - mod / a) % mod;
    a = mod % a;
  }
  return t;
}

i32 mod_pow (i32 r, i32 n) {
  i32 t = 1;
  i32 s = r;
  while (n > 0) {
    if (n & 1) t = (i64) t * s % mod;
    s = (i64) s * s % mod;
    n >>= 1;
  }
  return t;
}

i32 *fact = NULL;
i32 *iFact = NULL;
void init_fact (const i32 n) {
  fact = (i32 *) calloc (n + 1, sizeof (i32));
  fact[0] = 1;
  for (i32 i = 1; i <= n; ++i) {
    fact[i] = (i64) i * fact[i - 1] % mod;
  }
  iFact = (i32 *) calloc (n + 1, sizeof (i32));
  iFact[n] = inv (fact[n]);
  for (i32 i = n - 1; i >= 0; --i) {
    iFact[i] = (i64) (i + 1) * iFact[i + 1] % mod;
  }
}

i32 perm (i32 n, i32 k) {
  if (!(0 <=k && k <= n)) return 0;
  return (i64) fact[n] * iFact[n - k] % mod;
}

i32 comb (i32 n, i32 k) {
  if (!(0 <= k && k <= n)) return 0;
  return (i64) fact[n] * iFact[k] % mod * iFact[n - k] % mod;
}

#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) > (0) ? (a) : -(a))

const i32 f = 10000000;

i64 func (i64 n) {
  i64 sum = 0;
  while (n > 0) {
    sum += n / mod;
    n /= mod;
  }
  return sum;
}

i32 calc_fact (i32 n) {
  i32 res = 1;
  while (n > 0) {
    res = (i64) res * n % mod;
    n--;
  }
  return res;
}

i32 calc_comb (i64 n, i64 k) {
  if (func (n) - func (k) - func (n - k) > 0) {
    return 0;
  }
  i32 nu = (i64) mod_pow (mod - 1, n / mod) * calc_fact (n % mod) % mod;
  i32 de = (i64) mod_pow (mod - 1, k / mod) * calc_fact (k % mod) % mod * mod_pow (mod - 1, (n - k) / mod) % mod * calc_fact ((n - k) % mod) % mod;
  return (i64) nu * inv (de) % mod;
}

void run (void) {
  i64 n, m, k;
  scanf ("%" SCNi64 "%" SCNi64 "%" SCNi64, &n, &m, &k);
  //init_fact (n * m);
  i64 ans = 0;
  i32 c = calc_comb (n * m - 2, k - 2);
  for (i32 d = 1; d < m; ++d) {
    ans = (ans + (i64) c * d % mod * (m - d) % mod * n % mod * n) % mod;
  }
  for (i32 d = 1; d < n; ++d) {
    ans = (ans + (i64) c * d % mod * (n - d) % mod * m % mod * m) % mod;
  }
  printf ("%" PRIi64 "\n", ans);
}

void gen (void) {
  
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mod
	.section	.rodata
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.text
	.globl	inv
	.type	inv, @function
inv:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	$1000000007, %esi
	movl	$1000000007, %eax
	cltd
	idivl	-20(%rbp)
	movl	%eax, %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	movl	$1000000007, %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, -20(%rbp)
.L2:
	cmpl	$1, -20(%rbp)
	jg	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	inv, .-inv
	.globl	mod_pow
	.type	mod_pow, @function
mod_pow:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$1, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L8:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -8(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	sarl	-24(%rbp)
.L6:
	cmpl	$0, -24(%rbp)
	jg	.L8
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mod_pow, .-mod_pow
	.globl	fact
	.bss
	.align 8
	.type	fact, @object
	.size	fact, 8
fact:
	.zero	8
	.globl	iFact
	.align 8
	.type	iFact, @object
	.size	iFact, 8
iFact:
	.zero	8
	.text
	.globl	init_fact
	.type	init_fact, @function
init_fact:
.LFB8:
	.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	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, fact(%rip)
	movq	fact(%rip), %rax
	movl	$1, (%rax)
	movl	$1, -24(%rbp)
	jmp	.L11
.L12:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	fact(%rip), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	subq	$4, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	fact(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L12
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, iFact(%rip)
	movq	fact(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movq	iFact(%rip), %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	(%rcx,%rdx), %rbx
	movl	%eax, %edi
	call	inv
	movl	%eax, (%rbx)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L14:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	iFact(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	subl	$1, -20(%rbp)
.L13:
	cmpl	$0, -20(%rbp)
	jns	.L14
	nop
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	init_fact, .-init_fact
	.globl	perm
	.type	perm, @function
perm:
.LFB9:
	.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)
	cmpl	$0, -8(%rbp)
	js	.L16
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L17
.L16:
	movl	$0, %eax
	jmp	.L18
.L17:
	movq	fact(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L18:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	perm, .-perm
	.globl	comb
	.type	comb, @function
comb:
.LFB10:
	.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)
	cmpl	$0, -8(%rbp)
	js	.L20
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L21
.L20:
	movl	$0, %eax
	jmp	.L22
.L21:
	movq	fact(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	iFact(%rip), %rdx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	comb, .-comb
	.globl	f
	.section	.rodata
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.long	10000000
	.text
	.globl	func
	.type	func, @function
func:
.LFB11:
	.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	$0, -8(%rbp)
	jmp	.L24
.L25:
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	addq	%rax, -8(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-24(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -24(%rbp)
.L24:
	cmpq	$0, -24(%rbp)
	jg	.L25
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	func, .-func
	.globl	calc_fact
	.type	calc_fact, @function
calc_fact:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L28
.L29:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	subl	$1, -20(%rbp)
.L28:
	cmpl	$0, -20(%rbp)
	jg	.L29
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	calc_fact, .-calc_fact
	.globl	calc_comb
	.type	calc_comb, @function
calc_comb:
.LFB13:
	.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	$32, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -32(%rbp)
	movq	%rsi, -40(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	func
	movq	%rax, %rbx
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	func
	subq	%rax, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	func
	movq	%rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L32
	movl	$0, %eax
	jmp	.L33
.L32:
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	movslq	%eax, %rbx
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -16(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	movslq	%eax, %rbx
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rsi
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	movslq	%eax, %rbx
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	inv
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L33:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	calc_comb, .-calc_comb
	.section	.rodata
.LC0:
	.string	"%li%li%li"
.LC1:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	movq	-24(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-40(%rbp), %rcx
	movq	-32(%rbp), %rax
	imulq	%rcx, %rax
	subq	$2, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	calc_comb
	movl	%eax, -44(%rbp)
	movl	$1, -52(%rbp)
	jmp	.L35
.L36:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-40(%rbp), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-40(%rbp), %rax
	imulq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
	addl	$1, -52(%rbp)
.L35:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L36
	movl	$1, -48(%rbp)
	jmp	.L37
.L38:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-48(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-40(%rbp), %rax
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-32(%rbp), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-32(%rbp), %rax
	imulq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
	addl	$1, -48(%rbp)
.L37:
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L38
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	run, .-run
	.globl	gen
	.type	gen, @function
gen:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	gen, .-gen
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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	mod
	.section	.rodata
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.text
	.globl	inv
	.type	inv, @function
inv:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	$1000000007, %esi
	movl	$1000000007, %eax
	cltd
	idivl	-20(%rbp)
	movl	%eax, %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	movl	$1000000007, %eax
	cltd
	idivl	-20(%rbp)
	movl	%edx, -20(%rbp)
.L2:
	cmpl	$1, -20(%rbp)
	jg	.L3
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	inv, .-inv
	.globl	mod_pow
	.type	mod_pow, @function
mod_pow:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$1, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L8:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -8(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	sarl	-24(%rbp)
.L6:
	cmpl	$0, -24(%rbp)
	jg	.L8
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mod_pow, .-mod_pow
	.globl	fact
	.bss
	.align 8
	.type	fact, @object
	.size	fact, 8
fact:
	.zero	8
	.globl	iFact
	.align 8
	.type	iFact, @object
	.size	iFact, 8
iFact:
	.zero	8
	.text
	.globl	init_fact
	.type	init_fact, @function
init_fact:
.LFB8:
	.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	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, fact(%rip)
	movq	fact(%rip), %rax
	movl	$1, (%rax)
	movl	$1, -24(%rbp)
	jmp	.L11
.L12:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	fact(%rip), %rcx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	subq	$4, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	fact(%rip), %rdx
	movl	-24(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L12
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, iFact(%rip)
	movq	fact(%rip), %rdx
	movl	-36(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movq	iFact(%rip), %rcx
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	(%rcx,%rdx), %rbx
	movl	%eax, %edi
	call	inv
	movl	%eax, (%rbx)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L14:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-20(%rbp), %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	iFact(%rip), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	%ecx, %edx
	movl	%edx, (%rax)
	subl	$1, -20(%rbp)
.L13:
	cmpl	$0, -20(%rbp)
	jns	.L14
	nop
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	init_fact, .-init_fact
	.globl	perm
	.type	perm, @function
perm:
.LFB9:
	.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)
	cmpl	$0, -8(%rbp)
	js	.L16
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L17
.L16:
	movl	$0, %eax
	jmp	.L18
.L17:
	movq	fact(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L18:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	perm, .-perm
	.globl	comb
	.type	comb, @function
comb:
.LFB10:
	.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)
	cmpl	$0, -8(%rbp)
	js	.L20
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L21
.L20:
	movl	$0, %eax
	jmp	.L22
.L21:
	movq	fact(%rip), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movq	iFact(%rip), %rcx
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	iFact(%rip), %rdx
	movl	-4(%rbp), %eax
	subl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	comb, .-comb
	.globl	f
	.section	.rodata
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.long	10000000
	.text
	.globl	func
	.type	func, @function
func:
.LFB11:
	.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	$0, -8(%rbp)
	jmp	.L24
.L25:
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	%rcx
	addq	%rax, -8(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-24(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -24(%rbp)
.L24:
	cmpq	$0, -24(%rbp)
	jg	.L25
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	func, .-func
	.globl	calc_fact
	.type	calc_fact, @function
calc_fact:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$1, -4(%rbp)
	jmp	.L28
.L29:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -4(%rbp)
	subl	$1, -20(%rbp)
.L28:
	cmpl	$0, -20(%rbp)
	jg	.L29
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	calc_fact, .-calc_fact
	.globl	calc_comb
	.type	calc_comb, @function
calc_comb:
.LFB13:
	.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	$32, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -32(%rbp)
	movq	%rsi, -40(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	func
	movq	%rax, %rbx
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	func
	subq	%rax, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	func
	movq	%rax, %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L32
	movl	$0, %eax
	jmp	.L33
.L32:
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	movslq	%eax, %rbx
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -16(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	movslq	%eax, %rbx
	movl	$1000000007, %eax
	movslq	%eax, %rcx
	movq	-40(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rsi
	cqto
	idivq	%rsi
	movl	%eax, %edx
	movl	$1000000007, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mod_pow
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rbx
	movq	-32(%rbp), %rax
	subq	-40(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, %edi
	call	calc_fact
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	movslq	%eax, %rbx
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	inv
	cltq
	imulq	%rbx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
.L33:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	calc_comb, .-calc_comb
	.section	.rodata
.LC0:
	.string	"%li%li%li"
.LC1:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	movq	-24(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-40(%rbp), %rcx
	movq	-32(%rbp), %rax
	imulq	%rcx, %rax
	subq	$2, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	calc_comb
	movl	%eax, -44(%rbp)
	movl	$1, -52(%rbp)
	jmp	.L35
.L36:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-52(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-32(%rbp), %rax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-40(%rbp), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-40(%rbp), %rax
	imulq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
	addl	$1, -52(%rbp)
.L35:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L36
	movl	$1, -48(%rbp)
	jmp	.L37
.L38:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-48(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-40(%rbp), %rax
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-32(%rbp), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-32(%rbp), %rax
	imulq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
	addl	$1, -48(%rbp)
.L37:
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L38
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	run, .-run
	.globl	gen
	.type	gen, @function
gen:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	gen, .-gen
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.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:
