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

```c
/*
  AOJ 0610
  Title:Weather Forecaster
  @kankichi573
*/
#include <stdio.h>

int H,W;
char result[100][101];
char tenki[101];

main()
{
  int i,j,flag;
  char weather;
  

  scanf("%d %d",&H,&W);
  for(i=0;i<H;i++)
    {
      scanf("%s",tenki);
      for(j=0,flag=-1;j<=W;j++)
	{
	  weather=tenki[j];
	  if(weather=='.')
	    {
	      if(flag>=0)
		flag++;
	    }
	  else if (weather=='c')
	    flag=0;
	  result[i][j]=flag;
	}
    }
  for(i=0;i<H;i++)
    {
      for(j=0;j<W;j++)
	{
	  printf("%d",result[i][j]);
	  if(j<W-1)
	    printf(" ");
	  else
	    printf("\n");
	}
    }
  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	result
	.align 32
	.type	result, @object
	.size	result, 10100
result:
	.zero	10100
	.globl	tenki
	.align 32
	.type	tenki, @object
	.size	tenki, 101
tenki:
	.zero	101
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d"
	.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
	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, -12(%rbp)
	jmp	.L2
.L7:
	leaq	tenki(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8(%rbp)
	movl	$-1, -4(%rbp)
	jmp	.L3
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	tenki(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -13(%rbp)
	cmpb	$46, -13(%rbp)
	jne	.L4
	cmpl	$0, -4(%rbp)
	js	.L5
	addl	$1, -4(%rbp)
	jmp	.L5
.L4:
	cmpb	$99, -13(%rbp)
	jne	.L5
	movl	$0, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	result(%rip), %rax
	addq	%rdx, %rax
	movb	%cl, (%rax)
	addl	$1, -8(%rbp)
.L3:
	movl	W(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L6
	addl	$1, -12(%rbp)
.L2:
	movl	H(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, -12(%rbp)
	jmp	.L8
.L13:
	movl	$0, -8(%rbp)
	jmp	.L9
.L12:
	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	result(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	W(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jge	.L10
	movl	$32, %edi
	call	putchar@PLT
	jmp	.L11
.L10:
	movl	$10, %edi
	call	putchar@PLT
.L11:
	addl	$1, -8(%rbp)
.L9:
	movl	W(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L8:
	movl	H(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, %eax
	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	"%s"
.LC2:
	.string	"%d"
	.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
	leaq	W(%rip), %rdx
	leaq	H(%rip), %rsi
	xorl	%eax, %eax
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	H(%rip), %eax
	testl	%eax, %eax
	jle	.L21
	leaq	result(%rip), %rbp
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	movq	%rbp, %r12
	leaq	tenki(%rip), %r13
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$-1, %edx
	xorl	%r8d, %r8d
	movslq	W(%rip), %rdi
	movq	%rdi, %rsi
	testl	%edi, %edi
	jns	.L8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$99, %cl
	movl	%r8d, %ecx
	cmovne	%edx, %ecx
	cmove	%r14d, %edx
.L7:
	movb	%cl, (%r12,%rax)
	leaq	1(%rax), %rcx
	cmpq	%rax, %rdi
	je	.L9
.L18:
	movq	%rcx, %rax
.L8:
	movzbl	0(%r13,%rax), %ecx
	cmpb	$46, %cl
	jne	.L6
	movl	$-1, %ecx
	cmpl	$-1, %edx
	je	.L7
	addl	$1, %edx
	movl	%edx, %ecx
	movb	%cl, (%r12,%rax)
	leaq	1(%rax), %rcx
	cmpq	%rax, %rdi
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L9:
	movl	H(%rip), %eax
	addl	$1, %r15d
	addq	$101, %r12
	cmpl	%r15d, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L21
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %r12
	testl	%esi, %esi
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L14:
	movsbl	0(%rbp,%rbx), %edx
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	W(%rip), %eax
	movl	$32, %edi
	subl	$1, %eax
	cmpl	%ebx, %eax
	jg	.L27
	movl	$10, %edi
.L27:
	call	putchar@PLT
	movl	W(%rip), %esi
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L14
	addl	$1, %r13d
	cmpl	%r13d, H(%rip)
	jle	.L21
	addq	$101, %rbp
	testl	%esi, %esi
	jg	.L20
.L21:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	tenki
	.bss
	.align 32
	.type	tenki, @object
	.size	tenki, 101
tenki:
	.zero	101
	.globl	result
	.align 32
	.type	result, @object
	.size	result, 10100
result:
	.zero	10100
	.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	"%s"
.LC2:
	.string	"%d"
	.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
	leaq	W(%rip), %rdx
	leaq	H(%rip), %rsi
	xorl	%eax, %eax
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movl	H(%rip), %eax
	testl	%eax, %eax
	jle	.L21
	leaq	result(%rip), %rbp
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	movq	%rbp, %r12
	leaq	tenki(%rip), %r13
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movl	$-1, %edx
	xorl	%r8d, %r8d
	movslq	W(%rip), %rdi
	movq	%rdi, %rsi
	testl	%edi, %edi
	jns	.L8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$99, %cl
	movl	%r8d, %ecx
	cmovne	%edx, %ecx
	cmove	%r14d, %edx
.L7:
	movb	%cl, (%r12,%rax)
	leaq	1(%rax), %rcx
	cmpq	%rax, %rdi
	je	.L9
.L18:
	movq	%rcx, %rax
.L8:
	movzbl	0(%r13,%rax), %ecx
	cmpb	$46, %cl
	jne	.L6
	movl	$-1, %ecx
	cmpl	$-1, %edx
	je	.L7
	addl	$1, %edx
	movl	%edx, %ecx
	movb	%cl, (%r12,%rax)
	leaq	1(%rax), %rcx
	cmpq	%rax, %rdi
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L9:
	movl	H(%rip), %eax
	addl	$1, %r15d
	addq	$101, %r12
	cmpl	%r15d, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L21
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %r12
	testl	%esi, %esi
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L14:
	movsbl	0(%rbp,%rbx), %edx
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	W(%rip), %eax
	movl	$32, %edi
	subl	$1, %eax
	cmpl	%ebx, %eax
	jg	.L27
	movl	$10, %edi
.L27:
	call	putchar@PLT
	movl	W(%rip), %esi
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L14
	addl	$1, %r13d
	cmpl	%r13d, H(%rip)
	jle	.L21
	addq	$101, %rbp
	testl	%esi, %esi
	jg	.L20
.L21:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	tenki
	.bss
	.align 32
	.type	tenki, @object
	.size	tenki, 101
tenki:
	.zero	101
	.globl	result
	.align 32
	.type	result, @object
	.size	result, 10100
result:
	.zero	10100
	.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:

/*
  AOJ 0610
  Title:Weather Forecaster
  @kankichi573
*/
#include <stdio.h>

int H,W;
char result[100][101];
char tenki[101];

main()
{
  int i,j,flag;
  char weather;
  

  scanf("%d %d",&H,&W);
  for(i=0;i<H;i++)
    {
      scanf("%s",tenki);
      for(j=0,flag=-1;j<=W;j++)
	{
	  weather=tenki[j];
	  if(weather=='.')
	    {
	      if(flag>=0)
		flag++;
	    }
	  else if (weather=='c')
	    flag=0;
	  result[i][j]=flag;
	}
    }
  for(i=0;i<H;i++)
    {
      for(j=0;j<W;j++)
	{
	  printf("%d",result[i][j]);
	  if(j<W-1)
	    printf(" ");
	  else
	    printf("\n");
	}
    }
  return(0);
}
3 4
c..c
..c.
....

0 1 2 0
-1 -1 0 1
-1 -1 -1 -1

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

```c
/*
  AOJ 0610
  Title:Weather Forecaster
  @kankichi573
*/
#include <stdio.h>

