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		1005									// 最大サイズ
#define D_STACK_MAX		D_SIZE_MAX * D_SIZE_MAX					// 最大スタック数
#define D_MASS_BLACK	'#'										// マス - 黒
#define D_MASS_WHITE	'.'										// マス - 白

// 内部構造体 - スタック情報
typedef struct Stack {
	int miX, miY;												// 位置
} Stack;

// 内部変数
static FILE *szpFpI;											// 入力
static int siW, siH;											// 幅・高さ
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX];					// マス
static Stack sz1Stack[D_STACK_MAX];								// スタック
static int siSCnt;												// スタック数
static int siSSNo;												// スタック位置 - セット
static int siSGNo;												// スタック位置 - 取得

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

// 出力
int
fOut(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// スタック - 追加
int
fStackAdd(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
)
{
	// セット
	sz1Stack[siSSNo].miX = piX;
	sz1Stack[siSSNo].miY = piY;

	// スタック数
	siSCnt++;

	// スタック位置 - セット
	if (siSSNo < D_STACK_MAX - 1) {
		siSSNo++;
	}
	else {
		siSSNo = 0;
	}

	return 0;
}

// スタック - 取得
int
fStackGet(
	Stack *pzpRet				// <O> 取得値
)
{
	// スタック数
	if (siSCnt < 1) {
		return -1;
	}
	siSCnt--;

	// 取得
	memcpy(pzpRet, &sz1Stack[siSGNo], sizeof(Stack));

	// スタック位置 - 取得
	if (siSGNo < D_STACK_MAX - 1) {
		siSGNo++;
	}
	else {
		siSGNo = 0;
	}

	return 0;
}

// 黒化
int
fToBlack(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
)
{
	// マス - チェック
	if (sc2Mass[piY][piX] != D_MASS_WHITE) {
		return 0;
	}

	// 黒化
	sc2Mass[piY][piX] = D_MASS_BLACK;

	// スタック - 追加
	fStackAdd(piX, piY);

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i, j;
	char lc1Buf[1024];

	// 幅・高さ - 取得
	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);
	}

	// スタック - 初期化
	for (i = 1; i <= siH; i++) {
		for (j = 1; j <= siW; j++) {
			if (sc2Mass[i][j] == D_MASS_BLACK) {
				fStackAdd(j, i);
			}
		}
	}

	// 黒化
	for (i = -1; ; i++) {

		// スタック数
		int liSCnt = siSCnt;
		if (liSCnt < 1) {
			return i;
		}

		// スタック数でループ
		for (j = 0; j < liSCnt; j++) {

			// スタック - 取得
			Stack lzStack;
			fStackGet(&lzStack);

			// 上下左右を黒化
			fToBlack(lzStack.miX + 1, lzStack.miY);
			fToBlack(lzStack.miX - 1, lzStack.miY);
			fToBlack(lzStack.miX, lzStack.miY + 1);
			fToBlack(lzStack.miX, lzStack.miY - 1);
		}
	}

	return 0;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// データ - 初期化
	memset(sc2Mass, 0, sizeof(sc2Mass));						// マス
	siSCnt = 0;													// スタック数
	siSSNo = 0;													// スタック位置 - セット
	siSGNo = 0;													// スタック位置 - 取得

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

	// 実行メイン
	liRet = fMain();

	// 出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOut(lc1Buf);

	// 残データ有無
#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", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

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

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	siW
	.comm	siW,4,4
	.local	siH
	.comm	siH,4,4
	.local	sc2Mass
	.comm	sc2Mass,1010025,32
	.local	sz1Stack
	.comm	sz1Stack,8080200,32
	.local	siSCnt
	.comm	siSCnt,4,4
	.local	siSSNo
	.comm	siSSNo,4,4
	.local	siSGNo
	.comm	siSGNo,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOut
	.type	fOut, @function
fOut:
.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	%rdi, -1048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-1048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fOut, .-fOut
	.globl	fStackAdd
	.type	fStackAdd, @function
fStackAdd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	siSSNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Stack(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	siSSNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+sz1Stack(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	siSCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movl	siSSNo(%rip), %eax
	cmpl	$1010023, %eax
	jg	.L5
	movl	siSSNo(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSSNo(%rip)
	jmp	.L6
.L5:
	movl	$0, siSSNo(%rip)
.L6:
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fStackAdd, .-fStackAdd
	.globl	fStackGet
	.type	fStackGet, @function
fStackGet:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	siSCnt(%rip), %eax
	testl	%eax, %eax
	jg	.L9
	movl	$-1, %eax
	jmp	.L10
.L9:
	movl	siSCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movl	siSGNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Stack(%rip), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	siSGNo(%rip), %eax
	cmpl	$1010023, %eax
	jg	.L11
	movl	siSGNo(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSGNo(%rip)
	jmp	.L12
.L11:
	movl	$0, siSGNo(%rip)
.L12:
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fStackGet, .-fStackGet
	.globl	fToBlack
	.type	fToBlack, @function
fToBlack:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L14
	movl	$0, %eax
	jmp	.L15
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movb	$35, (%rax)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fStackAdd
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fToBlack, .-fToBlack
	.section	.rodata
.LC1:
	.string	"%d%d"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-1040(%rbp), %rax
	leaq	siW(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siH(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -1060(%rbp)
	jmp	.L17
.L18:
	movq	szpFpI(%rip), %rax
	movl	-1060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1005, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	sc2Mass(%rip), %rdx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movl	$1004, %esi
	movq	%rcx, %rdi
	call	fgets@PLT
	addl	$1, -1060(%rbp)
.L17:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jle	.L18
	movl	$1, -1060(%rbp)
	jmp	.L19
.L23:
	movl	$1, -1056(%rbp)
	jmp	.L20
.L22:
	movl	-1056(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1060(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L21
	movl	-1060(%rbp), %edx
	movl	-1056(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fStackAdd
.L21:
	addl	$1, -1056(%rbp)
.L20:
	movl	siW(%rip), %eax
	cmpl	%eax, -1056(%rbp)
	jle	.L22
	addl	$1, -1060(%rbp)
.L19:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jle	.L23
	movl	$-1, -1060(%rbp)
.L28:
	movl	siSCnt(%rip), %eax
	movl	%eax, -1052(%rbp)
	cmpl	$0, -1052(%rbp)
	jg	.L24
	movl	-1060(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	jmp	.L30
.L24:
	movl	$0, -1056(%rbp)
	jmp	.L26
.L27:
	leaq	-1048(%rbp), %rax
	movq	%rax, %rdi
	call	fStackGet
	movl	-1044(%rbp), %eax
	movl	-1048(%rbp), %edx
	addl	$1, %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	movl	-1048(%rbp), %edx
	subl	$1, %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	leal	1(%rax), %edx
	movl	-1048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fToBlack
	addl	$1, -1056(%rbp)
.L26:
	movl	-1056(%rbp), %eax
	cmpl	-1052(%rbp), %eax
	jl	.L27
	addl	$1, -1060(%rbp)
	jmp	.L28
.L30:
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	fMain, .-fMain
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB11:
	.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	$1010025, %edx
	movl	$0, %esi
	leaq	sc2Mass(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, siSCnt(%rip)
	movl	$0, siSSNo(%rip)
	movl	$0, siSGNo(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	-1044(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	fOut
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	fOne
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	"%s"
	.text
	.p2align 4
	.globl	fOut
	.type	fOut, @function
fOut:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	fOut, .-fOut
	.p2align 4
	.globl	fStackAdd
	.type	fStackAdd, @function
fStackAdd:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	siSSNo(%rip), %rcx
	movd	%edi, %xmm0
	movd	%esi, %xmm1
	leaq	sz1Stack(%rip), %rax
	punpckldq	%xmm1, %xmm0
	addl	$1, siSCnt(%rip)
	movl	$0, %edx
	cmpl	$1010024, %ecx
	movq	%xmm0, (%rax,%rcx,8)
	leal	1(%rcx), %eax
	cmovge	%edx, %eax
	movl	%eax, siSSNo(%rip)
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fStackAdd, .-fStackAdd
	.p2align 4
	.globl	fStackGet
	.type	fStackGet, @function
fStackGet:
.LFB53:
	.cfi_startproc
	endbr64
	movl	siSCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L10
	movslq	siSGNo(%rip), %rcx
	leaq	sz1Stack(%rip), %rdx
	subl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movq	(%rdx,%rcx,8), %rdx
	movq	%rcx, %rax
	movq	%rdx, (%rdi)
	cmpl	$1010023, %ecx
	jg	.L9
	addl	$1, %eax
	movl	%eax, siSGNo(%rip)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$0, siSGNo(%rip)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	fStackGet, .-fStackGet
	.p2align 4
	.globl	fToBlack
	.type	fToBlack, @function
fToBlack:
.LFB54:
	.cfi_startproc
	endbr64
	movd	%esi, %xmm1
	movslq	%esi, %rsi
	leaq	sc2Mass(%rip), %rax
	imulq	$1005, %rsi, %rsi
	movd	%edi, %xmm0
	movslq	%edi, %rdi
	punpckldq	%xmm1, %xmm0
	addq	%rsi, %rax
	addq	%rdi, %rax
	cmpb	$46, (%rax)
	jne	.L12
	movslq	siSSNo(%rip), %rcx
	movb	$35, (%rax)
	movl	$0, %edx
	leaq	sz1Stack(%rip), %rax
	addl	$1, siSCnt(%rip)
	movq	%xmm0, (%rax,%rcx,8)
	cmpl	$1010024, %ecx
	leal	1(%rcx), %eax
	cmovge	%edx, %eax
	movl	%eax, siSSNo(%rip)
.L12:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	fToBlack, .-fToBlack
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1024, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$1048, %rsp
	.cfi_def_cfa_offset 1088
	movq	szpFpI(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	leaq	siW(%rip), %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	siH(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	siH(%rip), %eax
	movl	siSCnt(%rip), %r10d
	testl	%eax, %eax
	jle	.L16
	leaq	1006+sc2Mass(%rip), %r12
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L17:
	movq	szpFpI(%rip), %rdx
	movq	%r12, %rdi
	movl	$1004, %esi
	addl	$1, %ebp
	addq	$1005, %r12
	call	fgets@PLT
	movl	siH(%rip), %eax
	cmpl	%ebp, %eax
	jge	.L17
	movl	siSCnt(%rip), %r10d
	testl	%eax, %eax
	jle	.L16
	movl	siW(%rip), %ebp
	leal	1(%rax), %r9d
	movl	%r10d, %edi
	xorl	%r8d, %r8d
	movl	$1, %eax
	movl	siSSNo(%rip), %ecx
	leaq	1005+sc2Mass(%rip), %rdx
	leaq	sz1Stack(%rip), %r11
	movd	%eax, %xmm0
	leal	1(%rbp), %esi
	.p2align 4,,10
	.p2align 3
.L18:
	movl	$1, %eax
	testl	%ebp, %ebp
	jg	.L20
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L23
.L20:
	movd	%eax, %xmm1
	cmpb	$35, (%rdx,%rax)
	punpckldq	%xmm0, %xmm1
	jne	.L19
	movslq	%ecx, %r8
	addl	$1, %edi
	movq	%xmm1, (%r11,%r8,8)
	cmpl	$1010023, %ecx
	jg	.L38
	addq	$1, %rax
	addl	$1, %ecx
	movl	$1, %r8d
	cmpq	%rax, %rsi
	jne	.L20
	.p2align 4,,10
	.p2align 3
.L23:
	movd	%xmm0, %eax
	addq	$1005, %rdx
	addl	$1, %eax
	movd	%eax, %xmm0
	cmpl	%r9d, %eax
	jne	.L18
	testb	%r8b, %r8b
	je	.L16
	movl	%ecx, siSSNo(%rip)
	movl	%edi, %r10d
	movl	%edi, siSCnt(%rip)
.L16:
	movl	$-1, %r11d
	leaq	sc2Mass(%rip), %rsi
	leaq	sz1Stack(%rip), %r9
	xorl	%r8d, %r8d
	testl	%r10d, %r10d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r10d, %ecx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L35:
	testl	%ecx, %ecx
	je	.L25
	movslq	siSGNo(%rip), %rax
	subl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rax, %rdx
	movq	(%r9,%rax,8), %rbx
	leal	1(%rax), %eax
	cmpl	$1010024, %edx
	cmovge	%r8d, %eax
	movl	%eax, siSGNo(%rip)
.L25:
	movq	%rbx, %rax
	leal	1(%rbx), %edx
	movl	%ebx, %r12d
	sarq	$32, %rax
	movslq	%edx, %r13
	movd	%edx, %xmm0
	imulq	$1005, %rax, %rbp
	movd	%eax, %xmm2
	movslq	%eax, %rdx
	punpckldq	%xmm2, %xmm0
	addq	%rsi, %rbp
	addq	%r13, %rbp
	cmpb	$46, 0(%rbp)
	jne	.L27
	movb	$35, 0(%rbp)
	movslq	siSSNo(%rip), %rbp
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rbp, %r13
	movq	%xmm0, (%r9,%rbp,8)
	leal	1(%rbp), %ebp
	cmpl	$1010024, %r13d
	cmovge	%r8d, %ebp
	movl	%ebp, siSSNo(%rip)
.L27:
	imulq	$1005, %rdx, %rdx
	leal	-1(%r12), %ebp
	movd	%eax, %xmm3
	movd	%ebp, %xmm0
	movslq	%ebp, %rbp
	punpckldq	%xmm3, %xmm0
	addq	%rsi, %rdx
	addq	%rbp, %rdx
	cmpb	$46, (%rdx)
	jne	.L29
	movb	$35, (%rdx)
	movslq	siSSNo(%rip), %rdx
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rdx, %rbp
	movq	%xmm0, (%r9,%rdx,8)
	leal	1(%rdx), %edx
	cmpl	$1010024, %ebp
	cmovge	%r8d, %edx
	movl	%edx, siSSNo(%rip)
.L29:
	leal	1(%rax), %edx
	movslq	%r12d, %rbp
	movd	%r12d, %xmm0
	movd	%edx, %xmm4
	movslq	%edx, %rdx
	imulq	$1005, %rdx, %rdx
	punpckldq	%xmm4, %xmm0
	addq	%rsi, %rdx
	addq	%rbp, %rdx
	cmpb	$46, (%rdx)
	jne	.L31
	movb	$35, (%rdx)
	movslq	siSSNo(%rip), %rdx
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rdx, %r13
	movq	%xmm0, (%r9,%rdx,8)
	leal	1(%rdx), %edx
	cmpl	$1010024, %r13d
	cmovge	%r8d, %edx
	movl	%edx, siSSNo(%rip)
.L31:
	subl	$1, %eax
	movd	%r12d, %xmm0
	movd	%eax, %xmm5
	cltq
	imulq	$1005, %rax, %rax
	punpckldq	%xmm5, %xmm0
	addq	%rsi, %rax
	addq	%rbp, %rax
	cmpb	$46, (%rax)
	jne	.L33
	movb	$35, (%rax)
	movslq	siSSNo(%rip), %rax
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rax, %rdx
	movq	%xmm0, (%r9,%rax,8)
	leal	1(%rax), %eax
	cmpl	$1010024, %edx
	cmovge	%r8d, %eax
	movl	%eax, siSSNo(%rip)
.L33:
	addl	$1, %edi
	cmpl	%edi, %r10d
	jg	.L35
	addl	$1, %r11d
	testl	%ecx, %ecx
	je	.L14
	movl	%ecx, %r10d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$1048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r11d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L57:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	fMain, .-fMain
	.section	.rodata.str1.1
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%esi, %esi
	movl	$1010025, %edx
	leaq	sc2Mass(%rip), %rdi
	subq	$1040, %rsp
	.cfi_def_cfa_offset 1056
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	call	memset@PLT
	movq	stdin(%rip), %rax
	movl	$0, siSCnt(%rip)
	movl	$0, siSSNo(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	movl	$0, siSGNo(%rip)
	call	fMain
	movl	$1024, %edx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	%eax, %r8d
	leaq	.LC2(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$1040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE56:
	.size	fOne, .-fOne
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB57:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	call	fOne
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.local	siSGNo
	.comm	siSGNo,4,4
	.local	siSSNo
	.comm	siSSNo,4,4
	.local	siSCnt
	.comm	siSCnt,4,4
	.local	sz1Stack
	.comm	sz1Stack,8080200,32
	.local	sc2Mass
	.comm	sc2Mass,1010025,32
	.local	siH
	.comm	siH,4,4
	.local	siW
	.comm	siW,4,4
	.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	"%s"
	.text
	.p2align 4
	.globl	fOut
	.type	fOut, @function
fOut:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	fOut, .-fOut
	.p2align 4
	.globl	fStackAdd
	.type	fStackAdd, @function
fStackAdd:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	siSSNo(%rip), %rcx
	movd	%edi, %xmm0
	movd	%esi, %xmm1
	leaq	sz1Stack(%rip), %rax
	punpckldq	%xmm1, %xmm0
	addl	$1, siSCnt(%rip)
	movl	$0, %edx
	cmpl	$1010024, %ecx
	movq	%xmm0, (%rax,%rcx,8)
	leal	1(%rcx), %eax
	cmovge	%edx, %eax
	movl	%eax, siSSNo(%rip)
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fStackAdd, .-fStackAdd
	.p2align 4
	.globl	fStackGet
	.type	fStackGet, @function
fStackGet:
.LFB53:
	.cfi_startproc
	endbr64
	movl	siSCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L10
	movslq	siSGNo(%rip), %rcx
	leaq	sz1Stack(%rip), %rdx
	subl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movq	(%rdx,%rcx,8), %rdx
	movq	%rcx, %rax
	movq	%rdx, (%rdi)
	cmpl	$1010023, %ecx
	jg	.L9
	addl	$1, %eax
	movl	%eax, siSGNo(%rip)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$0, siSGNo(%rip)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	fStackGet, .-fStackGet
	.p2align 4
	.globl	fToBlack
	.type	fToBlack, @function
fToBlack:
.LFB54:
	.cfi_startproc
	endbr64
	movd	%esi, %xmm1
	movslq	%esi, %rsi
	leaq	sc2Mass(%rip), %rax
	imulq	$1005, %rsi, %rsi
	movd	%edi, %xmm0
	movslq	%edi, %rdi
	punpckldq	%xmm1, %xmm0
	addq	%rsi, %rax
	addq	%rdi, %rax
	cmpb	$46, (%rax)
	jne	.L12
	movslq	siSSNo(%rip), %rcx
	movb	$35, (%rax)
	movl	$0, %edx
	leaq	sz1Stack(%rip), %rax
	addl	$1, siSCnt(%rip)
	movq	%xmm0, (%rax,%rcx,8)
	cmpl	$1010024, %ecx
	leal	1(%rcx), %eax
	cmovge	%edx, %eax
	movl	%eax, siSSNo(%rip)
.L12:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	fToBlack, .-fToBlack
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1024, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$1048, %rsp
	.cfi_def_cfa_offset 1088
	movq	szpFpI(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	leaq	siW(%rip), %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	leaq	siH(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	siH(%rip), %eax
	movl	siSCnt(%rip), %r10d
	testl	%eax, %eax
	jle	.L16
	leaq	1006+sc2Mass(%rip), %r12
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L17:
	movq	szpFpI(%rip), %rdx
	movq	%r12, %rdi
	movl	$1004, %esi
	addl	$1, %ebp
	addq	$1005, %r12
	call	fgets@PLT
	movl	siH(%rip), %eax
	cmpl	%ebp, %eax
	jge	.L17
	movl	siSCnt(%rip), %r10d
	testl	%eax, %eax
	jle	.L16
	movl	siW(%rip), %ebp
	leal	1(%rax), %r9d
	movl	%r10d, %edi
	xorl	%r8d, %r8d
	movl	$1, %eax
	movl	siSSNo(%rip), %ecx
	leaq	1005+sc2Mass(%rip), %rdx
	leaq	sz1Stack(%rip), %r11
	movd	%eax, %xmm0
	leal	1(%rbp), %esi
	.p2align 4,,10
	.p2align 3
.L18:
	movl	$1, %eax
	testl	%ebp, %ebp
	jg	.L20
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L23
.L20:
	movd	%eax, %xmm1
	cmpb	$35, (%rdx,%rax)
	punpckldq	%xmm0, %xmm1
	jne	.L19
	movslq	%ecx, %r8
	addl	$1, %edi
	movq	%xmm1, (%r11,%r8,8)
	cmpl	$1010023, %ecx
	jg	.L38
	addq	$1, %rax
	addl	$1, %ecx
	movl	$1, %r8d
	cmpq	%rax, %rsi
	jne	.L20
	.p2align 4,,10
	.p2align 3
.L23:
	movd	%xmm0, %eax
	addq	$1005, %rdx
	addl	$1, %eax
	movd	%eax, %xmm0
	cmpl	%r9d, %eax
	jne	.L18
	testb	%r8b, %r8b
	je	.L16
	movl	%ecx, siSSNo(%rip)
	movl	%edi, %r10d
	movl	%edi, siSCnt(%rip)
.L16:
	movl	$-1, %r11d
	leaq	sc2Mass(%rip), %rsi
	leaq	sz1Stack(%rip), %r9
	xorl	%r8d, %r8d
	testl	%r10d, %r10d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r10d, %ecx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L35:
	testl	%ecx, %ecx
	je	.L25
	movslq	siSGNo(%rip), %rax
	subl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rax, %rdx
	movq	(%r9,%rax,8), %rbx
	leal	1(%rax), %eax
	cmpl	$1010024, %edx
	cmovge	%r8d, %eax
	movl	%eax, siSGNo(%rip)
.L25:
	movq	%rbx, %rax
	leal	1(%rbx), %edx
	movl	%ebx, %r12d
	sarq	$32, %rax
	movslq	%edx, %r13
	movd	%edx, %xmm0
	imulq	$1005, %rax, %rbp
	movd	%eax, %xmm2
	movslq	%eax, %rdx
	punpckldq	%xmm2, %xmm0
	addq	%rsi, %rbp
	addq	%r13, %rbp
	cmpb	$46, 0(%rbp)
	jne	.L27
	movb	$35, 0(%rbp)
	movslq	siSSNo(%rip), %rbp
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rbp, %r13
	movq	%xmm0, (%r9,%rbp,8)
	leal	1(%rbp), %ebp
	cmpl	$1010024, %r13d
	cmovge	%r8d, %ebp
	movl	%ebp, siSSNo(%rip)
.L27:
	imulq	$1005, %rdx, %rdx
	leal	-1(%r12), %ebp
	movd	%eax, %xmm3
	movd	%ebp, %xmm0
	movslq	%ebp, %rbp
	punpckldq	%xmm3, %xmm0
	addq	%rsi, %rdx
	addq	%rbp, %rdx
	cmpb	$46, (%rdx)
	jne	.L29
	movb	$35, (%rdx)
	movslq	siSSNo(%rip), %rdx
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rdx, %rbp
	movq	%xmm0, (%r9,%rdx,8)
	leal	1(%rdx), %edx
	cmpl	$1010024, %ebp
	cmovge	%r8d, %edx
	movl	%edx, siSSNo(%rip)
.L29:
	leal	1(%rax), %edx
	movslq	%r12d, %rbp
	movd	%r12d, %xmm0
	movd	%edx, %xmm4
	movslq	%edx, %rdx
	imulq	$1005, %rdx, %rdx
	punpckldq	%xmm4, %xmm0
	addq	%rsi, %rdx
	addq	%rbp, %rdx
	cmpb	$46, (%rdx)
	jne	.L31
	movb	$35, (%rdx)
	movslq	siSSNo(%rip), %rdx
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rdx, %r13
	movq	%xmm0, (%r9,%rdx,8)
	leal	1(%rdx), %edx
	cmpl	$1010024, %r13d
	cmovge	%r8d, %edx
	movl	%edx, siSSNo(%rip)
.L31:
	subl	$1, %eax
	movd	%r12d, %xmm0
	movd	%eax, %xmm5
	cltq
	imulq	$1005, %rax, %rax
	punpckldq	%xmm5, %xmm0
	addq	%rsi, %rax
	addq	%rbp, %rax
	cmpb	$46, (%rax)
	jne	.L33
	movb	$35, (%rax)
	movslq	siSSNo(%rip), %rax
	addl	$1, %ecx
	movl	%ecx, siSCnt(%rip)
	movq	%rax, %rdx
	movq	%xmm0, (%r9,%rax,8)
	leal	1(%rax), %eax
	cmpl	$1010024, %edx
	cmovge	%r8d, %eax
	movl	%eax, siSSNo(%rip)
.L33:
	addl	$1, %edi
	cmpl	%edi, %r10d
	jg	.L35
	addl	$1, %r11d
	testl	%ecx, %ecx
	je	.L14
	movl	%ecx, %r10d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$1048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r11d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L57:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	fMain, .-fMain
	.section	.rodata.str1.1
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%esi, %esi
	movl	$1010025, %edx
	leaq	sc2Mass(%rip), %rdi
	subq	$1040, %rsp
	.cfi_def_cfa_offset 1056
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	call	memset@PLT
	movq	stdin(%rip), %rax
	movl	$0, siSCnt(%rip)
	movl	$0, siSSNo(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	movl	$0, siSGNo(%rip)
	call	fMain
	movl	$1024, %edx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	%eax, %r8d
	leaq	.LC2(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$1040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE56:
	.size	fOne, .-fOne
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB57:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	call	fOne
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.local	siSGNo
	.comm	siSGNo,4,4
	.local	siSSNo
	.comm	siSSNo,4,4
	.local	siSCnt
	.comm	siSCnt,4,4
	.local	sz1Stack
	.comm	sz1Stack,8080200,32
	.local	sc2Mass
	.comm	sc2Mass,1010025,32
	.local	siH
	.comm	siH,4,4
	.local	siW
	.comm	siW,4,4
	.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		1005									// 最大サイズ
#define D_STACK_MAX		D_SIZE_MAX * D_SIZE_MAX					// 最大スタック数
#define D_MASS_BLACK	'#'										// マス - 黒
#define D_MASS_WHITE	'.'										// マス - 白

// 内部構造体 - スタック情報
typedef struct Stack {
	int miX, miY;												// 位置
} Stack;

// 内部変数
static FILE *szpFpI;											// 入力
static int siW, siH;											// 幅・高さ
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX];					// マス
static Stack sz1Stack[D_STACK_MAX];								// スタック
static int siSCnt;												// スタック数
static int siSSNo;												// スタック位置 - セット
static int siSGNo;												// スタック位置 - 取得

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

// 出力
int
fOut(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// スタック - 追加
int
fStackAdd(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
)
{
	// セット
	sz1Stack[siSSNo].miX = piX;
	sz1Stack[siSSNo].miY = piY;

	// スタック数
	siSCnt++;

	// スタック位置 - セット
	if (siSSNo < D_STACK_MAX - 1) {
		siSSNo++;
	}
	else {
		siSSNo = 0;
	}

	return 0;
}

// スタック - 取得
int
fStackGet(
	Stack *pzpRet				// <O> 取得値
)
{
	// スタック数
	if (siSCnt < 1) {
		return -1;
	}
	siSCnt--;

	// 取得
	memcpy(pzpRet, &sz1Stack[siSGNo], sizeof(Stack));

	// スタック位置 - 取得
	if (siSGNo < D_STACK_MAX - 1) {
		siSGNo++;
	}
	else {
		siSGNo = 0;
	}

	return 0;
}

// 黒化
int
fToBlack(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
)
{
	// マス - チェック
	if (sc2Mass[piY][piX] != D_MASS_WHITE) {
		return 0;
	}

	// 黒化
	sc2Mass[piY][piX] = D_MASS_BLACK;

	// スタック - 追加
	fStackAdd(piX, piY);

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i, j;
	char lc1Buf[1024];

	// 幅・高さ - 取得
	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);
	}

	// スタック - 初期化
	for (i = 1; i <= siH; i++) {
		for (j = 1; j <= siW; j++) {
			if (sc2Mass[i][j] == D_MASS_BLACK) {
				fStackAdd(j, i);
			}
		}
	}

	// 黒化
	for (i = -1; ; i++) {

		// スタック数
		int liSCnt = siSCnt;
		if (liSCnt < 1) {
			return i;
		}

		// スタック数でループ
		for (j = 0; j < liSCnt; j++) {

			// スタック - 取得
			Stack lzStack;
			fStackGet(&lzStack);

			// 上下左右を黒化
			fToBlack(lzStack.miX + 1, lzStack.miY);
			fToBlack(lzStack.miX - 1, lzStack.miY);
			fToBlack(lzStack.miX, lzStack.miY + 1);
			fToBlack(lzStack.miX, lzStack.miY - 1);
		}
	}

	return 0;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// データ - 初期化
	memset(sc2Mass, 0, sizeof(sc2Mass));						// マス
	siSCnt = 0;													// スタック数
	siSSNo = 0;													// スタック位置 - セット
	siSGNo = 0;													// スタック位置 - 取得

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

	// 実行メイン
	liRet = fMain();

	// 出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOut(lc1Buf);

	// 残データ有無
#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", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

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

	return 0;
}


2 3
...
.#.
...
 6 6
..#..#
......
..#..
......
.#....
-...#.
 2 6
#.#...
......
..#0.
......
.#.-..
--..#-
 2 3
...
.#.
..-
 2 3
/..
.#.
..-
 2 3
/..
.#.
..,
 3 3
...
/#.
...
 2 3
...
.#.
..,
 3 3
../
/#.
...
 3 3
-..
.#.
...

2
 3
 4
 2
 2
 2
 2
 2
 2
 2

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		1005									// 最大サイズ
#define D_STACK_MAX		D_SIZE_MAX * D_SIZE_MAX					// 最大スタック数
#define D_MASS_BLACK	'#'										// マス - 黒
#define D_MASS_WHITE	'.'										// マス - 白

// 内部構造体 - スタック情報
typedef struct Stack {
	int miX, miY;												// 位置
} Stack;

// 内部変数
static FILE *szpFpI;											// 入力
static int siW, siH;											// 幅・高さ
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX];					// マス
static Stack sz1Stack[D_STACK_MAX];								// スタック
static int siSCnt;												// スタック数
static int siSSNo;												// スタック位置 - セット
static int siSGNo;												// スタック位置 - 取得

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

// 出力
int
fOut(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// スタック - 追加
int
fStackAdd(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
)
{
	// セット
	sz1Stack[siSSNo].miX = piX;
	sz1Stack[siSSNo].miY = piY;

	// スタック数
	siSCnt++;

	// スタック位置 - セット
	if (siSSNo < D_STACK_MAX - 1) {
		siSSNo++;
	}
	else {
		siSSNo = 0;
	}

	return 0;
}

// スタック - 取得
int
fStackGet(
	Stack *pzpRet				// <O> 取得値
)
{
	// スタック数
	if (siSCnt < 1) {
		return -1;
	}
	siSCnt--;

	// 取得
	memcpy(pzpRet, &sz1Stack[siSGNo], sizeof(Stack));

	// スタック位置 - 取得
	if (siSGNo < D_STACK_MAX - 1) {
		siSGNo++;
	}
	else {
		siSGNo = 0;
	}

	return 0;
}

// 黒化
int
fToBlack(
	int piX						// <I> 位置X
	, int piY					// <I> 位置Y
)
{
	// マス - チェック
	if (sc2Mass[piY][piX] != D_MASS_WHITE) {
		return 0;
	}

	// 黒化
	sc2Mass[piY][piX] = D_MASS_BLACK;

	// スタック - 追加
	fStackAdd(piX, piY);

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i, j;
	char lc1Buf[1024];

	// 幅・高さ - 取得
	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);
	}

	// スタック - 初期化
	for (i = 1; i <= siH; i++) {
		for (j = 1; j <= siW; j++) {
			if (sc2Mass[i][j] == D_MASS_BLACK) {
				fStackAdd(j, i);
			}
		}
	}

	// 黒化
	for (i = -1; ; i++) {

		// スタック数
		int liSCnt = siSCnt;
		if (liSCnt < 1) {
			return i;
		}

		// スタック数でループ
		for (j = 0; j < liSCnt; j++) {

			// スタック - 取得
			Stack lzStack;
			fStackGet(&lzStack);

			// 上下左右を黒化
			fToBlack(lzStack.miX + 1, lzStack.miY);
			fToBlack(lzStack.miX - 1, lzStack.miY);
			fToBlack(lzStack.miX, lzStack.miY + 1);
			fToBlack(lzStack.miX, lzStack.miY - 1);
		}
	}

	return 0;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// データ - 初期化
	memset(sc2Mass, 0, sizeof(sc2Mass));						// マス
	siSCnt = 0;													// スタック数
	siSSNo = 0;													// スタック位置 - セット
	siSGNo = 0;													// スタック位置 - 取得

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

	// 実行メイン
	liRet = fMain();

	// 出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOut(lc1Buf);

	// 残データ有無
#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", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

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

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	siW
	.comm	siW,4,4
	.local	siH
	.comm	siH,4,4
	.local	sc2Mass
	.comm	sc2Mass,1010025,32
	.local	sz1Stack
	.comm	sz1Stack,8080200,32
	.local	siSCnt
	.comm	siSCnt,4,4
	.local	siSSNo
	.comm	siSSNo,4,4
	.local	siSGNo
	.comm	siSGNo,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOut
	.type	fOut, @function
fOut:
.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	%rdi, -1048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-1048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fOut, .-fOut
	.globl	fStackAdd
	.type	fStackAdd, @function
fStackAdd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	siSSNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Stack(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	siSSNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+sz1Stack(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	siSCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movl	siSSNo(%rip), %eax
	cmpl	$1010023, %eax
	jg	.L5
	movl	siSSNo(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSSNo(%rip)
	jmp	.L6
.L5:
	movl	$0, siSSNo(%rip)
.L6:
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fStackAdd, .-fStackAdd
	.globl	fStackGet
	.type	fStackGet, @function
fStackGet:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	siSCnt(%rip), %eax
	testl	%eax, %eax
	jg	.L9
	movl	$-1, %eax
	jmp	.L10
.L9:
	movl	siSCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movl	siSGNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Stack(%rip), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	siSGNo(%rip), %eax
	cmpl	$1010023, %eax
	jg	.L11
	movl	siSGNo(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSGNo(%rip)
	jmp	.L12
.L11:
	movl	$0, siSGNo(%rip)
.L12:
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fStackGet, .-fStackGet
	.globl	fToBlack
	.type	fToBlack, @function
fToBlack:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L14
	movl	$0, %eax
	jmp	.L15
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movb	$35, (%rax)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fStackAdd
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fToBlack, .-fToBlack
	.section	.rodata
.LC1:
	.string	"%d%d"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-1040(%rbp), %rax
	leaq	siW(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siH(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -1060(%rbp)
	jmp	.L17
.L18:
	movq	szpFpI(%rip), %rax
	movl	-1060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1005, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	sc2Mass(%rip), %rdx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movl	$1004, %esi
	movq	%rcx, %rdi
	call	fgets@PLT
	addl	$1, -1060(%rbp)
.L17:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jle	.L18
	movl	$1, -1060(%rbp)
	jmp	.L19
.L23:
	movl	$1, -1056(%rbp)
	jmp	.L20
.L22:
	movl	-1056(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1060(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L21
	movl	-1060(%rbp), %edx
	movl	-1056(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fStackAdd
.L21:
	addl	$1, -1056(%rbp)
.L20:
	movl	siW(%rip), %eax
	cmpl	%eax, -1056(%rbp)
	jle	.L22
	addl	$1, -1060(%rbp)
.L19:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jle	.L23
	movl	$-1, -1060(%rbp)
.L28:
	movl	siSCnt(%rip), %eax
	movl	%eax, -1052(%rbp)
	cmpl	$0, -1052(%rbp)
	jg	.L24
	movl	-1060(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	jmp	.L30
.L24:
	movl	$0, -1056(%rbp)
	jmp	.L26
.L27:
	leaq	-1048(%rbp), %rax
	movq	%rax, %rdi
	call	fStackGet
	movl	-1044(%rbp), %eax
	movl	-1048(%rbp), %edx
	addl	$1, %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	movl	-1048(%rbp), %edx
	subl	$1, %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	leal	1(%rax), %edx
	movl	-1048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fToBlack
	addl	$1, -1056(%rbp)
.L26:
	movl	-1056(%rbp), %eax
	cmpl	-1052(%rbp), %eax
	jl	.L27
	addl	$1, -1060(%rbp)
	jmp	.L28
.L30:
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	fMain, .-fMain
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB11:
	.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	$1010025, %edx
	movl	$0, %esi
	leaq	sc2Mass(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, siSCnt(%rip)
	movl	$0, siSSNo(%rip)
	movl	$0, siSGNo(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	-1044(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	fOut
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	fOne
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	siW
	.comm	siW,4,4
	.local	siH
	.comm	siH,4,4
	.local	sc2Mass
	.comm	sc2Mass,1010025,32
	.local	sz1Stack
	.comm	sz1Stack,8080200,32
	.local	siSCnt
	.comm	siSCnt,4,4
	.local	siSSNo
	.comm	siSSNo,4,4
	.local	siSGNo
	.comm	siSGNo,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOut
	.type	fOut, @function
fOut:
.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	%rdi, -1048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-1048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fOut, .-fOut
	.globl	fStackAdd
	.type	fStackAdd, @function
fStackAdd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	siSSNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Stack(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	siSSNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+sz1Stack(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	siSCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movl	siSSNo(%rip), %eax
	cmpl	$1010023, %eax
	jg	.L5
	movl	siSSNo(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSSNo(%rip)
	jmp	.L6
.L5:
	movl	$0, siSSNo(%rip)
.L6:
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fStackAdd, .-fStackAdd
	.globl	fStackGet
	.type	fStackGet, @function
fStackGet:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	siSCnt(%rip), %eax
	testl	%eax, %eax
	jg	.L9
	movl	$-1, %eax
	jmp	.L10
.L9:
	movl	siSCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, siSCnt(%rip)
	movl	siSGNo(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Stack(%rip), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movl	siSGNo(%rip), %eax
	cmpl	$1010023, %eax
	jg	.L11
	movl	siSGNo(%rip), %eax
	addl	$1, %eax
	movl	%eax, siSGNo(%rip)
	jmp	.L12
.L11:
	movl	$0, siSGNo(%rip)
.L12:
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fStackGet, .-fStackGet
	.globl	fToBlack
	.type	fToBlack, @function
fToBlack:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L14
	movl	$0, %eax
	jmp	.L15
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movb	$35, (%rax)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fStackAdd
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fToBlack, .-fToBlack
	.section	.rodata
.LC1:
	.string	"%d%d"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-1040(%rbp), %rax
	leaq	siW(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siH(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -1060(%rbp)
	jmp	.L17
.L18:
	movq	szpFpI(%rip), %rax
	movl	-1060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1005, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	sc2Mass(%rip), %rdx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movl	$1004, %esi
	movq	%rcx, %rdi
	call	fgets@PLT
	addl	$1, -1060(%rbp)
.L17:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jle	.L18
	movl	$1, -1060(%rbp)
	jmp	.L19
.L23:
	movl	$1, -1056(%rbp)
	jmp	.L20
.L22:
	movl	-1056(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1060(%rbp), %eax
	cltq
	imulq	$1005, %rax, %rax
	addq	%rax, %rdx
	leaq	sc2Mass(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L21
	movl	-1060(%rbp), %edx
	movl	-1056(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fStackAdd
.L21:
	addl	$1, -1056(%rbp)
.L20:
	movl	siW(%rip), %eax
	cmpl	%eax, -1056(%rbp)
	jle	.L22
	addl	$1, -1060(%rbp)
.L19:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jle	.L23
	movl	$-1, -1060(%rbp)
.L28:
	movl	siSCnt(%rip), %eax
	movl	%eax, -1052(%rbp)
	cmpl	$0, -1052(%rbp)
	jg	.L24
	movl	-1060(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	jmp	.L30
.L24:
	movl	$0, -1056(%rbp)
	jmp	.L26
.L27:
	leaq	-1048(%rbp), %rax
	movq	%rax, %rdi
	call	fStackGet
	movl	-1044(%rbp), %eax
	movl	-1048(%rbp), %edx
	addl	$1, %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	movl	-1048(%rbp), %edx
	subl	$1, %edx
	movl	%eax, %esi
	movl	%edx, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	leal	1(%rax), %edx
	movl	-1048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fToBlack
	movl	-1044(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-1048(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	fToBlack
	addl	$1, -1056(%rbp)
.L26:
	movl	-1056(%rbp), %eax
	cmpl	-1052(%rbp), %eax
	jl	.L27
	addl	$1, -1060(%rbp)
	jmp	.L28
.L30:
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	fMain, .-fMain
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB11:
	.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	$1010025, %edx
	movl	$0, %esi
	leaq	sc2Mass(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, siSCnt(%rip)
	movl	$0, siSSNo(%rip)
	movl	$0, siSGNo(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	-1044(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	fOut
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	fOne
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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:
