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

```c
#include <stdio.h>

int w,h;
int map[50][50];

void rec(int x, int y){
	int i,j;
	map[x][y]=0;
	for(i=-1;i<2;i++){
		for(j=-1;j<2;j++){
			if(x+i>=0&&x+i<h&&y+j>=0&&y+j<w){
				if(map[x+i][y+j]){
					rec(x+i, y+j);
				}
			}
		}
	}
	return;
}

int main(void){
	int i,j,count;
	while(scanf("%d %d",&w,&h),w||h){
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				scanf("%d",&map[i][j]);
			}
		}
		count=0;
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				if(map[i][j]){
					count++;
					rec(i,j);
				}
			}
		}
		printf("%d\n",count);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.text
	.globl	rec
	.type	rec, @function
rec:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L6:
	movl	$-1, -4(%rbp)
	jmp	.L3
.L5:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	w(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %ecx
	movl	-8(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rec
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$1, -4(%rbp)
	jle	.L5
	addl	$1, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L6
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	rec, .-rec
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L9
.L22:
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -8(%rbp)
	jmp	.L11
.L12:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	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, -8(%rbp)
.L11:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L14
.L18:
	movl	$0, -8(%rbp)
	jmp	.L15
.L17:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	addl	$1, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rec
.L16:
	addl	$1, -8(%rbp)
.L15:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L17
	addl	$1, -12(%rbp)
.L14:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L19
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L20
.L19:
	movl	$1, %eax
	jmp	.L21
.L20:
	movl	$0, %eax
.L21:
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	rec
	.type	rec, @function
rec:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rcx
	leaq	map(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	leaq	(%rdx,%rdx,4), %rdx
	leal	-1(%rcx), %r9d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	(%rdx,%rdx,4), %rdx
	leal	-2(%rcx), %r11d
	movl	%ecx, %r10d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	(%rcx,%rdx,2), %rdx
	leal	3(%rcx), %r15d
	movl	%r14d, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leal	-1(%r14), %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	$0, (%rsi,%rdx,4)
	leal	2(%r14), %esi
	leal	-2(%r14), %edx
	movl	%esi, 8(%rsp)
.L2:
	movslq	%ebp, %rcx
	movl	%r10d, %ebx
	movl	%r9d, %r12d
	movl	%r11d, %r13d
	leaq	(%rcx,%rcx,4), %r14
	leaq	0(,%r14,4), %r8
.L4:
	testl	%ebp, %ebp
	js	.L6
	movl	h(%rip), %ecx
	cmpl	%ecx, %ebp
	jge	.L6
	testl	%r12d, %r12d
	js	.L6
	movl	w(%rip), %esi
	movl	%esi, 12(%rsp)
	cmpl	%esi, %r12d
	jge	.L6
	movslq	%r12d, %rdi
	movq	%rdi, %rsi
	movq	%rdi, 16(%rsp)
	leaq	(%r14,%r8), %rdi
	leaq	(%rsi,%rdi,2), %rdi
	leaq	map(%rip), %rsi
	cmpl	$0, (%rsi,%rdi,4)
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %ebx
	addl	$1, %r12d
	addl	$1, %r13d
	cmpl	%r15d, %ebx
	jne	.L4
	addl	$1, %ebp
	addl	$1, %eax
	addl	$1, %edx
	cmpl	8(%rsp), %ebp
	jne	.L2
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	movl	$0, (%rsi,%rdi,4)
	testl	%r13d, %r13d
	js	.L54
	testl	%edx, %edx
	js	.L24
	cmpl	%edx, %ecx
	jle	.L25
	movslq	%edx, %rsi
	cmpl	%r13d, 12(%rsp)
	movq	%rsi, 24(%rsp)
	jle	.L28
	leaq	(%rsi,%rsi,4), %rcx
	leaq	map(%rip), %rsi
	leaq	(%rcx,%rcx,4), %rdi
	movslq	%r13d, %rcx
	leaq	(%rcx,%rdi,2), %rcx
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L55
.L28:
	movq	24(%rsp), %rsi
	leaq	(%rsi,%rsi,4), %rcx
	movq	16(%rsp), %rsi
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L56
.L30:
	cmpl	%ebx, 12(%rsp)
	jle	.L25
	movq	24(%rsp), %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %edi
	testl	%edi, %edi
	je	.L25
	movl	%edx, %edi
	movl	%ebx, %esi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	movl	24(%rsp), %eax
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
.L25:
	cmpl	h(%rip), %ebp
	jl	.L57
.L32:
	testl	%eax, %eax
	js	.L6
	cmpl	%eax, h(%rip)
	jle	.L6
	movl	w(%rip), %edi
	cmpl	%edi, %r13d
	jge	.L39
	movslq	%eax, %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rsi
	movslq	%r13d, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L58
.L39:
	cmpl	%edi, %r12d
	jge	.L40
	movslq	%eax, %rcx
	movq	16(%rsp), %rsi
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L59
.L40:
	cmpl	%edi, %ebx
	jge	.L6
.L51:
	movslq	%eax, %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L6
	movl	%eax, %edi
	movl	%ebx, %esi
	movq	%r8, 40(%rsp)
	movl	%r9d, 36(%rsp)
	movl	%r11d, 32(%rsp)
	movl	%r10d, 24(%rsp)
	movl	%edx, 16(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	movl	16(%rsp), %edx
	movl	24(%rsp), %r10d
	movl	32(%rsp), %r11d
	movl	36(%rsp), %r9d
	movq	40(%rsp), %r8
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L54:
	testl	%edx, %edx
	js	.L8
	cmpl	%edx, %ecx
	jg	.L9
.L8:
	movl	12(%rsp), %esi
	cmpl	%esi, %r12d
	jge	.L16
	movq	16(%rsp), %rdi
	leaq	(%r14,%r8), %rcx
	leaq	(%rdi,%rcx,2), %rcx
	leaq	map(%rip), %rdi
	movl	(%rdi,%rcx,4), %edi
	testl	%edi, %edi
	jne	.L60
.L16:
	cmpl	%ebx, %esi
	jle	.L15
	leaq	(%r14,%r8), %rsi
	movslq	%ebx, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L61
.L15:
	testl	%eax, %eax
	js	.L6
	cmpl	%eax, h(%rip)
	jle	.L6
	movl	w(%rip), %ecx
	cmpl	%ecx, %r12d
	jge	.L21
	movslq	%eax, %rsi
	movq	16(%rsp), %rdi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rdi,%rsi,2), %rsi
	leaq	map(%rip), %rdi
	movl	(%rdi,%rsi,4), %esi
	testl	%esi, %esi
	jne	.L62
.L21:
	cmpl	%ecx, %ebx
	jge	.L6
	jmp	.L51
.L9:
	movslq	%edx, %rsi
	leaq	(%rsi,%rsi,4), %rcx
	movq	%rsi, 24(%rsp)
	movq	16(%rsp), %rsi
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L63
.L12:
	cmpl	%ebx, 12(%rsp)
	jle	.L11
	movq	24(%rsp), %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %edi
	testl	%edi, %edi
	jne	.L64
.L11:
	cmpl	h(%rip), %ebp
	jge	.L15
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L57:
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
.L24:
	movl	12(%rsp), %edi
	cmpl	%edi, %r13d
	jge	.L34
	leaq	(%r14,%r8), %rsi
	movslq	%r13d, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L65
.L34:
	cmpl	%edi, %r12d
	jge	.L36
	movq	16(%rsp), %rsi
	leaq	(%r14,%r8), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L66
.L36:
	cmpl	%ebx, %edi
	jle	.L32
	leaq	(%r14,%r8), %rsi
	movslq	%ebx, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %edi
	testl	%edi, %edi
	je	.L32
	movl	%ebx, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jmp	.L32
.L56:
	movl	%edx, %edi
	movl	%r12d, %esi
	movq	%r8, 56(%rsp)
	movl	%r9d, 48(%rsp)
	movl	%r11d, 40(%rsp)
	movl	%r10d, 36(%rsp)
	movl	%eax, 32(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	cmpl	%edx, h(%rip)
	movl	32(%rsp), %eax
	movl	36(%rsp), %r10d
	movl	40(%rsp), %r11d
	movl	48(%rsp), %r9d
	movq	56(%rsp), %r8
	jle	.L25
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	jmp	.L30
.L66:
	movl	%r12d, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	cmpl	h(%rip), %ebp
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jge	.L32
	movl	w(%rip), %edi
	jmp	.L36
.L59:
	movl	%eax, %edi
	movl	%r12d, %esi
	movq	%r8, 40(%rsp)
	movl	%r9d, 36(%rsp)
	movl	%r11d, 32(%rsp)
	movl	%r10d, 24(%rsp)
	movl	%edx, 16(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	cmpl	%eax, h(%rip)
	movl	16(%rsp), %edx
	movl	24(%rsp), %r10d
	movl	32(%rsp), %r11d
	movl	36(%rsp), %r9d
	movq	40(%rsp), %r8
	jle	.L6
	movl	w(%rip), %edi
	jmp	.L40
.L63:
	movl	%edx, %edi
	movl	%r12d, %esi
	movq	%r8, 56(%rsp)
	movl	%r9d, 48(%rsp)
	movl	%r11d, 40(%rsp)
	movl	%r10d, 36(%rsp)
	movl	%eax, 32(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	cmpl	%edx, h(%rip)
	movl	32(%rsp), %eax
	movl	36(%rsp), %r10d
	movl	40(%rsp), %r11d
	movl	48(%rsp), %r9d
	movq	56(%rsp), %r8
	jle	.L11
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	jmp	.L12
.L62:
	movl	%eax, %edi
	movl	%r12d, %esi
	movq	%r8, 40(%rsp)
	movl	%r9d, 36(%rsp)
	movl	%r11d, 32(%rsp)
	movl	%r10d, 24(%rsp)
	movl	%edx, 16(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	cmpl	%eax, h(%rip)
	movl	16(%rsp), %edx
	movl	24(%rsp), %r10d
	movl	32(%rsp), %r11d
	movl	36(%rsp), %r9d
	movq	40(%rsp), %r8
	jle	.L6
	movl	w(%rip), %ecx
	jmp	.L21
.L60:
	movl	%r12d, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	cmpl	h(%rip), %ebp
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jge	.L15
	movl	w(%rip), %esi
	jmp	.L16
.L58:
	movl	%eax, %edi
	movl	%r13d, %esi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	cmpl	%eax, h(%rip)
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jle	.L6
	movl	w(%rip), %edi
	jmp	.L39
.L65:
	movl	%r13d, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	cmpl	h(%rip), %ebp
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jge	.L32
	movl	w(%rip), %edi
	jmp	.L34
.L55:
	movl	%edx, %edi
	movl	%r13d, %esi
	movq	%r8, 56(%rsp)
	movl	%r9d, 48(%rsp)
	movl	%r11d, 40(%rsp)
	movl	%r10d, 36(%rsp)
	movl	%eax, 32(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	cmpl	%edx, h(%rip)
	movl	32(%rsp), %eax
	movl	36(%rsp), %r10d
	movl	40(%rsp), %r11d
	movl	48(%rsp), %r9d
	movq	56(%rsp), %r8
	jle	.L25
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	cmpl	%edi, %r12d
	jge	.L30
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L64:
	movl	%edx, %edi
	movl	%ebx, %esi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	movl	24(%rsp), %eax
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jmp	.L11
.L61:
	movl	%ebx, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jmp	.L15
	.cfi_endproc
.LFE23:
	.size	rec, .-rec
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$328, %rsp
	.cfi_def_cfa_offset 384
.L68:
	leaq	h(%rip), %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	leaq	w(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	w(%rip), %edi
	movl	h(%rip), %eax
	movl	%edi, %edx
	orl	%eax, %edx
	je	.L127
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	.L76
	testl	%edi, %edi
	jle	.L72
	.p2align 4,,10
	.p2align 3
.L74:
	leaq	map(%rip), %rax
	xorl	%ebx, %ebx
	leaq	(%rax,%r13,4), %rbp
	.p2align 4,,10
	.p2align 3
.L69:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	w(%rip), %edi
	addq	$4, %rbp
	cmpl	%ebx, %edi
	jg	.L69
	movl	h(%rip), %eax
	addl	$1, %r12d
	cmpl	%r12d, %eax
	jle	.L172
	addq	$50, %r13
	testl	%edi, %edi
	jg	.L74
.L72:
	leaq	map(%rip), %rax
	movl	$2, %r11d
	movq	$-300, 16(%rsp)
	movq	%rax, 40(%rsp)
	movl	%r11d, %r10d
	movl	$0, 28(%rsp)
	testl	%edi, %edi
	jle	.L107
	.p2align 4,,10
	.p2align 3
.L114:
	movq	40(%rsp), %r11
	movl	$2, %r9d
	movl	%r10d, %eax
	movq	%r11, %r10
	movl	%r9d, %r11d
	movl	%eax, %r9d
	jmp	.L105
	.p2align 4,,10
	.p2align 3
.L77:
	leal	-1(%r11), %eax
	addq	$4, %r10
	leal	1(%r11), %edx
	cmpl	%eax, %edi
	jle	.L173
.L113:
	movl	%edx, %r11d
.L105:
	movl	(%r10), %r12d
	testl	%r12d, %r12d
	je	.L77
	addl	$1, 28(%rsp)
	movq	16(%rsp), %rcx
	leal	-3(%r11), %r8d
	leal	-3(%r9), %r15d
	movl	$0, (%r10)
	movq	%r10, 8(%rsp)
	movq	%rcx, %r10
	movl	%r11d, %ecx
	movl	%r15d, %r11d
	movl	%r8d, %r15d
	movl	%r9d, %r8d
.L78:
	movslq	%r11d, %rax
	movq	%r10, %rbx
	movl	%r15d, %r9d
	movl	%r11d, %r10d
	leaq	(%rax,%rax,4), %r13
	movl	%r8d, %eax
	movq	%rbx, %r11
	movl	%ecx, %r8d
	leaq	0(,%r13,4), %r14
	movl	%eax, %ecx
	movq	%r14, %r12
	movq	%r13, %r14
.L104:
	cmpl	$-1, %r10d
	je	.L79
	cmpl	h(%rip), %r10d
	jge	.L79
	cmpl	$-1, %r9d
	je	.L79
	cmpl	%edi, %r9d
	jge	.L79
	leaq	(%r14,%r12), %rdx
	movslq	%r9d, %rax
	leaq	(%rax,%rdx,2), %rax
	leaq	map(%rip), %rdx
	movl	(%rdx,%rax,4), %ebp
	testl	%ebp, %ebp
	jne	.L174
	.p2align 4,,10
	.p2align 3
.L79:
	addl	$1, %r9d
	cmpl	%r8d, %r9d
	jne	.L104
	movq	%r11, %rsi
	movl	%r10d, %r11d
	movl	%ecx, %eax
	movl	%r8d, %ecx
	movq	%rsi, %r10
	addl	$1, %r11d
	movl	%eax, %r8d
	addq	$50, %r10
	cmpl	%eax, %r11d
	jne	.L78
	movl	%ecx, %r11d
	movq	8(%rsp), %r10
	movl	%eax, %r9d
	leal	-1(%r11), %eax
	leal	1(%r11), %edx
	addq	$4, %r10
	cmpl	%eax, %edi
	jg	.L113
.L173:
	leal	-1(%r9), %eax
	cmpl	%eax, h(%rip)
	movl	%r9d, %r10d
	jle	.L107
	addq	$200, 40(%rsp)
	addl	$1, %r10d
	addq	$50, 16(%rsp)
	testl	%edi, %edi
	jg	.L114
.L107:
	movl	28(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L174:
	movl	$0, (%rdx,%rax,4)
	leal	2(%r10), %eax
	leal	-1(%r10), %r13d
	movl	%eax, 36(%rsp)
	leal	-1(%r9), %eax
	leal	2(%r9), %edx
	movl	%eax, 32(%rsp)
	movl	%r9d, 48(%rsp)
	movq	%r12, 72(%rsp)
	movl	%r10d, 52(%rsp)
	movq	%r11, %r10
	movq	%r11, 56(%rsp)
	movl	%r13d, %r11d
	movl	%edx, %r13d
	movl	%r15d, 80(%rsp)
	movl	%ecx, %r15d
	movq	%r14, 64(%rsp)
	movl	%r8d, %r14d
.L80:
	movslq	%r11d, %rax
	movl	32(%rsp), %r9d
	leaq	(%rax,%rax,4), %r8
	movl	%r11d, %eax
	leaq	0(,%r8,4), %rcx
	movl	%r9d, %r11d
	movl	%eax, %r9d
	movq	%rcx, %r12
	movq	%r10, %rcx
	movl	%r14d, %r10d
	movq	%r8, %r14
	movl	%r15d, %r8d
	movl	%r13d, %r15d
.L103:
	cmpl	$-1, %r9d
	je	.L81
	cmpl	h(%rip), %r9d
	jge	.L81
	cmpl	$-1, %r11d
	je	.L81
	cmpl	%edi, %r11d
	jge	.L81
	movslq	%r11d, %rax
	leaq	(%r14,%r12), %rdx
	leaq	map(%rip), %rsi
	leaq	(%rax,%rdx,2), %rax
	movl	(%rsi,%rax,4), %ebx
	testl	%ebx, %ebx
	jne	.L175
	.p2align 4,,10
	.p2align 3
.L81:
	addl	$1, %r11d
	cmpl	%r15d, %r11d
	jne	.L103
	movl	%r9d, %r11d
	movl	%r10d, %r14d
	movq	%rcx, %r10
	movl	%r15d, %r13d
	addl	$1, %r11d
	movl	%r8d, %r15d
	addq	$50, %r10
	cmpl	36(%rsp), %r11d
	jne	.L80
	movl	%r14d, %r8d
	movl	%r15d, %ecx
	movl	48(%rsp), %r9d
	movl	52(%rsp), %r10d
	movq	56(%rsp), %r11
	movl	80(%rsp), %r15d
	movq	64(%rsp), %r14
	movq	72(%rsp), %r12
	jmp	.L79
.L175:
	movl	$0, (%rsi,%rax,4)
	leal	2(%r9), %eax
	leal	2(%r11), %r13d
	movl	%eax, 88(%rsp)
	leal	-1(%r11), %eax
	leal	-1(%r9), %edx
	movl	%eax, 84(%rsp)
	movl	%r9d, 104(%rsp)
	movl	%r10d, 108(%rsp)
	movq	%r14, 120(%rsp)
	movq	%r12, 128(%rsp)
	movl	%r11d, 92(%rsp)
	movq	%rcx, %r11
	movq	%rcx, 96(%rsp)
	movl	%r13d, %ecx
	movl	%r8d, 112(%rsp)
	movl	%edi, %r8d
	movl	%r15d, 116(%rsp)
	movl	%edx, %r15d
.L82:
	movslq	%r15d, %rax
	movl	84(%rsp), %r14d
	movl	%ecx, %r12d
	leaq	(%rax,%rax,4), %r10
	leaq	0(,%r10,4), %r9
	movl	%r14d, %r13d
	movq	%r11, %r14
	movl	%r8d, %r11d
	movq	%r9, %r8
.L102:
	cmpl	$-1, %r15d
	je	.L83
	cmpl	h(%rip), %r15d
	jge	.L83
	cmpl	$-1, %r13d
	je	.L83
	cmpl	%r11d, %r13d
	jge	.L83
	leaq	(%r10,%r8), %rdx
	movslq	%r13d, %rax
	leaq	(%rax,%rdx,2), %rax
	leaq	map(%rip), %rdx
	movl	(%rdx,%rax,4), %r9d
	testl	%r9d, %r9d
	jne	.L176
	.p2align 4,,10
	.p2align 3
.L83:
	addl	$1, %r13d
	cmpl	%r12d, %r13d
	jne	.L102
	movl	%r11d, %r8d
	movq	%r14, %r11
	movl	%r12d, %ecx
	addl	$1, %r15d
	addq	$50, %r11
	cmpl	88(%rsp), %r15d
	jne	.L82
	movl	%r8d, %edi
	movl	92(%rsp), %r11d
	movl	104(%rsp), %r9d
	movq	96(%rsp), %rcx
	movl	108(%rsp), %r10d
	movl	112(%rsp), %r8d
	movl	116(%rsp), %r15d
	movq	120(%rsp), %r14
	movq	128(%rsp), %r12
	jmp	.L81
.L176:
	movl	$0, (%rdx,%rax,4)
	leal	2(%r15), %eax
	leal	-1(%r15), %ecx
	movl	%eax, 144(%rsp)
	leal	-1(%r13), %eax
	leal	2(%r13), %r9d
	movq	%r14, 136(%rsp)
	movl	%eax, 148(%rsp)
	movq	%r14, 264(%rsp)
	movl	%r13d, 272(%rsp)
	movq	%r10, 280(%rsp)
	movq	%r8, 288(%rsp)
	movl	%r15d, 260(%rsp)
	movl	%ecx, %r15d
	movl	%r12d, 276(%rsp)
	movl	%r9d, %r12d
.L84:
	movslq	%r15d, %rax
	movl	148(%rsp), %r14d
	leaq	(%rax,%rax,4), %r13
	leaq	0(,%r13,4), %rax
	movq	%r13, %rbp
	movq	%rax, 152(%rsp)
	movl	%r11d, %eax
.L101:
	cmpl	$-1, %r15d
	je	.L85
	cmpl	h(%rip), %r15d
	jge	.L85
	cmpl	$-1, %r14d
	je	.L85
	cmpl	%eax, %r14d
	jge	.L85
	movq	152(%rsp), %rsi
	movslq	%r14d, %rdx
	leaq	0(%rbp,%rsi), %rcx
	leaq	map(%rip), %rsi
	leaq	(%rdx,%rcx,2), %rdx
	movl	(%rsi,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L177
	.p2align 4,,10
	.p2align 3
.L85:
	addl	$1, %r14d
	cmpl	%r12d, %r14d
	jne	.L101
	addq	$50, 136(%rsp)
	movl	%eax, %r11d
	addl	$1, %r15d
	cmpl	144(%rsp), %r15d
	jne	.L84
	movl	260(%rsp), %r15d
	movq	264(%rsp), %r14
	movl	272(%rsp), %r13d
	movl	276(%rsp), %r12d
	movq	280(%rsp), %r10
	movq	288(%rsp), %r8
	jmp	.L83
.L177:
	movl	$0, (%rsi,%rdx,4)
	movq	136(%rsp), %rdx
	leal	-1(%r15), %r13d
	movl	%r14d, 296(%rsp)
	movq	%rdx, 160(%rsp)
	leal	2(%r14), %edx
	movl	%edx, 176(%rsp)
	leal	2(%r15), %edx
	movl	%r15d, 300(%rsp)
	movl	%r12d, 312(%rsp)
	movq	%rbp, 304(%rsp)
	movl	%edx, 188(%rsp)
	leal	-1(%r14), %edx
	movl	%edx, 184(%rsp)
	movl	%eax, %edx
.L86:
	movslq	%r13d, %rax
	movl	184(%rsp), %ebp
	movq	%rax, 232(%rsp)
	leaq	(%rax,%rax,4), %rax
	movq	%rax, 240(%rsp)
	salq	$2, %rax
	movl	%ebp, %r12d
	movq	%rax, 248(%rsp)
.L100:
	cmpl	$-1, %r13d
	je	.L87
	cmpl	h(%rip), %r13d
	jge	.L87
	cmpl	$-1, %r12d
	je	.L87
	cmpl	%edx, %r12d
	jge	.L87
	movq	240(%rsp), %rcx
	movslq	%r12d, %rsi
	addq	248(%rsp), %rcx
	leaq	map(%rip), %rax
	leaq	(%rsi,%rcx,2), %rcx
	movl	(%rax,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L178
.L87:
	addl	$1, %r12d
	cmpl	%r12d, 176(%rsp)
	jne	.L100
	addq	$50, 160(%rsp)
	addl	$1, %r13d
	cmpl	%r13d, 188(%rsp)
	jne	.L86
	movl	296(%rsp), %r14d
	movl	300(%rsp), %r15d
	movl	%edx, %eax
	movl	312(%rsp), %r12d
	movq	304(%rsp), %rbp
	jmp	.L85
.L172:
	testl	%eax, %eax
	jg	.L72
.L76:
	movl	$0, 28(%rsp)
	jmp	.L107
.L127:
	addq	$328, %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
.L178:
	.cfi_restore_state
	imulq	$50, 232(%rsp), %rcx
	movl	%r12d, 180(%rsp)
	leal	-1(%r13), %ebp
	movl	%r13d, 316(%rsp)
	addq	%rsi, %rcx
	movl	$0, (%rax,%rcx,4)
	movq	160(%rsp), %rax
	movq	%rax, 168(%rsp)
	leal	2(%r12), %eax
	movl	%eax, 204(%rsp)
	leal	2(%r13), %eax
	movl	%ebp, %r13d
	movl	%eax, 200(%rsp)
	leal	-1(%r12), %eax
	movl	%eax, 196(%rsp)
	leal	-2(%r12), %eax
	movl	%eax, 192(%rsp)
.L88:
	movslq	%r13d, %r14
	movl	196(%rsp), %r15d
	movl	192(%rsp), %ebp
	imulq	$50, %r14, %rax
	movl	180(%rsp), %r12d
	movq	%rax, 224(%rsp)
	leal	2(%r13), %eax
	movl	%eax, 256(%rsp)
.L90:
	cmpl	$-1, %r13d
	je	.L92
	cmpl	h(%rip), %r13d
	jge	.L92
	cmpl	$-1, %r15d
	je	.L92
	cmpl	w(%rip), %r15d
	jge	.L92
	movq	224(%rsp), %rax
	movslq	%r15d, %rsi
	leaq	(%rax,%rsi), %rdi
	leaq	map(%rip), %rax
	cmpl	$0, (%rax,%rdi,4)
	jne	.L179
.L92:
	addl	$1, %r15d
	addl	$1, %r12d
	addl	$1, %ebp
	cmpl	%r15d, 204(%rsp)
	jne	.L90
	addq	$50, 168(%rsp)
	addl	$1, %r13d
	cmpl	%r13d, 200(%rsp)
	jne	.L88
	movl	316(%rsp), %r13d
	movl	180(%rsp), %r12d
	jmp	.L87
.L179:
	movq	168(%rsp), %rcx
	movl	$0, (%rax,%rdi,4)
	leal	-1(%r13), %ebx
	leaq	(%rcx,%rsi), %rdi
	leaq	(%rax,%rdi,4), %r14
	movslq	%r12d, %rax
	subq	%rsi, %rax
	movq	%rax, 208(%rsp)
	movslq	%ebp, %rax
	subq	%rsi, %rax
	movq	%rax, 216(%rsp)
.L99:
	cmpl	$-1, %ebx
	je	.L94
	cmpl	h(%rip), %ebx
	jge	.L94
	testl	%ebp, %ebp
	js	.L96
	cmpl	%edx, %ebp
	jge	.L96
	movq	216(%rsp), %rax
	cmpl	$0, -200(%r14,%rax,4)
	je	.L96
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	rec
	cmpl	h(%rip), %ebx
	jl	.L96
.L171:
	movl	w(%rip), %edx
.L94:
	addl	$1, %ebx
	addq	$200, %r14
	cmpl	%ebx, 256(%rsp)
	jne	.L99
	jmp	.L92
.L96:
	cmpl	w(%rip), %r15d
	jl	.L180
.L97:
	movl	w(%rip), %edx
.L112:
	cmpl	%edx, %r12d
	jge	.L94
	movq	208(%rsp), %rax
	cmpl	$0, -200(%r14,%rax,4)
	je	.L94
	movl	%r12d, %esi
	movl	%ebx, %edi
	call	rec
	jmp	.L171
.L180:
	cmpl	$0, -200(%r14)
	je	.L97
	movl	%r15d, %esi
	movl	%ebx, %edi
	call	rec
	cmpl	h(%rip), %ebx
	movl	w(%rip), %edx
	jl	.L112
	jmp	.L94
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.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	rec
	.type	rec, @function
rec:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rcx
	leaq	map(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	leaq	(%rdx,%rdx,4), %rdx
	leal	-1(%rcx), %r9d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	(%rdx,%rdx,4), %rdx
	leal	-2(%rcx), %r11d
	movl	%ecx, %r10d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	(%rcx,%rdx,2), %rdx
	leal	3(%rcx), %r15d
	movl	%r14d, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leal	-1(%r14), %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	$0, (%rsi,%rdx,4)
	leal	2(%r14), %esi
	leal	-2(%r14), %edx
	movl	%esi, 8(%rsp)
.L2:
	movslq	%ebp, %rcx
	movl	%r10d, %ebx
	movl	%r9d, %r12d
	movl	%r11d, %r13d
	leaq	(%rcx,%rcx,4), %r14
	leaq	0(,%r14,4), %r8
.L4:
	testl	%ebp, %ebp
	js	.L6
	movl	h(%rip), %ecx
	cmpl	%ecx, %ebp
	jge	.L6
	testl	%r12d, %r12d
	js	.L6
	movl	w(%rip), %esi
	movl	%esi, 12(%rsp)
	cmpl	%esi, %r12d
	jge	.L6
	movslq	%r12d, %rdi
	movq	%rdi, %rsi
	movq	%rdi, 16(%rsp)
	leaq	(%r14,%r8), %rdi
	leaq	(%rsi,%rdi,2), %rdi
	leaq	map(%rip), %rsi
	cmpl	$0, (%rsi,%rdi,4)
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %ebx
	addl	$1, %r12d
	addl	$1, %r13d
	cmpl	%r15d, %ebx
	jne	.L4
	addl	$1, %ebp
	addl	$1, %eax
	addl	$1, %edx
	cmpl	8(%rsp), %ebp
	jne	.L2
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	movl	$0, (%rsi,%rdi,4)
	testl	%r13d, %r13d
	js	.L54
	testl	%edx, %edx
	js	.L24
	cmpl	%edx, %ecx
	jle	.L25
	movslq	%edx, %rsi
	cmpl	%r13d, 12(%rsp)
	movq	%rsi, 24(%rsp)
	jle	.L28
	leaq	(%rsi,%rsi,4), %rcx
	leaq	map(%rip), %rsi
	leaq	(%rcx,%rcx,4), %rdi
	movslq	%r13d, %rcx
	leaq	(%rcx,%rdi,2), %rcx
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L55
.L28:
	movq	24(%rsp), %rsi
	leaq	(%rsi,%rsi,4), %rcx
	movq	16(%rsp), %rsi
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L56
.L30:
	cmpl	%ebx, 12(%rsp)
	jle	.L25
	movq	24(%rsp), %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %edi
	testl	%edi, %edi
	je	.L25
	movl	%edx, %edi
	movl	%ebx, %esi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	movl	24(%rsp), %eax
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
.L25:
	cmpl	h(%rip), %ebp
	jl	.L57
.L32:
	testl	%eax, %eax
	js	.L6
	cmpl	%eax, h(%rip)
	jle	.L6
	movl	w(%rip), %edi
	cmpl	%edi, %r13d
	jge	.L39
	movslq	%eax, %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rsi
	movslq	%r13d, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L58
.L39:
	cmpl	%edi, %r12d
	jge	.L40
	movslq	%eax, %rcx
	movq	16(%rsp), %rsi
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L59
.L40:
	cmpl	%edi, %ebx
	jge	.L6
.L51:
	movslq	%eax, %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L6
	movl	%eax, %edi
	movl	%ebx, %esi
	movq	%r8, 40(%rsp)
	movl	%r9d, 36(%rsp)
	movl	%r11d, 32(%rsp)
	movl	%r10d, 24(%rsp)
	movl	%edx, 16(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	movl	16(%rsp), %edx
	movl	24(%rsp), %r10d
	movl	32(%rsp), %r11d
	movl	36(%rsp), %r9d
	movq	40(%rsp), %r8
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L54:
	testl	%edx, %edx
	js	.L8
	cmpl	%edx, %ecx
	jg	.L9
.L8:
	movl	12(%rsp), %esi
	cmpl	%esi, %r12d
	jge	.L16
	movq	16(%rsp), %rdi
	leaq	(%r14,%r8), %rcx
	leaq	(%rdi,%rcx,2), %rcx
	leaq	map(%rip), %rdi
	movl	(%rdi,%rcx,4), %edi
	testl	%edi, %edi
	jne	.L60
.L16:
	cmpl	%ebx, %esi
	jle	.L15
	leaq	(%r14,%r8), %rsi
	movslq	%ebx, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L61
.L15:
	testl	%eax, %eax
	js	.L6
	cmpl	%eax, h(%rip)
	jle	.L6
	movl	w(%rip), %ecx
	cmpl	%ecx, %r12d
	jge	.L21
	movslq	%eax, %rsi
	movq	16(%rsp), %rdi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rdi,%rsi,2), %rsi
	leaq	map(%rip), %rdi
	movl	(%rdi,%rsi,4), %esi
	testl	%esi, %esi
	jne	.L62
.L21:
	cmpl	%ecx, %ebx
	jge	.L6
	jmp	.L51
.L9:
	movslq	%edx, %rsi
	leaq	(%rsi,%rsi,4), %rcx
	movq	%rsi, 24(%rsp)
	movq	16(%rsp), %rsi
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L63
.L12:
	cmpl	%ebx, 12(%rsp)
	jle	.L11
	movq	24(%rsp), %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %edi
	testl	%edi, %edi
	jne	.L64
.L11:
	cmpl	h(%rip), %ebp
	jge	.L15
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L57:
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
.L24:
	movl	12(%rsp), %edi
	cmpl	%edi, %r13d
	jge	.L34
	leaq	(%r14,%r8), %rsi
	movslq	%r13d, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L65
.L34:
	cmpl	%edi, %r12d
	jge	.L36
	movq	16(%rsp), %rsi
	leaq	(%r14,%r8), %rcx
	leaq	(%rsi,%rcx,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	testl	%esi, %esi
	jne	.L66
.L36:
	cmpl	%ebx, %edi
	jle	.L32
	leaq	(%r14,%r8), %rsi
	movslq	%ebx, %rcx
	leaq	(%rcx,%rsi,2), %rcx
	leaq	map(%rip), %rsi
	movl	(%rsi,%rcx,4), %edi
	testl	%edi, %edi
	je	.L32
	movl	%ebx, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jmp	.L32
.L56:
	movl	%edx, %edi
	movl	%r12d, %esi
	movq	%r8, 56(%rsp)
	movl	%r9d, 48(%rsp)
	movl	%r11d, 40(%rsp)
	movl	%r10d, 36(%rsp)
	movl	%eax, 32(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	cmpl	%edx, h(%rip)
	movl	32(%rsp), %eax
	movl	36(%rsp), %r10d
	movl	40(%rsp), %r11d
	movl	48(%rsp), %r9d
	movq	56(%rsp), %r8
	jle	.L25
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	jmp	.L30
.L66:
	movl	%r12d, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	cmpl	h(%rip), %ebp
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jge	.L32
	movl	w(%rip), %edi
	jmp	.L36
.L59:
	movl	%eax, %edi
	movl	%r12d, %esi
	movq	%r8, 40(%rsp)
	movl	%r9d, 36(%rsp)
	movl	%r11d, 32(%rsp)
	movl	%r10d, 24(%rsp)
	movl	%edx, 16(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	cmpl	%eax, h(%rip)
	movl	16(%rsp), %edx
	movl	24(%rsp), %r10d
	movl	32(%rsp), %r11d
	movl	36(%rsp), %r9d
	movq	40(%rsp), %r8
	jle	.L6
	movl	w(%rip), %edi
	jmp	.L40
.L63:
	movl	%edx, %edi
	movl	%r12d, %esi
	movq	%r8, 56(%rsp)
	movl	%r9d, 48(%rsp)
	movl	%r11d, 40(%rsp)
	movl	%r10d, 36(%rsp)
	movl	%eax, 32(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	cmpl	%edx, h(%rip)
	movl	32(%rsp), %eax
	movl	36(%rsp), %r10d
	movl	40(%rsp), %r11d
	movl	48(%rsp), %r9d
	movq	56(%rsp), %r8
	jle	.L11
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	jmp	.L12
.L62:
	movl	%eax, %edi
	movl	%r12d, %esi
	movq	%r8, 40(%rsp)
	movl	%r9d, 36(%rsp)
	movl	%r11d, 32(%rsp)
	movl	%r10d, 24(%rsp)
	movl	%edx, 16(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	cmpl	%eax, h(%rip)
	movl	16(%rsp), %edx
	movl	24(%rsp), %r10d
	movl	32(%rsp), %r11d
	movl	36(%rsp), %r9d
	movq	40(%rsp), %r8
	jle	.L6
	movl	w(%rip), %ecx
	jmp	.L21
.L60:
	movl	%r12d, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	cmpl	h(%rip), %ebp
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jge	.L15
	movl	w(%rip), %esi
	jmp	.L16
.L58:
	movl	%eax, %edi
	movl	%r13d, %esi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	cmpl	%eax, h(%rip)
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jle	.L6
	movl	w(%rip), %edi
	jmp	.L39
.L65:
	movl	%r13d, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	cmpl	h(%rip), %ebp
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jge	.L32
	movl	w(%rip), %edi
	jmp	.L34
.L55:
	movl	%edx, %edi
	movl	%r13d, %esi
	movq	%r8, 56(%rsp)
	movl	%r9d, 48(%rsp)
	movl	%r11d, 40(%rsp)
	movl	%r10d, 36(%rsp)
	movl	%eax, 32(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	cmpl	%edx, h(%rip)
	movl	32(%rsp), %eax
	movl	36(%rsp), %r10d
	movl	40(%rsp), %r11d
	movl	48(%rsp), %r9d
	movq	56(%rsp), %r8
	jle	.L25
	movl	w(%rip), %edi
	movl	%edi, 12(%rsp)
	cmpl	%edi, %r12d
	jge	.L30
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L64:
	movl	%edx, %edi
	movl	%ebx, %esi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edx, 12(%rsp)
	call	rec
	movl	12(%rsp), %edx
	movl	24(%rsp), %eax
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jmp	.L11
.L61:
	movl	%ebx, %esi
	movl	%ebp, %edi
	movq	%r8, 48(%rsp)
	movl	%r9d, 40(%rsp)
	movl	%r11d, 36(%rsp)
	movl	%r10d, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%eax, 12(%rsp)
	call	rec
	movl	12(%rsp), %eax
	movl	24(%rsp), %edx
	movl	32(%rsp), %r10d
	movl	36(%rsp), %r11d
	movl	40(%rsp), %r9d
	movq	48(%rsp), %r8
	jmp	.L15
	.cfi_endproc
.LFE23:
	.size	rec, .-rec
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$328, %rsp
	.cfi_def_cfa_offset 384
.L68:
	leaq	h(%rip), %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	leaq	w(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	w(%rip), %edi
	movl	h(%rip), %eax
	movl	%edi, %edx
	orl	%eax, %edx
	je	.L127
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	testl	%eax, %eax
	jle	.L76
	testl	%edi, %edi
	jle	.L72
	.p2align 4,,10
	.p2align 3
.L74:
	leaq	map(%rip), %rax
	xorl	%ebx, %ebx
	leaq	(%rax,%r13,4), %rbp
	.p2align 4,,10
	.p2align 3
.L69:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	w(%rip), %edi
	addq	$4, %rbp
	cmpl	%ebx, %edi
	jg	.L69
	movl	h(%rip), %eax
	addl	$1, %r12d
	cmpl	%r12d, %eax
	jle	.L172
	addq	$50, %r13
	testl	%edi, %edi
	jg	.L74
.L72:
	leaq	map(%rip), %rax
	movl	$2, %r11d
	movq	$-300, 16(%rsp)
	movq	%rax, 40(%rsp)
	movl	%r11d, %r10d
	movl	$0, 28(%rsp)
	testl	%edi, %edi
	jle	.L107
	.p2align 4,,10
	.p2align 3
.L114:
	movq	40(%rsp), %r11
	movl	$2, %r9d
	movl	%r10d, %eax
	movq	%r11, %r10
	movl	%r9d, %r11d
	movl	%eax, %r9d
	jmp	.L105
	.p2align 4,,10
	.p2align 3
.L77:
	leal	-1(%r11), %eax
	addq	$4, %r10
	leal	1(%r11), %edx
	cmpl	%eax, %edi
	jle	.L173
.L113:
	movl	%edx, %r11d
.L105:
	movl	(%r10), %r12d
	testl	%r12d, %r12d
	je	.L77
	addl	$1, 28(%rsp)
	movq	16(%rsp), %rcx
	leal	-3(%r11), %r8d
	leal	-3(%r9), %r15d
	movl	$0, (%r10)
	movq	%r10, 8(%rsp)
	movq	%rcx, %r10
	movl	%r11d, %ecx
	movl	%r15d, %r11d
	movl	%r8d, %r15d
	movl	%r9d, %r8d
.L78:
	movslq	%r11d, %rax
	movq	%r10, %rbx
	movl	%r15d, %r9d
	movl	%r11d, %r10d
	leaq	(%rax,%rax,4), %r13
	movl	%r8d, %eax
	movq	%rbx, %r11
	movl	%ecx, %r8d
	leaq	0(,%r13,4), %r14
	movl	%eax, %ecx
	movq	%r14, %r12
	movq	%r13, %r14
.L104:
	cmpl	$-1, %r10d
	je	.L79
	cmpl	h(%rip), %r10d
	jge	.L79
	cmpl	$-1, %r9d
	je	.L79
	cmpl	%edi, %r9d
	jge	.L79
	leaq	(%r14,%r12), %rdx
	movslq	%r9d, %rax
	leaq	(%rax,%rdx,2), %rax
	leaq	map(%rip), %rdx
	movl	(%rdx,%rax,4), %ebp
	testl	%ebp, %ebp
	jne	.L174
	.p2align 4,,10
	.p2align 3
.L79:
	addl	$1, %r9d
	cmpl	%r8d, %r9d
	jne	.L104
	movq	%r11, %rsi
	movl	%r10d, %r11d
	movl	%ecx, %eax
	movl	%r8d, %ecx
	movq	%rsi, %r10
	addl	$1, %r11d
	movl	%eax, %r8d
	addq	$50, %r10
	cmpl	%eax, %r11d
	jne	.L78
	movl	%ecx, %r11d
	movq	8(%rsp), %r10
	movl	%eax, %r9d
	leal	-1(%r11), %eax
	leal	1(%r11), %edx
	addq	$4, %r10
	cmpl	%eax, %edi
	jg	.L113
.L173:
	leal	-1(%r9), %eax
	cmpl	%eax, h(%rip)
	movl	%r9d, %r10d
	jle	.L107
	addq	$200, 40(%rsp)
	addl	$1, %r10d
	addq	$50, 16(%rsp)
	testl	%edi, %edi
	jg	.L114
.L107:
	movl	28(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L174:
	movl	$0, (%rdx,%rax,4)
	leal	2(%r10), %eax
	leal	-1(%r10), %r13d
	movl	%eax, 36(%rsp)
	leal	-1(%r9), %eax
	leal	2(%r9), %edx
	movl	%eax, 32(%rsp)
	movl	%r9d, 48(%rsp)
	movq	%r12, 72(%rsp)
	movl	%r10d, 52(%rsp)
	movq	%r11, %r10
	movq	%r11, 56(%rsp)
	movl	%r13d, %r11d
	movl	%edx, %r13d
	movl	%r15d, 80(%rsp)
	movl	%ecx, %r15d
	movq	%r14, 64(%rsp)
	movl	%r8d, %r14d
.L80:
	movslq	%r11d, %rax
	movl	32(%rsp), %r9d
	leaq	(%rax,%rax,4), %r8
	movl	%r11d, %eax
	leaq	0(,%r8,4), %rcx
	movl	%r9d, %r11d
	movl	%eax, %r9d
	movq	%rcx, %r12
	movq	%r10, %rcx
	movl	%r14d, %r10d
	movq	%r8, %r14
	movl	%r15d, %r8d
	movl	%r13d, %r15d
.L103:
	cmpl	$-1, %r9d
	je	.L81
	cmpl	h(%rip), %r9d
	jge	.L81
	cmpl	$-1, %r11d
	je	.L81
	cmpl	%edi, %r11d
	jge	.L81
	movslq	%r11d, %rax
	leaq	(%r14,%r12), %rdx
	leaq	map(%rip), %rsi
	leaq	(%rax,%rdx,2), %rax
	movl	(%rsi,%rax,4), %ebx
	testl	%ebx, %ebx
	jne	.L175
	.p2align 4,,10
	.p2align 3
.L81:
	addl	$1, %r11d
	cmpl	%r15d, %r11d
	jne	.L103
	movl	%r9d, %r11d
	movl	%r10d, %r14d
	movq	%rcx, %r10
	movl	%r15d, %r13d
	addl	$1, %r11d
	movl	%r8d, %r15d
	addq	$50, %r10
	cmpl	36(%rsp), %r11d
	jne	.L80
	movl	%r14d, %r8d
	movl	%r15d, %ecx
	movl	48(%rsp), %r9d
	movl	52(%rsp), %r10d
	movq	56(%rsp), %r11
	movl	80(%rsp), %r15d
	movq	64(%rsp), %r14
	movq	72(%rsp), %r12
	jmp	.L79
.L175:
	movl	$0, (%rsi,%rax,4)
	leal	2(%r9), %eax
	leal	2(%r11), %r13d
	movl	%eax, 88(%rsp)
	leal	-1(%r11), %eax
	leal	-1(%r9), %edx
	movl	%eax, 84(%rsp)
	movl	%r9d, 104(%rsp)
	movl	%r10d, 108(%rsp)
	movq	%r14, 120(%rsp)
	movq	%r12, 128(%rsp)
	movl	%r11d, 92(%rsp)
	movq	%rcx, %r11
	movq	%rcx, 96(%rsp)
	movl	%r13d, %ecx
	movl	%r8d, 112(%rsp)
	movl	%edi, %r8d
	movl	%r15d, 116(%rsp)
	movl	%edx, %r15d
.L82:
	movslq	%r15d, %rax
	movl	84(%rsp), %r14d
	movl	%ecx, %r12d
	leaq	(%rax,%rax,4), %r10
	leaq	0(,%r10,4), %r9
	movl	%r14d, %r13d
	movq	%r11, %r14
	movl	%r8d, %r11d
	movq	%r9, %r8
.L102:
	cmpl	$-1, %r15d
	je	.L83
	cmpl	h(%rip), %r15d
	jge	.L83
	cmpl	$-1, %r13d
	je	.L83
	cmpl	%r11d, %r13d
	jge	.L83
	leaq	(%r10,%r8), %rdx
	movslq	%r13d, %rax
	leaq	(%rax,%rdx,2), %rax
	leaq	map(%rip), %rdx
	movl	(%rdx,%rax,4), %r9d
	testl	%r9d, %r9d
	jne	.L176
	.p2align 4,,10
	.p2align 3
.L83:
	addl	$1, %r13d
	cmpl	%r12d, %r13d
	jne	.L102
	movl	%r11d, %r8d
	movq	%r14, %r11
	movl	%r12d, %ecx
	addl	$1, %r15d
	addq	$50, %r11
	cmpl	88(%rsp), %r15d
	jne	.L82
	movl	%r8d, %edi
	movl	92(%rsp), %r11d
	movl	104(%rsp), %r9d
	movq	96(%rsp), %rcx
	movl	108(%rsp), %r10d
	movl	112(%rsp), %r8d
	movl	116(%rsp), %r15d
	movq	120(%rsp), %r14
	movq	128(%rsp), %r12
	jmp	.L81
.L176:
	movl	$0, (%rdx,%rax,4)
	leal	2(%r15), %eax
	leal	-1(%r15), %ecx
	movl	%eax, 144(%rsp)
	leal	-1(%r13), %eax
	leal	2(%r13), %r9d
	movq	%r14, 136(%rsp)
	movl	%eax, 148(%rsp)
	movq	%r14, 264(%rsp)
	movl	%r13d, 272(%rsp)
	movq	%r10, 280(%rsp)
	movq	%r8, 288(%rsp)
	movl	%r15d, 260(%rsp)
	movl	%ecx, %r15d
	movl	%r12d, 276(%rsp)
	movl	%r9d, %r12d
.L84:
	movslq	%r15d, %rax
	movl	148(%rsp), %r14d
	leaq	(%rax,%rax,4), %r13
	leaq	0(,%r13,4), %rax
	movq	%r13, %rbp
	movq	%rax, 152(%rsp)
	movl	%r11d, %eax
.L101:
	cmpl	$-1, %r15d
	je	.L85
	cmpl	h(%rip), %r15d
	jge	.L85
	cmpl	$-1, %r14d
	je	.L85
	cmpl	%eax, %r14d
	jge	.L85
	movq	152(%rsp), %rsi
	movslq	%r14d, %rdx
	leaq	0(%rbp,%rsi), %rcx
	leaq	map(%rip), %rsi
	leaq	(%rdx,%rcx,2), %rdx
	movl	(%rsi,%rdx,4), %edi
	testl	%edi, %edi
	jne	.L177
	.p2align 4,,10
	.p2align 3
.L85:
	addl	$1, %r14d
	cmpl	%r12d, %r14d
	jne	.L101
	addq	$50, 136(%rsp)
	movl	%eax, %r11d
	addl	$1, %r15d
	cmpl	144(%rsp), %r15d
	jne	.L84
	movl	260(%rsp), %r15d
	movq	264(%rsp), %r14
	movl	272(%rsp), %r13d
	movl	276(%rsp), %r12d
	movq	280(%rsp), %r10
	movq	288(%rsp), %r8
	jmp	.L83
.L177:
	movl	$0, (%rsi,%rdx,4)
	movq	136(%rsp), %rdx
	leal	-1(%r15), %r13d
	movl	%r14d, 296(%rsp)
	movq	%rdx, 160(%rsp)
	leal	2(%r14), %edx
	movl	%edx, 176(%rsp)
	leal	2(%r15), %edx
	movl	%r15d, 300(%rsp)
	movl	%r12d, 312(%rsp)
	movq	%rbp, 304(%rsp)
	movl	%edx, 188(%rsp)
	leal	-1(%r14), %edx
	movl	%edx, 184(%rsp)
	movl	%eax, %edx
.L86:
	movslq	%r13d, %rax
	movl	184(%rsp), %ebp
	movq	%rax, 232(%rsp)
	leaq	(%rax,%rax,4), %rax
	movq	%rax, 240(%rsp)
	salq	$2, %rax
	movl	%ebp, %r12d
	movq	%rax, 248(%rsp)
.L100:
	cmpl	$-1, %r13d
	je	.L87
	cmpl	h(%rip), %r13d
	jge	.L87
	cmpl	$-1, %r12d
	je	.L87
	cmpl	%edx, %r12d
	jge	.L87
	movq	240(%rsp), %rcx
	movslq	%r12d, %rsi
	addq	248(%rsp), %rcx
	leaq	map(%rip), %rax
	leaq	(%rsi,%rcx,2), %rcx
	movl	(%rax,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L178
.L87:
	addl	$1, %r12d
	cmpl	%r12d, 176(%rsp)
	jne	.L100
	addq	$50, 160(%rsp)
	addl	$1, %r13d
	cmpl	%r13d, 188(%rsp)
	jne	.L86
	movl	296(%rsp), %r14d
	movl	300(%rsp), %r15d
	movl	%edx, %eax
	movl	312(%rsp), %r12d
	movq	304(%rsp), %rbp
	jmp	.L85
.L172:
	testl	%eax, %eax
	jg	.L72
.L76:
	movl	$0, 28(%rsp)
	jmp	.L107
.L127:
	addq	$328, %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
.L178:
	.cfi_restore_state
	imulq	$50, 232(%rsp), %rcx
	movl	%r12d, 180(%rsp)
	leal	-1(%r13), %ebp
	movl	%r13d, 316(%rsp)
	addq	%rsi, %rcx
	movl	$0, (%rax,%rcx,4)
	movq	160(%rsp), %rax
	movq	%rax, 168(%rsp)
	leal	2(%r12), %eax
	movl	%eax, 204(%rsp)
	leal	2(%r13), %eax
	movl	%ebp, %r13d
	movl	%eax, 200(%rsp)
	leal	-1(%r12), %eax
	movl	%eax, 196(%rsp)
	leal	-2(%r12), %eax
	movl	%eax, 192(%rsp)
.L88:
	movslq	%r13d, %r14
	movl	196(%rsp), %r15d
	movl	192(%rsp), %ebp
	imulq	$50, %r14, %rax
	movl	180(%rsp), %r12d
	movq	%rax, 224(%rsp)
	leal	2(%r13), %eax
	movl	%eax, 256(%rsp)
.L90:
	cmpl	$-1, %r13d
	je	.L92
	cmpl	h(%rip), %r13d
	jge	.L92
	cmpl	$-1, %r15d
	je	.L92
	cmpl	w(%rip), %r15d
	jge	.L92
	movq	224(%rsp), %rax
	movslq	%r15d, %rsi
	leaq	(%rax,%rsi), %rdi
	leaq	map(%rip), %rax
	cmpl	$0, (%rax,%rdi,4)
	jne	.L179
.L92:
	addl	$1, %r15d
	addl	$1, %r12d
	addl	$1, %ebp
	cmpl	%r15d, 204(%rsp)
	jne	.L90
	addq	$50, 168(%rsp)
	addl	$1, %r13d
	cmpl	%r13d, 200(%rsp)
	jne	.L88
	movl	316(%rsp), %r13d
	movl	180(%rsp), %r12d
	jmp	.L87
.L179:
	movq	168(%rsp), %rcx
	movl	$0, (%rax,%rdi,4)
	leal	-1(%r13), %ebx
	leaq	(%rcx,%rsi), %rdi
	leaq	(%rax,%rdi,4), %r14
	movslq	%r12d, %rax
	subq	%rsi, %rax
	movq	%rax, 208(%rsp)
	movslq	%ebp, %rax
	subq	%rsi, %rax
	movq	%rax, 216(%rsp)
.L99:
	cmpl	$-1, %ebx
	je	.L94
	cmpl	h(%rip), %ebx
	jge	.L94
	testl	%ebp, %ebp
	js	.L96
	cmpl	%edx, %ebp
	jge	.L96
	movq	216(%rsp), %rax
	cmpl	$0, -200(%r14,%rax,4)
	je	.L96
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	rec
	cmpl	h(%rip), %ebx
	jl	.L96
.L171:
	movl	w(%rip), %edx
.L94:
	addl	$1, %ebx
	addq	$200, %r14
	cmpl	%ebx, 256(%rsp)
	jne	.L99
	jmp	.L92
.L96:
	cmpl	w(%rip), %r15d
	jl	.L180
.L97:
	movl	w(%rip), %edx
.L112:
	cmpl	%edx, %r12d
	jge	.L94
	movq	208(%rsp), %rax
	cmpl	$0, -200(%r14,%rax,4)
	je	.L94
	movl	%r12d, %esi
	movl	%ebx, %edi
	call	rec
	jmp	.L171
.L180:
	cmpl	$0, -200(%r14)
	je	.L97
	movl	%r15d, %esi
	movl	%ebx, %edi
	call	rec
	cmpl	h(%rip), %ebx
	movl	w(%rip), %edx
	jl	.L112
	jmp	.L94
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.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 <stdio.h>

int w,h;
int map[50][50];

void rec(int x, int y){
	int i,j;
	map[x][y]=0;
	for(i=-1;i<2;i++){
		for(j=-1;j<2;j++){
			if(x+i>=0&&x+i<h&&y+j>=0&&y+j<w){
				if(map[x+i][y+j]){
					rec(x+i, y+j);
				}
			}
		}
	}
	return;
}

int main(void){
	int i,j,count;
	while(scanf("%d %d",&w,&h),w||h){
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				scanf("%d",&map[i][j]);
			}
		}
		count=0;
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				if(map[i][j]){
					count++;
					rec(i,j);
				}
			}
		}
		printf("%d\n",count);
	}
	return 0;
}
1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
1 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 1
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
2 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 1
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 0
0 0
 1 1
0
2 2
0 1
2 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 0 1 0 0
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 0 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 1
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
0 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 1
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
0 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 1 1
0 0
 1 1
0
2 2
0 1
2 0
3 2
0 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 1 1 0 0
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 0 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
2 0 1 0 0
1 0 1 0 0
1 0 1 0 2
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
1 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 1
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0

0
1
1
3
1
8
 0
1
1
3
1
7
 0
1
1
3
1
5
 0
1
1
2
1
8
 0
1
1
3
1
6
 0
1
1
4
1
4
 0
1
0
1
2
2
8
 0
1
0
1
2
2
7
 0
1
1
3
1
4
 0
1
1
2
1
7

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

```c
#include <stdio.h>

int w,h;
int map[50][50];

void rec(int x, int y){
	int i,j;
	map[x][y]=0;
	for(i=-1;i<2;i++){
		for(j=-1;j<2;j++){
			if(x+i>=0&&x+i<h&&y+j>=0&&y+j<w){
				if(map[x+i][y+j]){
					rec(x+i, y+j);
				}
			}
		}
	}
	return;
}

int main(void){
	int i,j,count;
	while(scanf("%d %d",&w,&h),w||h){
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				scanf("%d",&map[i][j]);
			}
		}
		count=0;
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				if(map[i][j]){
					count++;
					rec(i,j);
				}
			}
		}
		printf("%d\n",count);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.text
	.globl	rec
	.type	rec, @function
rec:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L6:
	movl	$-1, -4(%rbp)
	jmp	.L3
.L5:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	w(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %ecx
	movl	-8(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rec
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$1, -4(%rbp)
	jle	.L5
	addl	$1, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L6
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	rec, .-rec
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L9
.L22:
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -8(%rbp)
	jmp	.L11
.L12:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	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, -8(%rbp)
.L11:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L14
.L18:
	movl	$0, -8(%rbp)
	jmp	.L15
.L17:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	addl	$1, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rec
.L16:
	addl	$1, -8(%rbp)
.L15:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L17
	addl	$1, -12(%rbp)
.L14:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L19
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L20
.L19:
	movl	$1, %eax
	jmp	.L21
.L20:
	movl	$0, %eax
.L21:
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.text
	.globl	rec
	.type	rec, @function
rec:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L6:
	movl	$-1, -4(%rbp)
	jmp	.L3
.L5:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	w(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %ecx
	movl	-8(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rec
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$1, -4(%rbp)
	jle	.L5
	addl	$1, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L6
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	rec, .-rec
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L9
.L22:
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -8(%rbp)
	jmp	.L11
.L12:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	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, -8(%rbp)
.L11:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L14
.L18:
	movl	$0, -8(%rbp)
	jmp	.L15
.L17:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	addl	$1, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rec
.L16:
	addl	$1, -8(%rbp)
.L15:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L17
	addl	$1, -12(%rbp)
.L14:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L19
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L20
.L19:
	movl	$1, %eax
	jmp	.L21
.L20:
	movl	$0, %eax
.L21:
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
