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_COST_MAX		200000									// 最大コスト数
#define D_COST_ROW		0										// コスト - 行
#define D_COST_COL		1										// コスト - 列

// 内部構造体 - コスト情報
typedef struct Cost {
	int miRC;													// 行・列
	long long mlCost;											// コスト
} Cost;

// 内部変数
static FILE *szpFpI;											// 入力
static int siW, siH;											// 幅・高さ
static Cost sz1Cost[D_COST_MAX];								// コスト
static int siCCnt;												// コスト数

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

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

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

	return 0;
}

// ソート関数 - コスト昇順
int
fSortFnc(
	const void *pzpVal1			// <I> 値１
	, const void *pzpVal2		// <I> 値２
)
{
	Cost *lzpVal1 = (Cost *)pzpVal1;
	Cost *lzpVal2 = (Cost *)pzpVal2;

	// コスト昇順
	if (lzpVal1->mlCost > lzpVal2->mlCost) {
		return 1;
	}
	else if (lzpVal1->mlCost < lzpVal2->mlCost) {
		return -1;
	}

	return 0;
}

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

	// 幅・高さ - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d%d", &siW, &siH);

	// コスト - 取得
	for (i = 0; i < siW; i++) {
		sz1Cost[siCCnt].miRC = D_COST_COL;
		fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
		sscanf(lc1Buf, "%lld", &sz1Cost[siCCnt].mlCost);
		siCCnt++;
	}
	for (i = 0; i < siH; i++) {
		sz1Cost[siCCnt].miRC = D_COST_ROW;
		fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
		sscanf(lc1Buf, "%lld", &sz1Cost[siCCnt].mlCost);
		siCCnt++;
	}
	qsort(sz1Cost, siCCnt, sizeof(Cost), fSortFnc);

	// 合計 - 取得
	long long llSum = 0;
	int liRCnt = -1;
	int liCCnt = -1;
	for (i = 0; i < siCCnt; i++) {
		if (sz1Cost[i].miRC == D_COST_ROW) {
			llSum += sz1Cost[i].mlCost * (long long)(siW - liCCnt);
			liRCnt++;
		}
		else {
			llSum += sz1Cost[i].mlCost * (long long)(siH - liRCnt);
			liCCnt++;
		}
	}

	// 出力
	sprintf(lc1Buf, "%lld\n", llSum);
	fOutLine(lc1Buf);

	return 0;
}

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

	// データ - 初期化
	siCCnt = 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();

	// 残データ有無
#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	sz1Cost
	.comm	sz1Cost,3200000,32
	.local	siCCnt
	.comm	siCCnt,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.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	fOutLine, .-fOutLine
	.globl	fSortFnc
	.type	fSortFnc, @function
fSortFnc:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L5
	movl	$1, %eax
	jmp	.L6
.L5:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L7
	movl	$-1, %eax
	jmp	.L6
.L7:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fSortFnc, .-fSortFnc
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB8:
	.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	siH(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siW(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -1060(%rbp)
	jmp	.L9
.L10:
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	$1, (%rdx,%rax)
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	addl	$1, -1060(%rbp)
.L9:
	movl	siW(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L10
	movl	$0, -1060(%rbp)
	jmp	.L11
.L12:
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	$0, (%rdx,%rax)
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	addl	$1, -1060(%rbp)
.L11:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L12
	movl	siCCnt(%rip), %eax
	cltq
	leaq	fSortFnc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	sz1Cost(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -1048(%rbp)
	movl	$-1, -1056(%rbp)
	movl	$-1, -1052(%rbp)
	movl	$0, -1060(%rbp)
	jmp	.L13
.L16:
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+sz1Cost(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	siW(%rip), %eax
	subl	-1052(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -1048(%rbp)
	addl	$1, -1056(%rbp)
	jmp	.L15
.L14:
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+sz1Cost(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	siH(%rip), %eax
	subl	-1056(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -1048(%rbp)
	addl	$1, -1052(%rbp)
.L15:
	addl	$1, -1060(%rbp)
.L13:
	movl	siCCnt(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L16
	movq	-1048(%rbp), %rdx
	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, %rdi
	call	fOutLine
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fMain, .-fMain
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, siCCnt(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	fSortFnc
	.type	fSortFnc, @function
fSortFnc:
.LFB52:
	.cfi_startproc
	endbr64
	movq	8(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, 8(%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE52:
	.size	fSortFnc, .-fSortFnc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.text
	.p2align 4
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.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	fOutLine, .-fOutLine
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1024, %esi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	sz1Cost(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$1040, %rsp
	.cfi_def_cfa_offset 1088
	movq	szpFpI(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	movq	%r12, %rdi
	call	fgets@PLT
	leaq	.LC1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	siH(%rip), %rcx
	leaq	siW(%rip), %rdx
	call	__isoc99_sscanf@PLT
	movl	siW(%rip), %edi
	movl	siCCnt(%rip), %esi
	testl	%edi, %edi
	jle	.L10
	xorl	%r14d, %r14d
	leaq	sz1Cost(%rip), %rbp
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%esi, %rsi
	movq	szpFpI(%rip), %rdx
	movq	%r12, %rdi
	addl	$1, %r14d
	salq	$4, %rsi
	movl	$1, 0(%rbp,%rsi)
	movl	$1024, %esi
	call	fgets@PLT
	movslq	siCCnt(%rip), %rax
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%rax, %rbx
	salq	$4, %rax
	leaq	8(%rax,%rbp), %rdx
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	leal	1(%rbx), %esi
	cmpl	%r14d, siW(%rip)
	movl	%esi, siCCnt(%rip)
	jg	.L9
.L10:
	movl	siH(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L11
	xorl	%r14d, %r14d
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%esi, %rsi
	movq	szpFpI(%rip), %rdx
	movq	%r12, %rdi
	addl	$1, %r14d
	salq	$4, %rsi
	movl	$0, 0(%rbp,%rsi)
	movl	$1024, %esi
	call	fgets@PLT
	movslq	siCCnt(%rip), %rax
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%rax, %rbx
	salq	$4, %rax
	leaq	8(%rax,%rbp), %rdx
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	leal	1(%rbx), %esi
	cmpl	%r14d, siH(%rip)
	movl	%esi, siCCnt(%rip)
	jg	.L12
.L11:
	movl	$16, %edx
	movslq	%esi, %rsi
	leaq	fSortFnc(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	siCCnt(%rip), %edx
	testl	%edx, %edx
	jle	.L18
	leal	-1(%rdx), %r9d
	movl	$-1, %edi
	xorl	%r8d, %r8d
	movl	siH(%rip), %r11d
	leaq	sz1Cost(%rip), %rax
	salq	$4, %r9
	movl	$-1, %esi
	movl	siW(%rip), %r10d
	leaq	16(%rax), %rdx
	addq	%rdx, %r9
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%r10d, %edx
	addq	$16, %rax
	addl	$1, %esi
	subl	%edi, %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdx, %r8
	cmpq	%rax, %r9
	je	.L13
.L16:
	movl	(%rax), %edx
	movq	8(%rax), %rcx
	testl	%edx, %edx
	je	.L23
	movl	%r11d, %edx
	addq	$16, %rax
	addl	$1, %edi
	subl	%esi, %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdx, %r8
	cmpq	%rax, %r9
	jne	.L16
.L13:
	movl	$1024, %edx
	movl	$1, %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rcx
	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	.L24
	addq	$1040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L13
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	fMain, .-fMain
	.p2align 4
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB54:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	stdin(%rip), %rax
	movl	$0, siCCnt(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	call	fMain
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE54:
	.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
	movq	stdin(%rip), %rax
	movl	$0, siCCnt(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	call	fMain
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.local	siCCnt
	.comm	siCCnt,4,4
	.local	sz1Cost
	.comm	sz1Cost,3200000,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
	.p2align 4
	.globl	fSortFnc
	.type	fSortFnc, @function
fSortFnc:
.LFB52:
	.cfi_startproc
	endbr64
	movq	8(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, 8(%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE52:
	.size	fSortFnc, .-fSortFnc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.text
	.p2align 4
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.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	fOutLine, .-fOutLine
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1024, %esi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	sz1Cost(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$1040, %rsp
	.cfi_def_cfa_offset 1088
	movq	szpFpI(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	movq	%r12, %rdi
	call	fgets@PLT
	leaq	.LC1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	siH(%rip), %rcx
	leaq	siW(%rip), %rdx
	call	__isoc99_sscanf@PLT
	movl	siW(%rip), %edi
	movl	siCCnt(%rip), %esi
	testl	%edi, %edi
	jle	.L10
	xorl	%r14d, %r14d
	leaq	sz1Cost(%rip), %rbp
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%esi, %rsi
	movq	szpFpI(%rip), %rdx
	movq	%r12, %rdi
	addl	$1, %r14d
	salq	$4, %rsi
	movl	$1, 0(%rbp,%rsi)
	movl	$1024, %esi
	call	fgets@PLT
	movslq	siCCnt(%rip), %rax
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%rax, %rbx
	salq	$4, %rax
	leaq	8(%rax,%rbp), %rdx
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	leal	1(%rbx), %esi
	cmpl	%r14d, siW(%rip)
	movl	%esi, siCCnt(%rip)
	jg	.L9
.L10:
	movl	siH(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L11
	xorl	%r14d, %r14d
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%esi, %rsi
	movq	szpFpI(%rip), %rdx
	movq	%r12, %rdi
	addl	$1, %r14d
	salq	$4, %rsi
	movl	$0, 0(%rbp,%rsi)
	movl	$1024, %esi
	call	fgets@PLT
	movslq	siCCnt(%rip), %rax
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%rax, %rbx
	salq	$4, %rax
	leaq	8(%rax,%rbp), %rdx
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	leal	1(%rbx), %esi
	cmpl	%r14d, siH(%rip)
	movl	%esi, siCCnt(%rip)
	jg	.L12
.L11:
	movl	$16, %edx
	movslq	%esi, %rsi
	leaq	fSortFnc(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	siCCnt(%rip), %edx
	testl	%edx, %edx
	jle	.L18
	leal	-1(%rdx), %r9d
	movl	$-1, %edi
	xorl	%r8d, %r8d
	movl	siH(%rip), %r11d
	leaq	sz1Cost(%rip), %rax
	salq	$4, %r9
	movl	$-1, %esi
	movl	siW(%rip), %r10d
	leaq	16(%rax), %rdx
	addq	%rdx, %r9
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%r10d, %edx
	addq	$16, %rax
	addl	$1, %esi
	subl	%edi, %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdx, %r8
	cmpq	%rax, %r9
	je	.L13
.L16:
	movl	(%rax), %edx
	movq	8(%rax), %rcx
	testl	%edx, %edx
	je	.L23
	movl	%r11d, %edx
	addq	$16, %rax
	addl	$1, %edi
	subl	%esi, %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdx, %r8
	cmpq	%rax, %r9
	jne	.L16
.L13:
	movl	$1024, %edx
	movl	$1, %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rcx
	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	.L24
	addq	$1040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L13
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	fMain, .-fMain
	.p2align 4
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB54:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	stdin(%rip), %rax
	movl	$0, siCCnt(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	call	fMain
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE54:
	.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
	movq	stdin(%rip), %rax
	movl	$0, siCCnt(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	call	fMain
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.local	siCCnt
	.comm	siCCnt,4,4
	.local	sz1Cost
	.comm	sz1Cost,3200000,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_COST_MAX		200000									// 最大コスト数
#define D_COST_ROW		0										// コスト - 行
#define D_COST_COL		1										// コスト - 列

// 内部構造体 - コスト情報
typedef struct Cost {
	int miRC;													// 行・列
	long long mlCost;											// コスト
} Cost;

// 内部変数
static FILE *szpFpI;											// 入力
static int siW, siH;											// 幅・高さ
static Cost sz1Cost[D_COST_MAX];								// コスト
static int siCCnt;												// コスト数

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

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

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

	return 0;
}

// ソート関数 - コスト昇順
int
fSortFnc(
	const void *pzpVal1			// <I> 値１
	, const void *pzpVal2		// <I> 値２
)
{
	Cost *lzpVal1 = (Cost *)pzpVal1;
	Cost *lzpVal2 = (Cost *)pzpVal2;

	// コスト昇順
	if (lzpVal1->mlCost > lzpVal2->mlCost) {
		return 1;
	}
	else if (lzpVal1->mlCost < lzpVal2->mlCost) {
		return -1;
	}

	return 0;
}

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

	// 幅・高さ - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d%d", &siW, &siH);

	// コスト - 取得
	for (i = 0; i < siW; i++) {
		sz1Cost[siCCnt].miRC = D_COST_COL;
		fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
		sscanf(lc1Buf, "%lld", &sz1Cost[siCCnt].mlCost);
		siCCnt++;
	}
	for (i = 0; i < siH; i++) {
		sz1Cost[siCCnt].miRC = D_COST_ROW;
		fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
		sscanf(lc1Buf, "%lld", &sz1Cost[siCCnt].mlCost);
		siCCnt++;
	}
	qsort(sz1Cost, siCCnt, sizeof(Cost), fSortFnc);

	// 合計 - 取得
	long long llSum = 0;
	int liRCnt = -1;
	int liCCnt = -1;
	for (i = 0; i < siCCnt; i++) {
		if (sz1Cost[i].miRC == D_COST_ROW) {
			llSum += sz1Cost[i].mlCost * (long long)(siW - liCCnt);
			liRCnt++;
		}
		else {
			llSum += sz1Cost[i].mlCost * (long long)(siH - liRCnt);
			liCCnt++;
		}
	}

	// 出力
	sprintf(lc1Buf, "%lld\n", llSum);
	fOutLine(lc1Buf);

	return 0;
}

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

	// データ - 初期化
	siCCnt = 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();

	// 残データ有無
#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;
}


4 3
2
6
8
1
2
9
3
 2 2
3
6
2
7
 0 3
2
6
8
1
2
9
3
 2 2
3
9
2
7
 0 3
2
6
13
1
2
9
3
 2 2
3
16
2
7
 2 2
3
32
2
7
 2 2
0
32
2
7
 0 3
1
6
8
1
2
9
0
 2 2
-1
32
2
7

64
 31
 16
 35
 21
 42
 58
 50
 15
 47

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_COST_MAX		200000									// 最大コスト数
#define D_COST_ROW		0										// コスト - 行
#define D_COST_COL		1										// コスト - 列

// 内部構造体 - コスト情報
typedef struct Cost {
	int miRC;													// 行・列
	long long mlCost;											// コスト
} Cost;

// 内部変数
static FILE *szpFpI;											// 入力
static int siW, siH;											// 幅・高さ
static Cost sz1Cost[D_COST_MAX];								// コスト
static int siCCnt;												// コスト数

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

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

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

	return 0;
}

// ソート関数 - コスト昇順
int
fSortFnc(
	const void *pzpVal1			// <I> 値１
	, const void *pzpVal2		// <I> 値２
)
{
	Cost *lzpVal1 = (Cost *)pzpVal1;
	Cost *lzpVal2 = (Cost *)pzpVal2;

	// コスト昇順
	if (lzpVal1->mlCost > lzpVal2->mlCost) {
		return 1;
	}
	else if (lzpVal1->mlCost < lzpVal2->mlCost) {
		return -1;
	}

	return 0;
}

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

	// 幅・高さ - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d%d", &siW, &siH);

	// コスト - 取得
	for (i = 0; i < siW; i++) {
		sz1Cost[siCCnt].miRC = D_COST_COL;
		fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
		sscanf(lc1Buf, "%lld", &sz1Cost[siCCnt].mlCost);
		siCCnt++;
	}
	for (i = 0; i < siH; i++) {
		sz1Cost[siCCnt].miRC = D_COST_ROW;
		fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
		sscanf(lc1Buf, "%lld", &sz1Cost[siCCnt].mlCost);
		siCCnt++;
	}
	qsort(sz1Cost, siCCnt, sizeof(Cost), fSortFnc);

	// 合計 - 取得
	long long llSum = 0;
	int liRCnt = -1;
	int liCCnt = -1;
	for (i = 0; i < siCCnt; i++) {
		if (sz1Cost[i].miRC == D_COST_ROW) {
			llSum += sz1Cost[i].mlCost * (long long)(siW - liCCnt);
			liRCnt++;
		}
		else {
			llSum += sz1Cost[i].mlCost * (long long)(siH - liRCnt);
			liCCnt++;
		}
	}

	// 出力
	sprintf(lc1Buf, "%lld\n", llSum);
	fOutLine(lc1Buf);

	return 0;
}

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

	// データ - 初期化
	siCCnt = 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();

	// 残データ有無
#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	sz1Cost
	.comm	sz1Cost,3200000,32
	.local	siCCnt
	.comm	siCCnt,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.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	fOutLine, .-fOutLine
	.globl	fSortFnc
	.type	fSortFnc, @function
fSortFnc:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L5
	movl	$1, %eax
	jmp	.L6
.L5:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L7
	movl	$-1, %eax
	jmp	.L6
.L7:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fSortFnc, .-fSortFnc
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB8:
	.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	siH(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siW(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -1060(%rbp)
	jmp	.L9
.L10:
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	$1, (%rdx,%rax)
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	addl	$1, -1060(%rbp)
.L9:
	movl	siW(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L10
	movl	$0, -1060(%rbp)
	jmp	.L11
.L12:
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	$0, (%rdx,%rax)
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	addl	$1, -1060(%rbp)
.L11:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L12
	movl	siCCnt(%rip), %eax
	cltq
	leaq	fSortFnc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	sz1Cost(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -1048(%rbp)
	movl	$-1, -1056(%rbp)
	movl	$-1, -1052(%rbp)
	movl	$0, -1060(%rbp)
	jmp	.L13
.L16:
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+sz1Cost(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	siW(%rip), %eax
	subl	-1052(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -1048(%rbp)
	addl	$1, -1056(%rbp)
	jmp	.L15
.L14:
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+sz1Cost(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	siH(%rip), %eax
	subl	-1056(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -1048(%rbp)
	addl	$1, -1052(%rbp)
.L15:
	addl	$1, -1060(%rbp)
.L13:
	movl	siCCnt(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L16
	movq	-1048(%rbp), %rdx
	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, %rdi
	call	fOutLine
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fMain, .-fMain
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, siCCnt(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
.LFE10:
	.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	sz1Cost
	.comm	sz1Cost,3200000,32
	.local	siCCnt
	.comm	siCCnt,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.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	fOutLine, .-fOutLine
	.globl	fSortFnc
	.type	fSortFnc, @function
fSortFnc:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L5
	movl	$1, %eax
	jmp	.L6
.L5:
	movq	-16(%rbp), %rax
	movq	8(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	8(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L7
	movl	$-1, %eax
	jmp	.L6
.L7:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fSortFnc, .-fSortFnc
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB8:
	.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	siH(%rip), %rdx
	movq	%rdx, %rcx
	leaq	siW(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, -1060(%rbp)
	jmp	.L9
.L10:
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	$1, (%rdx,%rax)
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	addl	$1, -1060(%rbp)
.L9:
	movl	siW(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L10
	movl	$0, -1060(%rbp)
	jmp	.L11
.L12:
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	$0, (%rdx,%rax)
	movq	szpFpI(%rip), %rdx
	leaq	-1040(%rbp), %rax
	movl	$1024, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	leaq	-1040(%rbp), %rax
	leaq	.LC2(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	addl	$1, -1060(%rbp)
.L11:
	movl	siH(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L12
	movl	siCCnt(%rip), %eax
	cltq
	leaq	fSortFnc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	sz1Cost(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -1048(%rbp)
	movl	$-1, -1056(%rbp)
	movl	$-1, -1052(%rbp)
	movl	$0, -1060(%rbp)
	jmp	.L13
.L16:
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	sz1Cost(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+sz1Cost(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	siW(%rip), %eax
	subl	-1052(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -1048(%rbp)
	addl	$1, -1056(%rbp)
	jmp	.L15
.L14:
	movl	-1060(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+sz1Cost(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	siH(%rip), %eax
	subl	-1056(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -1048(%rbp)
	addl	$1, -1052(%rbp)
.L15:
	addl	$1, -1060(%rbp)
.L13:
	movl	siCCnt(%rip), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L16
	movq	-1048(%rbp), %rdx
	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, %rdi
	call	fOutLine
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fMain, .-fMain
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, siCCnt(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
.LFE10:
	.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:
