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>

const int Mod = 1000000007;

long long div_mod(long long x, long long y, long long z)
{
	if (x % y == 0) return x / y;
	else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}

int main()
{
	int N, M;
	scanf("%d %d", &N, &M);
	
	int i;
	long long fact[500001], fact_inv[500001];
	for (i = 1, fact[0] = 1; i <= M; i++) fact[i] = fact[i-1] * i % Mod;
	for (i = M - 1, fact_inv[M] = div_mod(1, fact[M], Mod); i >= 0; i--) fact_inv[i] = fact_inv[i+1] * (i + 1) % Mod;
	
	long long ans = fact[M] * fact_inv[M-N] % Mod;
	for (i = 1; i <= N; i++) {
		if (i % 2 == 0) ans = (ans + fact[N] * fact_inv[i] % Mod * fact_inv[N-i] % Mod * fact[M-i] % Mod * fact_inv[M-N] % Mod + Mod) % Mod;
		else ans = (ans - fact[N] * fact_inv[i] % Mod * fact_inv[N-i] % Mod * fact[M-i] % Mod * fact_inv[M-N] % Mod + Mod) % Mod;
	}
	
	printf("%lld\n", ans * fact[M] % Mod * fact_inv[M-N] % Mod);
	fflush(stdout);
	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	div_mod
	.type	div_mod, @function
div_mod:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rcx
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	addq	$1, %rax
	imulq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	div_mod
	imulq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-16(%rbp)
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	div_mod, .-div_mod
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-7999488(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$584, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-8000064(%rbp), %rdx
	leaq	-8000068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8000060(%rbp)
	movq	$1, -8000048(%rbp)
	jmp	.L5
.L6:
	movl	-8000060(%rbp), %eax
	subl	$1, %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000060(%rbp), %eax
	cltq
	movq	%rdx, -8000048(%rbp,%rax,8)
	addl	$1, -8000060(%rbp)
.L5:
	movl	-8000064(%rbp), %eax
	cmpl	%eax, -8000060(%rbp)
	jle	.L6
	movl	-8000064(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8000060(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rdx
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	movl	-8000064(%rbp), %ebx
	movq	%rax, %rsi
	movl	$1, %edi
	call	div_mod
	movslq	%ebx, %rdx
	movq	%rax, -4000032(%rbp,%rdx,8)
	jmp	.L7
.L8:
	movl	-8000060(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	addl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000060(%rbp), %eax
	cltq
	movq	%rdx, -4000032(%rbp,%rax,8)
	subl	$1, -8000060(%rbp)
.L7:
	cmpl	$0, -8000060(%rbp)
	jns	.L8
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %ecx
	subl	%ecx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
	movl	$1, -8000060(%rbp)
	jmp	.L9
.L12:
	movl	-8000060(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L10
	movl	-8000068(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000068(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000064(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-8000056(%rbp), %rax
	addq	%rax, %rdx
	movl	$1000000007, %eax
	cltq
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
	jmp	.L11
.L10:
	movl	-8000068(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000068(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000064(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-8000056(%rbp), %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	movl	$1000000007, %eax
	cltq
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
.L11:
	addl	$1, -8000060(%rbp)
.L9:
	movl	-8000068(%rbp), %eax
	cmpl	%eax, -8000060(%rbp)
	jle	.L12
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	-8000056(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	div_mod
	.type	div_mod, @function
div_mod:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	cqto
	idivq	%rsi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testq	%rdx, %rdx
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movq	%rax, %r12
	movq	%r13, %rax
	movq	%rdi, %rbp
	movq	%rsi, %rbx
	cqto
	addq	$1, %r12
	idivq	%rsi
	imulq	%rsi, %r12
	subq	%rdi, %r12
	movq	%r12, %rax
	movq	%rdx, %r14
	cqto
	idivq	%r14
	movq	%rax, %r8
	testq	%rdx, %rdx
	jne	.L17
.L3:
	imulq	%rax, %r13
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	leaq	0(%r13,%rbp), %rax
	cqto
	idivq	%rbx
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movq	%rsi, %rax
	addq	$1, %r8
	cqto
	imulq	%r14, %r8
	idivq	%r14
	subq	%r12, %r8
	movq	%r8, %rax
	movq	%rdx, %r15
	cqto
	idivq	%r15
	movq	%rax, %rdi
	testq	%rdx, %rdx
	jne	.L18
.L4:
	movq	%rdi, %rax
	imulq	%rbx, %rax
	addq	%r12, %rax
	cqto
	idivq	%r14
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r14, %rax
	addq	$1, %rdi
	movq	%r8, 8(%rsp)
	cqto
	imulq	%r15, %rdi
	idivq	%r15
	subq	%r8, %rdi
	movq	%rdx, %rsi
	movq	%r15, %rdx
	call	div_mod
	movq	8(%rsp), %r8
	imulq	%r14, %rax
	addq	%r8, %rax
	cqto
	idivq	%r15
	movq	%rax, %rdi
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	div_mod, .-div_mod
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-7999488(%rsp), %r11
	.cfi_def_cfa 11, 7999536
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$560, %rsp
	.cfi_def_cfa_offset 8000096
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8000040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	movq	$1, 16(%rsp)
	testl	%r9d, %r9d
	jle	.L42
	leal	1(%r9), %r10d
	movl	$1, %ecx
	movl	$1, %edx
	movabsq	$-8543223828751151131, %rdi
	leaq	16(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rdx, %rsi
	imulq	%rcx, %rsi
	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, (%r8,%rcx,8)
	addq	$1, %rcx
	movq	%rsi, %rdx
	cmpq	%rcx, %r10
	jne	.L23
	movslq	%r9d, %rcx
	movl	$1, %eax
	leal	-1(%r9), %r10d
	movq	16(%rsp,%rcx,8), %r12
	cqto
	idivq	%r12
	movq	%rax, %rdi
	testq	%rdx, %rdx
	jne	.L22
	movq	%rax, 4000032(%rsp,%rcx,8)
.L25:
	leal	1(%r10), %esi
	leaq	-1(%rcx), %r8
	movq	4000032(%rsp,%rcx,8), %rdx
	movabsq	$-8543223828751151131, %r11
	subq	%r10, %r8
	movslq	%esi, %rsi
	leaq	4000032(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rdx, %rdi
	imulq	%rsi, %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, -8(%r10,%rsi,8)
	subq	$1, %rsi
	movq	%rdi, %rdx
	cmpq	%r8, %rsi
	jne	.L28
.L29:
	movabsq	$-8543223828751151131, %rdi
	movl	8(%rsp), %r10d
	subl	%r10d, %r9d
	movslq	%r9d, %r9
	movq	4000032(%rsp,%r9,8), %r11
	movq	%r11, %r8
	imulq	%r12, %r8
	movq	%r8, %rax
	imulq	%rdi
	movq	%r8, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r8), %rsi
	sarq	$29, %rsi
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	movq	%r8, %rsi
	subq	%rax, %rsi
	testl	%r10d, %r10d
	jle	.L27
	movslq	%r10d, %rax
	leal	1(%r10), %r13d
	leaq	16(%rsp,%rcx,8), %rbx
	xorl	%r9d, %r9d
	leaq	4000032(%rsp), %r10
	movq	16(%rsp,%rax,8), %r14
	movl	$1, %r8d
	leaq	(%r10,%rax,8), %rbp
	.p2align 4,,10
	.p2align 3
.L32:
	movq	(%r10,%r8,8), %rcx
	imulq	%r14, %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	-8(%rbp,%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	-8(%rbx,%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	%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, %rdx
	leaq	1000000007(%rsi,%rcx), %rcx
	testb	$1, %r8b
	je	.L41
	subq	%rdx, %rsi
	movq	%rsi, %rcx
	addq	$1000000007, %rcx
.L41:
	movq	%rcx, %rax
	addq	$1, %r8
	subq	$8, %r9
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rcx), %rsi
	sarq	$29, %rsi
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	movq	%rcx, %rsi
	subq	%rax, %rsi
	cmpq	%r8, %r13
	jne	.L32
.L27:
	imulq	%r12, %rsi
	movl	$1, %edi
	movabsq	$-8543223828751151131, %rcx
	movq	%rsi, %rax
	imulq	%rcx
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rsi
	imulq	%r11, %rsi
	movq	%rsi, %rax
	imulq	%rcx
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rsi
	xorl	%eax, %eax
	movq	%rsi, %rdx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	8000040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$8000048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	movl	$1000000007, %eax
	addq	$1, %rdi
	cqto
	imulq	%r12, %rdi
	idivq	%r12
	subq	$1, %rdi
	movq	%rdx, %rsi
	movq	%r12, %rdx
	call	div_mod
	imulq	$1000000007, %rax, %rax
	addq	$1, %rax
	cqto
	idivq	%r12
	movq	%rax, 4000032(%rsp,%rcx,8)
	testl	%r10d, %r10d
	jns	.L25
	jmp	.L29
.L42:
	movslq	%r9d, %rcx
	movl	$1, %eax
	leal	-1(%r9), %r10d
	movq	16(%rsp,%rcx,8), %r12
	cqto
	idivq	%r12
	movq	%rax, %rdi
	testq	%rdx, %rdx
	jne	.L22
	movq	%rax, 4000032(%rsp,%rcx,8)
	jmp	.L29
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.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	div_mod
	.type	div_mod, @function
div_mod:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	cqto
	idivq	%rsi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testq	%rdx, %rdx
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movq	%rax, %r12
	movq	%r13, %rax
	movq	%rdi, %rbp
	movq	%rsi, %rbx
	cqto
	addq	$1, %r12
	idivq	%rsi
	imulq	%rsi, %r12
	subq	%rdi, %r12
	movq	%r12, %rax
	movq	%rdx, %r14
	cqto
	idivq	%r14
	movq	%rax, %r8
	testq	%rdx, %rdx
	jne	.L17
.L3:
	imulq	%rax, %r13
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	leaq	0(%r13,%rbp), %rax
	cqto
	idivq	%rbx
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movq	%rsi, %rax
	addq	$1, %r8
	cqto
	imulq	%r14, %r8
	idivq	%r14
	subq	%r12, %r8
	movq	%r8, %rax
	movq	%rdx, %r15
	cqto
	idivq	%r15
	movq	%rax, %rdi
	testq	%rdx, %rdx
	jne	.L18
.L4:
	movq	%rdi, %rax
	imulq	%rbx, %rax
	addq	%r12, %rax
	cqto
	idivq	%r14
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r14, %rax
	addq	$1, %rdi
	movq	%r8, 8(%rsp)
	cqto
	imulq	%r15, %rdi
	idivq	%r15
	subq	%r8, %rdi
	movq	%rdx, %rsi
	movq	%r15, %rdx
	call	div_mod
	movq	8(%rsp), %r8
	imulq	%r14, %rax
	addq	%r8, %rax
	cqto
	idivq	%r15
	movq	%rax, %rdi
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	div_mod, .-div_mod
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-7999488(%rsp), %r11
	.cfi_def_cfa 11, 7999536
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$560, %rsp
	.cfi_def_cfa_offset 8000096
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8000040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r9d
	movq	$1, 16(%rsp)
	testl	%r9d, %r9d
	jle	.L42
	leal	1(%r9), %r10d
	movl	$1, %ecx
	movl	$1, %edx
	movabsq	$-8543223828751151131, %rdi
	leaq	16(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rdx, %rsi
	imulq	%rcx, %rsi
	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, (%r8,%rcx,8)
	addq	$1, %rcx
	movq	%rsi, %rdx
	cmpq	%rcx, %r10
	jne	.L23
	movslq	%r9d, %rcx
	movl	$1, %eax
	leal	-1(%r9), %r10d
	movq	16(%rsp,%rcx,8), %r12
	cqto
	idivq	%r12
	movq	%rax, %rdi
	testq	%rdx, %rdx
	jne	.L22
	movq	%rax, 4000032(%rsp,%rcx,8)
.L25:
	leal	1(%r10), %esi
	leaq	-1(%rcx), %r8
	movq	4000032(%rsp,%rcx,8), %rdx
	movabsq	$-8543223828751151131, %r11
	subq	%r10, %r8
	movslq	%esi, %rsi
	leaq	4000032(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rdx, %rdi
	imulq	%rsi, %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, -8(%r10,%rsi,8)
	subq	$1, %rsi
	movq	%rdi, %rdx
	cmpq	%r8, %rsi
	jne	.L28
.L29:
	movabsq	$-8543223828751151131, %rdi
	movl	8(%rsp), %r10d
	subl	%r10d, %r9d
	movslq	%r9d, %r9
	movq	4000032(%rsp,%r9,8), %r11
	movq	%r11, %r8
	imulq	%r12, %r8
	movq	%r8, %rax
	imulq	%rdi
	movq	%r8, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r8), %rsi
	sarq	$29, %rsi
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	movq	%r8, %rsi
	subq	%rax, %rsi
	testl	%r10d, %r10d
	jle	.L27
	movslq	%r10d, %rax
	leal	1(%r10), %r13d
	leaq	16(%rsp,%rcx,8), %rbx
	xorl	%r9d, %r9d
	leaq	4000032(%rsp), %r10
	movq	16(%rsp,%rax,8), %r14
	movl	$1, %r8d
	leaq	(%r10,%rax,8), %rbp
	.p2align 4,,10
	.p2align 3
.L32:
	movq	(%r10,%r8,8), %rcx
	imulq	%r14, %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	-8(%rbp,%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	-8(%rbx,%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	%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, %rdx
	leaq	1000000007(%rsi,%rcx), %rcx
	testb	$1, %r8b
	je	.L41
	subq	%rdx, %rsi
	movq	%rsi, %rcx
	addq	$1000000007, %rcx
.L41:
	movq	%rcx, %rax
	addq	$1, %r8
	subq	$8, %r9
	imulq	%rdi
	movq	%rcx, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rcx), %rsi
	sarq	$29, %rsi
	subq	%rax, %rsi
	imulq	$1000000007, %rsi, %rax
	movq	%rcx, %rsi
	subq	%rax, %rsi
	cmpq	%r8, %r13
	jne	.L32
.L27:
	imulq	%r12, %rsi
	movl	$1, %edi
	movabsq	$-8543223828751151131, %rcx
	movq	%rsi, %rax
	imulq	%rcx
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rsi
	imulq	%r11, %rsi
	movq	%rsi, %rax
	imulq	%rcx
	leaq	(%rdx,%rsi), %rax
	movq	%rsi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %rsi
	xorl	%eax, %eax
	movq	%rsi, %rdx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	8000040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$8000048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	movl	$1000000007, %eax
	addq	$1, %rdi
	cqto
	imulq	%r12, %rdi
	idivq	%r12
	subq	$1, %rdi
	movq	%rdx, %rsi
	movq	%r12, %rdx
	call	div_mod
	imulq	$1000000007, %rax, %rax
	addq	$1, %rax
	cqto
	idivq	%r12
	movq	%rax, 4000032(%rsp,%rcx,8)
	testl	%r10d, %r10d
	jns	.L25
	jmp	.L29
.L42:
	movslq	%r9d, %rcx
	movl	$1, %eax
	leal	-1(%r9), %r10d
	movq	16(%rsp,%rcx,8), %r12
	cqto
	idivq	%r12
	movq	%rax, %rdi
	testq	%rdx, %rdx
	jne	.L22
	movq	%rax, 4000032(%rsp,%rcx,8)
	jmp	.L29
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.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>

const int Mod = 1000000007;

long long div_mod(long long x, long long y, long long z)
{
	if (x % y == 0) return x / y;
	else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}

int main()
{
	int N, M;
	scanf("%d %d", &N, &M);
	
	int i;
	long long fact[500001], fact_inv[500001];
	for (i = 1, fact[0] = 1; i <= M; i++) fact[i] = fact[i-1] * i % Mod;
	for (i = M - 1, fact_inv[M] = div_mod(1, fact[M], Mod); i >= 0; i--) fact_inv[i] = fact_inv[i+1] * (i + 1) % Mod;
	
	long long ans = fact[M] * fact_inv[M-N] % Mod;
	for (i = 1; i <= N; i++) {
		if (i % 2 == 0) ans = (ans + fact[N] * fact_inv[i] % Mod * fact_inv[N-i] % Mod * fact[M-i] % Mod * fact_inv[M-N] % Mod + Mod) % Mod;
		else ans = (ans - fact[N] * fact_inv[i] % Mod * fact_inv[N-i] % Mod * fact[M-i] % Mod * fact_inv[M-N] % Mod + Mod) % Mod;
	}
	
	printf("%lld\n", ans * fact[M] % Mod * fact_inv[M-N] % Mod);
	fflush(stdout);
	return 0;
}
1 2
 2 6
 0 2
 2 4
 1 4
 3 4
 141421 225813
 1 1
 1 6
 2 7

2
 630
 1
 84
 12
 264
 288699586
 0
 30
 1302

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>

const int Mod = 1000000007;

long long div_mod(long long x, long long y, long long z)
{
	if (x % y == 0) return x / y;
	else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}

int main()
{
	int N, M;
	scanf("%d %d", &N, &M);
	
	int i;
	long long fact[500001], fact_inv[500001];
	for (i = 1, fact[0] = 1; i <= M; i++) fact[i] = fact[i-1] * i % Mod;
	for (i = M - 1, fact_inv[M] = div_mod(1, fact[M], Mod); i >= 0; i--) fact_inv[i] = fact_inv[i+1] * (i + 1) % Mod;
	
	long long ans = fact[M] * fact_inv[M-N] % Mod;
	for (i = 1; i <= N; i++) {
		if (i % 2 == 0) ans = (ans + fact[N] * fact_inv[i] % Mod * fact_inv[N-i] % Mod * fact[M-i] % Mod * fact_inv[M-N] % Mod + Mod) % Mod;
		else ans = (ans - fact[N] * fact_inv[i] % Mod * fact_inv[N-i] % Mod * fact[M-i] % Mod * fact_inv[M-N] % Mod + Mod) % Mod;
	}
	
	printf("%lld\n", ans * fact[M] % Mod * fact_inv[M-N] % Mod);
	fflush(stdout);
	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	div_mod
	.type	div_mod, @function
div_mod:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rcx
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	addq	$1, %rax
	imulq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	div_mod
	imulq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-16(%rbp)
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	div_mod, .-div_mod
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-7999488(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$584, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-8000064(%rbp), %rdx
	leaq	-8000068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8000060(%rbp)
	movq	$1, -8000048(%rbp)
	jmp	.L5
.L6:
	movl	-8000060(%rbp), %eax
	subl	$1, %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000060(%rbp), %eax
	cltq
	movq	%rdx, -8000048(%rbp,%rax,8)
	addl	$1, -8000060(%rbp)
.L5:
	movl	-8000064(%rbp), %eax
	cmpl	%eax, -8000060(%rbp)
	jle	.L6
	movl	-8000064(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8000060(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rdx
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	movl	-8000064(%rbp), %ebx
	movq	%rax, %rsi
	movl	$1, %edi
	call	div_mod
	movslq	%ebx, %rdx
	movq	%rax, -4000032(%rbp,%rdx,8)
	jmp	.L7
.L8:
	movl	-8000060(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	addl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000060(%rbp), %eax
	cltq
	movq	%rdx, -4000032(%rbp,%rax,8)
	subl	$1, -8000060(%rbp)
.L7:
	cmpl	$0, -8000060(%rbp)
	jns	.L8
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %ecx
	subl	%ecx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
	movl	$1, -8000060(%rbp)
	jmp	.L9
.L12:
	movl	-8000060(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L10
	movl	-8000068(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000068(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000064(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-8000056(%rbp), %rax
	addq	%rax, %rdx
	movl	$1000000007, %eax
	cltq
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
	jmp	.L11
.L10:
	movl	-8000068(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000068(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000064(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-8000056(%rbp), %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	movl	$1000000007, %eax
	cltq
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
.L11:
	addl	$1, -8000060(%rbp)
.L9:
	movl	-8000068(%rbp), %eax
	cmpl	%eax, -8000060(%rbp)
	jle	.L12
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	-8000056(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	div_mod
	.type	div_mod, @function
div_mod:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L2
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	movq	%rdx, %rcx
	movq	-8(%rbp), %rax
	cqto
	idivq	-16(%rbp)
	addq	$1, %rax
	imulq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	div_mod
	imulq	-24(%rbp), %rax
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-16(%rbp)
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	div_mod, .-div_mod
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-7999488(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$584, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-8000064(%rbp), %rdx
	leaq	-8000068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8000060(%rbp)
	movq	$1, -8000048(%rbp)
	jmp	.L5
.L6:
	movl	-8000060(%rbp), %eax
	subl	$1, %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000060(%rbp), %eax
	cltq
	movq	%rdx, -8000048(%rbp,%rax,8)
	addl	$1, -8000060(%rbp)
.L5:
	movl	-8000064(%rbp), %eax
	cmpl	%eax, -8000060(%rbp)
	jle	.L6
	movl	-8000064(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8000060(%rbp)
	movl	$1000000007, %eax
	movslq	%eax, %rdx
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	movl	-8000064(%rbp), %ebx
	movq	%rax, %rsi
	movl	$1, %edi
	call	div_mod
	movslq	%ebx, %rdx
	movq	%rax, -4000032(%rbp,%rdx,8)
	jmp	.L7
.L8:
	movl	-8000060(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	addl	$1, %eax
	cltq
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000060(%rbp), %eax
	cltq
	movq	%rdx, -4000032(%rbp,%rax,8)
	subl	$1, -8000060(%rbp)
.L7:
	cmpl	$0, -8000060(%rbp)
	jns	.L8
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %ecx
	subl	%ecx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
	movl	$1, -8000060(%rbp)
	jmp	.L9
.L12:
	movl	-8000060(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L10
	movl	-8000068(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000068(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000064(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	-8000056(%rbp), %rax
	addq	%rax, %rdx
	movl	$1000000007, %eax
	cltq
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
	jmp	.L11
.L10:
	movl	-8000068(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rdx
	movl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000068(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movl	-8000064(%rbp), %eax
	subl	-8000060(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movq	-8000056(%rbp), %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	movl	$1000000007, %eax
	cltq
	addq	%rdx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8000056(%rbp)
.L11:
	addl	$1, -8000060(%rbp)
.L9:
	movl	-8000068(%rbp), %eax
	cmpl	%eax, -8000060(%rbp)
	jle	.L12
	movl	-8000064(%rbp), %eax
	cltq
	movq	-8000048(%rbp,%rax,8), %rax
	imulq	-8000056(%rbp), %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-8000064(%rbp), %eax
	movl	-8000068(%rbp), %edx
	subl	%edx, %eax
	cltq
	movq	-4000032(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	movl	$1000000007, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
