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 H, W;
char S[2048][2048];

int l[2048][2048], r[2048][2048], u[2048][2048], d[2048][2048];

int main(void) {
	int i, j;
	int answer = 0;
	if (scanf("%d%d", &H, &W) != 2) return 1;
	for (i = 0; i < H; i++) {
		if (scanf("%2047s", S[i]) != 1) return 1;
	}
	for (i = 0; i < H; i++) {
		if (S[i][0] == '.') l[i][0] = 1;
		for (j = 1; j < W; j++) {
			l[i][j] = l[i][j - 1] + 1;
			if (S[i][j] == '#') l[i][j] = 0;
		}
		if (S[i][W - 1] == '.') r[i][W - 1] = 1;
		for (j = W - 2; j >= 0; j--) {
			r[i][j] = r[i][j + 1] + 1;
			if (S[i][j] == '#') r[i][j] = 0;
		}
	}
	for (j = 0; j < W; j++) {
		if (S[0][j] == '.') u[0][j] = 1;
		for (i = 1; i < H; i++) {
			u[i][j] = u[i - 1][j] + 1;
			if (S[i][j] == '#') u[i][j] = 0;
		}
		if (S[H - 1][j] == '.') d[H - 1][j] = 1;
		for (i = H - 2; i >= 0; i--) {
			d[i][j] = d[i + 1][j] + 1;
			if (S[i][j] == '#') d[i][j] = 0;
		}
	}
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			if (S[i][j] == '.') {
				int candidate = l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3;
				if (answer < candidate) answer = candidate;
			}
		}
	}
	printf("%d\n", answer);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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	S
	.align 32
	.type	S, @object
	.size	S, 4194304
S:
	.zero	4194304
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 16777216
l:
	.zero	16777216
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 16777216
r:
	.zero	16777216
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 16777216
u:
	.zero	16777216
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 16777216
d:
	.zero	16777216
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%2047s"
.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
	movl	$0, -8(%rbp)
	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
	cmpl	$2, %eax
	je	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	$0, -16(%rbp)
	jmp	.L4
.L6:
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	movq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L5
	movl	$1, %eax
	jmp	.L3
.L5:
	addl	$1, -16(%rbp)
.L4:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L6
	movl	$0, -16(%rbp)
	jmp	.L7
