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			(long long)1000000007					// 除数(10の9乗+7)
#define D_MT_MAX		100000									// 最大山数
#define D_STS_FIX		0										// 状態 - 確定
#define D_STS_LTL		1										// 状態 - 以下

// 内部構造体 - 山情報
typedef struct Mt {
	int miH;													// 高さ
	int miSts;													// 状態
} Mt;

// 内部変数
static FILE *szpFpI;											// 入力
static Mt sz1Mt[D_MT_MAX];										// 山
static int siMCnt;												// 山数
static int si1H[D_MT_MAX];										// 高さ(東→西)
static long long slPtn;											// パターン数

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

// パターン数 - セット
int
fSetPtn(
)
{
	int i;
	char lc1Buf[1024];

	// 高さ - 西→東 - 取得
	int liH;
	int liMax = 0;
	for (i = 0; i < siMCnt; i++) {
		fscanf(szpFpI, "%d", &liH);

		// 前回と比較
		if (liMax < liH) {							// 確定
			sz1Mt[i].miH = liH;
			sz1Mt[i].miSts = D_STS_FIX;
			liMax = liH;
		}
		else {										// 以下
			sz1Mt[i].miH = liMax;
			sz1Mt[i].miSts = D_STS_LTL;
		}
	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 高さ - 東→西 - 取得
	for (i = 0; i < siMCnt; i++) {
		fscanf(szpFpI, "%d", &si1H[i]);
	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 高さ - 東→西 - チェック
	liMax = 0;
	for (i = siMCnt - 1; i >= 0; i--) {

		// 前回と比較
		if (liMax < si1H[i]) {						// 確定
			if (sz1Mt[i].miSts == D_STS_FIX) {			// 確定
				if (sz1Mt[i].miH != si1H[i]) {
					return 0;
				}
			}
			else {										// 以下
				if (sz1Mt[i].miH < si1H[i]) {
					return 0;
				}
				sz1Mt[i].miH = si1H[i];
				sz1Mt[i].miSts = D_STS_FIX;
			}
			liMax = si1H[i];
		}
		else {										// 以下
			if (sz1Mt[i].miSts == D_STS_FIX) {			// 確定
				if (sz1Mt[i].miH > si1H[i]) {
					return 0;
				}
			}
			else {										// 以下
				if (sz1Mt[i].miH > si1H[i]) {
					sz1Mt[i].miH = si1H[i];
				}
			}
		}
	}

	// パターン数 - セット
	slPtn = 1;
	for (i = 0; i < siMCnt; i++) {
		if (sz1Mt[i].miSts == D_STS_LTL) {			// 以下
			slPtn *= sz1Mt[i].miH;
			slPtn %= D_MOD;
		}
	}

	return 0;
}

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

	// データ - 初期化
	slPtn = 0;													// パターン数

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 山数 - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d", &siMCnt);

	// パターン数 - セット
	fSetPtn();

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

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

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	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
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	sz1Mt
	.comm	sz1Mt,800000,32
	.local	siMCnt
	.comm	siMCnt,4,4
	.local	si1H
	.comm	si1H,400000,32
	.local	slPtn
	.comm	slPtn,8,8
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	fSetPtn
	.type	fSetPtn, @function
fSetPtn:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1044(%rbp)
	movl	$0, -1048(%rbp)
	jmp	.L2
.L5:
	movq	szpFpI(%rip), %rax
	leaq	-1052(%rbp), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-1052(%rbp), %eax
	cmpl	%eax, -1044(%rbp)
	jge	.L3
	movl	-1052(%rbp), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-1052(%rbp), %eax
	movl	%eax, -1044(%rbp)
	jmp	.L4
.L3:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	-1044(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$1, (%rdx,%rax)
.L4:
	addl	$1, -1048(%rbp)
.L2:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L5
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -1048(%rbp)
	jmp	.L6
.L7:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	addq	%rax, %rdx
	movq	szpFpI(%rip), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	addl	$1, -1048(%rbp)
.L6:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L7
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -1044(%rbp)
	movl	siMCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, -1048(%rbp)
	jmp	.L8
.L16:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -1044(%rbp)
	jge	.L9
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L11
	movl	$0, %eax
	jmp	.L20
.L10:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	$0, %eax
	jmp	.L20
.L13:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -1044(%rbp)
	jmp	.L14
.L9:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	$0, %eax
	jmp	.L20
.L15:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L14:
	subl	$1, -1048(%rbp)
.L8:
	cmpl	$0, -1048(%rbp)
	jns	.L16
	movq	$1, slPtn(%rip)
	movl	$0, -1048(%rbp)
	jmp	.L17
.L19:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	slPtn(%rip), %rax
	imulq	%rdx, %rax
	movq	%rax, slPtn(%rip)
	movq	slPtn(%rip), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, slPtn(%rip)
.L18:
	addl	$1, -1048(%rbp)
.L17:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L19
	movl	$0, %eax
.L20:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fSetPtn, .-fSetPtn
	.section	.rodata
.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
	subq	$2080, %rsp
	movl	%edi, -2068(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, slPtn(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movq	szpFpI(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2064(%rbp), %rax
	leaq	siMCnt(%rip), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, %eax
	call	fSetPtn
	movq	slPtn(%rip), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	fSetPtn
	.type	fSetPtn, @function
fSetPtn:
.LFB51:
	.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
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1104
	movl	siMCnt(%rip), %edx
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	.L6
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
	leaq	.LC0(%rip), %r12
	xorl	%ebp, %ebp
	leaq	sz1Mt(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	szpFpI(%rip), %rdi
	movq	%r14, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	12(%rsp), %edx
	movl	$1, %eax
	cmpl	%ebp, %edx
	jle	.L5
	movl	%edx, %ebp
	xorl	%eax, %eax
.L5:
	movd	%ebp, %xmm0
	movd	%eax, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 0(%r13,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, siMCnt(%rip)
	jg	.L2
.L6:
	movq	szpFpI(%rip), %rdx
	leaq	16(%rsp), %r13
	movl	$1024, %esi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	leaq	si1H(%rip), %rbp
	leaq	.LC0(%rip), %r12
	call	fgets@PLT
	movl	siMCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L9:
	movq	szpFpI(%rip), %rdi
	movq	%rbp, %rdx
	xorl	%eax, %eax
	movq	%r12, %rsi
	addl	$1, %ebx
	addq	$4, %rbp
	call	__isoc99_fscanf@PLT
	cmpl	%ebx, siMCnt(%rip)
	jg	.L9
.L4:
	movq	szpFpI(%rip), %rdx
	movl	$1024, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	movl	siMCnt(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L8
	movslq	%r10d, %rdx
	leaq	si1H(%rip), %rax
	leal	-1(%r10), %esi
	xorl	%r8d, %r8d
	leaq	(%rax,%rdx,4), %rcx
	leaq	sz1Mt(%rip), %rax
	leaq	(%rax,%rdx,8), %rax
	subq	%rsi, %rdx
	leaq	-8+sz1Mt(%rip), %rsi
	leaq	(%rsi,%rdx,8), %r9
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L34:
	testl	%edi, %edi
	jne	.L13
	cmpl	%esi, %edx
	jne	.L15
	movl	%edx, %r8d
.L14:
	subq	$8, %rax
	subq	$4, %rcx
	cmpq	%r9, %rax
	je	.L8
.L17:
	movl	-4(%rcx), %edx
	movl	-4(%rax), %edi
	movl	-8(%rax), %esi
	cmpl	%r8d, %edx
	jg	.L34
	testl	%edi, %edi
	jne	.L16
	cmpl	%esi, %edx
	jge	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$1056, %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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	cmpl	%esi, %edx
	jge	.L14
	movl	%edx, -8(%rax)
	subq	$8, %rax
	subq	$4, %rcx
	cmpq	%r9, %rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	movq	$1, slPtn(%rip)
	testl	%r10d, %r10d
	jle	.L15
	leaq	sz1Mt(%rip), %rcx
	leal	-1(%r10), %edx
	movabsq	$-8543223828751151131, %r8
	leaq	8(%rcx), %rax
	leaq	(%rax,%rdx,8), %rdi
	xorl	%eax, %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$1, 4(%rcx)
	jne	.L18
	movslq	(%rcx), %rsi
	imulq	%rdx, %rsi
	movq	%rsi, %rax
	imulq	%r8
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movl	$1, %eax
	movq	%rsi, %rdx
.L18:
	addq	$8, %rcx
	cmpq	%rcx, %rdi
	jne	.L19
	testb	%al, %al
	je	.L15
	movq	%rdx, slPtn(%rip)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	%esi, %edx
	jg	.L15
	movl	%edx, -8(%rax)
	movl	%edx, %r8d
	movl	$0, -4(%rax)
	jmp	.L14
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	fSetPtn, .-fSetPtn
	.section	.rodata.str1.1
.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	$2064, %rsp
	.cfi_def_cfa_offset 2080
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 2056(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	movq	$0, slPtn(%rip)
	movq	%r12, %rdi
	movq	%rdx, szpFpI(%rip)
	call	fgets@PLT
	movq	%r12, %rdi
	leaq	siMCnt(%rip), %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	leaq	1024(%rsp), %r12
	call	__isoc99_sscanf@PLT
	xorl	%eax, %eax
	call	fSetPtn
	movl	$1024, %edx
	movq	%r12, %rdi
	xorl	%eax, %eax
	movq	slPtn(%rip), %r8
	movl	$1, %esi
	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	2056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$2064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L39:
	.cfi_restore_state
	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
	.local	slPtn
	.comm	slPtn,8,8
	.local	si1H
	.comm	si1H,400000,32
	.local	siMCnt
	.comm	siMCnt,4,4
	.local	sz1Mt
	.comm	sz1Mt,800000,32
	.local	szpFpI
	.comm	szpFpI,8,8
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	fSetPtn
	.type	fSetPtn, @function
fSetPtn:
.LFB51:
	.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
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1104
	movl	siMCnt(%rip), %edx
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	.L6
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
	leaq	.LC0(%rip), %r12
	xorl	%ebp, %ebp
	leaq	sz1Mt(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	szpFpI(%rip), %rdi
	movq	%r14, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movl	12(%rsp), %edx
	movl	$1, %eax
	cmpl	%ebp, %edx
	jle	.L5
	movl	%edx, %ebp
	xorl	%eax, %eax
.L5:
	movd	%ebp, %xmm0
	movd	%eax, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 0(%r13,%rbx,8)
	addq	$1, %rbx
	cmpl	%ebx, siMCnt(%rip)
	jg	.L2
.L6:
	movq	szpFpI(%rip), %rdx
	leaq	16(%rsp), %r13
	movl	$1024, %esi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	leaq	si1H(%rip), %rbp
	leaq	.LC0(%rip), %r12
	call	fgets@PLT
	movl	siMCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L9:
	movq	szpFpI(%rip), %rdi
	movq	%rbp, %rdx
	xorl	%eax, %eax
	movq	%r12, %rsi
	addl	$1, %ebx
	addq	$4, %rbp
	call	__isoc99_fscanf@PLT
	cmpl	%ebx, siMCnt(%rip)
	jg	.L9
.L4:
	movq	szpFpI(%rip), %rdx
	movl	$1024, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	movl	siMCnt(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L8
	movslq	%r10d, %rdx
	leaq	si1H(%rip), %rax
	leal	-1(%r10), %esi
	xorl	%r8d, %r8d
	leaq	(%rax,%rdx,4), %rcx
	leaq	sz1Mt(%rip), %rax
	leaq	(%rax,%rdx,8), %rax
	subq	%rsi, %rdx
	leaq	-8+sz1Mt(%rip), %rsi
	leaq	(%rsi,%rdx,8), %r9
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L34:
	testl	%edi, %edi
	jne	.L13
	cmpl	%esi, %edx
	jne	.L15
	movl	%edx, %r8d
.L14:
	subq	$8, %rax
	subq	$4, %rcx
	cmpq	%r9, %rax
	je	.L8
.L17:
	movl	-4(%rcx), %edx
	movl	-4(%rax), %edi
	movl	-8(%rax), %esi
	cmpl	%r8d, %edx
	jg	.L34
	testl	%edi, %edi
	jne	.L16
	cmpl	%esi, %edx
	jge	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	movq	1048(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$1056, %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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	cmpl	%esi, %edx
	jge	.L14
	movl	%edx, -8(%rax)
	subq	$8, %rax
	subq	$4, %rcx
	cmpq	%r9, %rax
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	movq	$1, slPtn(%rip)
	testl	%r10d, %r10d
	jle	.L15
	leaq	sz1Mt(%rip), %rcx
	leal	-1(%r10), %edx
	movabsq	$-8543223828751151131, %r8
	leaq	8(%rcx), %rax
	leaq	(%rax,%rdx,8), %rdi
	xorl	%eax, %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$1, 4(%rcx)
	jne	.L18
	movslq	(%rcx), %rsi
	imulq	%rdx, %rsi
	movq	%rsi, %rax
	imulq	%r8
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movl	$1, %eax
	movq	%rsi, %rdx
.L18:
	addq	$8, %rcx
	cmpq	%rcx, %rdi
	jne	.L19
	testb	%al, %al
	je	.L15
	movq	%rdx, slPtn(%rip)
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	%esi, %edx
	jg	.L15
	movl	%edx, -8(%rax)
	movl	%edx, %r8d
	movl	$0, -4(%rax)
	jmp	.L14
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	fSetPtn, .-fSetPtn
	.section	.rodata.str1.1
.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	$2064, %rsp
	.cfi_def_cfa_offset 2080
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 2056(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	movq	$0, slPtn(%rip)
	movq	%r12, %rdi
	movq	%rdx, szpFpI(%rip)
	call	fgets@PLT
	movq	%r12, %rdi
	leaq	siMCnt(%rip), %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	leaq	1024(%rsp), %r12
	call	__isoc99_sscanf@PLT
	xorl	%eax, %eax
	call	fSetPtn
	movl	$1024, %edx
	movq	%r12, %rdi
	xorl	%eax, %eax
	movq	slPtn(%rip), %r8
	movl	$1, %esi
	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	2056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$2064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L39:
	.cfi_restore_state
	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
	.local	slPtn
	.comm	slPtn,8,8
	.local	si1H
	.comm	si1H,400000,32
	.local	siMCnt
	.comm	siMCnt,4,4
	.local	sz1Mt
	.comm	sz1Mt,800000,32
	.local	szpFpI
	.comm	szpFpI,8,8
	.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			(long long)1000000007					// 除数(10の9乗+7)
#define D_MT_MAX		100000									// 最大山数
#define D_STS_FIX		0										// 状態 - 確定
#define D_STS_LTL		1										// 状態 - 以下

// 内部構造体 - 山情報
typedef struct Mt {
	int miH;													// 高さ
	int miSts;													// 状態
} Mt;

// 内部変数
static FILE *szpFpI;											// 入力
static Mt sz1Mt[D_MT_MAX];										// 山
static int siMCnt;												// 山数
static int si1H[D_MT_MAX];										// 高さ(東→西)
static long long slPtn;											// パターン数

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

// パターン数 - セット
int
fSetPtn(
)
{
	int i;
	char lc1Buf[1024];

	// 高さ - 西→東 - 取得
	int liH;
	int liMax = 0;
	for (i = 0; i < siMCnt; i++) {
		fscanf(szpFpI, "%d", &liH);

		// 前回と比較
		if (liMax < liH) {							// 確定
			sz1Mt[i].miH = liH;
			sz1Mt[i].miSts = D_STS_FIX;
			liMax = liH;
		}
		else {										// 以下
			sz1Mt[i].miH = liMax;
			sz1Mt[i].miSts = D_STS_LTL;
		}
	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 高さ - 東→西 - 取得
	for (i = 0; i < siMCnt; i++) {
		fscanf(szpFpI, "%d", &si1H[i]);
	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 高さ - 東→西 - チェック
	liMax = 0;
	for (i = siMCnt - 1; i >= 0; i--) {

		// 前回と比較
		if (liMax < si1H[i]) {						// 確定
			if (sz1Mt[i].miSts == D_STS_FIX) {			// 確定
				if (sz1Mt[i].miH != si1H[i]) {
					return 0;
				}
			}
			else {										// 以下
				if (sz1Mt[i].miH < si1H[i]) {
					return 0;
				}
				sz1Mt[i].miH = si1H[i];
				sz1Mt[i].miSts = D_STS_FIX;
			}
			liMax = si1H[i];
		}
		else {										// 以下
			if (sz1Mt[i].miSts == D_STS_FIX) {			// 確定
				if (sz1Mt[i].miH > si1H[i]) {
					return 0;
				}
			}
			else {										// 以下
				if (sz1Mt[i].miH > si1H[i]) {
					sz1Mt[i].miH = si1H[i];
				}
			}
		}
	}

	// パターン数 - セット
	slPtn = 1;
	for (i = 0; i < siMCnt; i++) {
		if (sz1Mt[i].miSts == D_STS_LTL) {			// 以下
			slPtn *= sz1Mt[i].miH;
			slPtn %= D_MOD;
		}
	}

	return 0;
}

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

	// データ - 初期化
	slPtn = 0;													// パターン数

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 山数 - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d", &siMCnt);

	// パターン数 - セット
	fSetPtn();

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

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

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	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;
}


5
2 3 3 3 3
3 3 2 2 2
 5
1 1 1 2 2
6 2 1 1 1
 5
1 1 1 4 2
6 2 1 1 1
 5
1 1 1 4 2
6 2 1 1 0
 5
1 1 1 4 2
6 0 1 1 0
 5
1 1 1 4 2
6 1 1 1 0
 5
1 1 1 4 2
6 2 1 2 0
 5
1 1 1 4 2
9 2 1 2 0
 5
1 1 1 1 2
9 2 1 2 0
 5
1 1 1 1 2
9 2 1 2 -1

4
 0
 0
 0
 0
 0
 0
 0
 0
 0

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			(long long)1000000007					// 除数(10の9乗+7)
#define D_MT_MAX		100000									// 最大山数
#define D_STS_FIX		0										// 状態 - 確定
#define D_STS_LTL		1										// 状態 - 以下

// 内部構造体 - 山情報
typedef struct Mt {
	int miH;													// 高さ
	int miSts;													// 状態
} Mt;

// 内部変数
static FILE *szpFpI;											// 入力
static Mt sz1Mt[D_MT_MAX];										// 山
static int siMCnt;												// 山数
static int si1H[D_MT_MAX];										// 高さ(東→西)
static long long slPtn;											// パターン数

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

// パターン数 - セット
int
fSetPtn(
)
{
	int i;
	char lc1Buf[1024];

	// 高さ - 西→東 - 取得
	int liH;
	int liMax = 0;
	for (i = 0; i < siMCnt; i++) {
		fscanf(szpFpI, "%d", &liH);

		// 前回と比較
		if (liMax < liH) {							// 確定
			sz1Mt[i].miH = liH;
			sz1Mt[i].miSts = D_STS_FIX;
			liMax = liH;
		}
		else {										// 以下
			sz1Mt[i].miH = liMax;
			sz1Mt[i].miSts = D_STS_LTL;
		}
	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 高さ - 東→西 - 取得
	for (i = 0; i < siMCnt; i++) {
		fscanf(szpFpI, "%d", &si1H[i]);
	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 高さ - 東→西 - チェック
	liMax = 0;
	for (i = siMCnt - 1; i >= 0; i--) {

		// 前回と比較
		if (liMax < si1H[i]) {						// 確定
			if (sz1Mt[i].miSts == D_STS_FIX) {			// 確定
				if (sz1Mt[i].miH != si1H[i]) {
					return 0;
				}
			}
			else {										// 以下
				if (sz1Mt[i].miH < si1H[i]) {
					return 0;
				}
				sz1Mt[i].miH = si1H[i];
				sz1Mt[i].miSts = D_STS_FIX;
			}
			liMax = si1H[i];
		}
		else {										// 以下
			if (sz1Mt[i].miSts == D_STS_FIX) {			// 確定
				if (sz1Mt[i].miH > si1H[i]) {
					return 0;
				}
			}
			else {										// 以下
				if (sz1Mt[i].miH > si1H[i]) {
					sz1Mt[i].miH = si1H[i];
				}
			}
		}
	}

	// パターン数 - セット
	slPtn = 1;
	for (i = 0; i < siMCnt; i++) {
		if (sz1Mt[i].miSts == D_STS_LTL) {			// 以下
			slPtn *= sz1Mt[i].miH;
			slPtn %= D_MOD;
		}
	}

	return 0;
}

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

	// データ - 初期化
	slPtn = 0;													// パターン数

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 山数 - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d", &siMCnt);

	// パターン数 - セット
	fSetPtn();

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

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

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	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
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	sz1Mt
	.comm	sz1Mt,800000,32
	.local	siMCnt
	.comm	siMCnt,4,4
	.local	si1H
	.comm	si1H,400000,32
	.local	slPtn
	.comm	slPtn,8,8
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	fSetPtn
	.type	fSetPtn, @function
fSetPtn:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1044(%rbp)
	movl	$0, -1048(%rbp)
	jmp	.L2
.L5:
	movq	szpFpI(%rip), %rax
	leaq	-1052(%rbp), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-1052(%rbp), %eax
	cmpl	%eax, -1044(%rbp)
	jge	.L3
	movl	-1052(%rbp), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-1052(%rbp), %eax
	movl	%eax, -1044(%rbp)
	jmp	.L4
.L3:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	-1044(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$1, (%rdx,%rax)
.L4:
	addl	$1, -1048(%rbp)
.L2:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L5
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -1048(%rbp)
	jmp	.L6
.L7:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	addq	%rax, %rdx
	movq	szpFpI(%rip), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	addl	$1, -1048(%rbp)
.L6:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L7
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -1044(%rbp)
	movl	siMCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, -1048(%rbp)
	jmp	.L8
.L16:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -1044(%rbp)
	jge	.L9
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L11
	movl	$0, %eax
	jmp	.L20
.L10:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	$0, %eax
	jmp	.L20
.L13:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -1044(%rbp)
	jmp	.L14
.L9:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	$0, %eax
	jmp	.L20
.L15:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L14:
	subl	$1, -1048(%rbp)
.L8:
	cmpl	$0, -1048(%rbp)
	jns	.L16
	movq	$1, slPtn(%rip)
	movl	$0, -1048(%rbp)
	jmp	.L17
.L19:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	slPtn(%rip), %rax
	imulq	%rdx, %rax
	movq	%rax, slPtn(%rip)
	movq	slPtn(%rip), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, slPtn(%rip)
.L18:
	addl	$1, -1048(%rbp)
.L17:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L19
	movl	$0, %eax
.L20:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fSetPtn, .-fSetPtn
	.section	.rodata
.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
	subq	$2080, %rsp
	movl	%edi, -2068(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, slPtn(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movq	szpFpI(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2064(%rbp), %rax
	leaq	siMCnt(%rip), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, %eax
	call	fSetPtn
	movq	slPtn(%rip), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	sz1Mt
	.comm	sz1Mt,800000,32
	.local	siMCnt
	.comm	siMCnt,4,4
	.local	si1H
	.comm	si1H,400000,32
	.local	slPtn
	.comm	slPtn,8,8
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	fSetPtn
	.type	fSetPtn, @function
fSetPtn:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -1044(%rbp)
	movl	$0, -1048(%rbp)
	jmp	.L2
.L5:
	movq	szpFpI(%rip), %rax
	leaq	-1052(%rbp), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-1052(%rbp), %eax
	cmpl	%eax, -1044(%rbp)
	jge	.L3
	movl	-1052(%rbp), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-1052(%rbp), %eax
	movl	%eax, -1044(%rbp)
	jmp	.L4
.L3:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	-1044(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$1, (%rdx,%rax)
.L4:
	addl	$1, -1048(%rbp)
.L2:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L5
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -1048(%rbp)
	jmp	.L6
.L7:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	addq	%rax, %rdx
	movq	szpFpI(%rip), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	addl	$1, -1048(%rbp)
.L6:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L7
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -1044(%rbp)
	movl	siMCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, -1048(%rbp)
	jmp	.L8
.L16:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -1044(%rbp)
	jge	.L9
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L11
	movl	$0, %eax
	jmp	.L20
.L10:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	$0, %eax
	jmp	.L20
.L13:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	$0, (%rdx,%rax)
.L11:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -1044(%rbp)
	jmp	.L14
.L9:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	$0, %eax
	jmp	.L20
.L15:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	si1H(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L14
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1H(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-1048(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Mt(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L14:
	subl	$1, -1048(%rbp)
.L8:
	cmpl	$0, -1048(%rbp)
	jns	.L16
	movq	$1, slPtn(%rip)
	movl	$0, -1048(%rbp)
	jmp	.L17
.L19:
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-1048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Mt(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	slPtn(%rip), %rax
	imulq	%rdx, %rax
	movq	%rax, slPtn(%rip)
	movq	slPtn(%rip), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, slPtn(%rip)
.L18:
	addl	$1, -1048(%rbp)
.L17:
	movl	siMCnt(%rip), %eax
	cmpl	%eax, -1048(%rbp)
	jl	.L19
	movl	$0, %eax
.L20:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fSetPtn, .-fSetPtn
	.section	.rodata
.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
	subq	$2080, %rsp
	movl	%edi, -2068(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, slPtn(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movq	szpFpI(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2064(%rbp), %rax
	leaq	siMCnt(%rip), %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, %eax
	call	fSetPtn
	movq	slPtn(%rip), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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:
