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

```c
#include<stdio.h>
int count;
long long int cb, cw;
int h, w;
char s[402][402];
int visited[402][402];
void dfs(int x, int y, int k)
{
	visited[x][y] = k;
	count++;
	if (s[x][y] == '#')
		cb++;
	else
		cw++;
	if (x > 0)
		if (s[x][y] != s[x - 1][y] && visited[x - 1][y] == 0)
			dfs(x - 1, y, k);
	if (y > 0)
		if (s[x][y] != s[x][y - 1] && visited[x][y - 1] == 0)
			dfs(x, y - 1, k);
	if (x < h - 1)
		if (s[x][y] != s[x + 1][y] && visited[x + 1][y] == 0)
			dfs(x + 1, y, k);
	if (y < w - 1)
		if (s[x][y] != s[x][y + 1] && visited[x][y + 1] == 0)
			dfs(x, y + 1, k);
	return;
}
int main()
{
	scanf("%d %d", &h, &w);
	int i, j;
	for (i = 0; i < h; i++)
		scanf("%s", s[i]);
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			visited[i][j] = 0;
	int k = 1;
	long long int ans = 0;
	for (i = 0; i < h; i++)
	{
		for (j = 0; j < w; j++)
		{
			if (visited[i][j] == 0)
			{
				cw = cb = 0;
				dfs(i, j, k);
				ans += cw * cb;
				k++;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.globl	cb
	.align 8
	.type	cb, @object
	.size	cb, 8
cb:
	.zero	8
	.globl	cw
	.align 8
	.type	cw, @object
	.size	cw, 8
cw:
	.zero	8
	.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
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 161604
s:
	.zero	161604
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 646416
visited:
	.zero	646416
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	visited(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L2
	movq	cb(%rip), %rax
	addq	$1, %rax
	movq	%rax, cb(%rip)
	jmp	.L3
.L2:
	movq	cw(%rip), %rax
	addq	$1, %rax
	movq	%rax, cw(%rip)
.L3:
	cmpl	$0, -4(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L4:
	cmpl	$0, -8(%rbp)
	jle	.L5
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-8(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
.L5:
	movl	h(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jge	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L6
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L6:
	movl	w(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jge	.L9
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-8(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	nop
.L9:
	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	"%lld\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	$32, %rsp
	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	$0, -20(%rbp)
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L11:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L12
	movl	$0, -20(%rbp)
	jmp	.L13
.L16:
	movl	$0, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L14:
	movl	w(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	addl	$1, -20(%rbp)
.L13:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	$1, -12(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L17
.L21:
	movl	$0, -16(%rbp)
	jmp	.L18
.L20:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movq	$0, cb(%rip)
	movq	cb(%rip), %rax
	movq	%rax, cw(%rip)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	movq	cw(%rip), %rdx
	movq	cb(%rip), %rax
	imulq	%rdx, %rax
	addq	%rax, -8(%rbp)
	addl	$1, -12(%rbp)
.L19:
	addl	$1, -16(%rbp)
.L18:
	movl	w(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L20
	addl	$1, -20(%rbp)
.L17:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %r8
	leaq	visited(%rip), %r10
	leaq	s(%rip), %r9
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	imulq	$-1608, %r8, %r15
	leal	-1(%r8), %eax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	imulq	$402, %r8, %r14
	movq	%r8, %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
	movslq	%esi, %rbx
	movq	%rbx, %rbp
	addq	%r14, %rbx
	leaq	(%r10,%rbx,4), %r12
	addq	%r9, %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	%eax, 36(%rsp)
	cltq
	imulq	$402, %rax, %r11
	imulq	$1608, %rax, %rax
	movq	%rax, 16(%rsp)
	leal	1(%r8), %eax
	movl	%eax, 40(%rsp)
	cltq
	imulq	$402, %rax, %rcx
	imulq	$1608, %rax, %rax
	movq	%rcx, 8(%rsp)
	movq	%rax, 24(%rsp)
	movq	%r15, %rax
	movq	%r14, %r15
	movq	%rax, %r14
.L8:
	movzbl	(%rbx), %eax
	addl	$1, count(%rip)
	movq	%r12, %rcx
	movl	%edx, (%r12)
	cmpb	$35, %al
	je	.L12
	addq	$1, cw(%rip)
.L3:
	testl	%r13d, %r13d
	jle	.L4
	movq	%rbx, %rsi
	subq	%r15, %rsi
	cmpb	(%rsi,%r11), %al
	je	.L4
	movq	16(%rsp), %rdi
	leaq	(%r12,%r14), %rax
	movl	(%rax,%rdi), %r8d
	testl	%r8d, %r8d
	je	.L13
.L4:
	testl	%ebp, %ebp
	jle	.L5
	leal	-1(%rbp), %esi
	leaq	(%r9,%r15), %rdi
	movslq	%esi, %rax
	movzbl	(%rdi,%rax), %edi
	cmpb	%dil, (%rbx)
	je	.L5
	addq	%r15, %rax
	movl	(%r10,%rax,4), %edi
	testl	%edi, %edi
	je	.L14
.L5:
	movl	h(%rip), %eax
	subl	$1, %eax
	cmpl	%r13d, %eax
	jle	.L6
	movq	8(%rsp), %rdi
	movq	%rbx, %rax
	subq	%r15, %rax
	movzbl	(%rax,%rdi), %eax
	cmpb	%al, (%rbx)
	je	.L6
	movq	24(%rsp), %rdi
	leaq	(%r12,%r14), %rax
	movl	(%rax,%rdi), %esi
	testl	%esi, %esi
	je	.L15
.L6:
	movl	w(%rip), %eax
	subl	$1, %eax
	cmpl	%ebp, %eax
	jle	.L1
	movzbl	1(%rbx), %eax
	addl	$1, %ebp
	cmpb	%al, (%rbx)
	je	.L1
	movl	4(%rcx), %eax
	addq	$4, %r12
	addq	$1, %rbx
	testl	%eax, %eax
	je	.L8
.L1:
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	addq	$1, cb(%rip)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	movl	36(%rsp), %edi
	movl	%ebp, %esi
	movq	%r11, 56(%rsp)
	movq	%rcx, 48(%rsp)
	movl	%edx, 44(%rsp)
	call	dfs
	movq	56(%rsp), %r11
	movl	44(%rsp), %edx
	leaq	s(%rip), %r9
	movq	48(%rsp), %rcx
	leaq	visited(%rip), %r10
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%r13d, %edi
	movq	%r11, 56(%rsp)
	movq	%rcx, 48(%rsp)
	movl	%edx, 44(%rsp)
	call	dfs
	movq	56(%rsp), %r11
	movl	44(%rsp), %edx
	leaq	s(%rip), %r9
	movq	48(%rsp), %rcx
	leaq	visited(%rip), %r10
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	movl	40(%rsp), %edi
	movl	%ebp, %esi
	movq	%r11, 56(%rsp)
	movq	%rcx, 48(%rsp)
	movl	%edx, 44(%rsp)
	call	dfs
	movq	56(%rsp), %r11
	movl	44(%rsp), %edx
	leaq	s(%rip), %r9
	movq	48(%rsp), %rcx
	leaq	visited(%rip), %r10
	jmp	.L6
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	h(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L17
	leaq	s(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	h(%rip), %edx
	addq	$402, %rbp
	cmpl	%ebx, %edx
	jg	.L18
	testl	%edx, %edx
	jle	.L17
	movslq	w(%rip), %rax
	testl	%eax, %eax
	jle	.L19
	leal	-1(%rdx), %ebp
	leaq	visited(%rip), %rcx
	imulq	$1608, %rbp, %rbp
	leaq	1608(%rcx), %rdx
	leaq	0(,%rax,4), %rbx
	addq	%rdx, %rbp
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rcx, %rdi
	movq	%rbx, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$1608, %rcx
	cmpq	%rcx, %rbp
	jne	.L20
	movl	w(%rip), %eax
.L19:
	leaq	visited(%rip), %rbp
	xorl	%r12d, %r12d
	movl	$1, %r13d
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L29:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L25:
	movl	0(%rbp,%rbx,4), %edx
	movl	%ebx, %esi
	testl	%edx, %edx
	je	.L35
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L25
.L24:
	addl	$1, %r14d
	cmpl	%r14d, h(%rip)
	jle	.L27
	addq	$1608, %rbp
	testl	%eax, %eax
	jg	.L29
.L27:
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	%r13d, %edx
	movl	%r14d, %edi
	movq	$0, cb(%rip)
	addq	$1, %rbx
	movq	$0, cw(%rip)
	addl	$1, %r13d
	call	dfs
	movq	cw(%rip), %rax
	imulq	cb(%rip), %rax
	addq	%rax, %r12
	movl	w(%rip), %eax
	cmpl	%ebx, %eax
	jg	.L25
	jmp	.L24
.L17:
	xorl	%r12d, %r12d
	jmp	.L27
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	visited
	.bss
	.align 32
	.type	visited, @object
	.size	visited, 646416
visited:
	.zero	646416
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 161604
s:
	.zero	161604
	.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
	.globl	cw
	.align 8
	.type	cw, @object
	.size	cw, 8
cw:
	.zero	8
	.globl	cb
	.align 8
	.type	cb, @object
	.size	cb, 8
cb:
	.zero	8
	.globl	count
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.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
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %r8
	leaq	visited(%rip), %r10
	leaq	s(%rip), %r9
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	imulq	$-1608, %r8, %r15
	leal	-1(%r8), %eax
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	imulq	$402, %r8, %r14
	movq	%r8, %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
	movslq	%esi, %rbx
	movq	%rbx, %rbp
	addq	%r14, %rbx
	leaq	(%r10,%rbx,4), %r12
	addq	%r9, %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	%eax, 36(%rsp)
	cltq
	imulq	$402, %rax, %r11
	imulq	$1608, %rax, %rax
	movq	%rax, 16(%rsp)
	leal	1(%r8), %eax
	movl	%eax, 40(%rsp)
	cltq
	imulq	$402, %rax, %rcx
	imulq	$1608, %rax, %rax
	movq	%rcx, 8(%rsp)
	movq	%rax, 24(%rsp)
	movq	%r15, %rax
	movq	%r14, %r15
	movq	%rax, %r14
.L8:
	movzbl	(%rbx), %eax
	addl	$1, count(%rip)
	movq	%r12, %rcx
	movl	%edx, (%r12)
	cmpb	$35, %al
	je	.L12
	addq	$1, cw(%rip)
.L3:
	testl	%r13d, %r13d
	jle	.L4
	movq	%rbx, %rsi
	subq	%r15, %rsi
	cmpb	(%rsi,%r11), %al
	je	.L4
	movq	16(%rsp), %rdi
	leaq	(%r12,%r14), %rax
	movl	(%rax,%rdi), %r8d
	testl	%r8d, %r8d
	je	.L13
.L4:
	testl	%ebp, %ebp
	jle	.L5
	leal	-1(%rbp), %esi
	leaq	(%r9,%r15), %rdi
	movslq	%esi, %rax
	movzbl	(%rdi,%rax), %edi
	cmpb	%dil, (%rbx)
	je	.L5
	addq	%r15, %rax
	movl	(%r10,%rax,4), %edi
	testl	%edi, %edi
	je	.L14
.L5:
	movl	h(%rip), %eax
	subl	$1, %eax
	cmpl	%r13d, %eax
	jle	.L6
	movq	8(%rsp), %rdi
	movq	%rbx, %rax
	subq	%r15, %rax
	movzbl	(%rax,%rdi), %eax
	cmpb	%al, (%rbx)
	je	.L6
	movq	24(%rsp), %rdi
	leaq	(%r12,%r14), %rax
	movl	(%rax,%rdi), %esi
	testl	%esi, %esi
	je	.L15
.L6:
	movl	w(%rip), %eax
	subl	$1, %eax
	cmpl	%ebp, %eax
	jle	.L1
	movzbl	1(%rbx), %eax
	addl	$1, %ebp
	cmpb	%al, (%rbx)
	je	.L1
	movl	4(%rcx), %eax
	addq	$4, %r12
	addq	$1, %rbx
	testl	%eax, %eax
	je	.L8
.L1:
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	addq	$1, cb(%rip)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L13:
	movl	36(%rsp), %edi
	movl	%ebp, %esi
	movq	%r11, 56(%rsp)
	movq	%rcx, 48(%rsp)
	movl	%edx, 44(%rsp)
	call	dfs
	movq	56(%rsp), %r11
	movl	44(%rsp), %edx
	leaq	s(%rip), %r9
	movq	48(%rsp), %rcx
	leaq	visited(%rip), %r10
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%r13d, %edi
	movq	%r11, 56(%rsp)
	movq	%rcx, 48(%rsp)
	movl	%edx, 44(%rsp)
	call	dfs
	movq	56(%rsp), %r11
	movl	44(%rsp), %edx
	leaq	s(%rip), %r9
	movq	48(%rsp), %rcx
	leaq	visited(%rip), %r10
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	movl	40(%rsp), %edi
	movl	%ebp, %esi
	movq	%r11, 56(%rsp)
	movq	%rcx, 48(%rsp)
	movl	%edx, 44(%rsp)
	call	dfs
	movq	56(%rsp), %r11
	movl	44(%rsp), %edx
	leaq	s(%rip), %r9
	movq	48(%rsp), %rcx
	leaq	visited(%rip), %r10
	jmp	.L6
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	h(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L17
	leaq	s(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	h(%rip), %edx
	addq	$402, %rbp
	cmpl	%ebx, %edx
	jg	.L18
	testl	%edx, %edx
	jle	.L17
	movslq	w(%rip), %rax
	testl	%eax, %eax
	jle	.L19
	leal	-1(%rdx), %ebp
	leaq	visited(%rip), %rcx
	imulq	$1608, %rbp, %rbp
	leaq	1608(%rcx), %rdx
	leaq	0(,%rax,4), %rbx
	addq	%rdx, %rbp
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rcx, %rdi
	movq	%rbx, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$1608, %rcx
	cmpq	%rcx, %rbp
	jne	.L20
	movl	w(%rip), %eax
.L19:
	leaq	visited(%rip), %rbp
	xorl	%r12d, %r12d
	movl	$1, %r13d
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L29:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L25:
	movl	0(%rbp,%rbx,4), %edx
	movl	%ebx, %esi
	testl	%edx, %edx
	je	.L35
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L25
.L24:
	addl	$1, %r14d
	cmpl	%r14d, h(%rip)
	jle	.L27
	addq	$1608, %rbp
	testl	%eax, %eax
	jg	.L29
.L27:
	movq	%r12, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	%r13d, %edx
	movl	%r14d, %edi
	movq	$0, cb(%rip)
	addq	$1, %rbx
	movq	$0, cw(%rip)
	addl	$1, %r13d
	call	dfs
	movq	cw(%rip), %rax
	imulq	cb(%rip), %rax
	addq	%rax, %r12
	movl	w(%rip), %eax
	cmpl	%ebx, %eax
	jg	.L25
	jmp	.L24
.L17:
	xorl	%r12d, %r12d
	jmp	.L27
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	visited
	.bss
	.align 32
	.type	visited, @object
	.size	visited, 646416
visited:
	.zero	646416
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 161604
s:
	.zero	161604
	.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
	.globl	cw
	.align 8
	.type	cw, @object
	.size	cw, 8
cw:
	.zero	8
	.globl	cb
	.align 8
	.type	cb, @object
	.size	cb, 8
cb:
	.zero	8
	.globl	count
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
int count;
long long int cb, cw;
int h, w;
char s[402][402];
int visited[402][402];
void dfs(int x, int y, int k)
{
	visited[x][y] = k;
	count++;
	if (s[x][y] == '#')
		cb++;
	else
		cw++;
	if (x > 0)
		if (s[x][y] != s[x - 1][y] && visited[x - 1][y] == 0)
			dfs(x - 1, y, k);
	if (y > 0)
		if (s[x][y] != s[x][y - 1] && visited[x][y - 1] == 0)
			dfs(x, y - 1, k);
	if (x < h - 1)
		if (s[x][y] != s[x + 1][y] && visited[x + 1][y] == 0)
			dfs(x + 1, y, k);
	if (y < w - 1)
		if (s[x][y] != s[x][y + 1] && visited[x][y + 1] == 0)
			dfs(x, y + 1, k);
	return;
}
int main()
{
	scanf("%d %d", &h, &w);
	int i, j;
	for (i = 0; i < h; i++)
		scanf("%s", s[i]);
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			visited[i][j] = 0;
	int k = 1;
	long long int ans = 0;
	for (i = 0; i < h; i++)
	{
		for (j = 0; j < w; j++)
		{
			if (visited[i][j] == 0)
			{
				cw = cb = 0;
				dfs(i, j, k);
				ans += cw * cb;
				k++;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}
3 4
.#.
..#
#..
 4 4


...
 3 3
.#.
-.#
..
 3 4
.#.
..#
#./
 3 2
.#.
-.#
..
 3 1
.#.
..#
#./
 3 2
.#.
#.-
..
 4 2
.#.
#.-
..
 4 2
.#.
#.-
-.
 4 1
.#.
#--
..

16
 0
 14
 27
 4
 1
 6
 8
 12
 3

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

```c
#include<stdio.h>
int count;
long long int cb, cw;
int h, w;
char s[402][402];
int visited[402][402];
void dfs(int x, int y, int k)
{
	visited[x][y] = k;
	count++;
	if (s[x][y] == '#')
		cb++;
	else
		cw++;
	if (x > 0)
		if (s[x][y] != s[x - 1][y] && visited[x - 1][y] == 0)
			dfs(x - 1, y, k);
	if (y > 0)
		if (s[x][y] != s[x][y - 1] && visited[x][y - 1] == 0)
			dfs(x, y - 1, k);
	if (x < h - 1)
		if (s[x][y] != s[x + 1][y] && visited[x + 1][y] == 0)
			dfs(x + 1, y, k);
	if (y < w - 1)
		if (s[x][y] != s[x][y + 1] && visited[x][y + 1] == 0)
			dfs(x, y + 1, k);
	return;
}
int main()
{
	scanf("%d %d", &h, &w);
	int i, j;
	for (i = 0; i < h; i++)
		scanf("%s", s[i]);
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			visited[i][j] = 0;
	int k = 1;
	long long int ans = 0;
	for (i = 0; i < h; i++)
	{
		for (j = 0; j < w; j++)
		{
			if (visited[i][j] == 0)
			{
				cw = cb = 0;
				dfs(i, j, k);
				ans += cw * cb;
				k++;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.globl	cb
	.align 8
	.type	cb, @object
	.size	cb, 8
cb:
	.zero	8
	.globl	cw
	.align 8
	.type	cw, @object
	.size	cw, 8
cw:
	.zero	8
	.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
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 161604
s:
	.zero	161604
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 646416
visited:
	.zero	646416
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	visited(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L2
	movq	cb(%rip), %rax
	addq	$1, %rax
	movq	%rax, cb(%rip)
	jmp	.L3
.L2:
	movq	cw(%rip), %rax
	addq	$1, %rax
	movq	%rax, cw(%rip)
.L3:
	cmpl	$0, -4(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L4:
	cmpl	$0, -8(%rbp)
	jle	.L5
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-8(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
.L5:
	movl	h(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jge	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L6
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L6:
	movl	w(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jge	.L9
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-8(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	nop
.L9:
	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	"%lld\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	$32, %rsp
	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	$0, -20(%rbp)
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L11:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L12
	movl	$0, -20(%rbp)
	jmp	.L13
.L16:
	movl	$0, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L14:
	movl	w(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	addl	$1, -20(%rbp)
.L13:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	$1, -12(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L17
.L21:
	movl	$0, -16(%rbp)
	jmp	.L18
.L20:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movq	$0, cb(%rip)
	movq	cb(%rip), %rax
	movq	%rax, cw(%rip)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	movq	cw(%rip), %rdx
	movq	cb(%rip), %rax
	imulq	%rdx, %rax
	addq	%rax, -8(%rbp)
	addl	$1, -12(%rbp)
.L19:
	addl	$1, -16(%rbp)
.L18:
	movl	w(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L20
	addl	$1, -20(%rbp)
.L17:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.globl	cb
	.align 8
	.type	cb, @object
	.size	cb, 8
cb:
	.zero	8
	.globl	cw
	.align 8
	.type	cw, @object
	.size	cw, 8
cw:
	.zero	8
	.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
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 161604
s:
	.zero	161604
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 646416
visited:
	.zero	646416
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	visited(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L2
	movq	cb(%rip), %rax
	addq	$1, %rax
	movq	%rax, cb(%rip)
	jmp	.L3
.L2:
	movq	cw(%rip), %rax
	addq	$1, %rax
	movq	%rax, cw(%rip)
.L3:
	cmpl	$0, -4(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L4
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L4:
	cmpl	$0, -8(%rbp)
	jle	.L5
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-8(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
.L5:
	movl	h(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jge	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L6
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	dfs
.L6:
	movl	w(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jge	.L9
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rax, %rcx
	leaq	s(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-8(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-4(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-8(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	nop
.L9:
	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	"%lld\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	$32, %rsp
	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	$0, -20(%rbp)
	jmp	.L11
.L12:
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -20(%rbp)
.L11:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L12
	movl	$0, -20(%rbp)
	jmp	.L13
.L16:
	movl	$0, -16(%rbp)
	jmp	.L14
.L15:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L14:
	movl	w(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L15
	addl	$1, -20(%rbp)
.L13:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	$1, -12(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L17
.L21:
	movl	$0, -16(%rbp)
	jmp	.L18
.L20:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	visited(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movq	$0, cb(%rip)
	movq	cb(%rip), %rax
	movq	%rax, cw(%rip)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	dfs
	movq	cw(%rip), %rdx
	movq	cb(%rip), %rax
	imulq	%rdx, %rax
	addq	%rax, -8(%rbp)
	addl	$1, -12(%rbp)
.L19:
	addl	$1, -16(%rbp)
.L18:
	movl	w(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L20
	addl	$1, -20(%rbp)
.L17:
	movl	h(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	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:
