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

```c
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MOD			1000000007								// 除数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpT, *szpFpA;
#endif

// パターン数取得
long long
fGetPtn(
	int piCnt					// <I> 数
)
{
	long long llRet = 1;
	while (piCnt > 1) {
		llRet = llRet * (long long)piCnt % D_MOD;
		piCnt--;
	}

	return llRet;
}

// 実行メイン
int
fMain(
	int piTNo					// <I> テスト番号 1～
)
{
	char lc1Buf[1024], lc1Out[1024];

	// テストファイルオープン
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpT = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#endif

	// 犬数・猿数取得
	int liDCnt, liMCnt;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d", &liDCnt, &liMCnt);

	// 差
	int liDF = abs(liDCnt - liMCnt);

	// 全パターン数
	long long llSum = 0;
	if (liDF < 2) {
		llSum = fGetPtn(liDCnt) * fGetPtn(liMCnt) % D_MOD;
		if (liDF == 0) {
			llSum = llSum * (long long)2 % D_MOD;
		}
	}

	// 結果セット
	sprintf(lc1Out, "%lld\n", llSum);

	// 結果表示
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, lc1Out)) {
		siRes = -1;
	}
#else
	printf("%s", lc1Out);
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpT);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", piTNo);
	}
	else {
		printf("NG %d\n", piTNo);
	}
#endif

	return 0;
}

int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		fMain(i);
	}
#else
	fMain(0);
#endif

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	fGetPtn
	.type	fGetPtn, @function
fGetPtn:
.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)
	movq	$1, -8(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	subl	$1, -20(%rbp)
.L2:
	cmpl	$1, -20(%rbp)
	jg	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fGetPtn, .-fGetPtn
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%s"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB7:
	.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	$2120, %rsp
	.cfi_offset 3, -24
	movl	%edi, -2116(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-2080(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2096(%rbp), %rcx
	leaq	-2100(%rbp), %rdx
	leaq	-2080(%rbp), %rax
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-2100(%rbp), %eax
	movl	-2096(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -2092(%rbp)
	movq	$0, -2088(%rbp)
	cmpl	$1, -2092(%rbp)
	jg	.L6
	movl	-2100(%rbp), %eax
	movl	%eax, %edi
	call	fGetPtn
	movq	%rax, %rbx
	movl	-2096(%rbp), %eax
	movl	%eax, %edi
	call	fGetPtn
	imulq	%rax, %rbx
	movq	%rbx, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	movq	-2088(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	cmpl	$0, -2092(%rbp)
	jne	.L6
	movq	-2088(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	movq	-2088(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
.L6:
	movq	-2088(%rbp), %rdx
	leaq	-1056(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fMain, .-fMain
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %edi
	call	fMain
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	fGetPtn
	.type	fGetPtn, @function
fGetPtn:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	jle	.L4
	movslq	%edi, %rcx
	leal	-2(%rdi), %eax
	movl	$1, %edx
	movabsq	$-8543223828751151131, %rdi
	leaq	-1(%rcx), %rsi
	movq	%rsi, %r8
	subq	%rax, %r8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	subq	$1, %rsi
.L3:
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rcx
	cmpq	%r8, %rsi
	jne	.L7
	movq	%rdx, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %edx
	movq	%rdx, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	fGetPtn, .-fGetPtn
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%s"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$1024, %esi
	subq	$2080, %rsp
	.cfi_def_cfa_offset 2096
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 2072(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	movq	%r12, %rdi
	call	fgets@PLT
	leaq	8(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	.LC0(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	8(%rsp), %r9d
	movl	12(%rsp), %edi
	movl	%r9d, %edx
	subl	%edi, %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	xorl	%r8d, %r8d
	cmpl	$1, %eax
	jle	.L21
.L9:
	leaq	1040(%rsp), %r12
	movl	$1024, %edx
	movl	$1, %esi
	xorl	%eax, %eax
	movq	%r12, %rdi
	leaq	.LC1(%rip), %rcx
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	2072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$2080, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	cmpl	$1, %r9d
	jle	.L16
	movslq	%r9d, %rcx
	leal	-2(%r9), %eax
	movl	$1, %r8d
	movabsq	$-8543223828751151131, %r10
	leaq	-1(%rcx), %rsi
	movq	%rsi, %r11
	subq	%rax, %r11
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	subq	$1, %rsi
.L11:
	imulq	%r8, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	movq	%rsi, %rcx
	cmpq	%rsi, %r11
	jne	.L23
.L10:
	cmpl	$1, %edi
	jle	.L12
	movslq	%edi, %rcx
	leal	-2(%rdi), %eax
	movl	$1, %edx
	movabsq	$-8543223828751151131, %r10
	leaq	-1(%rcx), %rsi
	movq	%rsi, %r11
	subq	%rax, %r11
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L24:
	subq	$1, %rsi
.L13:
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rcx, %rdx
	movq	%rsi, %rcx
	subq	%rax, %rdx
	cmpq	%rsi, %r11
	jne	.L24
	movq	%rdx, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
.L12:
	cmpl	%edi, %r9d
	jne	.L9
	movabsq	$-8543223828751151131, %rdx
	leaq	(%r8,%r8), %rcx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %r8d
	jmp	.L10
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	fMain, .-fMain
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%edi, %edi
	call	fMain
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	fGetPtn
	.type	fGetPtn, @function
fGetPtn:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	jle	.L4
	movslq	%edi, %rcx
	leal	-2(%rdi), %eax
	movl	$1, %edx
	movabsq	$-8543223828751151131, %rdi
	leaq	-1(%rcx), %rsi
	movq	%rsi, %r8
	subq	%rax, %r8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	subq	$1, %rsi
.L3:
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	mulq	%rdi
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rcx
	cmpq	%r8, %rsi
	jne	.L7
	movq	%rdx, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %edx
	movq	%rdx, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	fGetPtn, .-fGetPtn
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%s"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$1024, %esi
	subq	$2080, %rsp
	.cfi_def_cfa_offset 2096
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 2072(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	movq	%r12, %rdi
	call	fgets@PLT
	leaq	8(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	.LC0(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	8(%rsp), %r9d
	movl	12(%rsp), %edi
	movl	%r9d, %edx
	subl	%edi, %edx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	xorl	%r8d, %r8d
	cmpl	$1, %eax
	jle	.L21
.L9:
	leaq	1040(%rsp), %r12
	movl	$1024, %edx
	movl	$1, %esi
	xorl	%eax, %eax
	movq	%r12, %rdi
	leaq	.LC1(%rip), %rcx
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	2072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$2080, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	cmpl	$1, %r9d
	jle	.L16
	movslq	%r9d, %rcx
	leal	-2(%r9), %eax
	movl	$1, %r8d
	movabsq	$-8543223828751151131, %r10
	leaq	-1(%rcx), %rsi
	movq	%rsi, %r11
	subq	%rax, %r11
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	subq	$1, %rsi
.L11:
	imulq	%r8, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	movq	%rsi, %rcx
	cmpq	%rsi, %r11
	jne	.L23
.L10:
	cmpl	$1, %edi
	jle	.L12
	movslq	%edi, %rcx
	leal	-2(%rdi), %eax
	movl	$1, %edx
	movabsq	$-8543223828751151131, %r10
	leaq	-1(%rcx), %rsi
	movq	%rsi, %r11
	subq	%rax, %r11
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L24:
	subq	$1, %rsi
.L13:
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	movq	%rcx, %rdx
	movq	%rsi, %rcx
	subq	%rax, %rdx
	cmpq	%rsi, %r11
	jne	.L24
	movq	%rdx, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rax
	mulq	%r10
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
.L12:
	cmpl	%edi, %r9d
	jne	.L9
	movabsq	$-8543223828751151131, %rdx
	leaq	(%r8,%r8), %rcx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %r8d
	jmp	.L10
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	fMain, .-fMain
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%edi, %edi
	call	fMain
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.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:

#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MOD			1000000007								// 除数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpT, *szpFpA;
#endif

// パターン数取得
long long
fGetPtn(
	int piCnt					// <I> 数
)
{
	long long llRet = 1;
	while (piCnt > 1) {
		llRet = llRet * (long long)piCnt % D_MOD;
		piCnt--;
	}

	return llRet;
}

// 実行メイン
int
fMain(
	int piTNo					// <I> テスト番号 1～
)
{
	char lc1Buf[1024], lc1Out[1024];

	// テストファイルオープン
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpT = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#endif

	// 犬数・猿数取得
	int liDCnt, liMCnt;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d", &liDCnt, &liMCnt);

	// 差
	int liDF = abs(liDCnt - liMCnt);

	// 全パターン数
	long long llSum = 0;
	if (liDF < 2) {
		llSum = fGetPtn(liDCnt) * fGetPtn(liMCnt) % D_MOD;
		if (liDF == 0) {
			llSum = llSum * (long long)2 % D_MOD;
		}
	}

	// 結果セット
	sprintf(lc1Out, "%lld\n", llSum);

	// 結果表示
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, lc1Out)) {
		siRes = -1;
	}
#else
	printf("%s", lc1Out);
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpT);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", piTNo);
	}
	else {
		printf("NG %d\n", piTNo);
	}
#endif

	return 0;
}

int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		fMain(i);
	}
#else
	fMain(0);
#endif

	return 0;
}


2 2

8

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

```c
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MOD			1000000007								// 除数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpT, *szpFpA;
#endif

// パターン数取得
long long
fGetPtn(
	int piCnt					// <I> 数
)
{
	long long llRet = 1;
	while (piCnt > 1) {
		llRet = llRet * (long long)piCnt % D_MOD;
		piCnt--;
	}

	return llRet;
}

// 実行メイン
int
fMain(
	int piTNo					// <I> テスト番号 1～
)
{
	char lc1Buf[1024], lc1Out[1024];

	// テストファイルオープン
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpT = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#endif

	// 犬数・猿数取得
	int liDCnt, liMCnt;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d", &liDCnt, &liMCnt);

	// 差
	int liDF = abs(liDCnt - liMCnt);

	// 全パターン数
	long long llSum = 0;
	if (liDF < 2) {
		llSum = fGetPtn(liDCnt) * fGetPtn(liMCnt) % D_MOD;
		if (liDF == 0) {
			llSum = llSum * (long long)2 % D_MOD;
		}
	}

	// 結果セット
	sprintf(lc1Out, "%lld\n", llSum);

	// 結果表示
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, lc1Out)) {
		siRes = -1;
	}
#else
	printf("%s", lc1Out);
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpT);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", piTNo);
	}
	else {
		printf("NG %d\n", piTNo);
	}
#endif

	return 0;
}

int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		fMain(i);
	}
#else
	fMain(0);
#endif

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	fGetPtn
	.type	fGetPtn, @function
fGetPtn:
.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)
	movq	$1, -8(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	subl	$1, -20(%rbp)
.L2:
	cmpl	$1, -20(%rbp)
	jg	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fGetPtn, .-fGetPtn
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%s"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB7:
	.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	$2120, %rsp
	.cfi_offset 3, -24
	movl	%edi, -2116(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-2080(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2096(%rbp), %rcx
	leaq	-2100(%rbp), %rdx
	leaq	-2080(%rbp), %rax
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-2100(%rbp), %eax
	movl	-2096(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -2092(%rbp)
	movq	$0, -2088(%rbp)
	cmpl	$1, -2092(%rbp)
	jg	.L6
	movl	-2100(%rbp), %eax
	movl	%eax, %edi
	call	fGetPtn
	movq	%rax, %rbx
	movl	-2096(%rbp), %eax
	movl	%eax, %edi
	call	fGetPtn
	imulq	%rax, %rbx
	movq	%rbx, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	movq	-2088(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	cmpl	$0, -2092(%rbp)
	jne	.L6
	movq	-2088(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	movq	-2088(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
.L6:
	movq	-2088(%rbp), %rdx
	leaq	-1056(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fMain, .-fMain
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %edi
	call	fMain
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	fGetPtn
	.type	fGetPtn, @function
fGetPtn:
.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)
	movq	$1, -8(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	subl	$1, -20(%rbp)
.L2:
	cmpl	$1, -20(%rbp)
	jg	.L3
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fGetPtn, .-fGetPtn
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%s"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB7:
	.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	$2120, %rsp
	.cfi_offset 3, -24
	movl	%edi, -2116(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-2080(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2096(%rbp), %rcx
	leaq	-2100(%rbp), %rdx
	leaq	-2080(%rbp), %rax
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-2100(%rbp), %eax
	movl	-2096(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -2092(%rbp)
	movq	$0, -2088(%rbp)
	cmpl	$1, -2092(%rbp)
	jg	.L6
	movl	-2100(%rbp), %eax
	movl	%eax, %edi
	call	fGetPtn
	movq	%rax, %rbx
	movl	-2096(%rbp), %eax
	movl	%eax, %edi
	call	fGetPtn
	imulq	%rax, %rbx
	movq	%rbx, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	movq	-2088(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	cmpl	$0, -2092(%rbp)
	jne	.L6
	movq	-2088(%rbp), %rax
	leaq	(%rax,%rax), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
	movq	-2088(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -2088(%rbp)
.L6:
	movq	-2088(%rbp), %rdx
	leaq	-1056(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fMain, .-fMain
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %edi
	call	fMain
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
