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>

void move(int,int);
int map[51][51];
int w,h;
int main()
{
  int i,j,count;
  
  while(1){
    scanf("%d%d",&w,&h);
    if(w==0&&h==0)break;
    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]==1){
          count++;
          move(i,j);
	}
      }
    }
    printf("%d\n",count);
  }
  return 0;
}

void move(int hh,int ww)
{
  if(ww<0||hh<0||hh>h||ww>w||map[hh][ww]==0)return;
  map[hh][ww]=0;
  move(hh+1,ww);
  move(hh+1,ww+1);
  move(hh+1,ww-1);
  move(hh,ww+1);
  move(hh,ww-1);
  move(hh-1,ww+1);
  move(hh-1,ww);
  move(hh-1,ww-1);
}
  ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
.L13:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L16
.L2:
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %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)
.L5:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L6
	addl	$1, -12(%rbp)
.L4:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L12:
	movl	$0, -8(%rbp)
	jmp	.L9
.L11:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L10
	addl	$1, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
.L10:
	addl	$1, -8(%rbp)
.L9:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L11
	addl	$1, -12(%rbp)
.L8:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L16:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	move
	.type	move, @function
move:
.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	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L21
	cmpl	$0, -4(%rbp)
	js	.L21
	movl	h(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L21
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L21
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L21
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	jmp	.L17
.L21:
	nop
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	move, .-move
	.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	move
	.type	move, @function
move:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	orl	%esi, %eax
	js	.L6
	movslq	%edi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	(%rax,%rax,2), %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rax, %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	salq	$4, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rdx, %rax
	movslq	%esi, %rdx
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addq	%rdx, %rax
	movl	%edi, %ebx
	leaq	map(%rip), %rdx
	leaq	(%rdx,%rax,4), %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%ebx, h(%rip)
	jl	.L1
.L10:
	cmpl	%ebp, w(%rip)
	jl	.L1
	movl	0(%r13), %eax
	testl	%eax, %eax
	je	.L1
	movl	$0, 0(%r13)
	leal	1(%rbx), %r15d
	leal	1(%rbp), %r14d
	movl	%ebp, %esi
	movl	%r15d, %edi
	leal	-1(%rbp), %r12d
	subq	$208, %r13
	call	move
	movl	%r14d, %esi
	movl	%r15d, %edi
	call	move
	movl	%r12d, %esi
	movl	%r15d, %edi
	call	move
	movl	%ebx, %edi
	movl	%r14d, %esi
	call	move
	movl	%ebx, %edi
	movl	%r12d, %esi
	subl	$1, %ebx
	call	move
	movl	%r14d, %esi
	movl	%ebx, %edi
	call	move
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	move
	testl	%r12d, %r12d
	js	.L1
	testl	%ebx, %ebx
	js	.L1
	cmpl	%ebx, h(%rip)
	movl	%r12d, %ebp
	jge	.L10
.L1:
	addq	$8, %rsp
	.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
.L6:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE24:
	.size	move, .-move
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	map(%rip), %r13
	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
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L29:
	leaq	h(%rip), %rdx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	leaq	w(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	movl	h(%rip), %edx
	movl	%eax, %edi
	orl	%edx, %edi
	je	.L33
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	testl	%edx, %edx
	jle	.L14
	testl	%eax, %eax
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	leaq	0(%r13,%r12,4), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L15
	movl	h(%rip), %edx
	addl	$1, %ebp
	cmpl	%ebp, %edx
	jle	.L38
	addq	$51, %r12
	testl	%eax, %eax
	jg	.L20
.L18:
	leaq	map(%rip), %r8
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	testl	%eax, %eax
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L32:
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	cmpl	$1, (%r8,%rcx,4)
	movl	%ecx, %esi
	je	.L39
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jg	.L25
.L24:
	addl	$1, %r10d
	cmpl	h(%rip), %r10d
	jge	.L27
	addq	$204, %r8
	testl	%eax, %eax
	jg	.L32
.L27:
	movl	%r9d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%r10d, %edi
	addq	$1, %rcx
	addl	$1, %r9d
	call	move
	movl	w(%rip), %eax
	cmpl	%ecx, %eax
	jg	.L25
	jmp	.L24
.L38:
	testl	%edx, %edx
	jg	.L18
.L14:
	xorl	%r9d, %r9d
	jmp	.L27
.L33:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	h
	.bss
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.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	move
	.type	move, @function
move:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	orl	%esi, %eax
	js	.L6
	movslq	%edi, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	(%rax,%rax,2), %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rax, %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	salq	$4, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rdx, %rax
	movslq	%esi, %rdx
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addq	%rdx, %rax
	movl	%edi, %ebx
	leaq	map(%rip), %rdx
	leaq	(%rdx,%rax,4), %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%ebx, h(%rip)
	jl	.L1
.L10:
	cmpl	%ebp, w(%rip)
	jl	.L1
	movl	0(%r13), %eax
	testl	%eax, %eax
	je	.L1
	movl	$0, 0(%r13)
	leal	1(%rbx), %r15d
	leal	1(%rbp), %r14d
	movl	%ebp, %esi
	movl	%r15d, %edi
	leal	-1(%rbp), %r12d
	subq	$208, %r13
	call	move
	movl	%r14d, %esi
	movl	%r15d, %edi
	call	move
	movl	%r12d, %esi
	movl	%r15d, %edi
	call	move
	movl	%ebx, %edi
	movl	%r14d, %esi
	call	move
	movl	%ebx, %edi
	movl	%r12d, %esi
	subl	$1, %ebx
	call	move
	movl	%r14d, %esi
	movl	%ebx, %edi
	call	move
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	move
	testl	%r12d, %r12d
	js	.L1
	testl	%ebx, %ebx
	js	.L1
	cmpl	%ebx, h(%rip)
	movl	%r12d, %ebp
	jge	.L10
.L1:
	addq	$8, %rsp
	.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
.L6:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE24:
	.size	move, .-move
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	map(%rip), %r13
	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
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L29:
	leaq	h(%rip), %rdx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	leaq	w(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	movl	h(%rip), %edx
	movl	%eax, %edi
	orl	%edx, %edi
	je	.L33
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	testl	%edx, %edx
	jle	.L14
	testl	%eax, %eax
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L20:
	leaq	0(%r13,%r12,4), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L15
	movl	h(%rip), %edx
	addl	$1, %ebp
	cmpl	%ebp, %edx
	jle	.L38
	addq	$51, %r12
	testl	%eax, %eax
	jg	.L20
.L18:
	leaq	map(%rip), %r8
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	testl	%eax, %eax
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L32:
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L25:
	cmpl	$1, (%r8,%rcx,4)
	movl	%ecx, %esi
	je	.L39
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jg	.L25
.L24:
	addl	$1, %r10d
	cmpl	h(%rip), %r10d
	jge	.L27
	addq	$204, %r8
	testl	%eax, %eax
	jg	.L32
.L27:
	movl	%r9d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%r10d, %edi
	addq	$1, %rcx
	addl	$1, %r9d
	call	move
	movl	w(%rip), %eax
	cmpl	%ecx, %eax
	jg	.L25
	jmp	.L24
.L38:
	testl	%edx, %edx
	jg	.L18
.L14:
	xorl	%r9d, %r9d
	jmp	.L27
.L33:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	h
	.bss
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.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>

void move(int,int);
int map[51][51];
int w,h;
int main()
{
  int i,j,count;
  
  while(1){
    scanf("%d%d",&w,&h);
    if(w==0&&h==0)break;
    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]==1){
          count++;
          move(i,j);
	}
      }
    }
    printf("%d\n",count);
  }
  return 0;
}

void move(int hh,int ww)
{
  if(ww<0||hh<0||hh>h||ww>w||map[hh][ww]==0)return;
  map[hh][ww]=0;
  move(hh+1,ww);
  move(hh+1,ww+1);
  move(hh+1,ww-1);
  move(hh,ww+1);
  move(hh,ww-1);
  move(hh-1,ww+1);
  move(hh-1,ww);
  move(hh-1,ww-1);
}
  
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
#include<stdio.h>

void move(int,int);
int map[51][51];
int w,h;
int main()
{
  int i,j,count;
  
  while(1){
    scanf("%d%d",&w,&h);
    if(w==0&&h==0)break;
    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]==1){
          count++;
          move(i,j);
	}
      }
    }
    printf("%d\n",count);
  }
  return 0;
}

void move(int hh,int ww)
{
  if(ww<0||hh<0||hh>h||ww>w||map[hh][ww]==0)return;
  map[hh][ww]=0;
  move(hh+1,ww);
  move(hh+1,ww+1);
  move(hh+1,ww-1);
  move(hh,ww+1);
  move(hh,ww-1);
  move(hh-1,ww+1);
  move(hh-1,ww);
  move(hh-1,ww-1);
}
  ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
.L13:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L16
.L2:
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %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)
.L5:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L6
	addl	$1, -12(%rbp)
.L4:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L12:
	movl	$0, -8(%rbp)
	jmp	.L9
.L11:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L10
	addl	$1, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
.L10:
	addl	$1, -8(%rbp)
.L9:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L11
	addl	$1, -12(%rbp)
.L8:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L16:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	move
	.type	move, @function
move:
.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	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L21
	cmpl	$0, -4(%rbp)
	js	.L21
	movl	h(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L21
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L21
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L21
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	jmp	.L17
.L21:
	nop
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	move, .-move
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
.L13:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L16
.L2:
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %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)
.L5:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L6
	addl	$1, -12(%rbp)
.L4:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L12:
	movl	$0, -8(%rbp)
	jmp	.L9
.L11:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L10
	addl	$1, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
.L10:
	addl	$1, -8(%rbp)
.L9:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L11
	addl	$1, -12(%rbp)
.L8:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L16:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	move
	.type	move, @function
move:
.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	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L21
	cmpl	$0, -4(%rbp)
	js	.L21
	movl	h(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L21
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L21
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L21
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	move
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	move
	jmp	.L17
.L21:
	nop
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	move, .-move
	.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:
