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

```c
/* 
   AOJ 1160
   How Many Islands?
   2015.4.28
 */

#include<stdio.h>

int width, height, map[50][50], direction[8][2] = { {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}};

void dfs(int x, int y)
{
  int i, j, prov_x = 0, prov_y = 0;

  /* printf("\n"); */

  /* for(i = 0; i < height; i++) */
  /*   { */
  /*     for(j = 0; j < width; j++) */
  /* 	{ */
  /* 	  printf("%d ", map[i][j]); */
  /* 	} */
  /*     printf("\n"); */
  /*   } */


  map[y][x] = 0;
  for(i = 0; i < 8; i++)
    {
      prov_x = x + direction[i][0];
      prov_y = y + direction[i][1];

      if(prov_x >= 0 && prov_x < width && prov_y >= 0 && prov_y < height && map[prov_y][prov_x] != 0)
	{
	  dfs(prov_x, prov_y);
	}
    }
}

int search_island()
{
  int i, j, count = 0;
  for(i = 0; i < height; i++)
    {
      for(j = 0; j < width; j++)
	{
	  if(map[i][j] == 1)
	    {
	      dfs(j, i);
	      count++;
	    }
	}
    }
  return count;
}

int main(void)
{
  int  i, j, island = 0;
  while(1)
    {
      scanf("%d %d", &width, &height);
      if(width == 0 && height == 0)
	{
	  break;
	}

      for(i = 0; i < 50; i++)
	{
	  for(j = 0; j < 50; j++)
	    {
	      map[i][j] = 0;
	    }
	}

      
      for(i = 0; i < height; i++)
	{
	  for(j = 0; j < width; j++)
	    {
	      scanf("%d", &map[i][j]);
	    }
	}

      /* printf("\n"); */
     
      /* for(i = 0; i < height; i++) */
      /* 	{ */
      /* 	  for(j = 0; j < width; j++) */
      /* 	    { */
      /* 	      printf("%d ", map[i][j]); */
      /* 	    } */
      /* 	  printf("\n"); */
      /* 	} */

      island = search_island();
      printf("%d\n", island);
      
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	width
	.bss
	.align 4
	.type	width, @object
	.size	width, 4
width:
	.zero	4
	.globl	height
	.align 4
	.type	height, @object
	.size	height, 4
height:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	direction
	.data
	.align 32
	.type	direction, @object
	.size	direction, 64
direction:
	.long	0
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	0
	.long	1
	.long	1
	.long	0
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	0
	.long	-1
	.long	-1
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%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	$0, -12(%rbp)
	jmp	.L2
.L4:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	direction(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+direction(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L3
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L3
	cmpl	$0, -4(%rbp)
	js	.L3
	movl	height(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L3
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%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	.L3
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
.L3:
	addl	$1, -12(%rbp)
.L2:
	cmpl	$7, -12(%rbp)
	jle	.L4
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.globl	search_island
	.type	search_island, @function
search_island:
.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
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L6
.L10:
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	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
	cmpl	$1, %eax
	jne	.L8
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addl	$1, -4(%rbp)
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	addl	$1, -12(%rbp)
.L6:
	movl	height(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search_island, .-search_island
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -4(%rbp)
.L23:
	leaq	height(%rip), %rax
	movq	%rax, %rdx
	leaq	width(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	width(%rip), %eax
	testl	%eax, %eax
	jne	.L13
	movl	height(%rip), %eax
	testl	%eax, %eax
	je	.L26
.L13:
	movl	$0, -12(%rbp)
	jmp	.L15
.L18:
	movl	$0, -8(%rbp)
	jmp	.L16
.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	$0, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L16:
	cmpl	$49, -8(%rbp)
	jle	.L17
	addl	$1, -12(%rbp)
.L15:
	cmpl	$49, -12(%rbp)
	jle	.L18
	movl	$0, -12(%rbp)
	jmp	.L19
.L22:
	movl	$0, -8(%rbp)
	jmp	.L20
.L21:
	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	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
.L20:
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L21
	addl	$1, -12(%rbp)
.L19:
	movl	height(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L22
	movl	$0, %eax
	call	search_island
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L26:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%esi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rcx
	leaq	direction(%rip), %r8
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rax, %r15
	leaq	(%rax,%rax,4), %rax
	leaq	map(%rip), %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	(%rax,%rax,4), %rax
	leaq	64(%r8), %r14
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	(%rcx,%rax,2), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r8, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movl	$0, (%rdx,%rax,4)
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$8, %rbx
	cmpq	%rbx, %r14
	je	.L42
.L11:
	movl	%ebp, %r12d
	addl	(%rbx), %r12d
	js	.L2
	movl	4(%rbx), %r13d
	movl	width(%rip), %eax
	addl	%r15d, %r13d
	cmpl	%r12d, %eax
	jle	.L2
	testl	%r13d, %r13d
	js	.L2
	movl	height(%rip), %ecx
	cmpl	%r13d, %ecx
	jle	.L2
	movslq	%r13d, %rdi
	movslq	%r12d, %rsi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rsi,%rdi,2), %rsi
	movl	(%rdx,%rsi,4), %edi
	testl	%edi, %edi
	je	.L2
	movl	$0, (%rdx,%rsi,4)
	movl	%r12d, %edi
	addl	(%r8), %edi
	js	.L3
	movl	4+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	%edi, %eax
	jle	.L3
	testl	%esi, %esi
	jns	.L43
.L3:
	movl	%r12d, %edi
	addl	8+direction(%rip), %edi
	js	.L4
	movl	12+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L4
	testl	%esi, %esi
	jns	.L44
.L4:
	movl	%r12d, %edi
	addl	16+direction(%rip), %edi
	js	.L5
	movl	20+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L5
	testl	%esi, %esi
	jns	.L45
.L5:
	movl	%r12d, %edi
	addl	24+direction(%rip), %edi
	js	.L6
	movl	28+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L6
	testl	%esi, %esi
	jns	.L46
.L6:
	movl	%r12d, %edi
	addl	32+direction(%rip), %edi
	js	.L7
	movl	36+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L7
	testl	%esi, %esi
	jns	.L47
.L7:
	movl	%r12d, %edi
	addl	40+direction(%rip), %edi
	js	.L8
	movl	44+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L8
	testl	%esi, %esi
	jns	.L48
.L8:
	movl	%r12d, %edi
	addl	48+direction(%rip), %edi
	js	.L9
	movl	52+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L9
	testl	%esi, %esi
	jns	.L49
.L9:
	addl	56+direction(%rip), %r12d
	js	.L2
	addl	60+direction(%rip), %r13d
	cmpl	width(%rip), %r12d
	jge	.L2
	testl	%r13d, %r13d
	js	.L2
	cmpl	height(%rip), %r13d
	jge	.L2
	movslq	%r13d, %rcx
	movslq	%r12d, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L2
	movl	%r13d, %esi
	movl	%r12d, %edi
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L42:
	addq	$8, %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
.L43:
	.cfi_restore_state
	cmpl	%esi, %ecx
	jle	.L3
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L3
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L3
.L44:
	cmpl	height(%rip), %esi
	jge	.L4
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L4
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L4
.L45:
	cmpl	height(%rip), %esi
	jge	.L5
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L5
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L5
.L46:
	cmpl	height(%rip), %esi
	jge	.L6
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %r11d
	testl	%r11d, %r11d
	je	.L6
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L6
.L47:
	cmpl	height(%rip), %esi
	jge	.L7
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %r10d
	testl	%r10d, %r10d
	je	.L7
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L7
.L48:
	cmpl	height(%rip), %esi
	jge	.L8
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %r9d
	testl	%r9d, %r9d
	je	.L8
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L8
.L49:
	cmpl	height(%rip), %esi
	jge	.L9
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L9
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L9
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.p2align 4
	.globl	search_island
	.type	search_island, @function
search_island:
.LFB24:
	.cfi_startproc
	endbr64
	movl	height(%rip), %eax
	testl	%eax, %eax
	jle	.L71
	movl	width(%rip), %eax
	leaq	map(%rip), %rcx
	xorl	%r11d, %r11d
	leaq	64+direction(%rip), %r9
	movl	%r11d, %r8d
	movq	%rcx, %r10
	movl	%eax, %edi
	testl	%eax, %eax
	jle	.L117
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r10, %r13
	xorl	%ebp, %ebp
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L53:
	addl	$1, %ebp
	addq	$4, %r13
	cmpl	%edi, %ebp
	jge	.L118
.L68:
	cmpl	$1, 0(%r13)
	jne	.L53
	movl	%r11d, %r15d
	movl	$0, 0(%r13)
	movq	%r13, %r11
	leaq	direction(%rip), %rbx
	jmp	.L67
	.p2align 4,,10
	.p2align 3
.L54:
	addq	$8, %rbx
	cmpq	%rbx, %r9
	je	.L119
.L67:
	movl	%ebp, %r12d
	addl	(%rbx), %r12d
	js	.L54
	movl	4(%rbx), %r13d
	addl	%r8d, %r13d
	cmpl	%edi, %r12d
	jge	.L54
	testl	%r13d, %r13d
	js	.L54
	cmpl	height(%rip), %r13d
	jge	.L54
	movslq	%r13d, %rdx
	movslq	%r12d, %rax
	leaq	map(%rip), %rsi
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	(%rsi,%rax,4), %r14d
	testl	%r14d, %r14d
	je	.L54
	movl	$0, (%rsi,%rax,4)
	leaq	direction(%rip), %rax
	movq	%rbx, 24(%rsp)
	movq	%rax, %rbx
	movq	%r10, (%rsp)
	movl	%ebp, 8(%rsp)
	movl	%r8d, 12(%rsp)
	movq	%r11, 16(%rsp)
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L55:
	addq	$8, %rbx
	cmpq	%r9, %rbx
	je	.L120
.L66:
	movl	%r12d, %ebp
	addl	(%rbx), %ebp
	js	.L55
	movl	%r13d, %eax
	addl	4(%rbx), %eax
	js	.L55
	cmpl	%edi, %ebp
	jge	.L55
	cmpl	height(%rip), %eax
	jge	.L55
	movslq	%eax, %rcx
	movslq	%ebp, %rdx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,2), %rdx
	leaq	map(%rip), %rcx
	movl	(%rcx,%rdx,4), %esi
	testl	%esi, %esi
	je	.L55
	movl	%r12d, 32(%rsp)
	leaq	direction(%rip), %r14
	movl	%eax, %r12d
	movq	%rbx, 40(%rsp)
	movl	%ebp, %ebx
	movl	$0, (%rcx,%rdx,4)
	movl	%r13d, 36(%rsp)
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L56:
	addq	$8, %r14
	cmpq	%r14, %r9
	je	.L121
.L65:
	movl	%ebx, %ebp
	addl	(%r14), %ebp
	js	.L56
	movl	4(%r14), %r13d
	addl	%r12d, %r13d
	cmpl	%edi, %ebp
	jge	.L56
	testl	%r13d, %r13d
	js	.L56
	movl	height(%rip), %esi
	cmpl	%esi, %r13d
	jge	.L56
	movslq	%r13d, %r10
	movslq	%ebp, %r8
	leaq	map(%rip), %rax
	leaq	(%r10,%r10,4), %r10
	leaq	(%r10,%r10,4), %r10
	leaq	(%r8,%r10,2), %r8
	movl	(%rax,%r8,4), %edx
	testl	%edx, %edx
	je	.L56
	leaq	direction(%rip), %rcx
	movl	$0, (%rax,%r8,4)
	movl	%ebp, %r8d
	addl	(%rcx), %r8d
	js	.L57
	movl	%r13d, %r10d
	addl	4+direction(%rip), %r10d
	js	.L57
	cmpl	%r8d, %edi
	jg	.L122
.L57:
	movl	%ebp, %r8d
	addl	8+direction(%rip), %r8d
	js	.L58
	movl	12+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	%edi, %r8d
	jge	.L58
	testl	%esi, %esi
	jns	.L123
.L58:
	movl	%ebp, %r8d
	addl	16+direction(%rip), %r8d
	js	.L59
	movl	20+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	%edi, %r8d
	jge	.L59
	testl	%esi, %esi
	jns	.L124
.L59:
	movl	%ebp, %r8d
	addl	24+direction(%rip), %r8d
	js	.L60
	movl	%r13d, %esi
	addl	28+direction(%rip), %esi
	js	.L60
	cmpl	%edi, %r8d
	jl	.L125
.L60:
	movl	%ebp, %r8d
	addl	32+direction(%rip), %r8d
	js	.L61
	movl	%r13d, %esi
	addl	36+direction(%rip), %esi
	js	.L61
	cmpl	%r8d, %edi
	jg	.L126
.L61:
	movl	%ebp, %r8d
	addl	40+direction(%rip), %r8d
	js	.L62
	movl	%r13d, %esi
	addl	44+direction(%rip), %esi
	js	.L62
	cmpl	%r8d, %edi
	jg	.L127
.L62:
	movl	%ebp, %r8d
	addl	48+direction(%rip), %r8d
	js	.L63
	movl	%r13d, %esi
	addl	52+direction(%rip), %esi
	js	.L63
	cmpl	%r8d, %edi
	jg	.L128
.L63:
	addl	56+direction(%rip), %ebp
	js	.L56
	movl	%r13d, %esi
	addl	60+direction(%rip), %esi
	js	.L56
	cmpl	%edi, %ebp
	jge	.L56
	cmpl	height(%rip), %esi
	jge	.L56
	movslq	%esi, %r8
	movslq	%ebp, %rcx
	leaq	map(%rip), %rax
	leaq	(%r8,%r8,4), %r8
	leaq	(%r8,%r8,4), %r8
	leaq	(%rcx,%r8,2), %rcx
	movl	(%rax,%rcx,4), %eax
	testl	%eax, %eax
	je	.L56
	movl	%ebp, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L119:
	movq	%r11, %r13
	addl	$1, %ebp
	movl	%r15d, %r11d
	addl	$1, %r11d
	addq	$4, %r13
	cmpl	%edi, %ebp
	jl	.L68
.L118:
	addl	$1, %r8d
	cmpl	%r8d, height(%rip)
	jle	.L50
	addq	$200, %r10
	testl	%edi, %edi
	jg	.L72
.L50:
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r11d, %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
.L120:
	.cfi_restore_state
	movq	(%rsp), %r10
	movl	8(%rsp), %ebp
	movl	12(%rsp), %r8d
	movq	16(%rsp), %r11
	movq	24(%rsp), %rbx
	jmp	.L54
.L121:
	movl	32(%rsp), %r12d
	movl	36(%rsp), %r13d
	movq	40(%rsp), %rbx
	jmp	.L55
.L71:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%r10d, %r10d
.L113:
	movl	%r10d, %eax
	ret
.L117:
	movl	%r11d, %r10d
	jmp	.L113
.L128:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	cmpl	height(%rip), %esi
	jge	.L63
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %edx
	testl	%edx, %edx
	je	.L63
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L63
.L127:
	cmpl	height(%rip), %esi
	jge	.L62
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %ecx
	testl	%ecx, %ecx
	je	.L62
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L62
.L126:
	cmpl	height(%rip), %esi
	jge	.L61
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %r10d
	testl	%r10d, %r10d
	je	.L61
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L61
.L125:
	cmpl	height(%rip), %esi
	jge	.L60
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %r11d
	testl	%r11d, %r11d
	je	.L60
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L60
.L124:
	cmpl	height(%rip), %esi
	jge	.L59
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %eax
	testl	%eax, %eax
	je	.L59
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L59
.L123:
	cmpl	%esi, height(%rip)
	jle	.L58
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %eax
	testl	%eax, %eax
	je	.L58
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L58
.L122:
	cmpl	%r10d, %esi
	jle	.L57
	movslq	%r10d, %r11
	movslq	%r8d, %rsi
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,2), %rsi
	movl	(%rax,%rsi,4), %eax
	testl	%eax, %eax
	je	.L57
	movl	%r8d, %edi
	movl	%r10d, %esi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L57
	.cfi_endproc
.LFE24:
	.size	search_island, .-search_island
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	$88, %rsp
	.cfi_def_cfa_offset 144
.L163:
	xorl	%eax, %eax
	leaq	height(%rip), %rdx
	leaq	width(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	width(%rip), %r11d
	movl	height(%rip), %ebx
	movl	%r11d, %eax
	movl	%r11d, (%rsp)
	orl	%ebx, %eax
	je	.L180
	xorl	%esi, %esi
	movl	$10000, %edx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	map(%rip), %rdi
	leaq	.LC1(%rip), %r12
	call	memset@PLT
	testl	%ebx, %ebx
	movl	(%rsp), %r11d
	jle	.L132
	testl	%r11d, %r11d
	jle	.L136
.L138:
	leaq	map(%rip), %rax
	xorl	%ebx, %ebx
	leaq	(%rax,%r14,4), %rbp
	.p2align 4,,10
	.p2align 3
.L133:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	width(%rip), %r11d
	addq	$4, %rbp
	cmpl	%ebx, %r11d
	jg	.L133
	movl	height(%rip), %ebx
	addl	$1, %r13d
	cmpl	%r13d, %ebx
	jle	.L218
	addq	$50, %r14
	testl	%r11d, %r11d
	jg	.L138
.L136:
	leaq	map(%rip), %rax
	xorl	%r12d, %r12d
	movl	$0, 8(%rsp)
	leaq	64+direction(%rip), %r15
	movq	%rax, 16(%rsp)
	movl	%r12d, %r14d
	testl	%r11d, %r11d
	jle	.L161
.L166:
	xorl	%r12d, %r12d
	movl	%r14d, %eax
	movq	16(%rsp), %rbx
	movl	%r12d, %r14d
	movl	%eax, %r12d
	jmp	.L159
	.p2align 4,,10
	.p2align 3
.L140:
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r11d, %r14d
	jge	.L219
.L159:
	cmpl	$1, (%rbx)
	jne	.L140
	leaq	direction(%rip), %r13
	movl	%r14d, %eax
	movq	%rbx, (%rsp)
	movl	width(%rip), %r11d
	movl	$0, (%rbx)
	movq	%r13, %r14
	movl	%r12d, %ebx
	movl	%eax, %r13d
	jmp	.L158
	.p2align 4,,10
	.p2align 3
.L141:
	addq	$8, %r14
	cmpq	%r15, %r14
	je	.L220
.L158:
	movl	%r13d, %ecx
	addl	(%r14), %ecx
	js	.L141
	movl	%ebx, %eax
	addl	4(%r14), %eax
	js	.L141
	cmpl	%r11d, %ecx
	jge	.L141
	cmpl	height(%rip), %eax
	jge	.L141
	movslq	%eax, %rdi
	movslq	%ecx, %rsi
	leaq	map(%rip), %rdx
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rsi,%rdi,2), %rsi
	movl	(%rdx,%rsi,4), %r8d
	testl	%r8d, %r8d
	je	.L141
	leaq	direction(%rip), %r12
	movq	%r14, 40(%rsp)
	movl	$0, (%rdx,%rsi,4)
	movq	%r12, %r14
	movl	%ecx, %r12d
	movl	%r13d, 48(%rsp)
	movl	%eax, 12(%rsp)
	movl	%ebx, 52(%rsp)
	jmp	.L157
.L142:
	addq	$8, %r14
	cmpq	%r14, %r15
	je	.L221
.L157:
	movl	%r12d, %r13d
	addl	(%r14), %r13d
	js	.L142
	movl	12(%rsp), %ebx
	addl	4(%r14), %ebx
	cmpl	%r11d, %r13d
	jge	.L142
	testl	%ebx, %ebx
	js	.L142
	cmpl	height(%rip), %ebx
	jge	.L142
	movslq	%ebx, %rsi
	movslq	%r13d, %rcx
	leaq	map(%rip), %rax
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	movl	(%rax,%rcx,4), %edi
	testl	%edi, %edi
	je	.L142
	movl	$0, (%rax,%rcx,4)
	leaq	direction(%rip), %rax
	movq	%r14, 64(%rsp)
	movq	%rax, %r14
	movl	%r12d, 56(%rsp)
	movl	%r13d, 28(%rsp)
	movl	%ebx, 60(%rsp)
	jmp	.L156
.L143:
	addq	$8, %r14
	cmpq	%r14, %r15
	je	.L222
.L156:
	movl	28(%rsp), %eax
	addl	(%r14), %eax
	movl	%eax, 24(%rsp)
	js	.L143
	movl	60(%rsp), %edx
	addl	4(%r14), %edx
	movl	%edx, 32(%rsp)
	cmpl	%r11d, %eax
	jge	.L143
	testl	%edx, %edx
	js	.L143
	cmpl	height(%rip), %edx
	jge	.L143
	movslq	%edx, %rdx
	cltq
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	leaq	map(%rip), %rdx
	movl	(%rdx,%rax,4), %esi
	testl	%esi, %esi
	je	.L143
	movl	$0, (%rdx,%rax,4)
	leaq	direction(%rip), %r13
	movq	%r14, 72(%rsp)
	jmp	.L155
.L144:
	addq	$8, %r13
	cmpq	%r13, %r15
	je	.L223
.L155:
	movl	24(%rsp), %eax
	addl	0(%r13), %eax
	movl	%eax, 36(%rsp)
	js	.L144
	movl	32(%rsp), %r14d
	addl	4(%r13), %r14d
	js	.L144
	cmpl	%r11d, %eax
	jge	.L144
	cmpl	height(%rip), %r14d
	jge	.L144
	movslq	%eax, %rdx
	movslq	%r14d, %rax
	leaq	map(%rip), %rdi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,2), %rcx
	movl	(%rdi,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L144
	imulq	$50, %rax, %rax
	leaq	direction(%rip), %r12
	addq	%rdx, %rax
	movl	$0, (%rdi,%rax,4)
	jmp	.L154
.L145:
	addq	$8, %r12
	cmpq	%r12, %r15
	je	.L144
.L154:
	movl	36(%rsp), %ebx
	addl	(%r12), %ebx
	js	.L145
	movl	4(%r12), %ebp
	addl	%r14d, %ebp
	cmpl	%r11d, %ebx
	jge	.L145
	testl	%ebp, %ebp
	js	.L145
	movl	height(%rip), %ecx
	cmpl	%ecx, %ebp
	jge	.L145
	movslq	%ebp, %rax
	movslq	%ebx, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L145
	movl	$0, (%rdx,%rax,4)
	leaq	direction(%rip), %rax
	movq	%rdx, %r8
	movl	%ebx, %edi
	addl	(%rax), %edi
	js	.L146
	movl	4+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L146
	testl	%esi, %esi
	jns	.L224
.L146:
	movl	%ebx, %edi
	addl	8+direction(%rip), %edi
	js	.L147
	movl	12+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L147
	testl	%esi, %esi
	jns	.L225
.L147:
	movl	%ebx, %edi
	addl	16+direction(%rip), %edi
	js	.L148
	movl	20+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L148
	testl	%esi, %esi
	jns	.L226
.L148:
	movl	%ebx, %edi
	addl	24+direction(%rip), %edi
	js	.L149
	movl	28+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L149
	testl	%esi, %esi
	jns	.L227
.L149:
	movl	%ebx, %edi
	addl	32+direction(%rip), %edi
	js	.L150
	movl	36+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L150
	testl	%esi, %esi
	jns	.L228
.L150:
	movl	%ebx, %edi
	addl	40+direction(%rip), %edi
	js	.L151
	movl	44+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L151
	testl	%esi, %esi
	jns	.L229
.L151:
	movl	%ebx, %edi
	addl	48+direction(%rip), %edi
	js	.L152
	movl	52+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L152
	testl	%esi, %esi
	jns	.L230
.L152:
	movl	%ebx, %edi
	addl	56+direction(%rip), %edi
	js	.L153
	movl	60+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L153
	testl	%esi, %esi
	jns	.L231
.L153:
	movl	width(%rip), %r11d
	jmp	.L145
	.p2align 4,,10
	.p2align 3
.L220:
	movl	%r13d, %r14d
	movl	%ebx, %r12d
	movq	(%rsp), %rbx
	addl	$1, 8(%rsp)
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r11d, %r14d
	jl	.L159
.L219:
	movl	%r12d, %r14d
	addl	$1, %r14d
	cmpl	height(%rip), %r14d
	jge	.L161
	addq	$200, 16(%rsp)
	testl	%r11d, %r11d
	jg	.L166
.L161:
	movl	8(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L163
.L221:
	movq	40(%rsp), %r14
	movl	48(%rsp), %r13d
	movl	52(%rsp), %ebx
	jmp	.L141
.L222:
	movl	56(%rsp), %r12d
	movq	64(%rsp), %r14
	jmp	.L142
.L223:
	movq	72(%rsp), %r14
	jmp	.L143
.L218:
	testl	%ebx, %ebx
	jg	.L136
.L132:
	movl	$0, 8(%rsp)
	jmp	.L161
.L180:
	addq	$88, %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
.L231:
	.cfi_restore_state
	cmpl	height(%rip), %esi
	jge	.L153
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L153
	call	dfs
	jmp	.L153
.L230:
	cmpl	height(%rip), %esi
	jge	.L152
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L152
	call	dfs
	jmp	.L152
.L229:
	cmpl	height(%rip), %esi
	jge	.L151
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L151
	call	dfs
	jmp	.L151
.L228:
	cmpl	%esi, height(%rip)
	jle	.L150
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L150
	call	dfs
	jmp	.L150
.L227:
	cmpl	%esi, height(%rip)
	jle	.L149
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L149
	call	dfs
	jmp	.L149
.L226:
	cmpl	%esi, height(%rip)
	jle	.L148
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L148
	call	dfs
	jmp	.L148
.L225:
	cmpl	%esi, height(%rip)
	jle	.L147
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L147
	call	dfs
	jmp	.L147
.L224:
	cmpl	%esi, %ecx
	jle	.L146
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	cmpl	$0, (%r8,%rax,4)
	je	.L146
	call	dfs
	jmp	.L146
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	direction
	.data
	.align 32
	.type	direction, @object
	.size	direction, 64
direction:
	.long	0
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	0
	.long	1
	.long	1
	.long	0
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	0
	.long	-1
	.long	-1
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	height
	.align 4
	.type	height, @object
	.size	height, 4
height:
	.zero	4
	.globl	width
	.align 4
	.type	width, @object
	.size	width, 4
width:
	.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	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%esi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rcx
	leaq	direction(%rip), %r8
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rax, %r15
	leaq	(%rax,%rax,4), %rax
	leaq	map(%rip), %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	(%rax,%rax,4), %rax
	leaq	64(%r8), %r14
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	(%rcx,%rax,2), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r8, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movl	$0, (%rdx,%rax,4)
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$8, %rbx
	cmpq	%rbx, %r14
	je	.L42
.L11:
	movl	%ebp, %r12d
	addl	(%rbx), %r12d
	js	.L2
	movl	4(%rbx), %r13d
	movl	width(%rip), %eax
	addl	%r15d, %r13d
	cmpl	%r12d, %eax
	jle	.L2
	testl	%r13d, %r13d
	js	.L2
	movl	height(%rip), %ecx
	cmpl	%r13d, %ecx
	jle	.L2
	movslq	%r13d, %rdi
	movslq	%r12d, %rsi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rsi,%rdi,2), %rsi
	movl	(%rdx,%rsi,4), %edi
	testl	%edi, %edi
	je	.L2
	movl	$0, (%rdx,%rsi,4)
	movl	%r12d, %edi
	addl	(%r8), %edi
	js	.L3
	movl	4+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	%edi, %eax
	jle	.L3
	testl	%esi, %esi
	jns	.L43
.L3:
	movl	%r12d, %edi
	addl	8+direction(%rip), %edi
	js	.L4
	movl	12+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L4
	testl	%esi, %esi
	jns	.L44
.L4:
	movl	%r12d, %edi
	addl	16+direction(%rip), %edi
	js	.L5
	movl	20+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L5
	testl	%esi, %esi
	jns	.L45
.L5:
	movl	%r12d, %edi
	addl	24+direction(%rip), %edi
	js	.L6
	movl	28+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L6
	testl	%esi, %esi
	jns	.L46
.L6:
	movl	%r12d, %edi
	addl	32+direction(%rip), %edi
	js	.L7
	movl	36+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L7
	testl	%esi, %esi
	jns	.L47
.L7:
	movl	%r12d, %edi
	addl	40+direction(%rip), %edi
	js	.L8
	movl	44+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L8
	testl	%esi, %esi
	jns	.L48
.L8:
	movl	%r12d, %edi
	addl	48+direction(%rip), %edi
	js	.L9
	movl	52+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	width(%rip), %edi
	jge	.L9
	testl	%esi, %esi
	jns	.L49
.L9:
	addl	56+direction(%rip), %r12d
	js	.L2
	addl	60+direction(%rip), %r13d
	cmpl	width(%rip), %r12d
	jge	.L2
	testl	%r13d, %r13d
	js	.L2
	cmpl	height(%rip), %r13d
	jge	.L2
	movslq	%r13d, %rcx
	movslq	%r12d, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L2
	movl	%r13d, %esi
	movl	%r12d, %edi
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L42:
	addq	$8, %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
.L43:
	.cfi_restore_state
	cmpl	%esi, %ecx
	jle	.L3
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L3
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L3
.L44:
	cmpl	height(%rip), %esi
	jge	.L4
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L4
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L4
.L45:
	cmpl	height(%rip), %esi
	jge	.L5
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L5
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L5
.L46:
	cmpl	height(%rip), %esi
	jge	.L6
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %r11d
	testl	%r11d, %r11d
	je	.L6
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L6
.L47:
	cmpl	height(%rip), %esi
	jge	.L7
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %r10d
	testl	%r10d, %r10d
	je	.L7
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L7
.L48:
	cmpl	height(%rip), %esi
	jge	.L8
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %r9d
	testl	%r9d, %r9d
	je	.L8
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L8
.L49:
	cmpl	height(%rip), %esi
	jge	.L9
	movslq	%esi, %rcx
	movslq	%edi, %rax
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,2), %rax
	movl	(%rdx,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L9
	call	dfs
	leaq	map(%rip), %rdx
	leaq	direction(%rip), %r8
	jmp	.L9
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.p2align 4
	.globl	search_island
	.type	search_island, @function
search_island:
.LFB24:
	.cfi_startproc
	endbr64
	movl	height(%rip), %eax
	testl	%eax, %eax
	jle	.L71
	movl	width(%rip), %eax
	leaq	map(%rip), %rcx
	xorl	%r11d, %r11d
	leaq	64+direction(%rip), %r9
	movl	%r11d, %r8d
	movq	%rcx, %r10
	movl	%eax, %edi
	testl	%eax, %eax
	jle	.L117
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r10, %r13
	xorl	%ebp, %ebp
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L53:
	addl	$1, %ebp
	addq	$4, %r13
	cmpl	%edi, %ebp
	jge	.L118
.L68:
	cmpl	$1, 0(%r13)
	jne	.L53
	movl	%r11d, %r15d
	movl	$0, 0(%r13)
	movq	%r13, %r11
	leaq	direction(%rip), %rbx
	jmp	.L67
	.p2align 4,,10
	.p2align 3
.L54:
	addq	$8, %rbx
	cmpq	%rbx, %r9
	je	.L119
.L67:
	movl	%ebp, %r12d
	addl	(%rbx), %r12d
	js	.L54
	movl	4(%rbx), %r13d
	addl	%r8d, %r13d
	cmpl	%edi, %r12d
	jge	.L54
	testl	%r13d, %r13d
	js	.L54
	cmpl	height(%rip), %r13d
	jge	.L54
	movslq	%r13d, %rdx
	movslq	%r12d, %rax
	leaq	map(%rip), %rsi
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	(%rsi,%rax,4), %r14d
	testl	%r14d, %r14d
	je	.L54
	movl	$0, (%rsi,%rax,4)
	leaq	direction(%rip), %rax
	movq	%rbx, 24(%rsp)
	movq	%rax, %rbx
	movq	%r10, (%rsp)
	movl	%ebp, 8(%rsp)
	movl	%r8d, 12(%rsp)
	movq	%r11, 16(%rsp)
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L55:
	addq	$8, %rbx
	cmpq	%r9, %rbx
	je	.L120
.L66:
	movl	%r12d, %ebp
	addl	(%rbx), %ebp
	js	.L55
	movl	%r13d, %eax
	addl	4(%rbx), %eax
	js	.L55
	cmpl	%edi, %ebp
	jge	.L55
	cmpl	height(%rip), %eax
	jge	.L55
	movslq	%eax, %rcx
	movslq	%ebp, %rdx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,2), %rdx
	leaq	map(%rip), %rcx
	movl	(%rcx,%rdx,4), %esi
	testl	%esi, %esi
	je	.L55
	movl	%r12d, 32(%rsp)
	leaq	direction(%rip), %r14
	movl	%eax, %r12d
	movq	%rbx, 40(%rsp)
	movl	%ebp, %ebx
	movl	$0, (%rcx,%rdx,4)
	movl	%r13d, 36(%rsp)
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L56:
	addq	$8, %r14
	cmpq	%r14, %r9
	je	.L121
.L65:
	movl	%ebx, %ebp
	addl	(%r14), %ebp
	js	.L56
	movl	4(%r14), %r13d
	addl	%r12d, %r13d
	cmpl	%edi, %ebp
	jge	.L56
	testl	%r13d, %r13d
	js	.L56
	movl	height(%rip), %esi
	cmpl	%esi, %r13d
	jge	.L56
	movslq	%r13d, %r10
	movslq	%ebp, %r8
	leaq	map(%rip), %rax
	leaq	(%r10,%r10,4), %r10
	leaq	(%r10,%r10,4), %r10
	leaq	(%r8,%r10,2), %r8
	movl	(%rax,%r8,4), %edx
	testl	%edx, %edx
	je	.L56
	leaq	direction(%rip), %rcx
	movl	$0, (%rax,%r8,4)
	movl	%ebp, %r8d
	addl	(%rcx), %r8d
	js	.L57
	movl	%r13d, %r10d
	addl	4+direction(%rip), %r10d
	js	.L57
	cmpl	%r8d, %edi
	jg	.L122
.L57:
	movl	%ebp, %r8d
	addl	8+direction(%rip), %r8d
	js	.L58
	movl	12+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	%edi, %r8d
	jge	.L58
	testl	%esi, %esi
	jns	.L123
.L58:
	movl	%ebp, %r8d
	addl	16+direction(%rip), %r8d
	js	.L59
	movl	20+direction(%rip), %esi
	addl	%r13d, %esi
	cmpl	%edi, %r8d
	jge	.L59
	testl	%esi, %esi
	jns	.L124
.L59:
	movl	%ebp, %r8d
	addl	24+direction(%rip), %r8d
	js	.L60
	movl	%r13d, %esi
	addl	28+direction(%rip), %esi
	js	.L60
	cmpl	%edi, %r8d
	jl	.L125
.L60:
	movl	%ebp, %r8d
	addl	32+direction(%rip), %r8d
	js	.L61
	movl	%r13d, %esi
	addl	36+direction(%rip), %esi
	js	.L61
	cmpl	%r8d, %edi
	jg	.L126
.L61:
	movl	%ebp, %r8d
	addl	40+direction(%rip), %r8d
	js	.L62
	movl	%r13d, %esi
	addl	44+direction(%rip), %esi
	js	.L62
	cmpl	%r8d, %edi
	jg	.L127
.L62:
	movl	%ebp, %r8d
	addl	48+direction(%rip), %r8d
	js	.L63
	movl	%r13d, %esi
	addl	52+direction(%rip), %esi
	js	.L63
	cmpl	%r8d, %edi
	jg	.L128
.L63:
	addl	56+direction(%rip), %ebp
	js	.L56
	movl	%r13d, %esi
	addl	60+direction(%rip), %esi
	js	.L56
	cmpl	%edi, %ebp
	jge	.L56
	cmpl	height(%rip), %esi
	jge	.L56
	movslq	%esi, %r8
	movslq	%ebp, %rcx
	leaq	map(%rip), %rax
	leaq	(%r8,%r8,4), %r8
	leaq	(%r8,%r8,4), %r8
	leaq	(%rcx,%r8,2), %rcx
	movl	(%rax,%rcx,4), %eax
	testl	%eax, %eax
	je	.L56
	movl	%ebp, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L119:
	movq	%r11, %r13
	addl	$1, %ebp
	movl	%r15d, %r11d
	addl	$1, %r11d
	addq	$4, %r13
	cmpl	%edi, %ebp
	jl	.L68
.L118:
	addl	$1, %r8d
	cmpl	%r8d, height(%rip)
	jle	.L50
	addq	$200, %r10
	testl	%edi, %edi
	jg	.L72
.L50:
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r11d, %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
.L120:
	.cfi_restore_state
	movq	(%rsp), %r10
	movl	8(%rsp), %ebp
	movl	12(%rsp), %r8d
	movq	16(%rsp), %r11
	movq	24(%rsp), %rbx
	jmp	.L54
.L121:
	movl	32(%rsp), %r12d
	movl	36(%rsp), %r13d
	movq	40(%rsp), %rbx
	jmp	.L55
.L71:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%r10d, %r10d
.L113:
	movl	%r10d, %eax
	ret
.L117:
	movl	%r11d, %r10d
	jmp	.L113
.L128:
	.cfi_def_cfa_offset 112
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	cmpl	height(%rip), %esi
	jge	.L63
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %edx
	testl	%edx, %edx
	je	.L63
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L63
.L127:
	cmpl	height(%rip), %esi
	jge	.L62
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %ecx
	testl	%ecx, %ecx
	je	.L62
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L62
.L126:
	cmpl	height(%rip), %esi
	jge	.L61
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %r10d
	testl	%r10d, %r10d
	je	.L61
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L61
.L125:
	cmpl	height(%rip), %esi
	jge	.L60
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %r11d
	testl	%r11d, %r11d
	je	.L60
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L60
.L124:
	cmpl	height(%rip), %esi
	jge	.L59
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %eax
	testl	%eax, %eax
	je	.L59
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L59
.L123:
	cmpl	%esi, height(%rip)
	jle	.L58
	movslq	%esi, %r11
	movslq	%r8d, %r10
	leaq	map(%rip), %rax
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%r10,%r11,2), %r10
	movl	(%rax,%r10,4), %eax
	testl	%eax, %eax
	je	.L58
	movl	%r8d, %edi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L58
.L122:
	cmpl	%r10d, %esi
	jle	.L57
	movslq	%r10d, %r11
	movslq	%r8d, %rsi
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,2), %rsi
	movl	(%rax,%rsi,4), %eax
	testl	%eax, %eax
	je	.L57
	movl	%r8d, %edi
	movl	%r10d, %esi
	call	dfs
	movl	width(%rip), %edi
	leaq	64+direction(%rip), %r9
	jmp	.L57
	.cfi_endproc
.LFE24:
	.size	search_island, .-search_island
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	$88, %rsp
	.cfi_def_cfa_offset 144
.L163:
	xorl	%eax, %eax
	leaq	height(%rip), %rdx
	leaq	width(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	width(%rip), %r11d
	movl	height(%rip), %ebx
	movl	%r11d, %eax
	movl	%r11d, (%rsp)
	orl	%ebx, %eax
	je	.L180
	xorl	%esi, %esi
	movl	$10000, %edx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	map(%rip), %rdi
	leaq	.LC1(%rip), %r12
	call	memset@PLT
	testl	%ebx, %ebx
	movl	(%rsp), %r11d
	jle	.L132
	testl	%r11d, %r11d
	jle	.L136
.L138:
	leaq	map(%rip), %rax
	xorl	%ebx, %ebx
	leaq	(%rax,%r14,4), %rbp
	.p2align 4,,10
	.p2align 3
.L133:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	width(%rip), %r11d
	addq	$4, %rbp
	cmpl	%ebx, %r11d
	jg	.L133
	movl	height(%rip), %ebx
	addl	$1, %r13d
	cmpl	%r13d, %ebx
	jle	.L218
	addq	$50, %r14
	testl	%r11d, %r11d
	jg	.L138
.L136:
	leaq	map(%rip), %rax
	xorl	%r12d, %r12d
	movl	$0, 8(%rsp)
	leaq	64+direction(%rip), %r15
	movq	%rax, 16(%rsp)
	movl	%r12d, %r14d
	testl	%r11d, %r11d
	jle	.L161
.L166:
	xorl	%r12d, %r12d
	movl	%r14d, %eax
	movq	16(%rsp), %rbx
	movl	%r12d, %r14d
	movl	%eax, %r12d
	jmp	.L159
	.p2align 4,,10
	.p2align 3
.L140:
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r11d, %r14d
	jge	.L219
.L159:
	cmpl	$1, (%rbx)
	jne	.L140
	leaq	direction(%rip), %r13
	movl	%r14d, %eax
	movq	%rbx, (%rsp)
	movl	width(%rip), %r11d
	movl	$0, (%rbx)
	movq	%r13, %r14
	movl	%r12d, %ebx
	movl	%eax, %r13d
	jmp	.L158
	.p2align 4,,10
	.p2align 3
.L141:
	addq	$8, %r14
	cmpq	%r15, %r14
	je	.L220
.L158:
	movl	%r13d, %ecx
	addl	(%r14), %ecx
	js	.L141
	movl	%ebx, %eax
	addl	4(%r14), %eax
	js	.L141
	cmpl	%r11d, %ecx
	jge	.L141
	cmpl	height(%rip), %eax
	jge	.L141
	movslq	%eax, %rdi
	movslq	%ecx, %rsi
	leaq	map(%rip), %rdx
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rsi,%rdi,2), %rsi
	movl	(%rdx,%rsi,4), %r8d
	testl	%r8d, %r8d
	je	.L141
	leaq	direction(%rip), %r12
	movq	%r14, 40(%rsp)
	movl	$0, (%rdx,%rsi,4)
	movq	%r12, %r14
	movl	%ecx, %r12d
	movl	%r13d, 48(%rsp)
	movl	%eax, 12(%rsp)
	movl	%ebx, 52(%rsp)
	jmp	.L157
.L142:
	addq	$8, %r14
	cmpq	%r14, %r15
	je	.L221
.L157:
	movl	%r12d, %r13d
	addl	(%r14), %r13d
	js	.L142
	movl	12(%rsp), %ebx
	addl	4(%r14), %ebx
	cmpl	%r11d, %r13d
	jge	.L142
	testl	%ebx, %ebx
	js	.L142
	cmpl	height(%rip), %ebx
	jge	.L142
	movslq	%ebx, %rsi
	movslq	%r13d, %rcx
	leaq	map(%rip), %rax
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rcx,%rsi,2), %rcx
	movl	(%rax,%rcx,4), %edi
	testl	%edi, %edi
	je	.L142
	movl	$0, (%rax,%rcx,4)
	leaq	direction(%rip), %rax
	movq	%r14, 64(%rsp)
	movq	%rax, %r14
	movl	%r12d, 56(%rsp)
	movl	%r13d, 28(%rsp)
	movl	%ebx, 60(%rsp)
	jmp	.L156
.L143:
	addq	$8, %r14
	cmpq	%r14, %r15
	je	.L222
.L156:
	movl	28(%rsp), %eax
	addl	(%r14), %eax
	movl	%eax, 24(%rsp)
	js	.L143
	movl	60(%rsp), %edx
	addl	4(%r14), %edx
	movl	%edx, 32(%rsp)
	cmpl	%r11d, %eax
	jge	.L143
	testl	%edx, %edx
	js	.L143
	cmpl	height(%rip), %edx
	jge	.L143
	movslq	%edx, %rdx
	cltq
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	leaq	map(%rip), %rdx
	movl	(%rdx,%rax,4), %esi
	testl	%esi, %esi
	je	.L143
	movl	$0, (%rdx,%rax,4)
	leaq	direction(%rip), %r13
	movq	%r14, 72(%rsp)
	jmp	.L155
.L144:
	addq	$8, %r13
	cmpq	%r13, %r15
	je	.L223
.L155:
	movl	24(%rsp), %eax
	addl	0(%r13), %eax
	movl	%eax, 36(%rsp)
	js	.L144
	movl	32(%rsp), %r14d
	addl	4(%r13), %r14d
	js	.L144
	cmpl	%r11d, %eax
	jge	.L144
	cmpl	height(%rip), %r14d
	jge	.L144
	movslq	%eax, %rdx
	movslq	%r14d, %rax
	leaq	map(%rip), %rdi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,2), %rcx
	movl	(%rdi,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L144
	imulq	$50, %rax, %rax
	leaq	direction(%rip), %r12
	addq	%rdx, %rax
	movl	$0, (%rdi,%rax,4)
	jmp	.L154
.L145:
	addq	$8, %r12
	cmpq	%r12, %r15
	je	.L144
.L154:
	movl	36(%rsp), %ebx
	addl	(%r12), %ebx
	js	.L145
	movl	4(%r12), %ebp
	addl	%r14d, %ebp
	cmpl	%r11d, %ebx
	jge	.L145
	testl	%ebp, %ebp
	js	.L145
	movl	height(%rip), %ecx
	cmpl	%ecx, %ebp
	jge	.L145
	movslq	%ebp, %rax
	movslq	%ebx, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L145
	movl	$0, (%rdx,%rax,4)
	leaq	direction(%rip), %rax
	movq	%rdx, %r8
	movl	%ebx, %edi
	addl	(%rax), %edi
	js	.L146
	movl	4+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L146
	testl	%esi, %esi
	jns	.L224
.L146:
	movl	%ebx, %edi
	addl	8+direction(%rip), %edi
	js	.L147
	movl	12+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L147
	testl	%esi, %esi
	jns	.L225
.L147:
	movl	%ebx, %edi
	addl	16+direction(%rip), %edi
	js	.L148
	movl	20+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L148
	testl	%esi, %esi
	jns	.L226
.L148:
	movl	%ebx, %edi
	addl	24+direction(%rip), %edi
	js	.L149
	movl	28+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L149
	testl	%esi, %esi
	jns	.L227
.L149:
	movl	%ebx, %edi
	addl	32+direction(%rip), %edi
	js	.L150
	movl	36+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	%edi, width(%rip)
	jle	.L150
	testl	%esi, %esi
	jns	.L228
.L150:
	movl	%ebx, %edi
	addl	40+direction(%rip), %edi
	js	.L151
	movl	44+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L151
	testl	%esi, %esi
	jns	.L229
.L151:
	movl	%ebx, %edi
	addl	48+direction(%rip), %edi
	js	.L152
	movl	52+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L152
	testl	%esi, %esi
	jns	.L230
.L152:
	movl	%ebx, %edi
	addl	56+direction(%rip), %edi
	js	.L153
	movl	60+direction(%rip), %esi
	addl	%ebp, %esi
	cmpl	width(%rip), %edi
	jge	.L153
	testl	%esi, %esi
	jns	.L231
.L153:
	movl	width(%rip), %r11d
	jmp	.L145
	.p2align 4,,10
	.p2align 3
.L220:
	movl	%r13d, %r14d
	movl	%ebx, %r12d
	movq	(%rsp), %rbx
	addl	$1, 8(%rsp)
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r11d, %r14d
	jl	.L159
.L219:
	movl	%r12d, %r14d
	addl	$1, %r14d
	cmpl	height(%rip), %r14d
	jge	.L161
	addq	$200, 16(%rsp)
	testl	%r11d, %r11d
	jg	.L166
.L161:
	movl	8(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L163
.L221:
	movq	40(%rsp), %r14
	movl	48(%rsp), %r13d
	movl	52(%rsp), %ebx
	jmp	.L141
.L222:
	movl	56(%rsp), %r12d
	movq	64(%rsp), %r14
	jmp	.L142
.L223:
	movq	72(%rsp), %r14
	jmp	.L143
.L218:
	testl	%ebx, %ebx
	jg	.L136
.L132:
	movl	$0, 8(%rsp)
	jmp	.L161
.L180:
	addq	$88, %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
.L231:
	.cfi_restore_state
	cmpl	height(%rip), %esi
	jge	.L153
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L153
	call	dfs
	jmp	.L153
.L230:
	cmpl	height(%rip), %esi
	jge	.L152
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L152
	call	dfs
	jmp	.L152
.L229:
	cmpl	height(%rip), %esi
	jge	.L151
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L151
	call	dfs
	jmp	.L151
.L228:
	cmpl	%esi, height(%rip)
	jle	.L150
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L150
	call	dfs
	jmp	.L150
.L227:
	cmpl	%esi, height(%rip)
	jle	.L149
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L149
	call	dfs
	jmp	.L149
.L226:
	cmpl	%esi, height(%rip)
	jle	.L148
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L148
	call	dfs
	jmp	.L148
.L225:
	cmpl	%esi, height(%rip)
	jle	.L147
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	leaq	map(%rip), %rdx
	cmpl	$0, (%rdx,%rax,4)
	je	.L147
	call	dfs
	jmp	.L147
.L224:
	cmpl	%esi, %ecx
	jle	.L146
	movslq	%esi, %rax
	movslq	%edi, %rdx
	imulq	$50, %rax, %rax
	addq	%rdx, %rax
	cmpl	$0, (%r8,%rax,4)
	je	.L146
	call	dfs
	jmp	.L146
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	direction
	.data
	.align 32
	.type	direction, @object
	.size	direction, 64
direction:
	.long	0
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	0
	.long	1
	.long	1
	.long	0
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	0
	.long	-1
	.long	-1
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	height
	.align 4
	.type	height, @object
	.size	height, 4
height:
	.zero	4
	.globl	width
	.align 4
	.type	width, @object
	.size	width, 4
width:
	.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:

/* 
   AOJ 1160
   How Many Islands?
   2015.4.28
 */

#include<stdio.h>

int width, height, map[50][50], direction[8][2] = { {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}};

void dfs(int x, int y)
{
  int i, j, prov_x = 0, prov_y = 0;

  /* printf("\n"); */

  /* for(i = 0; i < height; i++) */
  /*   { */
  /*     for(j = 0; j < width; j++) */
  /* 	{ */
  /* 	  printf("%d ", map[i][j]); */
  /* 	} */
  /*     printf("\n"); */
  /*   } */


  map[y][x] = 0;
  for(i = 0; i < 8; i++)
    {
      prov_x = x + direction[i][0];
      prov_y = y + direction[i][1];

      if(prov_x >= 0 && prov_x < width && prov_y >= 0 && prov_y < height && map[prov_y][prov_x] != 0)
	{
	  dfs(prov_x, prov_y);
	}
    }
}

int search_island()
{
  int i, j, count = 0;
  for(i = 0; i < height; i++)
    {
      for(j = 0; j < width; j++)
	{
	  if(map[i][j] == 1)
	    {
	      dfs(j, i);
	      count++;
	    }
	}
    }
  return count;
}

int main(void)
{
  int  i, j, island = 0;
  while(1)
    {
      scanf("%d %d", &width, &height);
      if(width == 0 && height == 0)
	{
	  break;
	}

      for(i = 0; i < 50; i++)
	{
	  for(j = 0; j < 50; j++)
	    {
	      map[i][j] = 0;
	    }
	}

      
      for(i = 0; i < height; i++)
	{
	  for(j = 0; j < width; j++)
	    {
	      scanf("%d", &map[i][j]);
	    }
	}

      /* printf("\n"); */
     
      /* for(i = 0; i < height; i++) */
      /* 	{ */
      /* 	  for(j = 0; j < width; j++) */
      /* 	    { */
      /* 	      printf("%d ", map[i][j]); */
      /* 	    } */
      /* 	  printf("\n"); */
      /* 	} */

      island = search_island();
      printf("%d\n", island);
      
    }
  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
3
1
4
 0
1
0
1
2
1
8
 0
1
0
1
2
1
7
 0
1
1
2
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
/* 
   AOJ 1160
   How Many Islands?
   2015.4.28
 */

#include<stdio.h>

int width, height, map[50][50], direction[8][2] = { {0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}};

void dfs(int x, int y)
{
  int i, j, prov_x = 0, prov_y = 0;

  /* printf("\n"); */

  /* for(i = 0; i < height; i++) */
  /*   { */
  /*     for(j = 0; j < width; j++) */
  /* 	{ */
  /* 	  printf("%d ", map[i][j]); */
  /* 	} */
  /*     printf("\n"); */
  /*   } */


  map[y][x] = 0;
  for(i = 0; i < 8; i++)
    {
      prov_x = x + direction[i][0];
      prov_y = y + direction[i][1];

      if(prov_x >= 0 && prov_x < width && prov_y >= 0 && prov_y < height && map[prov_y][prov_x] != 0)
	{
	  dfs(prov_x, prov_y);
	}
    }
}

int search_island()
{
  int i, j, count = 0;
  for(i = 0; i < height; i++)
    {
      for(j = 0; j < width; j++)
	{
	  if(map[i][j] == 1)
	    {
	      dfs(j, i);
	      count++;
	    }
	}
    }
  return count;
}

int main(void)
{
  int  i, j, island = 0;
  while(1)
    {
      scanf("%d %d", &width, &height);
      if(width == 0 && height == 0)
	{
	  break;
	}

      for(i = 0; i < 50; i++)
	{
	  for(j = 0; j < 50; j++)
	    {
	      map[i][j] = 0;
	    }
	}

      
      for(i = 0; i < height; i++)
	{
	  for(j = 0; j < width; j++)
	    {
	      scanf("%d", &map[i][j]);
	    }
	}

      /* printf("\n"); */
     
      /* for(i = 0; i < height; i++) */
      /* 	{ */
      /* 	  for(j = 0; j < width; j++) */
      /* 	    { */
      /* 	      printf("%d ", map[i][j]); */
      /* 	    } */
      /* 	  printf("\n"); */
      /* 	} */

      island = search_island();
      printf("%d\n", island);
      
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	width
	.bss
	.align 4
	.type	width, @object
	.size	width, 4
width:
	.zero	4
	.globl	height
	.align 4
	.type	height, @object
	.size	height, 4
height:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	direction
	.data
	.align 32
	.type	direction, @object
	.size	direction, 64
direction:
	.long	0
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	0
	.long	1
	.long	1
	.long	0
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	0
	.long	-1
	.long	-1
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%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	$0, -12(%rbp)
	jmp	.L2
.L4:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	direction(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+direction(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L3
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L3
	cmpl	$0, -4(%rbp)
	js	.L3
	movl	height(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L3
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%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	.L3
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
.L3:
	addl	$1, -12(%rbp)
.L2:
	cmpl	$7, -12(%rbp)
	jle	.L4
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.globl	search_island
	.type	search_island, @function
search_island:
.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
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L6
.L10:
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	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
	cmpl	$1, %eax
	jne	.L8
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addl	$1, -4(%rbp)
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	addl	$1, -12(%rbp)
.L6:
	movl	height(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search_island, .-search_island
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -4(%rbp)
.L23:
	leaq	height(%rip), %rax
	movq	%rax, %rdx
	leaq	width(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	width(%rip), %eax
	testl	%eax, %eax
	jne	.L13
	movl	height(%rip), %eax
	testl	%eax, %eax
	je	.L26
.L13:
	movl	$0, -12(%rbp)
	jmp	.L15
.L18:
	movl	$0, -8(%rbp)
	jmp	.L16
.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	$0, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L16:
	cmpl	$49, -8(%rbp)
	jle	.L17
	addl	$1, -12(%rbp)
.L15:
	cmpl	$49, -12(%rbp)
	jle	.L18
	movl	$0, -12(%rbp)
	jmp	.L19
.L22:
	movl	$0, -8(%rbp)
	jmp	.L20
.L21:
	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	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
.L20:
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L21
	addl	$1, -12(%rbp)
.L19:
	movl	height(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L22
	movl	$0, %eax
	call	search_island
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L26:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	width
	.bss
	.align 4
	.type	width, @object
	.size	width, 4
width:
	.zero	4
	.globl	height
	.align 4
	.type	height, @object
	.size	height, 4
height:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	direction
	.data
	.align 32
	.type	direction, @object
	.size	direction, 64
direction:
	.long	0
	.long	-1
	.long	1
	.long	-1
	.long	1
	.long	0
	.long	1
	.long	1
	.long	0
	.long	1
	.long	-1
	.long	1
	.long	-1
	.long	0
	.long	-1
	.long	-1
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.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	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%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	$0, -12(%rbp)
	jmp	.L2
.L4:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	direction(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+direction(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L3
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L3
	cmpl	$0, -4(%rbp)
	js	.L3
	movl	height(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L3
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%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	.L3
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
.L3:
	addl	$1, -12(%rbp)
.L2:
	cmpl	$7, -12(%rbp)
	jle	.L4
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.globl	search_island
	.type	search_island, @function
search_island:
.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
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L6
.L10:
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	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
	cmpl	$1, %eax
	jne	.L8
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addl	$1, -4(%rbp)
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	addl	$1, -12(%rbp)
.L6:
	movl	height(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search_island, .-search_island
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -4(%rbp)
.L23:
	leaq	height(%rip), %rax
	movq	%rax, %rdx
	leaq	width(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	width(%rip), %eax
	testl	%eax, %eax
	jne	.L13
	movl	height(%rip), %eax
	testl	%eax, %eax
	je	.L26
.L13:
	movl	$0, -12(%rbp)
	jmp	.L15
.L18:
	movl	$0, -8(%rbp)
	jmp	.L16
.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	$0, (%rdx,%rax)
	addl	$1, -8(%rbp)
.L16:
	cmpl	$49, -8(%rbp)
	jle	.L17
	addl	$1, -12(%rbp)
.L15:
	cmpl	$49, -12(%rbp)
	jle	.L18
	movl	$0, -12(%rbp)
	jmp	.L19
.L22:
	movl	$0, -8(%rbp)
	jmp	.L20
.L21:
	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	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
.L20:
	movl	width(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L21
	addl	$1, -12(%rbp)
.L19:
	movl	height(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L22
	movl	$0, %eax
	call	search_island
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L23
.L26:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
