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

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

// 内部定数
#define D_POS_MAX		90000									// 最大位置数

// 内部構造体 - 位置情報
typedef struct Pos {
	int miX, miY;												// 座標
} Pos;

// 内部変数
static Pos sz1Pos[D_POS_MAX + 5];								// 位置情報
static int si1Sum[D_POS_MAX + 5];								// 総和

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

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

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

	// 高さ・幅・移動量取得
	int liH, liW, liMv;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d%d", &liH, &liW, &liMv);

	// 位置情報取得
	for (i = 1; i <= liH; i++) {
		for (j = 1; j <= liW; j++) {
			int liNo;
#ifdef D_TEST
			fscanf(szpFpT, "%d", &liNo);
#else
			fscanf(stdin, "%d", &liNo);
#endif
			sz1Pos[liNo].miX = j;
			sz1Pos[liNo].miY = i;
		}
#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	}

	// 総和セット
	for (i = 1; i <= liMv; i++) {

		// 初期位置
		si1Sum[i] = 0;

		// 順に移動
		int liFNo = i;
		int liTNo;
		while (1) {
			liTNo = liFNo + liMv;
			if (liTNo > D_POS_MAX) {
				break;
			}
			si1Sum[liTNo] = si1Sum[liFNo] + abs(sz1Pos[liTNo].miX - sz1Pos[liFNo].miX) + abs(sz1Pos[liTNo].miY - sz1Pos[liFNo].miY);
			liFNo = liTNo;
		}
	}

	// クエリ数取得
	int liQCnt;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d", &liQCnt);

	// クエリ数でループ
	for (i = 0; i < liQCnt; i++) {

		// クエリ取得
		int liFNo, liTNo;
#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
		sscanf(lc1Buf, "%d%d", &liFNo, &liTNo);

		// 合計取得
		int liSum = si1Sum[liTNo] - si1Sum[liFNo];

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

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

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

	return 0;
}

int
main()
{

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

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	sz1Pos
	.comm	sz1Pos,720040,32
	.local	si1Sum
	.comm	si1Sum,360020,32
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%s"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2128, %rsp
	movl	%edi, -2116(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2100(%rbp), %rsi
	leaq	-2104(%rbp), %rcx
	leaq	-2108(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -2084(%rbp)
	jmp	.L2
.L5:
	movl	$1, -2080(%rbp)
	jmp	.L3
.L4:
	movq	stdin(%rip), %rax
	leaq	-2088(%rbp), %rdx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Pos(%rip), %rdx
	movl	-2080(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+sz1Pos(%rip), %rdx
	movl	-2084(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -2080(%rbp)
.L3:
	movl	-2104(%rbp), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L4
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	addl	$1, -2084(%rbp)
.L2:
	movl	-2108(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jle	.L5
	movl	$1, -2084(%rbp)
	jmp	.L6
.L10:
	movl	-2084(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-2084(%rbp), %eax
	movl	%eax, -2076(%rbp)
.L9:
	movl	-2100(%rbp), %edx
	movl	-2076(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -2068(%rbp)
	cmpl	$90000, -2068(%rbp)
	jg	.L16
	movl	-2076(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2076(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Pos(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%eax, %esi
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2076(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Pos(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rsi,%rax), %ecx
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-2068(%rbp), %eax
	movl	%eax, -2076(%rbp)
	jmp	.L9
.L16:
	nop
	addl	$1, -2084(%rbp)
.L6:
	movl	-2100(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jle	.L10
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2096(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -2084(%rbp)
	jmp	.L11
.L12:
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2088(%rbp), %rcx
	leaq	-2092(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2092(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	si1Sum(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -2072(%rbp)
	movl	-2072(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2084(%rbp)
.L11:
	movl	-2096(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jl	.L12
	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
.LFE6:
	.size	fMain, .-fMain
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%s"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1024, %esi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2136, %rsp
	.cfi_def_cfa_offset 2192
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 2120(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rbx
	movq	%rbx, %rdi
	movq	%rbx, 16(%rsp)
	call	fgets@PLT
	leaq	44(%rsp), %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	40(%rsp), %rdx
	leaq	48(%rsp), %r8
	leaq	.LC0(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L3
	movq	16(%rsp), %r15
	movl	$1, %r12d
	leaq	sz1Pos(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movl	44(%rsp), %edx
	movl	$1, %ebx
	leaq	60(%rsp), %r13
	testl	%edx, %edx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdi
	movq	%r13, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movd	%ebx, %xmm0
	movslq	60(%rsp), %rax
	addl	$1, %ebx
	movd	%r12d, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r14,%rax,8)
	cmpl	%ebx, 44(%rsp)
	jge	.L4
.L5:
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%r15, %rdi
	addl	$1, %r12d
	call	fgets@PLT
	cmpl	%r12d, 40(%rsp)
	jge	.L2
.L3:
	movslq	48(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L6
	cmpl	$1, %r8d
	jne	.L41
	leaq	si1Sum(%rip), %r15
	movl	12+sz1Pos(%rip), %edi
	xorl	%eax, %eax
	movl	$0, 4+si1Sum(%rip)
	movl	8+sz1Pos(%rip), %r11d
	leaq	16+sz1Pos(%rip), %rsi
	movl	$3, %ecx
	leaq	-4(%r15), %r10
.L12:
	movl	(%rsi), %r9d
	movl	4(%rsi), %r8d
	movl	%ecx, %r12d
	movl	%r9d, %ebx
	subl	%r11d, %ebx
	movl	%r8d, %r11d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%edi, %r11d
	movl	12(%rsi), %edi
	addl	%eax, %edx
	movl	%r11d, %eax
	negl	%eax
	cmovs	%r11d, %eax
	movl	8(%rsi), %r11d
	movl	%r11d, %ebx
	addl	%eax, %edx
	subl	%r9d, %ebx
	movl	%edi, %r9d
	movl	%edx, (%r10,%rcx,4)
	movl	%ebx, %eax
	negl	%eax
	cmovs	%ebx, %eax
	subl	%r8d, %r9d
	addl	%edx, %eax
	movl	%r9d, %edx
	negl	%edx
	cmovs	%r9d, %edx
	addq	$16, %rsi
	addl	%edx, %eax
	leal	1(%rcx), %edx
	movl	%eax, (%r15,%rcx,4)
	addq	$2, %rcx
	cmpq	$90001, %rcx
	jne	.L12
	leaq	sz1Pos(%rip), %rcx
	movslq	%edx, %rdx
	movslq	%r12d, %rdi
	movl	(%rcx,%rdx,8), %r11d
	movl	4(%rcx,%rdx,8), %esi
	movl	%r11d, %r8d
	subl	(%rcx,%rdi,8), %r8d
	movl	%r8d, %eax
	negl	%eax
	cmovs	%r8d, %eax
	movl	%esi, %r8d
	subl	4(%rcx,%rdi,8), %r8d
	addl	(%r15,%rdi,4), %eax
	movl	%r8d, %edi
	negl	%edi
	cmovs	%r8d, %edi
	leal	2(%r12), %r8d
	addl	%edi, %eax
	movl	%eax, (%r15,%rdx,4)
	cmpl	$89999, %r12d
	je	.L6
	movslq	%r8d, %r8
	movl	(%rcx,%r8,8), %r10d
	movl	4(%rcx,%r8,8), %edi
	movl	%r10d, %ebx
	subl	%r11d, %ebx
	movl	%edi, %r11d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%esi, %r11d
	addl	%edx, %eax
	movl	%r11d, %edx
	negl	%edx
	cmovs	%r11d, %edx
	leal	3(%r12), %r11d
	addl	%edx, %eax
	movl	%eax, (%r15,%r8,4)
	cmpl	$89998, %r12d
	je	.L6
	movslq	%r11d, %r11
	movl	(%rcx,%r11,8), %r8d
	movl	4(%rcx,%r11,8), %esi
	movl	%r8d, %ebx
	subl	%r10d, %ebx
	movl	%esi, %r10d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%edi, %r10d
	addl	%edx, %eax
	movl	%r10d, %edx
	negl	%edx
	cmovs	%r10d, %edx
	leal	4(%r12), %r10d
	addl	%edx, %eax
	movl	%eax, (%r15,%r11,4)
	cmpl	$89997, %r12d
	je	.L6
	movslq	%r10d, %r10
	movl	(%rcx,%r10,8), %r11d
	movl	4(%rcx,%r10,8), %edi
	movl	%r11d, %ebx
	subl	%r8d, %ebx
	movl	%edi, %r8d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%esi, %r8d
	leal	5(%r12), %esi
	addl	%edx, %eax
	movl	%r8d, %edx
	negl	%edx
	cmovs	%r8d, %edx
	addl	%edx, %eax
	movl	%eax, (%r15,%r10,4)
	cmpl	$89996, %r12d
	je	.L6
	movslq	%esi, %rsi
	movl	(%rcx,%rsi,8), %r8d
	subl	%r11d, %r8d
	movl	%r8d, %edx
	negl	%edx
	cmovs	%r8d, %edx
	addl	%edx, %eax
	movl	4(%rcx,%rsi,8), %edx
	subl	%edi, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%edx, %eax
	movl	%eax, (%r15,%rsi,4)
.L6:
	movq	16(%rsp), %rbx
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	leaq	52(%rsp), %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%rbx, 16(%rsp)
	call	__isoc99_sscanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	60(%rsp), %rax
	xorl	%ebp, %ebp
	leaq	56(%rsp), %r14
	leaq	1088(%rsp), %rbx
	movq	%rax, (%rsp)
	leaq	si1Sum(%rip), %r15
	movq	%r14, 8(%rsp)
	movl	%ebp, %r14d
	movq	%rbx, %rbp
	movq	16(%rsp), %rbx
	leaq	.LC2(%rip), %r13
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbx, %rdi
	addl	$1, %r14d
	call	fgets@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	__isoc99_sscanf@PLT
	movslq	60(%rsp), %rdx
	movq	%r12, %rcx
	movq	%rbp, %rdi
	movslq	56(%rsp), %rax
	movl	$1, %esi
	movl	(%r15,%rdx,4), %r8d
	movl	$1024, %edx
	subl	(%r15,%rax,4), %r8d
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbp, %rdx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	cmpl	%r14d, 52(%rsp)
	jg	.L15
.L14:
	movq	2120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$2136, %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
.L41:
	.cfi_restore_state
	movq	%r8, %rax
	leal	1(%r8), %r14d
	leaq	sz1Pos(%rip), %r11
	movl	$8, %r9d
	notq	%rax
	movl	$4, %r13d
	leaq	4(%r11), %rbx
	movl	$1, %r12d
	leaq	0(,%rax,4), %rdi
	salq	$3, %rax
	leaq	si1Sum(%rip), %r15
	movq	%rax, 8(%rsp)
	movl	%r14d, %eax
	movq	%rdi, (%rsp)
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$0, (%r15,%r13)
	cmpl	$90000, %r14d
	jg	.L8
	movq	8(%rsp), %rdi
	movq	(%rsp), %rcx
	leaq	(%r12,%r8), %rax
	addq	%r9, %rdi
	leaq	(%rcx,%r13), %r10
	addq	%r11, %rdi
	addq	%r15, %r10
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%r11,%rax,8), %edx
	subl	(%rdi,%rax,8), %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	movl	(%r10,%rax,4), %ecx
	addl	%edx, %ecx
	movl	(%rbx,%rax,8), %edx
	subl	4(%rdi,%rax,8), %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	addl	%ecx, %edx
	movl	%edx, (%r15,%rax,4)
	addq	%r8, %rax
	cmpl	$90000, %eax
	jle	.L9
.L8:
	addq	$1, %r12
	addl	$1, %r14d
	addq	$4, %r13
	addq	$8, %r9
	subq	$4, (%rsp)
	subq	$8, 8(%rsp)
	cmpq	24(%rsp), %r12
	jne	.L10
	jmp	.L6
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	fMain, .-fMain
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
.LFE52:
	.size	main, .-main
	.local	si1Sum
	.comm	si1Sum,360020,32
	.local	sz1Pos
	.comm	sz1Pos,720040,32
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%s"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1024, %esi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2136, %rsp
	.cfi_def_cfa_offset 2192
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 2120(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rbx
	movq	%rbx, %rdi
	movq	%rbx, 16(%rsp)
	call	fgets@PLT
	leaq	44(%rsp), %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	40(%rsp), %rdx
	leaq	48(%rsp), %r8
	leaq	.LC0(%rip), %rsi
	call	__isoc99_sscanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L3
	movq	16(%rsp), %r15
	movl	$1, %r12d
	leaq	sz1Pos(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movl	44(%rsp), %edx
	movl	$1, %ebx
	leaq	60(%rsp), %r13
	testl	%edx, %edx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdi
	movq	%r13, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	call	__isoc99_fscanf@PLT
	movd	%ebx, %xmm0
	movslq	60(%rsp), %rax
	addl	$1, %ebx
	movd	%r12d, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r14,%rax,8)
	cmpl	%ebx, 44(%rsp)
	jge	.L4
.L5:
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%r15, %rdi
	addl	$1, %r12d
	call	fgets@PLT
	cmpl	%r12d, 40(%rsp)
	jge	.L2
.L3:
	movslq	48(%rsp), %r8
	testl	%r8d, %r8d
	jle	.L6
	cmpl	$1, %r8d
	jne	.L41
	leaq	si1Sum(%rip), %r15
	movl	12+sz1Pos(%rip), %edi
	xorl	%eax, %eax
	movl	$0, 4+si1Sum(%rip)
	movl	8+sz1Pos(%rip), %r11d
	leaq	16+sz1Pos(%rip), %rsi
	movl	$3, %ecx
	leaq	-4(%r15), %r10
.L12:
	movl	(%rsi), %r9d
	movl	4(%rsi), %r8d
	movl	%ecx, %r12d
	movl	%r9d, %ebx
	subl	%r11d, %ebx
	movl	%r8d, %r11d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%edi, %r11d
	movl	12(%rsi), %edi
	addl	%eax, %edx
	movl	%r11d, %eax
	negl	%eax
	cmovs	%r11d, %eax
	movl	8(%rsi), %r11d
	movl	%r11d, %ebx
	addl	%eax, %edx
	subl	%r9d, %ebx
	movl	%edi, %r9d
	movl	%edx, (%r10,%rcx,4)
	movl	%ebx, %eax
	negl	%eax
	cmovs	%ebx, %eax
	subl	%r8d, %r9d
	addl	%edx, %eax
	movl	%r9d, %edx
	negl	%edx
	cmovs	%r9d, %edx
	addq	$16, %rsi
	addl	%edx, %eax
	leal	1(%rcx), %edx
	movl	%eax, (%r15,%rcx,4)
	addq	$2, %rcx
	cmpq	$90001, %rcx
	jne	.L12
	leaq	sz1Pos(%rip), %rcx
	movslq	%edx, %rdx
	movslq	%r12d, %rdi
	movl	(%rcx,%rdx,8), %r11d
	movl	4(%rcx,%rdx,8), %esi
	movl	%r11d, %r8d
	subl	(%rcx,%rdi,8), %r8d
	movl	%r8d, %eax
	negl	%eax
	cmovs	%r8d, %eax
	movl	%esi, %r8d
	subl	4(%rcx,%rdi,8), %r8d
	addl	(%r15,%rdi,4), %eax
	movl	%r8d, %edi
	negl	%edi
	cmovs	%r8d, %edi
	leal	2(%r12), %r8d
	addl	%edi, %eax
	movl	%eax, (%r15,%rdx,4)
	cmpl	$89999, %r12d
	je	.L6
	movslq	%r8d, %r8
	movl	(%rcx,%r8,8), %r10d
	movl	4(%rcx,%r8,8), %edi
	movl	%r10d, %ebx
	subl	%r11d, %ebx
	movl	%edi, %r11d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%esi, %r11d
	addl	%edx, %eax
	movl	%r11d, %edx
	negl	%edx
	cmovs	%r11d, %edx
	leal	3(%r12), %r11d
	addl	%edx, %eax
	movl	%eax, (%r15,%r8,4)
	cmpl	$89998, %r12d
	je	.L6
	movslq	%r11d, %r11
	movl	(%rcx,%r11,8), %r8d
	movl	4(%rcx,%r11,8), %esi
	movl	%r8d, %ebx
	subl	%r10d, %ebx
	movl	%esi, %r10d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%edi, %r10d
	addl	%edx, %eax
	movl	%r10d, %edx
	negl	%edx
	cmovs	%r10d, %edx
	leal	4(%r12), %r10d
	addl	%edx, %eax
	movl	%eax, (%r15,%r11,4)
	cmpl	$89997, %r12d
	je	.L6
	movslq	%r10d, %r10
	movl	(%rcx,%r10,8), %r11d
	movl	4(%rcx,%r10,8), %edi
	movl	%r11d, %ebx
	subl	%r8d, %ebx
	movl	%edi, %r8d
	movl	%ebx, %edx
	negl	%edx
	cmovs	%ebx, %edx
	subl	%esi, %r8d
	leal	5(%r12), %esi
	addl	%edx, %eax
	movl	%r8d, %edx
	negl	%edx
	cmovs	%r8d, %edx
	addl	%edx, %eax
	movl	%eax, (%r15,%r10,4)
	cmpl	$89996, %r12d
	je	.L6
	movslq	%esi, %rsi
	movl	(%rcx,%rsi,8), %r8d
	subl	%r11d, %r8d
	movl	%r8d, %edx
	negl	%edx
	cmovs	%r8d, %edx
	addl	%edx, %eax
	movl	4(%rcx,%rsi,8), %edx
	subl	%edi, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	addl	%edx, %eax
	movl	%eax, (%r15,%rsi,4)
.L6:
	movq	16(%rsp), %rbx
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	leaq	52(%rsp), %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%rbx, 16(%rsp)
	call	__isoc99_sscanf@PLT
	movl	52(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	60(%rsp), %rax
	xorl	%ebp, %ebp
	leaq	56(%rsp), %r14
	leaq	1088(%rsp), %rbx
	movq	%rax, (%rsp)
	leaq	si1Sum(%rip), %r15
	movq	%r14, 8(%rsp)
	movl	%ebp, %r14d
	movq	%rbx, %rbp
	movq	16(%rsp), %rbx
	leaq	.LC2(%rip), %r13
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	stdin(%rip), %rdx
	movl	$1024, %esi
	movq	%rbx, %rdi
	addl	$1, %r14d
	call	fgets@PLT
	movq	(%rsp), %rcx
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	__isoc99_sscanf@PLT
	movslq	60(%rsp), %rdx
	movq	%r12, %rcx
	movq	%rbp, %rdi
	movslq	56(%rsp), %rax
	movl	$1, %esi
	movl	(%r15,%rdx,4), %r8d
	movl	$1024, %edx
	subl	(%r15,%rax,4), %r8d
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbp, %rdx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	cmpl	%r14d, 52(%rsp)
	jg	.L15
.L14:
	movq	2120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$2136, %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
.L41:
	.cfi_restore_state
	movq	%r8, %rax
	leal	1(%r8), %r14d
	leaq	sz1Pos(%rip), %r11
	movl	$8, %r9d
	notq	%rax
	movl	$4, %r13d
	leaq	4(%r11), %rbx
	movl	$1, %r12d
	leaq	0(,%rax,4), %rdi
	salq	$3, %rax
	leaq	si1Sum(%rip), %r15
	movq	%rax, 8(%rsp)
	movl	%r14d, %eax
	movq	%rdi, (%rsp)
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$0, (%r15,%r13)
	cmpl	$90000, %r14d
	jg	.L8
	movq	8(%rsp), %rdi
	movq	(%rsp), %rcx
	leaq	(%r12,%r8), %rax
	addq	%r9, %rdi
	leaq	(%rcx,%r13), %r10
	addq	%r11, %rdi
	addq	%r15, %r10
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%r11,%rax,8), %edx
	subl	(%rdi,%rax,8), %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	movl	(%r10,%rax,4), %ecx
	addl	%edx, %ecx
	movl	(%rbx,%rax,8), %edx
	subl	4(%rdi,%rax,8), %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	addl	%ecx, %edx
	movl	%edx, (%r15,%rax,4)
	addq	%r8, %rax
	cmpl	$90000, %eax
	jle	.L9
.L8:
	addq	$1, %r12
	addl	$1, %r14d
	addq	$4, %r13
	addq	$8, %r9
	subq	$4, (%rsp)
	subq	$8, 8(%rsp)
	cmpq	24(%rsp), %r12
	jne	.L10
	jmp	.L6
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	fMain, .-fMain
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
.LFE52:
	.size	main, .-main
	.local	si1Sum
	.comm	si1Sum,360020,32
	.local	sz1Pos
	.comm	sz1Pos,720040,32
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

// 内部定数
#define D_POS_MAX		90000									// 最大位置数

// 内部構造体 - 位置情報
typedef struct Pos {
	int miX, miY;												// 座標
} Pos;

// 内部変数
static Pos sz1Pos[D_POS_MAX + 5];								// 位置情報
static int si1Sum[D_POS_MAX + 5];								// 総和

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

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

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

	// 高さ・幅・移動量取得
	int liH, liW, liMv;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d%d", &liH, &liW, &liMv);

	// 位置情報取得
	for (i = 1; i <= liH; i++) {
		for (j = 1; j <= liW; j++) {
			int liNo;
#ifdef D_TEST
			fscanf(szpFpT, "%d", &liNo);
#else
			fscanf(stdin, "%d", &liNo);
#endif
			sz1Pos[liNo].miX = j;
			sz1Pos[liNo].miY = i;
		}
#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	}

	// 総和セット
	for (i = 1; i <= liMv; i++) {

		// 初期位置
		si1Sum[i] = 0;

		// 順に移動
		int liFNo = i;
		int liTNo;
		while (1) {
			liTNo = liFNo + liMv;
			if (liTNo > D_POS_MAX) {
				break;
			}
			si1Sum[liTNo] = si1Sum[liFNo] + abs(sz1Pos[liTNo].miX - sz1Pos[liFNo].miX) + abs(sz1Pos[liTNo].miY - sz1Pos[liFNo].miY);
			liFNo = liTNo;
		}
	}

	// クエリ数取得
	int liQCnt;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d", &liQCnt);

	// クエリ数でループ
	for (i = 0; i < liQCnt; i++) {

		// クエリ取得
		int liFNo, liTNo;
#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
		sscanf(lc1Buf, "%d%d", &liFNo, &liTNo);

		// 合計取得
		int liSum = si1Sum[liTNo] - si1Sum[liFNo];

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

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

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

	return 0;
}

int
main()
{

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

	return 0;
}


4 2 3
3 7
1 4
5 2
6 8
2
2 1
2 2
 5 5 4
13 25 7 15 17
16 22 20 2 9
14 11 12 1 19
10 6 23 8 18
3 21 5 24 4
1
13 13
2 10
13 13
 4 2 3
3 7
1 4
5 2
6 8
2
2 1
4 2
 3 3 1
1 4 3
2 5 7
8 9 6
1
4 8
 4 2 3
3 7
1 4
5 2
6 8
2
4 1
4 2
 3 3 1
1 4 3
2 5 7
8 9 6
1
4 9
 3 3 3
1 4 3
2 5 7
8 9 6
1
4 8
 3 3 2
1 4 3
2 5 7
8 9 6
1
4 1
 4 2 6
3 7
1 4
5 2
6 8
2
1 2
7 4
 5 5 4
13 25 7 15 17
16 22 20 2 9
14 11 12 1 19
10 6 23 8 18
3 21 5 24 4
3
13 13
0 10
13 13

0
0
 0
 0
-1
 7
 -1
-1
 8
 2
 -2
 0
-2
 0
5
0

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

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

// 内部定数
#define D_POS_MAX		90000									// 最大位置数

// 内部構造体 - 位置情報
typedef struct Pos {
	int miX, miY;												// 座標
} Pos;

// 内部変数
static Pos sz1Pos[D_POS_MAX + 5];								// 位置情報
static int si1Sum[D_POS_MAX + 5];								// 総和

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

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

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

	// 高さ・幅・移動量取得
	int liH, liW, liMv;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d%d", &liH, &liW, &liMv);

	// 位置情報取得
	for (i = 1; i <= liH; i++) {
		for (j = 1; j <= liW; j++) {
			int liNo;
#ifdef D_TEST
			fscanf(szpFpT, "%d", &liNo);
#else
			fscanf(stdin, "%d", &liNo);
#endif
			sz1Pos[liNo].miX = j;
			sz1Pos[liNo].miY = i;
		}
#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	}

	// 総和セット
	for (i = 1; i <= liMv; i++) {

		// 初期位置
		si1Sum[i] = 0;

		// 順に移動
		int liFNo = i;
		int liTNo;
		while (1) {
			liTNo = liFNo + liMv;
			if (liTNo > D_POS_MAX) {
				break;
			}
			si1Sum[liTNo] = si1Sum[liFNo] + abs(sz1Pos[liTNo].miX - sz1Pos[liFNo].miX) + abs(sz1Pos[liTNo].miY - sz1Pos[liFNo].miY);
			liFNo = liTNo;
		}
	}

	// クエリ数取得
	int liQCnt;
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d", &liQCnt);

	// クエリ数でループ
	for (i = 0; i < liQCnt; i++) {

		// クエリ取得
		int liFNo, liTNo;
#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
		sscanf(lc1Buf, "%d%d", &liFNo, &liTNo);

		// 合計取得
		int liSum = si1Sum[liTNo] - si1Sum[liFNo];

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

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

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

	return 0;
}

int
main()
{

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

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	sz1Pos
	.comm	sz1Pos,720040,32
	.local	si1Sum
	.comm	si1Sum,360020,32
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%s"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2128, %rsp
	movl	%edi, -2116(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2100(%rbp), %rsi
	leaq	-2104(%rbp), %rcx
	leaq	-2108(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -2084(%rbp)
	jmp	.L2
.L5:
	movl	$1, -2080(%rbp)
	jmp	.L3
.L4:
	movq	stdin(%rip), %rax
	leaq	-2088(%rbp), %rdx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Pos(%rip), %rdx
	movl	-2080(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+sz1Pos(%rip), %rdx
	movl	-2084(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -2080(%rbp)
.L3:
	movl	-2104(%rbp), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L4
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	addl	$1, -2084(%rbp)
.L2:
	movl	-2108(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jle	.L5
	movl	$1, -2084(%rbp)
	jmp	.L6
.L10:
	movl	-2084(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-2084(%rbp), %eax
	movl	%eax, -2076(%rbp)
.L9:
	movl	-2100(%rbp), %edx
	movl	-2076(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -2068(%rbp)
	cmpl	$90000, -2068(%rbp)
	jg	.L16
	movl	-2076(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2076(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Pos(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%eax, %esi
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2076(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Pos(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rsi,%rax), %ecx
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-2068(%rbp), %eax
	movl	%eax, -2076(%rbp)
	jmp	.L9
.L16:
	nop
	addl	$1, -2084(%rbp)
.L6:
	movl	-2100(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jle	.L10
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2096(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -2084(%rbp)
	jmp	.L11
.L12:
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2088(%rbp), %rcx
	leaq	-2092(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2092(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	si1Sum(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -2072(%rbp)
	movl	-2072(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2084(%rbp)
.L11:
	movl	-2096(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jl	.L12
	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
.LFE6:
	.size	fMain, .-fMain
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
.LFE7:
	.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	sz1Pos
	.comm	sz1Pos,720040,32
	.local	si1Sum
	.comm	si1Sum,360020,32
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%s"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2128, %rsp
	movl	%edi, -2116(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2100(%rbp), %rsi
	leaq	-2104(%rbp), %rcx
	leaq	-2108(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$1, -2084(%rbp)
	jmp	.L2
.L5:
	movl	$1, -2080(%rbp)
	jmp	.L3
.L4:
	movq	stdin(%rip), %rax
	leaq	-2088(%rbp), %rdx
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_fscanf@PLT
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Pos(%rip), %rdx
	movl	-2080(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+sz1Pos(%rip), %rdx
	movl	-2084(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -2080(%rbp)
.L3:
	movl	-2104(%rbp), %eax
	cmpl	%eax, -2080(%rbp)
	jle	.L4
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	addl	$1, -2084(%rbp)
.L2:
	movl	-2108(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jle	.L5
	movl	$1, -2084(%rbp)
	jmp	.L6
.L10:
	movl	-2084(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-2084(%rbp), %eax
	movl	%eax, -2076(%rbp)
.L9:
	movl	-2100(%rbp), %edx
	movl	-2076(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -2068(%rbp)
	cmpl	$90000, -2068(%rbp)
	jg	.L16
	movl	-2076(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2076(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	sz1Pos(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%eax, %esi
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2076(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Pos(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	leal	(%rsi,%rax), %ecx
	movl	-2068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-2068(%rbp), %eax
	movl	%eax, -2076(%rbp)
	jmp	.L9
.L16:
	nop
	addl	$1, -2084(%rbp)
.L6:
	movl	-2100(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jle	.L10
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2096(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -2084(%rbp)
	jmp	.L11
.L12:
	movq	stdin(%rip), %rdx
	leaq	-2064(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-2088(%rbp), %rcx
	leaq	-2092(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-2088(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	si1Sum(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-2092(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	si1Sum(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -2072(%rbp)
	movl	-2072(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC3(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2084(%rbp)
.L11:
	movl	-2096(%rbp), %eax
	cmpl	%eax, -2084(%rbp)
	jl	.L12
	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
.LFE6:
	.size	fMain, .-fMain
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
.LFE7:
	.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:
