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

```c
// AOJ 1618: A Garden with Ponds
// 2017.12.25 bal4u@uu

#include <stdio.h>

#define MAX 9

int map[10][10];
int max[10][10][10][10];
int cap[10][10][10][10];

int main()
{
	int d, w, r, c, m, s, ans;
	int d1, w1, r1, c1, r2, c2;

	while (scanf("%d%d", &d, &w) && d > 0) {
		d1 = d-1, w1 = w-1;
		for (r= 0; r < d; r++) for (c = 0; c < w; c++) scanf("%d", &map[r][c]);

		// ?????¢???????¢??????????????????????????????¨?????§?????????????????????9??¨????????????????¨????
		for (r1 = 1; r1 < d1; r1++) for (c1 = 1; c1 < w1; c1++) {
			for (r2 = r1; r2 < d1; r2++) for (c2 = c1; c2 < w1; c2++) {
				m = 0, s = 0;
				for (r = r1; r <= r2; r++) for (c = c1; c <= c2; c++) {
					if (map[r][c] > m) m = map[r][c];
					s += MAX - map[r][c];
				}
				max[r1][c1][r2][c2] = m;
				cap[r1][c1][r2][c2] = s;
			}
		}

		ans = 0;
		// ???????????????????±?????¢????????????????
		for (r1 = 0; r1 < d; r1++) for (c1 = 0; c1 < w; c1++) {
			for (r2 = r1+2; r2 < d; r2++) for (c2 = c1+2; c2 < w; c2++) {
				m = MAX;
				for (r = r1; r <= r2; r++) if (map[r ][c1] < m) m = map[r ][c1];
				for (r = r1; r <= r2; r++) if (map[r ][c2] < m) m = map[r ][c2];
				for (c = c1; c <= c2; c++) if (map[r1][c ] < m) m = map[r1][c ];
				for (c = c1; c <= c2; c++) if (map[r2][c ] < m) m = map[r2][c ];
				if (max[r1+1][c1+1][r2-1][c2-1] >= m) continue;
				s = cap[r1+1][c1+1][r2-1][c2-1] - (MAX-m)*(r2-r1-1)*(c2-c1-1);
				if (s > ans) ans = s;
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 400
map:
	.zero	400
	.globl	max
	.align 32
	.type	max, @object
	.size	max, 40000
max:
	.zero	40000
	.globl	cap
	.align 32
	.type	cap, @object
	.size	cap, 40000
cap:
	.zero	40000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L43:
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L3
.L6:
	movl	$0, -48(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -48(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L5
	addl	$1, -52(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L6
	movl	$1, -32(%rbp)
	jmp	.L7
.L19:
	movl	$1, -28(%rbp)
	jmp	.L8
.L18:
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L9
.L17:
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L10
.L16:
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L11
.L15:
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L12
.L14:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jge	.L13
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L13:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$9, %eax
	subl	%edx, %eax
	addl	%eax, -40(%rbp)
	addl	$1, -48(%rbp)
.L12:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
	addl	$1, -52(%rbp)
.L11:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L15
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	max(%rip), %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cap(%rip), %rdx
	movl	-40(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L16
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L17
	addl	$1, -28(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L18
	addl	$1, -32(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L19
	movl	$0, -36(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L20
.L41:
	movl	$0, -28(%rbp)
	jmp	.L21
.L40:
	movl	-32(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -24(%rbp)
	jmp	.L22
.L39:
	movl	-28(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -20(%rbp)
	jmp	.L23
.L38:
	movl	$9, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L24
.L26:
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L25
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L25:
	addl	$1, -52(%rbp)
.L24:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L26
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L27
.L29:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L28
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L28:
	addl	$1, -52(%rbp)
.L27:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L29
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L30
.L32:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L31
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L31:
	addl	$1, -48(%rbp)
.L30:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L32
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L33
.L35:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L34
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L34:
	addl	$1, -48(%rbp)
.L33:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L35
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movl	-28(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	max(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L46
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movl	-28(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cap(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$9, %eax
	subl	-44(%rbp), %eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	subl	-32(%rbp), %eax
	subl	$1, %eax
	imull	%eax, %ecx
	movl	-20(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	imull	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L37
	movl	-40(%rbp), %eax
	movl	%eax, -36(%rbp)
	jmp	.L37
.L46:
	nop
.L37:
	addl	$1, -20(%rbp)
.L23:
	movl	-56(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L38
	addl	$1, -24(%rbp)
.L22:
	movl	-60(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L39
	addl	$1, -28(%rbp)
.L21:
	movl	-56(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L40
	addl	$1, -32(%rbp)
.L20:
	movl	-60(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L41
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L42
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jg	.L43
.L42:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$344, %rsp
	.cfi_def_cfa_offset 400
	movq	%fs:40, %rax
	movq	%rax, 328(%rsp)
	xorl	%eax, %eax
	leaq	324(%rsp), %rax
	movq	%rax, 296(%rsp)
	leaq	320(%rsp), %rax
	movq	%rax, 288(%rsp)
.L2:
	movq	296(%rsp), %rdx
	xorl	%eax, %eax
	movq	288(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L47
	movl	320(%rsp), %eax
	movdqa	.LC1(%rip), %xmm3
	testl	%eax, %eax
	movl	%eax, 200(%rsp)
	jle	.L47
	subl	$1, %eax
	xorl	%ebp, %ebp
	leaq	map(%rip), %r15
	movl	%eax, 80(%rsp)
	movl	324(%rsp), %eax
	leaq	.LC0(%rip), %r14
	leal	-1(%rax), %ebx
	movl	%ebx, 64(%rsp)
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	.L88
.L9:
	leaq	(%r15,%rbp,4), %r13
	xorl	%r12d, %r12d
.L4:
	movq	%r13, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	324(%rsp), %eax
	addq	$4, %r13
	movdqa	.LC1(%rip), %xmm3
	cmpl	%r12d, %eax
	jg	.L4
	movl	320(%rsp), %ecx
	addl	$1, %ebx
	movl	%ecx, 200(%rsp)
	cmpl	%ebx, %ecx
	jle	.L89
	addq	$10, %rbp
	testl	%eax, %eax
	jg	.L9
.L88:
	cmpl	$1, 80(%rsp)
	movl	%eax, 48(%rsp)
	jle	.L53
.L52:
	cmpl	$1, 64(%rsp)
	jle	.L11
	leaq	44+map(%rip), %rax
	movl	$1, 44(%rsp)
	movl	$9, %r14d
	movq	%rax, 104(%rsp)
	leaq	-44(%rax), %r13
	movq	$4444, 112(%rsp)
.L13:
	movq	$1, 56(%rsp)
	movq	112(%rsp), %rax
	movq	%rax, 96(%rsp)
	movq	104(%rsp), %rax
	movq	%rax, 72(%rsp)
	movl	44(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 120(%rsp)
.L23:
	movq	56(%rsp), %rax
	movl	120(%rsp), %r12d
	movl	%eax, 40(%rsp)
	movl	%eax, 68(%rsp)
	movq	96(%rsp), %rax
	movq	%rax, 88(%rsp)
	movl	44(%rsp), %eax
	movl	%eax, 52(%rsp)
.L22:
	movq	88(%rsp), %rax
	movl	68(%rsp), %ebp
	movl	$1, 36(%rsp)
	movq	$0, 24(%rsp)
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movl	44(%rsp), %edi
	cmpl	%edi, 52(%rsp)
	jl	.L56
	cmpl	68(%rsp), %ebp
	movl	$1, %r11d
	cmovge	36(%rsp), %r11d
	cmpl	56(%rsp), %ebp
	movq	72(%rsp), %r8
	setl	%r10b
	cmpl	$2, 24(%rsp)
	movl	%r11d, %ebx
	setbe	%al
	andl	$-4, %ebx
	xorl	%ecx, %ecx
	orl	%eax, %r10d
	movl	%r11d, %eax
	shrl	$2, %eax
	movl	%eax, 32(%rsp)
	movl	40(%rsp), %eax
	addl	%ebx, %eax
	movl	%eax, 8(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	testb	%r10b, %r10b
	jne	.L57
	movd	%eax, %xmm6
	movdqu	(%r8), %xmm2
	cmpl	$1, 32(%rsp)
	pshufd	$0, %xmm6, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm3, %xmm1
	psubd	%xmm2, %xmm1
	jbe	.L16
	movdqu	16(%r8), %xmm4
	movdqa	%xmm4, %xmm2
	movdqa	%xmm4, %xmm5
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm5
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	psubd	%xmm4, %xmm2
	por	%xmm5, %xmm0
	paddd	%xmm2, %xmm1
.L16:
	movdqa	%xmm1, %xmm2
	psrldq	$8, %xmm2
	paddd	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	paddd	%xmm2, %xmm1
	movdqa	%xmm0, %xmm2
	psrldq	$8, %xmm2
	movd	%xmm1, %eax
	movdqa	%xmm2, %xmm1
	addl	%eax, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %eax
	cmpl	%ebx, %r11d
	je	.L17
	movl	8(%rsp), %edx
.L15:
	movslq	%edi, %rsi
	movslq	%edx, %r9
	movl	%r14d, %r15d
	leaq	(%rsi,%rsi,4), %rsi
	addq	%rsi, %rsi
	addq	%rsi, %r9
	movl	0(%r13,%r9,4), %r9d
	cmpl	%r9d, %eax
	cmovl	%r9d, %eax
	subl	%r9d, %r15d
	leal	1(%rdx), %r9d
	addl	%r15d, %ecx
	cmpl	%r9d, %ebp
	jl	.L17
	movslq	%r9d, %r9
	movl	%r14d, %r15d
	addq	%rsi, %r9
	movl	0(%r13,%r9,4), %r9d
	cmpl	%r9d, %eax
	cmovl	%r9d, %eax
	subl	%r9d, %r15d
	addl	$2, %edx
	addl	%r15d, %ecx
	cmpl	%edx, %ebp
	jl	.L17
	movslq	%edx, %rdx
	addq	%rdx, %rsi
	movl	0(%r13,%rsi,4), %edx
	movl	%r14d, %esi
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	subl	%edx, %esi
	addl	%esi, %ecx
.L17:
	addl	$1, %edi
	addq	$40, %r8
	cmpl	%r12d, %edi
	jne	.L18
.L14:
	movq	16(%rsp), %rbx
	leaq	max(%rip), %rdx
	addl	$1, 36(%rsp)
	addl	$1, %ebp
	addq	$1, 24(%rsp)
	movl	%eax, (%rdx,%rbx)
	movq	%rbx, %rax
	leaq	cap(%rip), %rdx
	addq	$4, %rax
	movl	%ecx, (%rdx,%rbx)
	movq	%rax, 16(%rsp)
	cmpl	%ebp, 64(%rsp)
	jg	.L19
	addl	$1, 52(%rsp)
	addl	$1, %r12d
	movl	52(%rsp), %eax
	addq	$40, 88(%rsp)
	cmpl	%eax, 80(%rsp)
	jg	.L22
	addq	$1, 56(%rsp)
	movq	56(%rsp), %rax
	addq	$4, 72(%rsp)
	addq	$404, 96(%rsp)
	cmpl	%eax, 64(%rsp)
	jg	.L23
	movl	120(%rsp), %eax
	addq	$40, 104(%rsp)
	addq	$4040, 112(%rsp)
	movl	%eax, 44(%rsp)
	cmpl	%eax, 80(%rsp)
	jne	.L13
.L11:
	movl	200(%rsp), %edx
	testl	%edx, %edx
	jle	.L58
.L53:
	leaq	40+map(%rip), %rax
	xorl	%r15d, %r15d
	movl	$5, 44(%rsp)
	leaq	map(%rip), %rbp
	movq	%rax, 80(%rsp)
	movl	200(%rsp), %eax
	movl	$4, 40(%rsp)
	addl	$5, %eax
	movl	$3, 16(%rsp)
	movl	%eax, 312(%rsp)
	movl	48(%rsp), %eax
	movl	$9, 120(%rsp)
	addl	$2, %eax
	movl	$2, 52(%rsp)
	movq	$4400, 280(%rsp)
	movl	%eax, 316(%rsp)
	movl	%r15d, 36(%rsp)
.L25:
	movl	44(%rsp), %eax
	subl	$5, %eax
	movl	%eax, 64(%rsp)
	movl	48(%rsp), %eax
	testl	%eax, %eax
	jle	.L90
	movl	$2, 204(%rsp)
	movslq	52(%rsp), %rax
	movq	$0, 56(%rsp)
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 128(%rsp)
	movq	%rax, 96(%rsp)
	movslq	120(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 264(%rsp)
	movq	%rax, 248(%rsp)
	movslq	16(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 160(%rsp)
	movq	%rax, 136(%rsp)
	movslq	40(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 192(%rsp)
	movq	%rax, 168(%rsp)
	movslq	44(%rsp), %rax
	movq	%rax, %rbx
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 208(%rsp)
	movq	%rax, 176(%rsp)
	leal	1(%rbx), %eax
	movl	%eax, 68(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 216(%rsp)
	movq	%rax, 184(%rsp)
	leal	2(%rbx), %eax
	movl	%eax, 88(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 240(%rsp)
	movq	%rax, 224(%rsp)
	leal	3(%rbx), %eax
	movl	%eax, 124(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 256(%rsp)
	movq	%rax, 232(%rsp)
	movq	80(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	-40(%rax), %r15
	movq	280(%rsp), %rax
	movq	%rax, 272(%rsp)
	leal	-4(%rbx), %eax
	movl	%eax, 32(%rsp)
	movslq	64(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	movq	%rax, 8(%rsp)
.L44:
	movl	204(%rsp), %eax
	movl	52(%rsp), %ecx
	leal	-2(%rax), %r14d
	movl	200(%rsp), %eax
	cmpl	%eax, %ecx
	jge	.L26
	movslq	%r14d, %rax
	addq	8(%rsp), %rax
	movl	$1, 112(%rsp)
	movq	%rax, 304(%rsp)
	movq	96(%rsp), %r13
.L43:
	movl	204(%rsp), %eax
	movl	48(%rsp), %ebx
	cmpl	%ebx, %eax
	jge	.L27
	movslq	%eax, %rdx
	leal	-1(%rcx), %eax
	movq	272(%rsp), %rbx
	movl	$3, %r8d
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	(%rbx,%rax,8), %rax
	leaq	max(%rip), %rbx
	addq	%rax, %rbx
	movq	%rbx, 72(%rsp)
	leaq	cap(%rip), %rbx
	addq	%rbx, %rax
	movq	304(%rsp), %rbx
	movq	%rax, 144(%rsp)
	movslq	%ecx, %rax
	leaq	(%rax,%rax,4), %r12
	addq	%r12, %r12
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L91:
	movl	0(%rbp,%rbx,4), %eax
	movl	$9, %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	32(%rsp), %ecx
	jl	.L29
	movq	104(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	%ecx, 52(%rsp)
	jg	.L29
	movq	96(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	16(%rsp), %ecx
	jl	.L30
	movq	136(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	40(%rsp), %ecx
	jl	.L30
	movq	168(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	44(%rsp), %ecx
	jl	.L30
	movq	176(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	68(%rsp), %ecx
	jl	.L30
	movq	184(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	88(%rsp), %ecx
	jl	.L30
	movq	224(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	124(%rsp), %ecx
	jl	.L30
	movq	232(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	120(%rsp), %ecx
	jl	.L30
	movq	248(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
.L30:
	movslq	%esi, %rdi
	addq	8(%rsp), %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	32(%rsp), %ecx
	jl	.L28
	movq	80(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
.L50:
	movq	128(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	16(%rsp), %ecx
	jl	.L28
	movq	160(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	40(%rsp), %ecx
	jl	.L28
	movq	192(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	44(%rsp), %ecx
	jl	.L28
	movq	208(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	68(%rsp), %ecx
	jl	.L28
	movq	216(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	88(%rsp), %ecx
	jl	.L28
	movq	240(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	124(%rsp), %ecx
	jl	.L28
	movq	256(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	120(%rsp), %ecx
	jl	.L28
	movq	264(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
.L28:
	cmpl	%r14d, %esi
	movl	$1, %edi
	movl	%edx, %r10d
	leal	-1(%r8), %esi
	cmovge	%r8d, %edi
	cmpl	$2, %esi
	setbe	%r9b
	cmpl	56(%rsp), %edx
	setl	%sil
	orb	%sil, %r9b
	movb	%r9b, 24(%rsp)
	jne	.L32
	movd	%eax, %xmm7
	movdqu	(%r15), %xmm0
	movl	%edi, %eax
	pshufd	$0, %xmm7, %xmm1
	movdqu	(%r15), %xmm7
	shrl	$2, %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm7, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %eax
	je	.L33
	movdqu	16(%r15), %xmm1
	movdqu	16(%r15), %xmm7
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm7, %xmm1
	por	%xmm1, %xmm0
.L33:
	movdqa	%xmm0, %xmm2
	movl	%edi, %r9d
	psrldq	$8, %xmm2
	andl	$-4, %r9d
	movdqa	%xmm2, %xmm1
	leal	(%r9,%r14), %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r9d, %edi
	je	.L34
	movslq	%esi, %r9
	addq	8(%rsp), %r9
	movl	0(%rbp,%r9,4), %r9d
	cmpl	%r9d, %eax
	cmovg	%r9d, %eax
	addl	$1, %esi
	cmpl	%esi, %r10d
	jl	.L34
.L49:
	movq	152(%rsp), %r9
	movslq	%esi, %r11
	leaq	(%r9,%r9,4), %r9
	addq	%r9, %r9
	addq	%r9, %r11
	movl	0(%rbp,%r11,4), %r11d
	cmpl	%r11d, %eax
	cmovg	%r11d, %eax
	addl	$1, %esi
	cmpl	%r10d, %esi
	jg	.L36
	movslq	%esi, %rsi
	addq	%rsi, %r9
	movl	0(%rbp,%r9,4), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
.L36:
	cmpb	$0, 24(%rsp)
	jne	.L60
.L34:
	movd	%eax, %xmm7
	movdqu	0(%r13), %xmm0
	movl	%edi, %eax
	pshufd	$0, %xmm7, %xmm1
	movdqu	0(%r13), %xmm7
	shrl	$2, %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm7, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %eax
	je	.L38
	movdqu	16(%r13), %xmm1
	movdqu	16(%r13), %xmm7
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm7, %xmm1
	por	%xmm1, %xmm0
.L38:
	movdqa	%xmm0, %xmm2
	movl	%edi, %r9d
	psrldq	$8, %xmm2
	andl	$-4, %r9d
	movdqa	%xmm2, %xmm1
	leal	(%r9,%r14), %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r9d, %edi
	je	.L41
.L37:
	movslq	%esi, %rdi
	addq	%r12, %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	leal	1(%rsi), %edi
	cmpl	%r10d, %edi
	jg	.L41
	movslq	%edi, %rdi
	addq	%r12, %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	addl	$2, %esi
	cmpl	%r10d, %esi
	jg	.L41
	movslq	%esi, %rsi
	addq	%r12, %rsi
	movl	0(%rbp,%rsi,4), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
.L41:
	movq	72(%rsp), %rdi
	cmpl	%eax, -4(%rdi,%rdx,4)
	jge	.L39
	movl	$9, %esi
	movl	36(%rsp), %edi
	subl	%eax, %esi
	movl	112(%rsp), %eax
	imull	%esi, %eax
	leal	-2(%r8), %esi
	imull	%eax, %esi
	movq	144(%rsp), %rax
	movl	-4(%rax,%rdx,4), %eax
	movl	%eax, 24(%rsp)
	subl	%esi, %eax
	cmpl	%eax, %edi
	cmovge	%edi, %eax
	movl	%eax, 36(%rsp)
.L39:
	addq	$1, %rdx
	addl	$1, %r8d
	cmpl	%edx, 48(%rsp)
	jle	.L27
.L42:
	movl	%edx, %esi
	cmpl	64(%rsp), %ecx
	jge	.L91
	movl	$9, %eax
	jmp	.L28
.L47:
	movq	328(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L92
	addq	$344, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L57:
	.cfi_restore_state
	movl	40(%rsp), %edx
	jmp	.L15
.L56:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L14
.L29:
	movslq	%esi, %rdi
	addq	8(%rsp), %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	32(%rsp), %ecx
	jl	.L28
	movq	80(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	%ecx, 52(%rsp)
	jg	.L28
	jmp	.L50
.L27:
	addl	$1, 112(%rsp)
	addl	$1, %ecx
	addq	$40, %r13
	cmpl	200(%rsp), %ecx
	jne	.L43
.L26:
	addl	$1, 204(%rsp)
	addq	$4, %r15
	movl	204(%rsp), %eax
	addq	$1, 56(%rsp)
	addq	$4, 96(%rsp)
	addq	$400, 272(%rsp)
	addq	$4, 248(%rsp)
	addq	$4, 104(%rsp)
	addq	$4, 136(%rsp)
	addq	$4, 168(%rsp)
	addq	$4, 176(%rsp)
	addq	$4, 184(%rsp)
	addq	$4, 224(%rsp)
	addq	$4, 232(%rsp)
	cmpl	316(%rsp), %eax
	jne	.L44
	jmp	.L46
.L32:
	movl	0(%rbp,%rbx,4), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	movl	204(%rsp), %esi
	subl	$1, %esi
	cmpl	%esi, %edx
	jge	.L49
.L60:
	movl	%r14d, %esi
	jmp	.L37
.L90:
	movl	44(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 68(%rsp)
.L46:
	movl	68(%rsp), %eax
	movl	312(%rsp), %ebx
	addq	$4000, 280(%rsp)
	addq	$40, 80(%rsp)
	addl	$1, 52(%rsp)
	addl	$1, 120(%rsp)
	addl	$1, 16(%rsp)
	addl	$1, 40(%rsp)
	movl	%eax, 44(%rsp)
	cmpl	%ebx, %eax
	jne	.L25
	movl	36(%rsp), %r15d
	jmp	.L24
.L89:
	cmpl	$1, 80(%rsp)
	movl	%eax, 48(%rsp)
	jg	.L52
	jmp	.L11
.L58:
	xorl	%r15d, %r15d
.L24:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L92:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	cap
	.bss
	.align 32
	.type	cap, @object
	.size	cap, 40000
cap:
	.zero	40000
	.globl	max
	.align 32
	.type	max, @object
	.size	max, 40000
max:
	.zero	40000
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 400
map:
	.zero	400
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	9
	.long	9
	.long	9
	.long	9
	.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"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$344, %rsp
	.cfi_def_cfa_offset 400
	movq	%fs:40, %rax
	movq	%rax, 328(%rsp)
	xorl	%eax, %eax
	leaq	324(%rsp), %rax
	movq	%rax, 296(%rsp)
	leaq	320(%rsp), %rax
	movq	%rax, 288(%rsp)
.L2:
	movq	296(%rsp), %rdx
	xorl	%eax, %eax
	movq	288(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L47
	movl	320(%rsp), %eax
	movdqa	.LC1(%rip), %xmm3
	testl	%eax, %eax
	movl	%eax, 200(%rsp)
	jle	.L47
	subl	$1, %eax
	xorl	%ebp, %ebp
	leaq	map(%rip), %r15
	movl	%eax, 80(%rsp)
	movl	324(%rsp), %eax
	leaq	.LC0(%rip), %r14
	leal	-1(%rax), %ebx
	movl	%ebx, 64(%rsp)
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	.L88
.L9:
	leaq	(%r15,%rbp,4), %r13
	xorl	%r12d, %r12d
.L4:
	movq	%r13, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	324(%rsp), %eax
	addq	$4, %r13
	movdqa	.LC1(%rip), %xmm3
	cmpl	%r12d, %eax
	jg	.L4
	movl	320(%rsp), %ecx
	addl	$1, %ebx
	movl	%ecx, 200(%rsp)
	cmpl	%ebx, %ecx
	jle	.L89
	addq	$10, %rbp
	testl	%eax, %eax
	jg	.L9
.L88:
	cmpl	$1, 80(%rsp)
	movl	%eax, 48(%rsp)
	jle	.L53
.L52:
	cmpl	$1, 64(%rsp)
	jle	.L11
	leaq	44+map(%rip), %rax
	movl	$1, 44(%rsp)
	movl	$9, %r14d
	movq	%rax, 104(%rsp)
	leaq	-44(%rax), %r13
	movq	$4444, 112(%rsp)
.L13:
	movq	$1, 56(%rsp)
	movq	112(%rsp), %rax
	movq	%rax, 96(%rsp)
	movq	104(%rsp), %rax
	movq	%rax, 72(%rsp)
	movl	44(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 120(%rsp)
.L23:
	movq	56(%rsp), %rax
	movl	120(%rsp), %r12d
	movl	%eax, 40(%rsp)
	movl	%eax, 68(%rsp)
	movq	96(%rsp), %rax
	movq	%rax, 88(%rsp)
	movl	44(%rsp), %eax
	movl	%eax, 52(%rsp)
.L22:
	movq	88(%rsp), %rax
	movl	68(%rsp), %ebp
	movl	$1, 36(%rsp)
	movq	$0, 24(%rsp)
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movl	44(%rsp), %edi
	cmpl	%edi, 52(%rsp)
	jl	.L56
	cmpl	68(%rsp), %ebp
	movl	$1, %r11d
	cmovge	36(%rsp), %r11d
	cmpl	56(%rsp), %ebp
	movq	72(%rsp), %r8
	setl	%r10b
	cmpl	$2, 24(%rsp)
	movl	%r11d, %ebx
	setbe	%al
	andl	$-4, %ebx
	xorl	%ecx, %ecx
	orl	%eax, %r10d
	movl	%r11d, %eax
	shrl	$2, %eax
	movl	%eax, 32(%rsp)
	movl	40(%rsp), %eax
	addl	%ebx, %eax
	movl	%eax, 8(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	testb	%r10b, %r10b
	jne	.L57
	movd	%eax, %xmm6
	movdqu	(%r8), %xmm2
	cmpl	$1, 32(%rsp)
	pshufd	$0, %xmm6, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm3, %xmm1
	psubd	%xmm2, %xmm1
	jbe	.L16
	movdqu	16(%r8), %xmm4
	movdqa	%xmm4, %xmm2
	movdqa	%xmm4, %xmm5
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm5
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	movdqa	%xmm3, %xmm2
	psubd	%xmm4, %xmm2
	por	%xmm5, %xmm0
	paddd	%xmm2, %xmm1
.L16:
	movdqa	%xmm1, %xmm2
	psrldq	$8, %xmm2
	paddd	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	paddd	%xmm2, %xmm1
	movdqa	%xmm0, %xmm2
	psrldq	$8, %xmm2
	movd	%xmm1, %eax
	movdqa	%xmm2, %xmm1
	addl	%eax, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %eax
	cmpl	%ebx, %r11d
	je	.L17
	movl	8(%rsp), %edx
.L15:
	movslq	%edi, %rsi
	movslq	%edx, %r9
	movl	%r14d, %r15d
	leaq	(%rsi,%rsi,4), %rsi
	addq	%rsi, %rsi
	addq	%rsi, %r9
	movl	0(%r13,%r9,4), %r9d
	cmpl	%r9d, %eax
	cmovl	%r9d, %eax
	subl	%r9d, %r15d
	leal	1(%rdx), %r9d
	addl	%r15d, %ecx
	cmpl	%r9d, %ebp
	jl	.L17
	movslq	%r9d, %r9
	movl	%r14d, %r15d
	addq	%rsi, %r9
	movl	0(%r13,%r9,4), %r9d
	cmpl	%r9d, %eax
	cmovl	%r9d, %eax
	subl	%r9d, %r15d
	addl	$2, %edx
	addl	%r15d, %ecx
	cmpl	%edx, %ebp
	jl	.L17
	movslq	%edx, %rdx
	addq	%rdx, %rsi
	movl	0(%r13,%rsi,4), %edx
	movl	%r14d, %esi
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	subl	%edx, %esi
	addl	%esi, %ecx
.L17:
	addl	$1, %edi
	addq	$40, %r8
	cmpl	%r12d, %edi
	jne	.L18
.L14:
	movq	16(%rsp), %rbx
	leaq	max(%rip), %rdx
	addl	$1, 36(%rsp)
	addl	$1, %ebp
	addq	$1, 24(%rsp)
	movl	%eax, (%rdx,%rbx)
	movq	%rbx, %rax
	leaq	cap(%rip), %rdx
	addq	$4, %rax
	movl	%ecx, (%rdx,%rbx)
	movq	%rax, 16(%rsp)
	cmpl	%ebp, 64(%rsp)
	jg	.L19
	addl	$1, 52(%rsp)
	addl	$1, %r12d
	movl	52(%rsp), %eax
	addq	$40, 88(%rsp)
	cmpl	%eax, 80(%rsp)
	jg	.L22
	addq	$1, 56(%rsp)
	movq	56(%rsp), %rax
	addq	$4, 72(%rsp)
	addq	$404, 96(%rsp)
	cmpl	%eax, 64(%rsp)
	jg	.L23
	movl	120(%rsp), %eax
	addq	$40, 104(%rsp)
	addq	$4040, 112(%rsp)
	movl	%eax, 44(%rsp)
	cmpl	%eax, 80(%rsp)
	jne	.L13
.L11:
	movl	200(%rsp), %edx
	testl	%edx, %edx
	jle	.L58
.L53:
	leaq	40+map(%rip), %rax
	xorl	%r15d, %r15d
	movl	$5, 44(%rsp)
	leaq	map(%rip), %rbp
	movq	%rax, 80(%rsp)
	movl	200(%rsp), %eax
	movl	$4, 40(%rsp)
	addl	$5, %eax
	movl	$3, 16(%rsp)
	movl	%eax, 312(%rsp)
	movl	48(%rsp), %eax
	movl	$9, 120(%rsp)
	addl	$2, %eax
	movl	$2, 52(%rsp)
	movq	$4400, 280(%rsp)
	movl	%eax, 316(%rsp)
	movl	%r15d, 36(%rsp)
.L25:
	movl	44(%rsp), %eax
	subl	$5, %eax
	movl	%eax, 64(%rsp)
	movl	48(%rsp), %eax
	testl	%eax, %eax
	jle	.L90
	movl	$2, 204(%rsp)
	movslq	52(%rsp), %rax
	movq	$0, 56(%rsp)
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 128(%rsp)
	movq	%rax, 96(%rsp)
	movslq	120(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 264(%rsp)
	movq	%rax, 248(%rsp)
	movslq	16(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 160(%rsp)
	movq	%rax, 136(%rsp)
	movslq	40(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 192(%rsp)
	movq	%rax, 168(%rsp)
	movslq	44(%rsp), %rax
	movq	%rax, %rbx
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 208(%rsp)
	movq	%rax, 176(%rsp)
	leal	1(%rbx), %eax
	movl	%eax, 68(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 216(%rsp)
	movq	%rax, 184(%rsp)
	leal	2(%rbx), %eax
	movl	%eax, 88(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 240(%rsp)
	movq	%rax, 224(%rsp)
	leal	3(%rbx), %eax
	movl	%eax, 124(%rsp)
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,8), %rax
	movq	%rax, 256(%rsp)
	movq	%rax, 232(%rsp)
	movq	80(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	-40(%rax), %r15
	movq	280(%rsp), %rax
	movq	%rax, 272(%rsp)
	leal	-4(%rbx), %eax
	movl	%eax, 32(%rsp)
	movslq	64(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	(%rax,%rax,4), %rax
	addq	%rax, %rax
	movq	%rax, 8(%rsp)
.L44:
	movl	204(%rsp), %eax
	movl	52(%rsp), %ecx
	leal	-2(%rax), %r14d
	movl	200(%rsp), %eax
	cmpl	%eax, %ecx
	jge	.L26
	movslq	%r14d, %rax
	addq	8(%rsp), %rax
	movl	$1, 112(%rsp)
	movq	%rax, 304(%rsp)
	movq	96(%rsp), %r13
.L43:
	movl	204(%rsp), %eax
	movl	48(%rsp), %ebx
	cmpl	%ebx, %eax
	jge	.L27
	movslq	%eax, %rdx
	leal	-1(%rcx), %eax
	movq	272(%rsp), %rbx
	movl	$3, %r8d
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	(%rbx,%rax,8), %rax
	leaq	max(%rip), %rbx
	addq	%rax, %rbx
	movq	%rbx, 72(%rsp)
	leaq	cap(%rip), %rbx
	addq	%rbx, %rax
	movq	304(%rsp), %rbx
	movq	%rax, 144(%rsp)
	movslq	%ecx, %rax
	leaq	(%rax,%rax,4), %r12
	addq	%r12, %r12
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L91:
	movl	0(%rbp,%rbx,4), %eax
	movl	$9, %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	32(%rsp), %ecx
	jl	.L29
	movq	104(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	%ecx, 52(%rsp)
	jg	.L29
	movq	96(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	16(%rsp), %ecx
	jl	.L30
	movq	136(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	40(%rsp), %ecx
	jl	.L30
	movq	168(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	44(%rsp), %ecx
	jl	.L30
	movq	176(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	68(%rsp), %ecx
	jl	.L30
	movq	184(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	88(%rsp), %ecx
	jl	.L30
	movq	224(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	124(%rsp), %ecx
	jl	.L30
	movq	232(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	120(%rsp), %ecx
	jl	.L30
	movq	248(%rsp), %rdi
	movl	(%rdi), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
.L30:
	movslq	%esi, %rdi
	addq	8(%rsp), %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	32(%rsp), %ecx
	jl	.L28
	movq	80(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
.L50:
	movq	128(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	16(%rsp), %ecx
	jl	.L28
	movq	160(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	40(%rsp), %ecx
	jl	.L28
	movq	192(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	44(%rsp), %ecx
	jl	.L28
	movq	208(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	68(%rsp), %ecx
	jl	.L28
	movq	216(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	88(%rsp), %ecx
	jl	.L28
	movq	240(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	124(%rsp), %ecx
	jl	.L28
	movq	256(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	120(%rsp), %ecx
	jl	.L28
	movq	264(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
.L28:
	cmpl	%r14d, %esi
	movl	$1, %edi
	movl	%edx, %r10d
	leal	-1(%r8), %esi
	cmovge	%r8d, %edi
	cmpl	$2, %esi
	setbe	%r9b
	cmpl	56(%rsp), %edx
	setl	%sil
	orb	%sil, %r9b
	movb	%r9b, 24(%rsp)
	jne	.L32
	movd	%eax, %xmm7
	movdqu	(%r15), %xmm0
	movl	%edi, %eax
	pshufd	$0, %xmm7, %xmm1
	movdqu	(%r15), %xmm7
	shrl	$2, %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm7, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %eax
	je	.L33
	movdqu	16(%r15), %xmm1
	movdqu	16(%r15), %xmm7
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm7, %xmm1
	por	%xmm1, %xmm0
.L33:
	movdqa	%xmm0, %xmm2
	movl	%edi, %r9d
	psrldq	$8, %xmm2
	andl	$-4, %r9d
	movdqa	%xmm2, %xmm1
	leal	(%r9,%r14), %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r9d, %edi
	je	.L34
	movslq	%esi, %r9
	addq	8(%rsp), %r9
	movl	0(%rbp,%r9,4), %r9d
	cmpl	%r9d, %eax
	cmovg	%r9d, %eax
	addl	$1, %esi
	cmpl	%esi, %r10d
	jl	.L34
.L49:
	movq	152(%rsp), %r9
	movslq	%esi, %r11
	leaq	(%r9,%r9,4), %r9
	addq	%r9, %r9
	addq	%r9, %r11
	movl	0(%rbp,%r11,4), %r11d
	cmpl	%r11d, %eax
	cmovg	%r11d, %eax
	addl	$1, %esi
	cmpl	%r10d, %esi
	jg	.L36
	movslq	%esi, %rsi
	addq	%rsi, %r9
	movl	0(%rbp,%r9,4), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
.L36:
	cmpb	$0, 24(%rsp)
	jne	.L60
.L34:
	movd	%eax, %xmm7
	movdqu	0(%r13), %xmm0
	movl	%edi, %eax
	pshufd	$0, %xmm7, %xmm1
	movdqu	0(%r13), %xmm7
	shrl	$2, %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm7, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %eax
	je	.L38
	movdqu	16(%r13), %xmm1
	movdqu	16(%r13), %xmm7
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm7, %xmm1
	por	%xmm1, %xmm0
.L38:
	movdqa	%xmm0, %xmm2
	movl	%edi, %r9d
	psrldq	$8, %xmm2
	andl	$-4, %r9d
	movdqa	%xmm2, %xmm1
	leal	(%r9,%r14), %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%r9d, %edi
	je	.L41
.L37:
	movslq	%esi, %rdi
	addq	%r12, %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	leal	1(%rsi), %edi
	cmpl	%r10d, %edi
	jg	.L41
	movslq	%edi, %rdi
	addq	%r12, %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	addl	$2, %esi
	cmpl	%r10d, %esi
	jg	.L41
	movslq	%esi, %rsi
	addq	%r12, %rsi
	movl	0(%rbp,%rsi,4), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
.L41:
	movq	72(%rsp), %rdi
	cmpl	%eax, -4(%rdi,%rdx,4)
	jge	.L39
	movl	$9, %esi
	movl	36(%rsp), %edi
	subl	%eax, %esi
	movl	112(%rsp), %eax
	imull	%esi, %eax
	leal	-2(%r8), %esi
	imull	%eax, %esi
	movq	144(%rsp), %rax
	movl	-4(%rax,%rdx,4), %eax
	movl	%eax, 24(%rsp)
	subl	%esi, %eax
	cmpl	%eax, %edi
	cmovge	%edi, %eax
	movl	%eax, 36(%rsp)
.L39:
	addq	$1, %rdx
	addl	$1, %r8d
	cmpl	%edx, 48(%rsp)
	jle	.L27
.L42:
	movl	%edx, %esi
	cmpl	64(%rsp), %ecx
	jge	.L91
	movl	$9, %eax
	jmp	.L28
.L47:
	movq	328(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L92
	addq	$344, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L57:
	.cfi_restore_state
	movl	40(%rsp), %edx
	jmp	.L15
.L56:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L14
.L29:
	movslq	%esi, %rdi
	addq	8(%rsp), %rdi
	movl	0(%rbp,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	32(%rsp), %ecx
	jl	.L28
	movq	80(%rsp), %rdi
	movl	(%rdi,%rdx,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	cmpl	%ecx, 52(%rsp)
	jg	.L28
	jmp	.L50
.L27:
	addl	$1, 112(%rsp)
	addl	$1, %ecx
	addq	$40, %r13
	cmpl	200(%rsp), %ecx
	jne	.L43
.L26:
	addl	$1, 204(%rsp)
	addq	$4, %r15
	movl	204(%rsp), %eax
	addq	$1, 56(%rsp)
	addq	$4, 96(%rsp)
	addq	$400, 272(%rsp)
	addq	$4, 248(%rsp)
	addq	$4, 104(%rsp)
	addq	$4, 136(%rsp)
	addq	$4, 168(%rsp)
	addq	$4, 176(%rsp)
	addq	$4, 184(%rsp)
	addq	$4, 224(%rsp)
	addq	$4, 232(%rsp)
	cmpl	316(%rsp), %eax
	jne	.L44
	jmp	.L46
.L32:
	movl	0(%rbp,%rbx,4), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	movl	204(%rsp), %esi
	subl	$1, %esi
	cmpl	%esi, %edx
	jge	.L49
.L60:
	movl	%r14d, %esi
	jmp	.L37
.L90:
	movl	44(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 68(%rsp)
.L46:
	movl	68(%rsp), %eax
	movl	312(%rsp), %ebx
	addq	$4000, 280(%rsp)
	addq	$40, 80(%rsp)
	addl	$1, 52(%rsp)
	addl	$1, 120(%rsp)
	addl	$1, 16(%rsp)
	addl	$1, 40(%rsp)
	movl	%eax, 44(%rsp)
	cmpl	%ebx, %eax
	jne	.L25
	movl	36(%rsp), %r15d
	jmp	.L24
.L89:
	cmpl	$1, 80(%rsp)
	movl	%eax, 48(%rsp)
	jg	.L52
	jmp	.L11
.L58:
	xorl	%r15d, %r15d
.L24:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L92:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	cap
	.bss
	.align 32
	.type	cap, @object
	.size	cap, 40000
cap:
	.zero	40000
	.globl	max
	.align 32
	.type	max, @object
	.size	max, 40000
max:
	.zero	40000
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 400
map:
	.zero	400
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	9
	.long	9
	.long	9
	.long	9
	.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:

// AOJ 1618: A Garden with Ponds
// 2017.12.25 bal4u@uu

#include <stdio.h>

#define MAX 9

int map[10][10];
int max[10][10][10][10];
int cap[10][10][10][10];

int main()
{
	int d, w, r, c, m, s, ans;
	int d1, w1, r1, c1, r2, c2;

	while (scanf("%d%d", &d, &w) && d > 0) {
		d1 = d-1, w1 = w-1;
		for (r= 0; r < d; r++) for (c = 0; c < w; c++) scanf("%d", &map[r][c]);

		// ?????¢???????¢??????????????????????????????¨?????§?????????????????????9??¨????????????????¨????
		for (r1 = 1; r1 < d1; r1++) for (c1 = 1; c1 < w1; c1++) {
			for (r2 = r1; r2 < d1; r2++) for (c2 = c1; c2 < w1; c2++) {
				m = 0, s = 0;
				for (r = r1; r <= r2; r++) for (c = c1; c <= c2; c++) {
					if (map[r][c] > m) m = map[r][c];
					s += MAX - map[r][c];
				}
				max[r1][c1][r2][c2] = m;
				cap[r1][c1][r2][c2] = s;
			}
		}

		ans = 0;
		// ???????????????????±?????¢????????????????
		for (r1 = 0; r1 < d; r1++) for (c1 = 0; c1 < w; c1++) {
			for (r2 = r1+2; r2 < d; r2++) for (c2 = c1+2; c2 < w; c2++) {
				m = MAX;
				for (r = r1; r <= r2; r++) if (map[r ][c1] < m) m = map[r ][c1];
				for (r = r1; r <= r2; r++) if (map[r ][c2] < m) m = map[r ][c2];
				for (c = c1; c <= c2; c++) if (map[r1][c ] < m) m = map[r1][c ];
				for (c = c1; c <= c2; c++) if (map[r2][c ] < m) m = map[r2][c ];
				if (max[r1+1][c1+1][r2-1][c2-1] >= m) continue;
				s = cap[r1+1][c1+1][r2-1][c2-1] - (MAX-m)*(r2-r1-1)*(c2-c1-1);
				if (s > ans) ans = s;
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}
3 3
2 3 2
2 1 2
2 3 1
3 5
3 3 4 3 3
3 1 0 2 3
3 3 4 3 2
7 7
1 1 1 1 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 0 1
0 0 2 0 0 0 1
0 0 1 1 1 1 1
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 0 2
3 3 3 9 9 9
3 0 0 9 0 9
3 3 3 9 9 9
0 0
 3 3
2 3 2
2 1 2
2 3 1
3 5
3 3 4 3 3
3 1 0 2 3
3 3 4 3 2
7 7
1 1 1 1 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 0 1
0 0 2 0 0 0 1
0 0 1 1 1 1 1
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 0 2
3 3 3 9 9 9
3 0 0 4 0 9
3 3 3 9 9 10
0 0
 3 3
2 3 2
2 1 2
2 3 1
3 5
3 3 4 3 3
3 1 0 2 3
3 3 4 3 2
7 7
1 1 1 2 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 0 1
0 0 2 0 0 0 1
0 0 1 1 1 1 1
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 0 2
3 1 3 9 9 9
3 0 0 4 0 9
3 3 3 9 9 10
0 0
 3 3
2 3 2
2 1 2
2 3 1
3 5
3 3 1 3 3
3 1 0 2 3
3 3 4 3 2
7 7
1 1 0 2 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 0 1
0 0 2 0 0 0 0
0 0 1 1 1 1 1
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 0 2
3 3 3 9 9 9
3 0 0 4 0 9
3 3 3 9 9 10
0 0
 3 3
2 3 2
2 1 2
2 3 1
3 5
3 3 4 3 3
3 1 0 2 3
3 3 4 3 2
7 7
1 1 0 2 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 -1 1
0 0 2 0 0 0 0
0 0 1 1 1 1 1
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 0 2
3 3 3 9 9 9
3 1 0 4 0 9
3 3 3 9 9 10
0 0
 3 3
2 3 2
2 1 2
2 3 1
3 5
3 3 4 3 3
3 1 0 2 3
3 3 4 3 2
7 7
1 1 1 2 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 0 1
0 0 2 0 0 0 0
0 0 1 1 1 1 1
6 6
1 1 1 1 2 2
1 0 0 2 0 0
1 0 0 2 0 2
3 3 3 9 9 9
3 0 0 2 0 9
3 3 3 9 9 10
0 0
 3 3
2 3 2
2 1 2
2 3 1
3 5
3 3 0 3 3
3 1 0 2 3
3 3 4 6 2
7 7
1 1 0 2 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 -1 1
0 0 2 0 0 0 0
0 0 1 1 1 1 1
6 6
0 1 1 1 2 2
1 1 0 2 0 2
1 0 0 2 0 0
3 3 3 9 9 9
3 0 0 4 0 9
3 3 3 9 9 10
0 0
 3 3
2 3 2
2 1 2
2 3 0
3 5
3 3 4 3 3
3 1 0 2 3
3 3 4 3 2
7 7
0 1 1 1 1 0 0
1 0 0 0 1 0 0
1 0 2 1 1 1 1
1 0 1 0 1 0 2
1 1 1 1 1 0 1
0 0 2 0 1 0 1
0 0 1 1 1 1 1
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 0 2
3 3 3 9 9 9
3 0 0 9 0 9
3 3 3 9 9 9
0 0
 3 3
2 0 2
0 1 2
2 3 1
3 5
0 3 4 3 3
3 1 0 2 3
3 3 4 0 2
6 7
1 1 1 1 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 1 0 1
1 1 1 1 1 0 1
0 0 2 0 0 1 1
0 0 1 1 1 2 0
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 1 2
3 3 3 9 13 9
3 0 0 18 -1 9
3 3 3 9 9 2
0 0
 3 3
2 0 2
0 1 2
2 3 1
3 5
0 3 7 3 3
3 1 0 2 3
3 3 4 0 2
7 7
2 1 1 1 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 1
1 0 1 0 2 0 1
1 1 1 1 1 0 1
0 0 2 0 0 1 1
0 0 1 1 1 2 0
6 6
1 1 1 1 2 2
1 0 0 2 0 2
1 0 0 2 1 2
3 3 3 9 13 9
3 0 0 18 -1 9
2 6 3 9 9 2
0 0

0
3
1
9
 0
3
1
6
 0
3
1
4
 0
1
1
6
 0
3
1
5
 0
3
1
10
 0
0
1
6
 0
3
3
9
 0
0
1
 0
0
1
4

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

```c
// AOJ 1618: A Garden with Ponds
// 2017.12.25 bal4u@uu

#include <stdio.h>

#define MAX 9

int map[10][10];
int max[10][10][10][10];
int cap[10][10][10][10];

int main()
{
	int d, w, r, c, m, s, ans;
	int d1, w1, r1, c1, r2, c2;

	while (scanf("%d%d", &d, &w) && d > 0) {
		d1 = d-1, w1 = w-1;
		for (r= 0; r < d; r++) for (c = 0; c < w; c++) scanf("%d", &map[r][c]);

		// ?????¢???????¢??????????????????????????????¨?????§?????????????????????9??¨????????????????¨????
		for (r1 = 1; r1 < d1; r1++) for (c1 = 1; c1 < w1; c1++) {
			for (r2 = r1; r2 < d1; r2++) for (c2 = c1; c2 < w1; c2++) {
				m = 0, s = 0;
				for (r = r1; r <= r2; r++) for (c = c1; c <= c2; c++) {
					if (map[r][c] > m) m = map[r][c];
					s += MAX - map[r][c];
				}
				max[r1][c1][r2][c2] = m;
				cap[r1][c1][r2][c2] = s;
			}
		}

		ans = 0;
		// ???????????????????±?????¢????????????????
		for (r1 = 0; r1 < d; r1++) for (c1 = 0; c1 < w; c1++) {
			for (r2 = r1+2; r2 < d; r2++) for (c2 = c1+2; c2 < w; c2++) {
				m = MAX;
				for (r = r1; r <= r2; r++) if (map[r ][c1] < m) m = map[r ][c1];
				for (r = r1; r <= r2; r++) if (map[r ][c2] < m) m = map[r ][c2];
				for (c = c1; c <= c2; c++) if (map[r1][c ] < m) m = map[r1][c ];
				for (c = c1; c <= c2; c++) if (map[r2][c ] < m) m = map[r2][c ];
				if (max[r1+1][c1+1][r2-1][c2-1] >= m) continue;
				s = cap[r1+1][c1+1][r2-1][c2-1] - (MAX-m)*(r2-r1-1)*(c2-c1-1);
				if (s > ans) ans = s;
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 400
map:
	.zero	400
	.globl	max
	.align 32
	.type	max, @object
	.size	max, 40000
max:
	.zero	40000
	.globl	cap
	.align 32
	.type	cap, @object
	.size	cap, 40000
cap:
	.zero	40000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L43:
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L3
.L6:
	movl	$0, -48(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -48(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L5
	addl	$1, -52(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L6
	movl	$1, -32(%rbp)
	jmp	.L7
.L19:
	movl	$1, -28(%rbp)
	jmp	.L8
.L18:
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L9
.L17:
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L10
.L16:
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L11
.L15:
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L12
.L14:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jge	.L13
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L13:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$9, %eax
	subl	%edx, %eax
	addl	%eax, -40(%rbp)
	addl	$1, -48(%rbp)
.L12:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
	addl	$1, -52(%rbp)
.L11:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L15
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	max(%rip), %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cap(%rip), %rdx
	movl	-40(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L16
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L17
	addl	$1, -28(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L18
	addl	$1, -32(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L19
	movl	$0, -36(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L20
.L41:
	movl	$0, -28(%rbp)
	jmp	.L21
.L40:
	movl	-32(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -24(%rbp)
	jmp	.L22
.L39:
	movl	-28(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -20(%rbp)
	jmp	.L23
.L38:
	movl	$9, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L24
.L26:
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L25
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L25:
	addl	$1, -52(%rbp)
.L24:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L26
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L27
.L29:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L28
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L28:
	addl	$1, -52(%rbp)
.L27:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L29
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L30
.L32:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L31
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L31:
	addl	$1, -48(%rbp)
.L30:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L32
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L33
.L35:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L34
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L34:
	addl	$1, -48(%rbp)
.L33:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L35
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movl	-28(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	max(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L46
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movl	-28(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cap(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$9, %eax
	subl	-44(%rbp), %eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	subl	-32(%rbp), %eax
	subl	$1, %eax
	imull	%eax, %ecx
	movl	-20(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	imull	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L37
	movl	-40(%rbp), %eax
	movl	%eax, -36(%rbp)
	jmp	.L37
.L46:
	nop
.L37:
	addl	$1, -20(%rbp)
.L23:
	movl	-56(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L38
	addl	$1, -24(%rbp)
.L22:
	movl	-60(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L39
	addl	$1, -28(%rbp)
.L21:
	movl	-56(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L40
	addl	$1, -32(%rbp)
.L20:
	movl	-60(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L41
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L42
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jg	.L43
.L42:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 400
map:
	.zero	400
	.globl	max
	.align 32
	.type	max, @object
	.size	max, 40000
max:
	.zero	40000
	.globl	cap
	.align 32
	.type	cap, @object
	.size	cap, 40000
cap:
	.zero	40000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L43:
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L3
.L6:
	movl	$0, -48(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -48(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L5
	addl	$1, -52(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L6
	movl	$1, -32(%rbp)
	jmp	.L7
.L19:
	movl	$1, -28(%rbp)
	jmp	.L8
.L18:
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L9
.L17:
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L10
.L16:
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L11
.L15:
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L12
.L14:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jge	.L13
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L13:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$9, %eax
	subl	%edx, %eax
	addl	%eax, -40(%rbp)
	addl	$1, -48(%rbp)
.L12:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
	addl	$1, -52(%rbp)
.L11:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L15
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	max(%rip), %rdx
	movl	-44(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	cap(%rip), %rdx
	movl	-40(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L16
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L17
	addl	$1, -28(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L18
	addl	$1, -32(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L19
	movl	$0, -36(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L20
.L41:
	movl	$0, -28(%rbp)
	jmp	.L21
.L40:
	movl	-32(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -24(%rbp)
	jmp	.L22
.L39:
	movl	-28(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -20(%rbp)
	jmp	.L23
.L38:
	movl	$9, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L24
.L26:
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L25
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L25:
	addl	$1, -52(%rbp)
.L24:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L26
	movl	-32(%rbp), %eax
	movl	%eax, -52(%rbp)
	jmp	.L27
.L29:
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L28
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L28:
	addl	$1, -52(%rbp)
.L27:
	movl	-52(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L29
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L30
.L32:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L31
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L31:
	addl	$1, -48(%rbp)
.L30:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L32
	movl	-28(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L33
.L35:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L34
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -44(%rbp)
.L34:
	addl	$1, -48(%rbp)
.L33:
	movl	-48(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L35
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movl	-28(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	max(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L46
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movl	-28(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdi
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$1000, %rsi, %rcx
	addq	%rax, %rcx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	cap(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$9, %eax
	subl	-44(%rbp), %eax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	subl	-32(%rbp), %eax
	subl	$1, %eax
	imull	%eax, %ecx
	movl	-20(%rbp), %eax
	subl	-28(%rbp), %eax
	subl	$1, %eax
	imull	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L37
	movl	-40(%rbp), %eax
	movl	%eax, -36(%rbp)
	jmp	.L37
.L46:
	nop
.L37:
	addl	$1, -20(%rbp)
.L23:
	movl	-56(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L38
	addl	$1, -24(%rbp)
.L22:
	movl	-60(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L39
	addl	$1, -28(%rbp)
.L21:
	movl	-56(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L40
	addl	$1, -32(%rbp)
.L20:
	movl	-60(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L41
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L42
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jg	.L43
.L42:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