int H,W;
char result[100][101];
char tenki[101];

main()
{
  int i,j,flag;
  char weather;
  

  scanf("%d %d",&H,&W);
  for(i=0;i<H;i++)
    {
      scanf("%s",tenki);
      for(j=0,flag=-1;j<=W;j++)
	{
	  weather=tenki[j];
	  if(weather=='.')
	    {
	      if(flag>=0)
		flag++;
	    }
	  else if (weather=='c')
	    flag=0;
	  result[i][j]=flag;
	}
    }
  for(i=0;i<H;i++)
    {
      for(j=0;j<W;j++)
	{
	  printf("%d",result[i][j]);
	  if(j<W-1)
	    printf(" ");
	  else
	    printf("\n");
	}
    }
  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	result
	.align 32
	.type	result, @object
	.size	result, 10100
result:
	.zero	10100
	.globl	tenki
	.align 32
	.type	tenki, @object
	.size	tenki, 101
tenki:
	.zero	101
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d"
	.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
	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, -12(%rbp)
	jmp	.L2
.L7:
	leaq	tenki(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8(%rbp)
	movl	$-1, -4(%rbp)
	jmp	.L3
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	tenki(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -13(%rbp)
	cmpb	$46, -13(%rbp)
	jne	.L4
	cmpl	$0, -4(%rbp)
	js	.L5
	addl	$1, -4(%rbp)
	jmp	.L5
.L4:
	cmpb	$99, -13(%rbp)
	jne	.L5
	movl	$0, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	result(%rip), %rax
	addq	%rdx, %rax
	movb	%cl, (%rax)
	addl	$1, -8(%rbp)
.L3:
	movl	W(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L6
	addl	$1, -12(%rbp)
.L2:
	movl	H(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, -12(%rbp)
	jmp	.L8
.L13:
	movl	$0, -8(%rbp)
	jmp	.L9
.L12:
	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	result(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	W(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jge	.L10
	movl	$32, %edi
	call	putchar@PLT
	jmp	.L11
.L10:
	movl	$10, %edi
	call	putchar@PLT
.L11:
	addl	$1, -8(%rbp)
.L9:
	movl	W(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L8:
	movl	H(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, %eax
	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	result
	.align 32
	.type	result, @object
	.size	result, 10100
result:
	.zero	10100
	.globl	tenki
	.align 32
	.type	tenki, @object
	.size	tenki, 101
tenki:
	.zero	101
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d"
	.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
	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, -12(%rbp)
	jmp	.L2
.L7:
	leaq	tenki(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8(%rbp)
	movl	$-1, -4(%rbp)
	jmp	.L3
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	tenki(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -13(%rbp)
	cmpb	$46, -13(%rbp)
	jne	.L4
	cmpl	$0, -4(%rbp)
	js	.L5
	addl	$1, -4(%rbp)
	jmp	.L5
.L4:
	cmpb	$99, -13(%rbp)
	jne	.L5
	movl	$0, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	result(%rip), %rax
	addq	%rdx, %rax
	movb	%cl, (%rax)
	addl	$1, -8(%rbp)
.L3:
	movl	W(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L6
	addl	$1, -12(%rbp)
.L2:
	movl	H(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, -12(%rbp)
	jmp	.L8
.L13:
	movl	$0, -8(%rbp)
	jmp	.L9
.L12:
	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	result(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	W(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jge	.L10
	movl	$32, %edi
	call	putchar@PLT
	jmp	.L11
.L10:
	movl	$10, %edi
	call	putchar@PLT
.L11:
	addl	$1, -8(%rbp)
.L9:
	movl	W(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L8:
	movl	H(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, %eax
	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:
