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>
#include <string.h>

char island[101][101];
int h, w;

void dfs(int i, int j, char c){
	int di, dj;
	
	island[i][j] = 'x';
		
	for (di = -1; di <= 1; di += 2){
		if (0 <= i + di && i + di < h && island[i + di][j] == c){
			dfs(i + di, j, c);
		}
	}
	for (dj = -1; dj <= 1; dj += 2){
		if (0 <= j + dj && j + dj < w && island[i][j + dj] == c){
			dfs(i, j + dj, c);
		}
	}
}

int main(void)
{
	int i, j;
	int num;
	
	while (1){
		scanf("%d%d", &h, &w);
		if (!(h + w)){
			break;
		}
		memset(island, 'x', sizeof(island));
		for (i = 0; i < h; i++){
			scanf("%s", island[i]);
			getchar();
		}
		
		num = 0;
		for (i = 0; i < h; i++){
			for (j = 0; j < w; j++){
				if (island[i][j] != 'x'){
					dfs(i, j, island[i][j]);
					num++;
				}
			}
		}
		
		printf("%d\n", num);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	island
	.bss
	.align 32
	.type	island, @object
	.size	island, 10201
island:
	.zero	10201
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.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	%edx, %eax
	movb	%al, -28(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L4:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L3
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L3
	movsbl	-28(%rbp), %edx
	movl	-20(%rbp), %ecx
	movl	-8(%rbp), %eax
	addl	%eax, %ecx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L3:
	addl	$2, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L4
	movl	$-1, -4(%rbp)
	jmp	.L5
.L7:
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L6
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	w(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L6
	movsbl	-28(%rbp), %edx
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
.L6:
	addl	$2, -4(%rbp)
.L5:
	cmpl	$1, -4(%rbp)
	jle	.L7
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
.L18:
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	h(%rip), %edx
	movl	w(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L21
	movl	$10201, %edx
	movl	$120, %esi
	leaq	island(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -12(%rbp)
	jmp	.L11
.L12:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	island(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	addl	$1, -12(%rbp)
.L11:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L12
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L13
.L17:
	movl	$0, -8(%rbp)
	jmp	.L14
.L16:
	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), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	je	.L15
	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), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movl	-8(%rbp), %ecx
	movl	-12(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	addl	$1, -4(%rbp)
.L15:
	addl	$1, -8(%rbp)
.L14:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L16
	addl	$1, -12(%rbp)
.L13:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L18
.L21:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%esi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	island(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%edi, %r12
	leaq	(%r12,%r12,4), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r12d, %edi
	movq	%r12, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	(%rax,%rax,4), %rax
	movq	%r14, %rbx
	leaq	(%r12,%rax,4), %rax
	addq	%r13, %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movb	$120, (%rax,%r14)
	subl	$1, %edi
	js	.L2
	cmpl	h(%rip), %edi
	jl	.L8
.L2:
	movl	%ebp, %edi
	addl	$1, %edi
	js	.L3
	cmpl	h(%rip), %edi
	jl	.L9
.L3:
	movl	%ebx, %esi
	subl	$1, %esi
	js	.L4
	cmpl	%esi, w(%rip)
	jg	.L10
.L4:
	addl	$1, %ebx
	js	.L1
	cmpl	w(%rip), %ebx
	jge	.L1
	leaq	(%r12,%r12,4), %rdx
	movslq	%ebx, %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r12,%rdx,4), %rdx
	addq	%rdx, %r13
	cmpb	%r15b, 0(%r13,%rax)
	je	.L11
.L1:
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	leaq	(%r12,%r12,4), %rdx
	movslq	%esi, %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r12,%rdx,4), %rdx
	addq	%r13, %rdx
	cmpb	%r15b, (%rdx,%rax)
	jne	.L4
	movsbl	%r15b, %edx
	movl	%ebp, %edi
	call	dfs
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%edi, %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	addq	%r13, %rax
	cmpb	%r15b, (%rax,%r14)
	jne	.L3
	movsbl	%r15b, %edx
	movl	%ebx, %esi
	call	dfs
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	addq	%r13, %rax
	cmpb	%r15b, (%rax,%r14)
	jne	.L2
	movsbl	%r15b, %edx
	movl	%r14d, %esi
	call	dfs
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	movsbl	%r15b, %edx
	movl	%ebx, %esi
	movl	%ebp, %edi
	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
	jmp	dfs
	.cfi_endproc
.LFE35:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L27:
	xorl	%eax, %eax
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	h(%rip), %ebx
	movl	%ebx, %eax
	addl	w(%rip), %eax
	je	.L31
	movl	$10201, %edx
	movl	$120, %esi
	leaq	island(%rip), %rdi
	call	memset@PLT
	testl	%ebx, %ebx
	jle	.L14
	leaq	island(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdi
	addq	$101, %rbp
	call	getc@PLT
	movl	h(%rip), %edi
	cmpl	%ebx, %edi
	jg	.L15
	testl	%edi, %edi
	jle	.L14
	movl	w(%rip), %esi
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	movl	$-1, %ebx
	leal	1(%r14), %ebp
	testl	%esi, %esi
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movl	$101, %eax
	leaq	island(%rip), %r8
	movl	%r14d, 8(%rsp)
	xorl	%ecx, %ecx
	subq	%r13, %rax
	movq	$-101, %r15
	subq	%r13, %r8
	movl	$-1, %r10d
	subq	%r13, %r15
	movq	%rax, %r14
	.p2align 4,,10
	.p2align 3
.L22:
	movzbl	(%r8), %r9d
	movl	%ecx, %r11d
	addl	$1, %ecx
	cmpb	$120, %r9b
	je	.L17
	movb	$120, (%r8)
	movsbl	%r9b, %edx
	testl	%ebx, %ebx
	js	.L18
	cmpl	%ebx, %edi
	jle	.L18
	leaq	(%r8,%r13), %rsi
	cmpb	(%rsi,%r15), %r9b
	je	.L40
.L18:
	cmpl	%ebp, %edi
	jle	.L19
	leaq	(%r8,%r13), %rsi
	cmpb	(%rsi,%r14), %r9b
	je	.L41
.L19:
	movl	w(%rip), %esi
	cmpl	$-1, %r10d
	je	.L20
	cmpl	%esi, %r10d
	jge	.L20
	cmpb	-1(%r8), %r9b
	je	.L42
.L20:
	cmpl	%ecx, %esi
	jle	.L21
	cmpb	1(%r8), %r9b
	je	.L43
.L21:
	movl	h(%rip), %edi
	addl	$1, %r12d
.L17:
	addq	$1, %r8
	addl	$1, %r10d
	cmpl	%ecx, %esi
	jg	.L22
	cmpl	%ebp, %edi
	jle	.L24
	movl	%ebp, %r14d
	addl	$1, %ebx
	subq	$101, %r13
	leal	1(%r14), %ebp
	testl	%esi, %esi
	jg	.L25
.L24:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L41:
	movl	%r11d, %esi
	movl	%ebp, %edi
	movl	%edx, 12(%rsp)
	call	dfs
	movl	12(%rsp), %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L42:
	movl	8(%rsp), %edi
	movl	%r10d, %esi
	movl	%edx, 12(%rsp)
	call	dfs
	movl	w(%rip), %esi
	movl	12(%rsp), %edx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L43:
	movl	8(%rsp), %edi
	movl	%ecx, %esi
	call	dfs
	movl	w(%rip), %esi
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%ebx, %edi
	movl	%r11d, %esi
	movl	%edx, 12(%rsp)
	call	dfs
	movl	h(%rip), %edi
	movl	12(%rsp), %edx
	jmp	.L18
.L31:
	addq	$24, %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
.L14:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L24
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	island
	.align 32
	.type	island, @object
	.size	island, 10201
island:
	.zero	10201
	.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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%esi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	island(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%edi, %r12
	leaq	(%r12,%r12,4), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r12d, %edi
	movq	%r12, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	(%rax,%rax,4), %rax
	movq	%r14, %rbx
	leaq	(%r12,%rax,4), %rax
	addq	%r13, %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movb	$120, (%rax,%r14)
	subl	$1, %edi
	js	.L2
	cmpl	h(%rip), %edi
	jl	.L8
.L2:
	movl	%ebp, %edi
	addl	$1, %edi
	js	.L3
	cmpl	h(%rip), %edi
	jl	.L9
.L3:
	movl	%ebx, %esi
	subl	$1, %esi
	js	.L4
	cmpl	%esi, w(%rip)
	jg	.L10
.L4:
	addl	$1, %ebx
	js	.L1
	cmpl	w(%rip), %ebx
	jge	.L1
	leaq	(%r12,%r12,4), %rdx
	movslq	%ebx, %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r12,%rdx,4), %rdx
	addq	%rdx, %r13
	cmpb	%r15b, 0(%r13,%rax)
	je	.L11
.L1:
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	leaq	(%r12,%r12,4), %rdx
	movslq	%esi, %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r12,%rdx,4), %rdx
	addq	%r13, %rdx
	cmpb	%r15b, (%rdx,%rax)
	jne	.L4
	movsbl	%r15b, %edx
	movl	%ebp, %edi
	call	dfs
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%edi, %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	addq	%r13, %rax
	cmpb	%r15b, (%rax,%r14)
	jne	.L3
	movsbl	%r15b, %edx
	movl	%ebx, %esi
	call	dfs
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	addq	%r13, %rax
	cmpb	%r15b, (%rax,%r14)
	jne	.L2
	movsbl	%r15b, %edx
	movl	%r14d, %esi
	call	dfs
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	movsbl	%r15b, %edx
	movl	%ebx, %esi
	movl	%ebp, %edi
	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
	jmp	dfs
	.cfi_endproc
.LFE35:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L27:
	xorl	%eax, %eax
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	h(%rip), %ebx
	movl	%ebx, %eax
	addl	w(%rip), %eax
	je	.L31
	movl	$10201, %edx
	movl	$120, %esi
	leaq	island(%rip), %rdi
	call	memset@PLT
	testl	%ebx, %ebx
	jle	.L14
	leaq	island(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdi
	addq	$101, %rbp
	call	getc@PLT
	movl	h(%rip), %edi
	cmpl	%ebx, %edi
	jg	.L15
	testl	%edi, %edi
	jle	.L14
	movl	w(%rip), %esi
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	movl	$-1, %ebx
	leal	1(%r14), %ebp
	testl	%esi, %esi
	jle	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movl	$101, %eax
	leaq	island(%rip), %r8
	movl	%r14d, 8(%rsp)
	xorl	%ecx, %ecx
	subq	%r13, %rax
	movq	$-101, %r15
	subq	%r13, %r8
	movl	$-1, %r10d
	subq	%r13, %r15
	movq	%rax, %r14
	.p2align 4,,10
	.p2align 3
.L22:
	movzbl	(%r8), %r9d
	movl	%ecx, %r11d
	addl	$1, %ecx
	cmpb	$120, %r9b
	je	.L17
	movb	$120, (%r8)
	movsbl	%r9b, %edx
	testl	%ebx, %ebx
	js	.L18
	cmpl	%ebx, %edi
	jle	.L18
	leaq	(%r8,%r13), %rsi
	cmpb	(%rsi,%r15), %r9b
	je	.L40
.L18:
	cmpl	%ebp, %edi
	jle	.L19
	leaq	(%r8,%r13), %rsi
	cmpb	(%rsi,%r14), %r9b
	je	.L41
.L19:
	movl	w(%rip), %esi
	cmpl	$-1, %r10d
	je	.L20
	cmpl	%esi, %r10d
	jge	.L20
	cmpb	-1(%r8), %r9b
	je	.L42
.L20:
	cmpl	%ecx, %esi
	jle	.L21
	cmpb	1(%r8), %r9b
	je	.L43
.L21:
	movl	h(%rip), %edi
	addl	$1, %r12d
.L17:
	addq	$1, %r8
	addl	$1, %r10d
	cmpl	%ecx, %esi
	jg	.L22
	cmpl	%ebp, %edi
	jle	.L24
	movl	%ebp, %r14d
	addl	$1, %ebx
	subq	$101, %r13
	leal	1(%r14), %ebp
	testl	%esi, %esi
	jg	.L25
.L24:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L41:
	movl	%r11d, %esi
	movl	%ebp, %edi
	movl	%edx, 12(%rsp)
	call	dfs
	movl	12(%rsp), %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L42:
	movl	8(%rsp), %edi
	movl	%r10d, %esi
	movl	%edx, 12(%rsp)
	call	dfs
	movl	w(%rip), %esi
	movl	12(%rsp), %edx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L43:
	movl	8(%rsp), %edi
	movl	%ecx, %esi
	call	dfs
	movl	w(%rip), %esi
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%ebx, %edi
	movl	%r11d, %esi
	movl	%edx, 12(%rsp)
	call	dfs
	movl	h(%rip), %edi
	movl	12(%rsp), %edx
	jmp	.L18
.L31:
	addq	$24, %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
.L14:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L24
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	island
	.align 32
	.type	island, @object
	.size	island, 10201
island:
	.zero	10201
	.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>
#include <string.h>

char island[101][101];
int h, w;

void dfs(int i, int j, char c){
	int di, dj;
	
	island[i][j] = 'x';
		
	for (di = -1; di <= 1; di += 2){
		if (0 <= i + di && i + di < h && island[i + di][j] == c){
			dfs(i + di, j, c);
		}
	}
	for (dj = -1; dj <= 1; dj += 2){
		if (0 <= j + dj && j + dj < w && island[i][j + dj] == c){
			dfs(i, j + dj, c);
		}
	}
}

int main(void)
{
	int i, j;
	int num;
	
	while (1){
		scanf("%d%d", &h, &w);
		if (!(h + w)){
			break;
		}
		memset(island, 'x', sizeof(island));
		for (i = 0; i < h; i++){
			scanf("%s", island[i]);
			getchar();
		}
		
		num = 0;
		for (i = 0; i < h; i++){
			for (j = 0; j < w; j++){
				if (island[i][j] != 'x'){
					dfs(i, j, island[i][j]);
					num++;
				}
			}
		}
		
		printf("%d\n", num);
	}
	
	return (0);
}
10 10
*****@
@#@@@@#*#*
@##***@@@*
****#*@**
@*#?@*##
*@@@@*@@@#
***#@*@##*
*@@@*@@##@
*@*#*@##**
@****#@@#@
0 0
 10 10
*****@
@#@@@@#*#*
@##***@@@*
****#*@**
@*#?@*##
*@@@@*@@A#
***#@*@##*
@@@@*@*##@
*@*#*@##**
@****#@@#@
0 0

36
 40

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>
#include <string.h>

char island[101][101];
int h, w;

void dfs(int i, int j, char c){
	int di, dj;
	
	island[i][j] = 'x';
		
	for (di = -1; di <= 1; di += 2){
		if (0 <= i + di && i + di < h && island[i + di][j] == c){
			dfs(i + di, j, c);
		}
	}
	for (dj = -1; dj <= 1; dj += 2){
		if (0 <= j + dj && j + dj < w && island[i][j + dj] == c){
			dfs(i, j + dj, c);
		}
	}
}

int main(void)
{
	int i, j;
	int num;
	
	while (1){
		scanf("%d%d", &h, &w);
		if (!(h + w)){
			break;
		}
		memset(island, 'x', sizeof(island));
		for (i = 0; i < h; i++){
			scanf("%s", island[i]);
			getchar();
		}
		
		num = 0;
		for (i = 0; i < h; i++){
			for (j = 0; j < w; j++){
				if (island[i][j] != 'x'){
					dfs(i, j, island[i][j]);
					num++;
				}
			}
		}
		
		printf("%d\n", num);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	island
	.bss
	.align 32
	.type	island, @object
	.size	island, 10201
island:
	.zero	10201
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.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	%edx, %eax
	movb	%al, -28(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L4:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L3
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L3
	movsbl	-28(%rbp), %edx
	movl	-20(%rbp), %ecx
	movl	-8(%rbp), %eax
	addl	%eax, %ecx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L3:
	addl	$2, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L4
	movl	$-1, -4(%rbp)
	jmp	.L5
.L7:
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L6
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	w(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L6
	movsbl	-28(%rbp), %edx
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
.L6:
	addl	$2, -4(%rbp)
.L5:
	cmpl	$1, -4(%rbp)
	jle	.L7
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
.L18:
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	h(%rip), %edx
	movl	w(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L21
	movl	$10201, %edx
	movl	$120, %esi
	leaq	island(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -12(%rbp)
	jmp	.L11
.L12:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	island(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	addl	$1, -12(%rbp)
.L11:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L12
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L13
.L17:
	movl	$0, -8(%rbp)
	jmp	.L14
.L16:
	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), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	je	.L15
	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), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movl	-8(%rbp), %ecx
	movl	-12(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	addl	$1, -4(%rbp)
.L15:
	addl	$1, -8(%rbp)
.L14:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L16
	addl	$1, -12(%rbp)
.L13:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L18
.L21:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	island
	.bss
	.align 32
	.type	island, @object
	.size	island, 10201
island:
	.zero	10201
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.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	%edx, %eax
	movb	%al, -28(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L4:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L3
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L3
	movsbl	-28(%rbp), %edx
	movl	-20(%rbp), %ecx
	movl	-8(%rbp), %eax
	addl	%eax, %ecx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L3:
	addl	$2, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L4
	movl	$-1, -4(%rbp)
	jmp	.L5
.L7:
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L6
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	w(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L6
	movsbl	-28(%rbp), %edx
	movl	-24(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
.L6:
	addl	$2, -4(%rbp)
.L5:
	cmpl	$1, -4(%rbp)
	jle	.L7
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
.L18:
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	h(%rip), %edx
	movl	w(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	je	.L21
	movl	$10201, %edx
	movl	$120, %esi
	leaq	island(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -12(%rbp)
	jmp	.L11
.L12:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	island(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	addl	$1, -12(%rbp)
.L11:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L12
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L13
.L17:
	movl	$0, -8(%rbp)
	jmp	.L14
.L16:
	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), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	je	.L15
	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), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	island(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movl	-8(%rbp), %ecx
	movl	-12(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	addl	$1, -4(%rbp)
.L15:
	addl	$1, -8(%rbp)
.L14:
	movl	w(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L16
	addl	$1, -12(%rbp)
.L13:
	movl	h(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L18
.L21:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
