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

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

// 内部定数
#define D_SIZE_MAX		405										// 最大サイズ
#define D_MASS_BLACK	'#'										// マス - 黒
#define D_MASS_WHITE	'.'										// マス - 白

// 内部変数
static FILE *szpFpI;											// 入力
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX];					// マス
static int siW, siH;											// 幅・高さ

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

// マス数 - 取得
int
fGetMCnt(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
	, char pcMass				// <I> 対象マスの色
	, int *pipBCnt				// <O> 黒数
	, int *pipWCnt				// <O> 白数
)
{
	// 対象マスの色 - チェック
	if (sc2Mass[piY][piX] != pcMass) {
		return 0;
	}

	// 処理済
	sc2Mass[piY][piX] = 0;

	// 色数・次の色
	if (pcMass == D_MASS_BLACK) {		// 黒
		(*pipBCnt)++;
		pcMass = D_MASS_WHITE;
	}
	else {								// 白
		(*pipWCnt)++;
		pcMass = D_MASS_BLACK;
	}

	// 上下左右へ
	fGetMCnt(piX + 1, piY, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX - 1, piY, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX, piY + 1, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX, piY - 1, pcMass, pipBCnt, pipWCnt);

	return 0;
}

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

	// データ - 初期化
	memset(sc2Mass, 0, sizeof(sc2Mass));						// マス

	// 入力 - セット
#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%d", &siH, &siW);

	// マス - 取得
	for (i = 1; i <= siH; i++) {
		fgets(&sc2Mass[i][1], sizeof(sc2Mass[0]) - 1, szpFpI);
	}

	// パターン数 - 取得
	long long llPCnt = 0;
	for (i = 1; i <= siH; i++) {
		for (j = 1; j <= siW; j++) {

			// マス数 - 取得
			int liBCnt = 0;
			int liWCnt = 0;
			fGetMCnt(j, i, D_MASS_BLACK, &liBCnt, &liWCnt);

			// パターン数 - 加算
			llPCnt += (long long)liBCnt * (long long)liWCnt;
		}
	}

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

	// 結果 - 表示
#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	sc2Mass
	.comm	sc2Mass,164025,32
	.local	siW
	.comm	siW,4,4
	.local	siH
	.comm	siH,4,4
	.globl	fGetMCnt
	.type	fGetMCnt, @function