.L16:
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	movq	%rax, %rdx
	leaq	S(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	$46, %al
	jne	.L8
	movl	-16(%rbp), %eax
	cltq
	salq	$13, %rax
	movq	%rax, %rdx
	leaq	l(%rip), %rax
	movl	$1, (%rdx,%rax)
.L8:
	movl	$1, -12(%rbp)
	jmp	.L9
.L11:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	$0, (%rdx,%rax)
.L10:
	addl	$1, -12(%rbp)
.L9:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	W(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L12
	movl	W(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$1, (%rdx,%rax)
.L12:
	movl	W(%rip), %eax
	subl	$2, %eax
	movl	%eax, -12(%rbp)
	jmp	.L13
.L15:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
.L14:
	subl	$1, -12(%rbp)
.L13:
	cmpl	$0, -12(%rbp)
	jns	.L15
	addl	$1, -16(%rbp)
.L7:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L16
	movl	$0, -12(%rbp)
	jmp	.L17
.L26:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L18
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	$1, (%rdx,%rax)
.L18:
	movl	$1, -16(%rbp)
	jmp	.L19
.L21:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	addl	$1, -16(%rbp)
.L19:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
	movl	H(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L22
	movl	H(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
.L22:
	movl	H(%rip), %eax
	subl	$2, %eax
	movl	%eax, -16(%rbp)
	jmp	.L23
.L25:
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L24
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
.L24:
	subl	$1, -16(%rbp)
.L23:
	cmpl	$0, -16(%rbp)
	jns	.L25
	addl	$1, -12(%rbp)
.L17:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	$0, -16(%rbp)
	jmp	.L27
.L31:
	movl	$0, -12(%rbp)
	jmp	.L28
.L30:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L29
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	subl	$3, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L29
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L29:
	addl	$1, -12(%rbp)
.L28:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L30
	addl	$1, -16(%rbp)
.L27:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L31
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%2047s"
.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
	xorl	%eax, %eax
	leaq	W(%rip), %rdx
	leaq	H(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	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
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L5
	movl	H(%rip), %edi
	movl	W(%rip), %r11d
	testl	%edi, %edi
	jle	.L4
	leaq	S(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	movq	%rbx, %rbp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L69:
	movl	H(%rip), %edi
	addl	$1, %r12d
	addq	$2048, %rbp
	cmpl	%r12d, %edi
	jle	.L68
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L69
.L5:
	movl	$1, %eax
.L1:
	addq	$24, %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
.L68:
	.cfi_restore_state
	movl	W(%rip), %r11d
	testl	%edi, %edi
	jle	.L4
	leaq	8+l(%rip), %rax
	leal	-2(%r11), %edx
	leal	-1(%rdi), %r12d
	leal	-1(%r11), %ebp
	movq	%rdx, %r13
	leaq	(%rax,%rdx,4), %r8
	leaq	-4(%rax), %r9
	salq	$11, %r12
	movslq	%ebp, %rbp
	leaq	2048+S(%rip), %rax
	leaq	r(%rip), %rsi
	addq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L15:
	cmpb	$46, (%rbx)
	jne	.L7
	movl	$1, -4(%r9)
.L7:
	movzbl	(%rbx,%rbp), %r10d
	cmpl	$1, %r11d
	jle	.L8
	movl	-4(%r9), %ecx
	leaq	1(%rbx), %rdx
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %ecx
	cmpb	$35, (%rdx)
	je	.L9
	movl	%ecx, (%rax)
	addq	$4, %rax
	addq	$1, %rdx
	cmpq	%r8, %rax
	jne	.L12
.L11:
	cmpb	$46, %r10b
	je	.L43
.L14:
	movslq	%r13d, %rax
	movl	4(%rsi,%rax,4), %edx
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %edx
	cmpb	$35, (%rbx,%rax)
	je	.L16
	movl	%edx, (%rsi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L19
.L18:
	addq	$2048, %rbx
	addq	$8192, %rsi
	addq	$8192, %r8
	addq	$8192, %r9
	cmpq	%r12, %rbx
	jne	.L15
.L4:
	testl	%r11d, %r11d
	jle	.L32
	leal	-2(%rdi), %esi
	leaq	u(%rip), %r10
	movslq	%r11d, %rcx
	xorl	%r9d, %r9d
	leaq	8192(%r10), %rax
	movq	%rsi, %rbx
	salq	$13, %rsi
	leaq	d(%rip), %r12
	addq	%rax, %rsi
	leal	-1(%rdi), %eax
	leaq	S(%rip), %r13
	movl	%r11d, 12(%rsp)
	cltq
	movq	%r13, %r8
	leaq	8192(%r12), %r14
	movq	%rcx, %r11
	movq	%rax, %rbp
	salq	$13, %rax
	addq	%r12, %rax
	salq	$11, %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$46, (%r8)
	jne	.L23
	movl	$1, (%r10)
.L23:
	movzbl	(%r8,%rbp), %r15d
	cmpl	$1, %edi
	jle	.L24
	movl	(%r10), %ecx
	movq	%r8, %rdx
	movq	%r10, %rax
	.p2align 4,,10
	.p2align 3
.L28:
	addl	$1, %ecx
	cmpb	$35, 2048(%rdx)
	je	.L25
	movl	%ecx, 8192(%rax)
	addq	$8192, %rax
	addq	$2048, %rdx
	cmpq	%rsi, %rax
	jne	.L28
.L27:
	movl	%ebx, %edx
	cmpb	$46, %r15b
	je	.L41
.L30:
	movslq	%ebx, %rax
	salq	$11, %rax
	addq	%r9, %rax
	movl	(%r14,%rax,4), %r15d
	leaq	(%r12,%rax,4), %rcx
	addq	%r13, %rax
	.p2align 4,,10
	.p2align 3
.L36:
	addl	$1, %r15d
	cmpb	$35, (%rax)
	je	.L33
	subl	$1, %edx
	movl	%r15d, (%rcx)
	subq	$2048, %rax
	subq	$8192, %rcx
	cmpl	$-1, %edx
	jne	.L36
.L35:
	addq	$1, %r9
	addq	$1, %r8
	addq	$4, %rsi
	addq	$4, %r10
	cmpq	%r11, %r9
	jne	.L31
	movl	12(%rsp), %r11d
.L32:
	testl	%edi, %edi
	jle	.L44
	leaq	S(%rip), %rcx
	subl	$1, %edi
	xorl	%r8d, %r8d
	movslq	%r11d, %rsi
	salq	$11, %rdi
	leaq	2048(%rcx), %rax
	leaq	l(%rip), %rbp
	leaq	r(%rip), %rbx
	leaq	u(%rip), %r10
	addq	%rax, %rdi
	leaq	d(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L22:
	xorl	%eax, %eax
	testl	%r11d, %r11d
	jle	.L40
	.p2align 4,,10
	.p2align 3
.L38:
	cmpb	$46, (%rcx,%rax)
	jne	.L37
	movl	(%rbx,%rax,4), %edx
	addl	0(%rbp,%rax,4), %edx
	addl	(%r10,%rax,4), %edx
	addl	(%r9,%rax,4), %edx
	subl	$3, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
.L37:
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L38
.L40:
	addq	$2048, %rcx
	addq	$8192, %rbp
	addq	$8192, %rbx
	addq	$8192, %r10
	addq	$8192, %r9
	cmpq	%rdi, %rcx
	jne	.L22
.L21:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	movl	$0, 8192(%rax)
	addq	$8192, %rax
	addq	$2048, %rdx
	cmpq	%rsi, %rax
	je	.L27
	xorl	%ecx, %ecx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L33:
	subl	$1, %edx
	movl	$0, (%rcx)
	subq	$2048, %rax
	subq	$8192, %rcx
	cmpl	$-1, %edx
	je	.L35
	xorl	%r15d, %r15d
	jmp	.L36
.L24:
	cmpb	$46, %r15b
	jne	.L29
	.p2align 4,,10
	.p2align 3
.L41:
	movq	(%rsp), %rax
	movl	$1, (%rax,%r9,4)
.L29:
	movl	%ebx, %edx
	testl	%ebx, %ebx
	jns	.L30
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$0, (%rsi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	js	.L18
	xorl	%edx, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$0, (%rax)
	addq	$4, %rax
	addq	$1, %rdx
	cmpq	%r8, %rax
	je	.L11
	xorl	%ecx, %ecx
	jmp	.L12
.L8:
	cmpb	$46, %r10b
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$1, (%rsi,%rbp,4)
.L13:
	testl	%r13d, %r13d
	jns	.L14
	jmp	.L18
.L44:
	xorl	%r8d, %r8d
	jmp	.L21
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 16777216
d:
	.zero	16777216
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 16777216
u:
	.zero	16777216
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 16777216
r:
	.zero	16777216
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 16777216
l:
	.zero	16777216
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 4194304
S:
	.zero	4194304
	.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
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%2047s"
.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
	xorl	%eax, %eax
	leaq	W(%rip), %rdx
	leaq	H(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	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
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L5
	movl	H(%rip), %edi
	movl	W(%rip), %r11d
	testl	%edi, %edi
	jle	.L4
	leaq	S(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	movq	%rbx, %rbp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L69:
	movl	H(%rip), %edi
	addl	$1, %r12d
	addq	$2048, %rbp
	cmpl	%r12d, %edi
	jle	.L68
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L69
.L5:
	movl	$1, %eax
.L1:
	addq	$24, %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
.L68:
	.cfi_restore_state
	movl	W(%rip), %r11d
	testl	%edi, %edi
	jle	.L4
	leaq	8+l(%rip), %rax
	leal	-2(%r11), %edx
	leal	-1(%rdi), %r12d
	leal	-1(%r11), %ebp
	movq	%rdx, %r13
	leaq	(%rax,%rdx,4), %r8
	leaq	-4(%rax), %r9
	salq	$11, %r12
	movslq	%ebp, %rbp
	leaq	2048+S(%rip), %rax
	leaq	r(%rip), %rsi
	addq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L15:
	cmpb	$46, (%rbx)
	jne	.L7
	movl	$1, -4(%r9)
.L7:
	movzbl	(%rbx,%rbp), %r10d
	cmpl	$1, %r11d
	jle	.L8
	movl	-4(%r9), %ecx
	leaq	1(%rbx), %rdx
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %ecx
	cmpb	$35, (%rdx)
	je	.L9
	movl	%ecx, (%rax)
	addq	$4, %rax
	addq	$1, %rdx
	cmpq	%r8, %rax
	jne	.L12
.L11:
	cmpb	$46, %r10b
	je	.L43
.L14:
	movslq	%r13d, %rax
	movl	4(%rsi,%rax,4), %edx
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %edx
	cmpb	$35, (%rbx,%rax)
	je	.L16
	movl	%edx, (%rsi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L19
.L18:
	addq	$2048, %rbx
	addq	$8192, %rsi
	addq	$8192, %r8
	addq	$8192, %r9
	cmpq	%r12, %rbx
	jne	.L15
.L4:
	testl	%r11d, %r11d
	jle	.L32
	leal	-2(%rdi), %esi
	leaq	u(%rip), %r10
	movslq	%r11d, %rcx
	xorl	%r9d, %r9d
	leaq	8192(%r10), %rax
	movq	%rsi, %rbx
	salq	$13, %rsi
	leaq	d(%rip), %r12
	addq	%rax, %rsi
	leal	-1(%rdi), %eax
	leaq	S(%rip), %r13
	movl	%r11d, 12(%rsp)
	cltq
	movq	%r13, %r8
	leaq	8192(%r12), %r14
	movq	%rcx, %r11
	movq	%rax, %rbp
	salq	$13, %rax
	addq	%r12, %rax
	salq	$11, %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$46, (%r8)
	jne	.L23
	movl	$1, (%r10)
.L23:
	movzbl	(%r8,%rbp), %r15d
	cmpl	$1, %edi
	jle	.L24
	movl	(%r10), %ecx
	movq	%r8, %rdx
	movq	%r10, %rax
	.p2align 4,,10
	.p2align 3
.L28:
	addl	$1, %ecx
	cmpb	$35, 2048(%rdx)
	je	.L25
	movl	%ecx, 8192(%rax)
	addq	$8192, %rax
	addq	$2048, %rdx
	cmpq	%rsi, %rax
	jne	.L28
.L27:
	movl	%ebx, %edx
	cmpb	$46, %r15b
	je	.L41
.L30:
	movslq	%ebx, %rax
	salq	$11, %rax
	addq	%r9, %rax
	movl	(%r14,%rax,4), %r15d
	leaq	(%r12,%rax,4), %rcx
	addq	%r13, %rax
	.p2align 4,,10
	.p2align 3
.L36:
	addl	$1, %r15d
	cmpb	$35, (%rax)
	je	.L33
	subl	$1, %edx
	movl	%r15d, (%rcx)
	subq	$2048, %rax
	subq	$8192, %rcx
	cmpl	$-1, %edx
	jne	.L36
.L35:
	addq	$1, %r9
	addq	$1, %r8
	addq	$4, %rsi
	addq	$4, %r10
	cmpq	%r11, %r9
	jne	.L31
	movl	12(%rsp), %r11d
.L32:
	testl	%edi, %edi
	jle	.L44
	leaq	S(%rip), %rcx
	subl	$1, %edi
	xorl	%r8d, %r8d
	movslq	%r11d, %rsi
	salq	$11, %rdi
	leaq	2048(%rcx), %rax
	leaq	l(%rip), %rbp
	leaq	r(%rip), %rbx
	leaq	u(%rip), %r10
	addq	%rax, %rdi
	leaq	d(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L22:
	xorl	%eax, %eax
	testl	%r11d, %r11d
	jle	.L40
	.p2align 4,,10
	.p2align 3
.L38:
	cmpb	$46, (%rcx,%rax)
	jne	.L37
	movl	(%rbx,%rax,4), %edx
	addl	0(%rbp,%rax,4), %edx
	addl	(%r10,%rax,4), %edx
	addl	(%r9,%rax,4), %edx
	subl	$3, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
.L37:
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L38
.L40:
	addq	$2048, %rcx
	addq	$8192, %rbp
	addq	$8192, %rbx
	addq	$8192, %r10
	addq	$8192, %r9
	cmpq	%rdi, %rcx
	jne	.L22
.L21:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	movl	$0, 8192(%rax)
	addq	$8192, %rax
	addq	$2048, %rdx
	cmpq	%rsi, %rax
	je	.L27
	xorl	%ecx, %ecx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L33:
	subl	$1, %edx
	movl	$0, (%rcx)
	subq	$2048, %rax
	subq	$8192, %rcx
	cmpl	$-1, %edx
	je	.L35
	xorl	%r15d, %r15d
	jmp	.L36
.L24:
	cmpb	$46, %r15b
	jne	.L29
	.p2align 4,,10
	.p2align 3
.L41:
	movq	(%rsp), %rax
	movl	$1, (%rax,%r9,4)
.L29:
	movl	%ebx, %edx
	testl	%ebx, %ebx
	jns	.L30
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$0, (%rsi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	js	.L18
	xorl	%edx, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$0, (%rax)
	addq	$4, %rax
	addq	$1, %rdx
	cmpq	%r8, %rax
	je	.L11
	xorl	%ecx, %ecx
	jmp	.L12
.L8:
	cmpb	$46, %r10b
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$1, (%rsi,%rbp,4)
.L13:
	testl	%r13d, %r13d
	jns	.L14
	jmp	.L18
.L44:
	xorl	%r8d, %r8d
	jmp	.L21
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 16777216
d:
	.zero	16777216
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 16777216
u:
	.zero	16777216
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 16777216
r:
	.zero	16777216
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 16777216
l:
	.zero	16777216
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 4194304
S:
	.zero	4194304
	.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
	.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 H, W;
char S[2048][2048];

int l[2048][2048], r[2048][2048], u[2048][2048], d[2048][2048];

int main(void) {
	int i, j;
	int answer = 0;
	if (scanf("%d%d", &H, &W) != 2) return 1;
	for (i = 0; i < H; i++) {
		if (scanf("%2047s", S[i]) != 1) return 1;
	}
	for (i = 0; i < H; i++) {
		if (S[i][0] == '.') l[i][0] = 1;
		for (j = 1; j < W; j++) {
			l[i][j] = l[i][j - 1] + 1;
			if (S[i][j] == '#') l[i][j] = 0;
		}
		if (S[i][W - 1] == '.') r[i][W - 1] = 1;
		for (j = W - 2; j >= 0; j--) {
			r[i][j] = r[i][j + 1] + 1;
			if (S[i][j] == '#') r[i][j] = 0;
		}
	}
	for (j = 0; j < W; j++) {
		if (S[0][j] == '.') u[0][j] = 1;
		for (i = 1; i < H; i++) {
			u[i][j] = u[i - 1][j] + 1;
			if (S[i][j] == '#') u[i][j] = 0;
		}
		if (S[H - 1][j] == '.') d[H - 1][j] = 1;
		for (i = H - 2; i >= 0; i--) {
			d[i][j] = d[i + 1][j] + 1;
			if (S[i][j] == '#') d[i][j] = 0;
		}
	}
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			if (S[i][j] == '.') {
				int candidate = l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3;
				if (answer < candidate) answer = candidate;
			}
		}
	}
	printf("%d\n", answer);
	return 0;
}

3 6
#..#..
.....#
....#.
#.#...
 8 8
..#...#.
....#...
......
..###..#
...#..#-
....#.
...#...
.#..#
 4 8
#..#..
.....#
....#.
#.#...
 2 6
..#..
.....#
....#.
.#...
 1 8
..#...#.
....#...
......
..###..#
...#..#.
....#.
...#...
#..#.
 4 1
..#..
#.....
./..#.
.#...
 2 8
..#...#.
....#...
......
..###..#
...#..#.
....#.
...#...
#..#.
 8 8
/#....#.
...#....
......
..###..#
...#..#.
....#.
...#..-
#..#.
 1 6
#....
.....#
.$....
.#.,.
 1 1
.#...#..
.../#...
0.....
..###..#
.#/.#...
....#.
...#...
#..#.

7
 14
 8
 6
 3
 2
 5
 13
 4
 1

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 H, W;
char S[2048][2048];

int l[2048][2048], r[2048][2048], u[2048][2048], d[2048][2048];

int main(void) {
	int i, j;
	int answer = 0;
	if (scanf("%d%d", &H, &W) != 2) return 1;
	for (i = 0; i < H; i++) {
		if (scanf("%2047s", S[i]) != 1) return 1;
	}
	for (i = 0; i < H; i++) {
		if (S[i][0] == '.') l[i][0] = 1;
		for (j = 1; j < W; j++) {
			l[i][j] = l[i][j - 1] + 1;
			if (S[i][j] == '#') l[i][j] = 0;
		}
		if (S[i][W - 1] == '.') r[i][W - 1] = 1;
		for (j = W - 2; j >= 0; j--) {
			r[i][j] = r[i][j + 1] + 1;
			if (S[i][j] == '#') r[i][j] = 0;
		}
	}
	for (j = 0; j < W; j++) {
		if (S[0][j] == '.') u[0][j] = 1;
		for (i = 1; i < H; i++) {
			u[i][j] = u[i - 1][j] + 1;
			if (S[i][j] == '#') u[i][j] = 0;
		}
		if (S[H - 1][j] == '.') d[H - 1][j] = 1;
		for (i = H - 2; i >= 0; i--) {
			d[i][j] = d[i + 1][j] + 1;
			if (S[i][j] == '#') d[i][j] = 0;
		}
	}
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			if (S[i][j] == '.') {
				int candidate = l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3;
				if (answer < candidate) answer = candidate;
			}
		}
	}
	printf("%d\n", answer);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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	S
	.align 32
	.type	S, @object
	.size	S, 4194304
S:
	.zero	4194304
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 16777216
l:
	.zero	16777216
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 16777216
r:
	.zero	16777216
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 16777216
u:
	.zero	16777216
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 16777216
d:
	.zero	16777216
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%2047s"
.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
	movl	$0, -8(%rbp)
	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
	cmpl	$2, %eax
	je	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	$0, -16(%rbp)
	jmp	.L4
.L6:
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	movq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L5
	movl	$1, %eax
	jmp	.L3
.L5:
	addl	$1, -16(%rbp)
.L4:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L6
	movl	$0, -16(%rbp)
	jmp	.L7
.L16:
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	movq	%rax, %rdx
	leaq	S(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	$46, %al
	jne	.L8
	movl	-16(%rbp), %eax
	cltq
	salq	$13, %rax
	movq	%rax, %rdx
	leaq	l(%rip), %rax
	movl	$1, (%rdx,%rax)
.L8:
	movl	$1, -12(%rbp)
	jmp	.L9
.L11:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	$0, (%rdx,%rax)
.L10:
	addl	$1, -12(%rbp)
.L9:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	W(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L12
	movl	W(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$1, (%rdx,%rax)
.L12:
	movl	W(%rip), %eax
	subl	$2, %eax
	movl	%eax, -12(%rbp)
	jmp	.L13
.L15:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
.L14:
	subl	$1, -12(%rbp)
.L13:
	cmpl	$0, -12(%rbp)
	jns	.L15
	addl	$1, -16(%rbp)
.L7:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L16
	movl	$0, -12(%rbp)
	jmp	.L17
.L26:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L18
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	$1, (%rdx,%rax)
.L18:
	movl	$1, -16(%rbp)
	jmp	.L19
.L21:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	addl	$1, -16(%rbp)
.L19:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
	movl	H(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L22
	movl	H(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
.L22:
	movl	H(%rip), %eax
	subl	$2, %eax
	movl	%eax, -16(%rbp)
	jmp	.L23
.L25:
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L24
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
.L24:
	subl	$1, -16(%rbp)
.L23:
	cmpl	$0, -16(%rbp)
	jns	.L25
	addl	$1, -12(%rbp)
.L17:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	$0, -16(%rbp)
	jmp	.L27
.L31:
	movl	$0, -12(%rbp)
	jmp	.L28
.L30:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L29
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	subl	$3, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L29
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L29:
	addl	$1, -12(%rbp)
.L28:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L30
	addl	$1, -16(%rbp)
.L27:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L31
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	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	S
	.align 32
	.type	S, @object
	.size	S, 4194304
S:
	.zero	4194304
	.globl	l
	.align 32
	.type	l, @object
	.size	l, 16777216
l:
	.zero	16777216
	.globl	r
	.align 32
	.type	r, @object
	.size	r, 16777216
r:
	.zero	16777216
	.globl	u
	.align 32
	.type	u, @object
	.size	u, 16777216
u:
	.zero	16777216
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 16777216
d:
	.zero	16777216
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%2047s"
.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
	movl	$0, -8(%rbp)
	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
	cmpl	$2, %eax
	je	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	$0, -16(%rbp)
	jmp	.L4
.L6:
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	movq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L5
	movl	$1, %eax
	jmp	.L3
.L5:
	addl	$1, -16(%rbp)
.L4:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L6
	movl	$0, -16(%rbp)
	jmp	.L7
.L16:
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	movq	%rax, %rdx
	leaq	S(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	$46, %al
	jne	.L8
	movl	-16(%rbp), %eax
	cltq
	salq	$13, %rax
	movq	%rax, %rdx
	leaq	l(%rip), %rax
	movl	$1, (%rdx,%rax)
.L8:
	movl	$1, -12(%rbp)
	jmp	.L9
.L11:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	$0, (%rdx,%rax)
.L10:
	addl	$1, -12(%rbp)
.L9:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
	movl	W(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L12
	movl	W(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$1, (%rdx,%rax)
.L12:
	movl	W(%rip), %eax
	subl	$2, %eax
	movl	%eax, -12(%rbp)
	jmp	.L13
.L15:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	$0, (%rdx,%rax)
.L14:
	subl	$1, -12(%rbp)
.L13:
	cmpl	$0, -12(%rbp)
	jns	.L15
	addl	$1, -16(%rbp)
.L7:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L16
	movl	$0, -12(%rbp)
	jmp	.L17
.L26:
	movl	-12(%rbp), %eax
	cltq
	leaq	S(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$46, %al
	jne	.L18
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	$1, (%rdx,%rax)
.L18:
	movl	$1, -16(%rbp)
	jmp	.L19
.L21:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L20
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	addl	$1, -16(%rbp)
.L19:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L21
	movl	H(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L22
	movl	H(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
.L22:
	movl	H(%rip), %eax
	subl	$2, %eax
	movl	%eax, -16(%rbp)
	jmp	.L23
.L25:
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	salq	$11, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L24
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
.L24:
	subl	$1, -16(%rbp)
.L23:
	cmpl	$0, -16(%rbp)
	jns	.L25
	addl	$1, -12(%rbp)
.L17:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L26
	movl	$0, -16(%rbp)
	jmp	.L27
.L31:
	movl	$0, -12(%rbp)
	jmp	.L28
.L30:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rax, %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	jne	.L29
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	l(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	r(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	u(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$11, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	subl	$3, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L29
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L29:
	addl	$1, -12(%rbp)
.L28:
	movl	W(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L30
	addl	$1, -16(%rbp)
.L27:
	movl	H(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L31
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