fGetMCnt:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, %eax
	movq	%rcx, -24(%rbp)
	movq	%r8, -32(%rbp)
	movb	%al, -12(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$405, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -12(%rbp)
	je	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$405, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	cmpb	$35, -12(%rbp)
	jne	.L4
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movb	$46, -12(%rbp)
	jmp	.L5
.L4:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movb	$35, -12(%rbp)
.L5:
	movsbl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %edi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movl	-8(%rbp), %eax
	movq	%rsi, %r8
	movl	%eax, %esi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movl	-8(%rbp), %eax
	movq	%rsi, %r8
	movl	%eax, %esi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	leal	1(%rax), %esi
	movq	-32(%rbp), %rdi
	movq	-24(%rbp), %rcx
	movl	-4(%rbp), %eax
	movq	%rdi, %r8
	movl	%eax, %edi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	leal	-1(%rax), %esi
	movq	-32(%rbp), %rdi
	movq	-24(%rbp), %rcx
	movl	-4(%rbp), %eax
	movq	%rdi, %r8
	movl	%eax, %edi
	call	fGetMCnt
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fGetMCnt, .-fGetMCnt
	.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
	subq	$2112, %rsp
	movl	%edi, -2100(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$164025, %edx
	movl	$0, %esi
	leaq	sc2Mass(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	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	siW(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siH(%rip), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -2080(%rbp)
	jmp	.L7
.L8:
	movq	szpFpI(%rip), %rax
	movl	-2080(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$405, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	sc2Mass(%rip), %rdx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movl	$404, %esi
	movq	%rcx, %rdi
	call	fgets@PLT
	addl	$1, -2080(%rbp)
.L7:
	movl	siH(%rip), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L8
	movq	$0, -2072(%rbp)
	movl	$1, -2080(%rbp)
	jmp	.L9
.L12:
	movl	$1, -2076(%rbp)
	jmp	.L10
.L11:
	movl	$0, -2088(%rbp)
	movl	$0, -2084(%rbp)
	leaq	-2084(%rbp), %rcx
	leaq	-2088(%rbp), %rdx
	movl	-2080(%rbp), %esi
	movl	-2076(%rbp), %eax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	$35, %edx
	movl	%eax, %edi
	call	fGetMCnt
	movl	-2088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2084(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -2072(%rbp)
	addl	$1, -2076(%rbp)
.L10:
	movl	siW(%rip), %eax
	cmpl	%eax, -2076(%rbp)
	jle	.L11
	addl	$1, -2080(%rbp)
.L9:
	movl	siH(%rip), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L12
	movq	-2072(%rbp), %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	.L14
	call	__stack_chk_fail@PLT
.L14:
	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
	.type	fGetMCnt.part.0, @function
fGetMCnt.part.0:
.LFB54:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %r9
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r8, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r9, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%esi, %r12
	imulq	$405, %r12, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	sc2Mass(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r12, %rbx
	addq	%rbp, %rax
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movb	$0, (%rax,%r9)
	cmpb	$35, %dl
	je	.L10
	addl	$1, (%r8)
	movl	$35, %edx
	movl	$35, %eax
.L3:
	imulq	$405, %r12, %rcx
	leal	1(%r13), %edi
	movslq	%edi, %rsi
	addq	%rbp, %rcx
	cmpb	(%rcx,%rsi), %al
	jne	.L4
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%ebx, %esi
	movq	%r9, 8(%rsp)
	movb	%al, 7(%rsp)
	movl	%edx, (%rsp)
	call	fGetMCnt.part.0
	movq	8(%rsp), %r9
	movzbl	7(%rsp), %eax
	movl	(%rsp), %edx
.L4:
	imulq	$405, %r12, %r12
	leal	-1(%r13), %edi
	movslq	%edi, %rcx
	addq	%rbp, %r12
	cmpb	(%r12,%rcx), %al
	jne	.L5
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%ebx, %esi
	movq	%r9, 8(%rsp)
	movb	%al, 7(%rsp)
	movl	%edx, (%rsp)
	call	fGetMCnt.part.0
	movq	8(%rsp), %r9
	movzbl	7(%rsp), %eax
	movl	(%rsp), %edx
.L5:
	leal	1(%rbx), %esi
	movslq	%esi, %rcx
	imulq	$405, %rcx, %rcx
	addq	%rbp, %rcx
	cmpb	(%rcx,%r9), %al
	jne	.L6
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%r13d, %edi
	movq	%r9, 8(%rsp)
	movb	%al, 7(%rsp)
	movl	%edx, (%rsp)
	call	fGetMCnt.part.0
	movq	8(%rsp), %r9
	movzbl	7(%rsp), %eax
	movl	(%rsp), %edx
.L6:
	leal	-1(%rbx), %esi
	movslq	%esi, %rcx
	imulq	$405, %rcx, %rcx
	addq	%rcx, %rbp
	cmpb	0(%rbp,%r9), %al
	jne	.L1
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%r13d, %edi
	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
	jmp	fGetMCnt.part.0
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	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
.L10:
	.cfi_restore_state
	addl	$1, (%rcx)
	movl	$46, %edx
	movl	$46, %eax
	jmp	.L3
	.cfi_endproc
.LFE54:
	.size	fGetMCnt.part.0, .-fGetMCnt.part.0
	.p2align 4
	.globl	fGetMCnt
	.type	fGetMCnt, @function
fGetMCnt:
.LFB51:
	.cfi_startproc
	endbr64
	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
	movslq	%edi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%esi, %rbp
	imulq	$405, %rbp, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	sc2Mass(%rip), %rbx
	addq	%rbx, %rax
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	addq	%r13, %rax
	cmpb	%dl, (%rax)
	jne	.L13
	movb	$0, (%rax)
	movq	%r13, %r11
	movq	%rbp, %r10
	movq	%rcx, %r14
	movq	%r8, %r12
	cmpb	$35, %dl
	je	.L21
	addl	$1, (%r8)
	movl	$35, %edx
	movl	$35, %r15d
.L15:
	imulq	$405, %rbp, %rax
	leal	1(%r11), %edi
	movslq	%edi, %rcx
	addq	%rbx, %rax
	cmpb	(%rax,%rcx), %r15b
	jne	.L16
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r10d, %esi
	movl	%edx, 12(%rsp)
	call	fGetMCnt.part.0
	movl	12(%rsp), %edx
.L16:
	imulq	$405, %rbp, %rbp
	leal	-1(%r11), %edi
	movslq	%edi, %rax
	addq	%rbx, %rbp
	cmpb	0(%rbp,%rax), %r15b
	jne	.L17
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r10d, %esi
	movl	%edx, 12(%rsp)
	call	fGetMCnt.part.0
	movl	12(%rsp), %edx
.L17:
	leal	1(%r10), %esi
	movslq	%esi, %rax
	imulq	$405, %rax, %rax
	addq	%rbx, %rax
	cmpb	(%rax,%r13), %r15b
	jne	.L18
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r11d, %edi
	movl	%edx, 12(%rsp)
	call	fGetMCnt.part.0
	movl	12(%rsp), %edx
.L18:
	leal	-1(%r10), %esi
	movslq	%esi, %rax
	imulq	$405, %rax, %rax
	addq	%rax, %rbx
	cmpb	(%rbx,%r13), %r15b
	jne	.L13
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r11d, %edi
	call	fGetMCnt.part.0
.L13:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L21:
	.cfi_restore_state
	addl	$1, (%rcx)
	movl	$46, %edx
	movl	$46, %r15d
	jmp	.L15
	.cfi_endproc
.LFE51:
	.size	fGetMCnt, .-fGetMCnt
	.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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$164025, %edx
	xorl	%esi, %esi
	leaq	sc2Mass(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$2120, %rsp
	.cfi_def_cfa_offset 2176
	movq	%fs:40, %rax
	movq	%rax, 2104(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	call	memset@PLT
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbp, %rdi
	movq	%rdx, szpFpI(%rip)
	call	fgets@PLT
	leaq	siW(%rip), %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	siH(%rip), %rdx
	leaq	.LC0(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	siH(%rip), %eax
	testl	%eax, %eax
	jle	.L23
	leaq	406+sc2Mass(%rip), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L24:
	movq	szpFpI(%rip), %rdx
	movq	%rbp, %rdi
	movl	$404, %esi
	addl	$1, %ebx
	addq	$405, %rbp
	call	fgets@PLT
	movl	siH(%rip), %eax
	cmpl	%ebx, %eax
	jge	.L24
	testl	%eax, %eax
	jle	.L23
	xorl	%r14d, %r14d
	movl	siW(%rip), %edx
	xorl	%ebx, %ebx
	leaq	44(%rsp), %r15
	leaq	405+sc2Mass(%rip), %rax
	movq	$0, (%rsp)
	leal	1(%r14), %ebp
	movq	%rax, 24(%rsp)
	leal	2(%r14), %eax
	movq	$-810, 8(%rsp)
	movl	%eax, 20(%rsp)
	testl	%edx, %edx
	jle	.L33
	.p2align 4,,10
	.p2align 3
.L34:
	movq	24(%rsp), %r10
	movq	%r15, %rax
	movl	$1, %r11d
	leaq	406(%r10), %r12
	movq	%r12, %r15
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%r11d, %r13d
	addl	$1, %r11d
	cmpb	$35, 1(%r10)
	movl	$0, 40(%rsp)
	movl	$0, 44(%rsp)
	jne	.L26
	cmpb	$46, 2(%r10)
	movb	$0, 1(%r10)
	movl	$1, 40(%rsp)
	jne	.L27
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	$46, %edx
	movl	%ebp, %esi
	movl	%r11d, %edi
	call	fGetMCnt.part.0
.L27:
	cmpb	$46, (%r10)
	leal	-1(%r13), %edi
	jne	.L28
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	$46, %edx
	movl	%ebp, %esi
	call	fGetMCnt.part.0
.L28:
	cmpb	$46, (%r15)
	jne	.L29
	movl	20(%rsp), %esi
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	%r13d, %edi
	movl	$46, %edx
	call	fGetMCnt.part.0
.L29:
	movq	8(%rsp), %rax
	leaq	(%r15,%rax), %rdx
	movq	(%rsp), %rax
	cmpb	$46, (%rdx,%rax)
	jne	.L41
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	$46, %edx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	fGetMCnt.part.0
.L41:
	movslq	40(%rsp), %rcx
	movslq	44(%rsp), %rsi
	movl	siW(%rip), %edx
	imulq	%rsi, %rcx
	addq	%rcx, %rbx
.L26:
	addq	$1, %r10
	addq	$1, %r15
	cmpl	%r11d, %edx
	jge	.L31
	movl	20(%rsp), %eax
	cmpl	siH(%rip), %eax
	movq	%r12, %r15
	jg	.L33
	movl	%ebp, %r14d
	subq	$405, 8(%rsp)
	leal	2(%r14), %eax
	addq	$405, (%rsp)
	leal	1(%r14), %ebp
	addq	$405, 24(%rsp)
	movl	%eax, 20(%rsp)
	testl	%edx, %edx
	jg	.L34
.L33:
	movl	$1024, %edx
	movl	$1, %esi
	xorl	%eax, %eax
	movq	%rbx, %r8
	leaq	1072(%rsp), %r12
	leaq	.LC1(%rip), %rcx
	movq	%r12, %rdi
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	2104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$2120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L23:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L33
.L42:
	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	siH
	.comm	siH,4,4
	.local	siW
	.comm	siW,4,4
	.local	sc2Mass
	.comm	sc2Mass,164025,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
	.p2align 4
	.type	fGetMCnt.part.0, @function
fGetMCnt.part.0:
.LFB54:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %r9
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r8, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r9, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%esi, %r12
	imulq	$405, %r12, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	sc2Mass(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r12, %rbx
	addq	%rbp, %rax
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movb	$0, (%rax,%r9)
	cmpb	$35, %dl
	je	.L10
	addl	$1, (%r8)
	movl	$35, %edx
	movl	$35, %eax
.L3:
	imulq	$405, %r12, %rcx
	leal	1(%r13), %edi
	movslq	%edi, %rsi
	addq	%rbp, %rcx
	cmpb	(%rcx,%rsi), %al
	jne	.L4
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%ebx, %esi
	movq	%r9, 8(%rsp)
	movb	%al, 7(%rsp)
	movl	%edx, (%rsp)
	call	fGetMCnt.part.0
	movq	8(%rsp), %r9
	movzbl	7(%rsp), %eax
	movl	(%rsp), %edx
.L4:
	imulq	$405, %r12, %r12
	leal	-1(%r13), %edi
	movslq	%edi, %rcx
	addq	%rbp, %r12
	cmpb	(%r12,%rcx), %al
	jne	.L5
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%ebx, %esi
	movq	%r9, 8(%rsp)
	movb	%al, 7(%rsp)
	movl	%edx, (%rsp)
	call	fGetMCnt.part.0
	movq	8(%rsp), %r9
	movzbl	7(%rsp), %eax
	movl	(%rsp), %edx
.L5:
	leal	1(%rbx), %esi
	movslq	%esi, %rcx
	imulq	$405, %rcx, %rcx
	addq	%rbp, %rcx
	cmpb	(%rcx,%r9), %al
	jne	.L6
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%r13d, %edi
	movq	%r9, 8(%rsp)
	movb	%al, 7(%rsp)
	movl	%edx, (%rsp)
	call	fGetMCnt.part.0
	movq	8(%rsp), %r9
	movzbl	7(%rsp), %eax
	movl	(%rsp), %edx
.L6:
	leal	-1(%rbx), %esi
	movslq	%esi, %rcx
	imulq	$405, %rcx, %rcx
	addq	%rcx, %rbp
	cmpb	0(%rbp,%r9), %al
	jne	.L1
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r14, %r8
	movq	%r15, %rcx
	movl	%r13d, %edi
	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
	jmp	fGetMCnt.part.0
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	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
.L10:
	.cfi_restore_state
	addl	$1, (%rcx)
	movl	$46, %edx
	movl	$46, %eax
	jmp	.L3
	.cfi_endproc
.LFE54:
	.size	fGetMCnt.part.0, .-fGetMCnt.part.0
	.p2align 4
	.globl	fGetMCnt
	.type	fGetMCnt, @function
fGetMCnt:
.LFB51:
	.cfi_startproc
	endbr64
	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
	movslq	%edi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%esi, %rbp
	imulq	$405, %rbp, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	sc2Mass(%rip), %rbx
	addq	%rbx, %rax
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	addq	%r13, %rax
	cmpb	%dl, (%rax)
	jne	.L13
	movb	$0, (%rax)
	movq	%r13, %r11
	movq	%rbp, %r10
	movq	%rcx, %r14
	movq	%r8, %r12
	cmpb	$35, %dl
	je	.L21
	addl	$1, (%r8)
	movl	$35, %edx
	movl	$35, %r15d
.L15:
	imulq	$405, %rbp, %rax
	leal	1(%r11), %edi
	movslq	%edi, %rcx
	addq	%rbx, %rax
	cmpb	(%rax,%rcx), %r15b
	jne	.L16
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r10d, %esi
	movl	%edx, 12(%rsp)
	call	fGetMCnt.part.0
	movl	12(%rsp), %edx
.L16:
	imulq	$405, %rbp, %rbp
	leal	-1(%r11), %edi
	movslq	%edi, %rax
	addq	%rbx, %rbp
	cmpb	0(%rbp,%rax), %r15b
	jne	.L17
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r10d, %esi
	movl	%edx, 12(%rsp)
	call	fGetMCnt.part.0
	movl	12(%rsp), %edx
.L17:
	leal	1(%r10), %esi
	movslq	%esi, %rax
	imulq	$405, %rax, %rax
	addq	%rbx, %rax
	cmpb	(%rax,%r13), %r15b
	jne	.L18
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r11d, %edi
	movl	%edx, 12(%rsp)
	call	fGetMCnt.part.0
	movl	12(%rsp), %edx
.L18:
	leal	-1(%r10), %esi
	movslq	%esi, %rax
	imulq	$405, %rax, %rax
	addq	%rax, %rbx
	cmpb	(%rbx,%r13), %r15b
	jne	.L13
	movq	%r12, %r8
	movq	%r14, %rcx
	movl	%r11d, %edi
	call	fGetMCnt.part.0
.L13:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L21:
	.cfi_restore_state
	addl	$1, (%rcx)
	movl	$46, %edx
	movl	$46, %r15d
	jmp	.L15
	.cfi_endproc
.LFE51:
	.size	fGetMCnt, .-fGetMCnt
	.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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$164025, %edx
	xorl	%esi, %esi
	leaq	sc2Mass(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$2120, %rsp
	.cfi_def_cfa_offset 2176
	movq	%fs:40, %rax
	movq	%rax, 2104(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbp
	call	memset@PLT
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbp, %rdi
	movq	%rdx, szpFpI(%rip)
	call	fgets@PLT
	leaq	siW(%rip), %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	siH(%rip), %rdx
	leaq	.LC0(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	siH(%rip), %eax
	testl	%eax, %eax
	jle	.L23
	leaq	406+sc2Mass(%rip), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L24:
	movq	szpFpI(%rip), %rdx
	movq	%rbp, %rdi
	movl	$404, %esi
	addl	$1, %ebx
	addq	$405, %rbp
	call	fgets@PLT
	movl	siH(%rip), %eax
	cmpl	%ebx, %eax
	jge	.L24
	testl	%eax, %eax
	jle	.L23
	xorl	%r14d, %r14d
	movl	siW(%rip), %edx
	xorl	%ebx, %ebx
	leaq	44(%rsp), %r15
	leaq	405+sc2Mass(%rip), %rax
	movq	$0, (%rsp)
	leal	1(%r14), %ebp
	movq	%rax, 24(%rsp)
	leal	2(%r14), %eax
	movq	$-810, 8(%rsp)
	movl	%eax, 20(%rsp)
	testl	%edx, %edx
	jle	.L33
	.p2align 4,,10
	.p2align 3
.L34:
	movq	24(%rsp), %r10
	movq	%r15, %rax
	movl	$1, %r11d
	leaq	406(%r10), %r12
	movq	%r12, %r15
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%r11d, %r13d
	addl	$1, %r11d
	cmpb	$35, 1(%r10)
	movl	$0, 40(%rsp)
	movl	$0, 44(%rsp)
	jne	.L26
	cmpb	$46, 2(%r10)
	movb	$0, 1(%r10)
	movl	$1, 40(%rsp)
	jne	.L27
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	$46, %edx
	movl	%ebp, %esi
	movl	%r11d, %edi
	call	fGetMCnt.part.0
.L27:
	cmpb	$46, (%r10)
	leal	-1(%r13), %edi
	jne	.L28
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	$46, %edx
	movl	%ebp, %esi
	call	fGetMCnt.part.0
.L28:
	cmpb	$46, (%r15)
	jne	.L29
	movl	20(%rsp), %esi
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	%r13d, %edi
	movl	$46, %edx
	call	fGetMCnt.part.0
.L29:
	movq	8(%rsp), %rax
	leaq	(%r15,%rax), %rdx
	movq	(%rsp), %rax
	cmpb	$46, (%rdx,%rax)
	jne	.L41
	leaq	40(%rsp), %rcx
	movq	%r12, %r8
	movl	$46, %edx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	fGetMCnt.part.0
.L41:
	movslq	40(%rsp), %rcx
	movslq	44(%rsp), %rsi
	movl	siW(%rip), %edx
	imulq	%rsi, %rcx
	addq	%rcx, %rbx
.L26:
	addq	$1, %r10
	addq	$1, %r15
	cmpl	%r11d, %edx
	jge	.L31
	movl	20(%rsp), %eax
	cmpl	siH(%rip), %eax
	movq	%r12, %r15
	jg	.L33
	movl	%ebp, %r14d
	subq	$405, 8(%rsp)
	leal	2(%r14), %eax
	addq	$405, (%rsp)
	leal	1(%r14), %ebp
	addq	$405, 24(%rsp)
	movl	%eax, 20(%rsp)
	testl	%edx, %edx
	jg	.L34
.L33:
	movl	$1024, %edx
	movl	$1, %esi
	xorl	%eax, %eax
	movq	%rbx, %r8
	leaq	1072(%rsp), %r12
	leaq	.LC1(%rip), %rcx
	movq	%r12, %rdi
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	2104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$2120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L23:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L33
.L42:
	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	siH
	.comm	siH,4,4
	.local	siW
	.comm	siW,4,4
	.local	sc2Mass
	.comm	sc2Mass,164025,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 <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_SIZE_MAX		405										// 最大サイズ
#define D_MASS_BLACK	'#'										// マス - 黒
#define D_MASS_WHITE	'.'										// マス - 白

// 内部変数
static FILE *szpFpI;											// 入力
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX];					// マス
static int siW, siH;											// 幅・高さ

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

// マス数 - 取得
int
fGetMCnt(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
	, char pcMass				// <I> 対象マスの色
	, int *pipBCnt				// <O> 黒数
	, int *pipWCnt				// <O> 白数
)
{
	// 対象マスの色 - チェック
	if (sc2Mass[piY][piX] != pcMass) {
		return 0;
	}

	// 処理済
	sc2Mass[piY][piX] = 0;

	// 色数・次の色
	if (pcMass == D_MASS_BLACK) {		// 黒
		(*pipBCnt)++;
		pcMass = D_MASS_WHITE;
	}
	else {								// 白
		(*pipWCnt)++;
		pcMass = D_MASS_BLACK;
	}

	// 上下左右へ
	fGetMCnt(piX + 1, piY, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX - 1, piY, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX, piY + 1, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX, piY - 1, pcMass, pipBCnt, pipWCnt);

	return 0;
}

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

	// データ - 初期化
	memset(sc2Mass, 0, sizeof(sc2Mass));						// マス

	// 入力 - セット
#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%d", &siH, &siW);

	// マス - 取得
	for (i = 1; i <= siH; i++) {
		fgets(&sc2Mass[i][1], sizeof(sc2Mass[0]) - 1, szpFpI);
	}

	// パターン数 - 取得
	long long llPCnt = 0;
	for (i = 1; i <= siH; i++) {
		for (j = 1; j <= siW; j++) {

			// マス数 - 取得
			int liBCnt = 0;
			int liWCnt = 0;
			fGetMCnt(j, i, D_MASS_BLACK, &liBCnt, &liWCnt);

			// パターン数 - 加算
			llPCnt += (long long)liBCnt * (long long)liWCnt;
		}
	}

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

	// 結果 - 表示
#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;
}


3 4
.#.
..#
#..
 4 4


...
 3 3
.#.
-.#
..
 3 4
.#.
..#
#./
 3 2
.#.
-.#
..
 3 1
.#.
..#
#./
 3 2
.#.
#.-
..
 4 2
.#.
#.-
..
 4 2
.#.
#.-
-.
 4 1
.#.
#--
..

10
 0
 6
 8
 6
 2
 8
 8
 6
 6

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

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

// 内部定数
#define D_SIZE_MAX		405										// 最大サイズ
#define D_MASS_BLACK	'#'										// マス - 黒
#define D_MASS_WHITE	'.'										// マス - 白

// 内部変数
static FILE *szpFpI;											// 入力
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX];					// マス
static int siW, siH;											// 幅・高さ

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

// マス数 - 取得
int
fGetMCnt(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
	, char pcMass				// <I> 対象マスの色
	, int *pipBCnt				// <O> 黒数
	, int *pipWCnt				// <O> 白数
)
{
	// 対象マスの色 - チェック
	if (sc2Mass[piY][piX] != pcMass) {
		return 0;
	}

	// 処理済
	sc2Mass[piY][piX] = 0;

	// 色数・次の色
	if (pcMass == D_MASS_BLACK) {		// 黒
		(*pipBCnt)++;
		pcMass = D_MASS_WHITE;
	}
	else {								// 白
		(*pipWCnt)++;
		pcMass = D_MASS_BLACK;
	}

	// 上下左右へ
	fGetMCnt(piX + 1, piY, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX - 1, piY, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX, piY + 1, pcMass, pipBCnt, pipWCnt);
	fGetMCnt(piX, piY - 1, pcMass, pipBCnt, pipWCnt);

	return 0;
}

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

	// データ - 初期化
	memset(sc2Mass, 0, sizeof(sc2Mass));						// マス

	// 入力 - セット
#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%d", &siH, &siW);

	// マス - 取得
	for (i = 1; i <= siH; i++) {
		fgets(&sc2Mass[i][1], sizeof(sc2Mass[0]) - 1, szpFpI);
	}

	// パターン数 - 取得
	long long llPCnt = 0;
	for (i = 1; i <= siH; i++) {
		for (j = 1; j <= siW; j++) {

			// マス数 - 取得
			int liBCnt = 0;
			int liWCnt = 0;
			fGetMCnt(j, i, D_MASS_BLACK, &liBCnt, &liWCnt);

			// パターン数 - 加算
			llPCnt += (long long)liBCnt * (long long)liWCnt;
		}
	}

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

	// 結果 - 表示
#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	sc2Mass
	.comm	sc2Mass,164025,32
	.local	siW
	.comm	siW,4,4
	.local	siH
	.comm	siH,4,4
	.globl	fGetMCnt
	.type	fGetMCnt, @function
fGetMCnt:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, %eax
	movq	%rcx, -24(%rbp)
	movq	%r8, -32(%rbp)
	movb	%al, -12(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$405, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -12(%rbp)
	je	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$405, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	cmpb	$35, -12(%rbp)
	jne	.L4
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movb	$46, -12(%rbp)
	jmp	.L5
.L4:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movb	$35, -12(%rbp)
.L5:
	movsbl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %edi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movl	-8(%rbp), %eax
	movq	%rsi, %r8
	movl	%eax, %esi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movl	-8(%rbp), %eax
	movq	%rsi, %r8
	movl	%eax, %esi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	leal	1(%rax), %esi
	movq	-32(%rbp), %rdi
	movq	-24(%rbp), %rcx
	movl	-4(%rbp), %eax
	movq	%rdi, %r8
	movl	%eax, %edi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	leal	-1(%rax), %esi
	movq	-32(%rbp), %rdi
	movq	-24(%rbp), %rcx
	movl	-4(%rbp), %eax
	movq	%rdi, %r8
	movl	%eax, %edi
	call	fGetMCnt
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fGetMCnt, .-fGetMCnt
	.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
	subq	$2112, %rsp
	movl	%edi, -2100(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$164025, %edx
	movl	$0, %esi
	leaq	sc2Mass(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	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	siW(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siH(%rip), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -2080(%rbp)
	jmp	.L7
.L8:
	movq	szpFpI(%rip), %rax
	movl	-2080(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$405, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	sc2Mass(%rip), %rdx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movl	$404, %esi
	movq	%rcx, %rdi
	call	fgets@PLT
	addl	$1, -2080(%rbp)
.L7:
	movl	siH(%rip), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L8
	movq	$0, -2072(%rbp)
	movl	$1, -2080(%rbp)
	jmp	.L9
.L12:
	movl	$1, -2076(%rbp)
	jmp	.L10
.L11:
	movl	$0, -2088(%rbp)
	movl	$0, -2084(%rbp)
	leaq	-2084(%rbp), %rcx
	leaq	-2088(%rbp), %rdx
	movl	-2080(%rbp), %esi
	movl	-2076(%rbp), %eax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	$35, %edx
	movl	%eax, %edi
	call	fGetMCnt
	movl	-2088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2084(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -2072(%rbp)
	addl	$1, -2076(%rbp)
.L10:
	movl	siW(%rip), %eax
	cmpl	%eax, -2076(%rbp)
	jle	.L11
	addl	$1, -2080(%rbp)
.L9:
	movl	siH(%rip), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L12
	movq	-2072(%rbp), %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	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	sc2Mass
	.comm	sc2Mass,164025,32
	.local	siW
	.comm	siW,4,4
	.local	siH
	.comm	siH,4,4
	.globl	fGetMCnt
	.type	fGetMCnt, @function
fGetMCnt:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, %eax
	movq	%rcx, -24(%rbp)
	movq	%r8, -32(%rbp)
	movb	%al, -12(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$405, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -12(%rbp)
	je	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$405, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	cmpb	$35, -12(%rbp)
	jne	.L4
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movb	$46, -12(%rbp)
	jmp	.L5
.L4:
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movb	$35, -12(%rbp)
.L5:
	movsbl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %edi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movl	-8(%rbp), %eax
	movq	%rsi, %r8
	movl	%eax, %esi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edi
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rcx
	movl	-8(%rbp), %eax
	movq	%rsi, %r8
	movl	%eax, %esi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	leal	1(%rax), %esi
	movq	-32(%rbp), %rdi
	movq	-24(%rbp), %rcx
	movl	-4(%rbp), %eax
	movq	%rdi, %r8
	movl	%eax, %edi
	call	fGetMCnt
	movsbl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	leal	-1(%rax), %esi
	movq	-32(%rbp), %rdi
	movq	-24(%rbp), %rcx
	movl	-4(%rbp), %eax
	movq	%rdi, %r8
	movl	%eax, %edi
	call	fGetMCnt
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fGetMCnt, .-fGetMCnt
	.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
	subq	$2112, %rsp
	movl	%edi, -2100(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$164025, %edx
	movl	$0, %esi
	leaq	sc2Mass(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	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	siW(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siH(%rip), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -2080(%rbp)
	jmp	.L7
.L8:
	movq	szpFpI(%rip), %rax
	movl	-2080(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$405, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	sc2Mass(%rip), %rdx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movl	$404, %esi
	movq	%rcx, %rdi
	call	fgets@PLT
	addl	$1, -2080(%rbp)
.L7:
	movl	siH(%rip), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L8
	movq	$0, -2072(%rbp)
	movl	$1, -2080(%rbp)
	jmp	.L9
.L12:
	movl	$1, -2076(%rbp)
	jmp	.L10
.L11:
	movl	$0, -2088(%rbp)
	movl	$0, -2084(%rbp)
	leaq	-2084(%rbp), %rcx
	leaq	-2088(%rbp), %rdx
	movl	-2080(%rbp), %esi
	movl	-2076(%rbp), %eax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	$35, %edx
	movl	%eax, %edi
	call	fGetMCnt
	movl	-2088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2084(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -2072(%rbp)
	addl	$1, -2076(%rbp)
.L10:
	movl	siW(%rip), %eax
	cmpl	%eax, -2076(%rbp)
	jle	.L11
	addl	$1, -2080(%rbp)
.L9:
	movl	siH(%rip), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L12
	movq	-2072(%rbp), %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	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
