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 main(){
  int h,w,i,j,M=1e9+7,d[1010][1010]={1};
  char s[1010][1010]={};
  scanf("%d %d",&h,&w);
  for(i=0;i<h;i++)scanf("%s",s[i]);
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      if(s[i][j]-'.')d[i][j]=0;//printf("%d ",d[i][j]);
      d[i+1][j]=(d[i+1][j]+d[i][j])%M;
      d[i][j+1]=(d[i][j+1]+d[i][j])%M;
    }//printf("\n");
  }
  printf("%d\n",d[h-1][w-1]);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.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
	leaq	-5099520(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000007, -5100532(%rbp)
	leaq	-4080416(%rbp), %rax
	movl	$4080400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -4080416(%rbp)
	leaq	-5100528(%rbp), %rax
	movl	$1020100, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-5100544(%rbp), %rdx
	leaq	-5100548(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -5100540(%rbp)
	jmp	.L2
.L3:
	leaq	-5100528(%rbp), %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5100540(%rbp)
.L2:
	movl	-5100548(%rbp), %eax
	cmpl	%eax, -5100540(%rbp)
	jl	.L3
	movl	$0, -5100540(%rbp)
	jmp	.L4
.L8:
	movl	$0, -5100536(%rbp)
	jmp	.L5
.L7:
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$5100528, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L6
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movl	$0, -4080416(%rbp,%rax,4)
.L6:
	movl	-5100540(%rbp), %eax
	leal	1(%rax), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	-5100540(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	-5100532(%rbp)
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$1010, %rax, %rax
	addq	%rsi, %rax
	movl	%edx, -4080416(%rbp,%rax,4)
	movl	-5100536(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movl	-4080416(%rbp,%rax,4), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	-5100536(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	-5100532(%rbp)
	movslq	%ecx, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -4080416(%rbp,%rax,4)
	addl	$1, -5100536(%rbp)
.L5:
	movl	-5100544(%rbp), %eax
	cmpl	%eax, -5100536(%rbp)
	jl	.L7
	addl	$1, -5100540(%rbp)
.L4:
	movl	-5100548(%rbp), %eax
	cmpl	%eax, -5100540(%rbp)
	jl	.L8
	movl	-5100548(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-5100544(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	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
	leaq	-5099520(%rsp), %r11
	.cfi_def_cfa 11, 5099568
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1024, %rsp
	.cfi_def_cfa_offset 5100592
	movl	$4080400, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 5100536(%rsp)
	xorl	%eax, %eax
	leaq	1020128(%rsp), %rdi
	leaq	16(%rsp), %rbp
	call	memset@PLT
	movl	$1020100, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movl	$1, 1020128(%rsp)
	call	memset@PLT
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movq	%rbp, %rbx
	movq	%rbp, %r13
	leaq	.LC1(%rip), %r14
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	addq	$1010, %r13
	cmpl	%r12d, %r9d
	jg	.L3
	movl	12(%rsp), %r11d
	testl	%r9d, %r9d
	jle	.L19
	testl	%r11d, %r11d
	jle	.L19
	leal	1009(%r11), %eax
	leaq	1024168(%rsp), %r8
	leaq	1020132(%rsp,%rax,4), %rdi
	leal	-1(%r9), %eax
	movq	%rax, %r9
	imulq	$1010, %rax, %rax
	leaq	1010(%rbp,%rax), %r10
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	-4040(%r8), %rdx
	movq	%r8, %rcx
	movq	%rbx, %rsi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$0, (%rdx)
	xorl	%ebp, %ebp
.L8:
	addl	(%rcx), %ebp
	addq	$4, %rcx
	addq	$1, %rsi
	addq	$4, %rdx
	movslq	%ebp, %rax
	movl	%ebp, %r12d
	imulq	$1152921497, %rax, %rax
	sarl	$31, %r12d
	sarq	$60, %rax
	subl	%r12d, %eax
	imull	$1000000007, %eax, %eax
	subl	%eax, %ebp
	movl	%ebp, -4(%rcx)
	movl	-4(%rdx), %ebp
	addl	(%rdx), %ebp
	movslq	%ebp, %rax
	movl	%ebp, %r12d
	imulq	$1152921497, %rax, %rax
	sarl	$31, %r12d
	sarq	$60, %rax
	subl	%r12d, %eax
	imull	$1000000007, %eax, %eax
	subl	%eax, %ebp
	movl	%ebp, (%rdx)
	cmpq	%rdi, %rcx
	je	.L21
.L9:
	cmpb	$46, (%rsi)
	jne	.L7
	movl	(%rdx), %ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$1010, %rbx
	addq	$4040, %rdi
	addq	$4040, %r8
	cmpq	%r10, %rbx
	jne	.L6
.L4:
	movslq	%r9d, %rax
	leal	-1(%r11), %edx
	movl	$1, %edi
	imulq	$1010, %rax, %rax
	movslq	%edx, %rdx
	leaq	.LC2(%rip), %rsi
	addq	%rdx, %rax
	movl	1020128(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	5100536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$5100544, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	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
.L2:
	.cfi_restore_state
	movl	12(%rsp), %r11d
.L19:
	subl	$1, %r9d
	jmp	.L4
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	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
	leaq	-5099520(%rsp), %r11
	.cfi_def_cfa 11, 5099568
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1024, %rsp
	.cfi_def_cfa_offset 5100592
	movl	$4080400, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 5100536(%rsp)
	xorl	%eax, %eax
	leaq	1020128(%rsp), %rdi
	leaq	16(%rsp), %rbp
	call	memset@PLT
	movl	$1020100, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movl	$1, 1020128(%rsp)
	call	memset@PLT
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L2
	movq	%rbp, %rbx
	movq	%rbp, %r13
	leaq	.LC1(%rip), %r14
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	addq	$1010, %r13
	cmpl	%r12d, %r9d
	jg	.L3
	movl	12(%rsp), %r11d
	testl	%r9d, %r9d
	jle	.L19
	testl	%r11d, %r11d
	jle	.L19
	leal	1009(%r11), %eax
	leaq	1024168(%rsp), %r8
	leaq	1020132(%rsp,%rax,4), %rdi
	leal	-1(%r9), %eax
	movq	%rax, %r9
	imulq	$1010, %rax, %rax
	leaq	1010(%rbp,%rax), %r10
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	-4040(%r8), %rdx
	movq	%r8, %rcx
	movq	%rbx, %rsi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$0, (%rdx)
	xorl	%ebp, %ebp
.L8:
	addl	(%rcx), %ebp
	addq	$4, %rcx
	addq	$1, %rsi
	addq	$4, %rdx
	movslq	%ebp, %rax
	movl	%ebp, %r12d
	imulq	$1152921497, %rax, %rax
	sarl	$31, %r12d
	sarq	$60, %rax
	subl	%r12d, %eax
	imull	$1000000007, %eax, %eax
	subl	%eax, %ebp
	movl	%ebp, -4(%rcx)
	movl	-4(%rdx), %ebp
	addl	(%rdx), %ebp
	movslq	%ebp, %rax
	movl	%ebp, %r12d
	imulq	$1152921497, %rax, %rax
	sarl	$31, %r12d
	sarq	$60, %rax
	subl	%r12d, %eax
	imull	$1000000007, %eax, %eax
	subl	%eax, %ebp
	movl	%ebp, (%rdx)
	cmpq	%rdi, %rcx
	je	.L21
.L9:
	cmpb	$46, (%rsi)
	jne	.L7
	movl	(%rdx), %ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$1010, %rbx
	addq	$4040, %rdi
	addq	$4040, %r8
	cmpq	%r10, %rbx
	jne	.L6
.L4:
	movslq	%r9d, %rax
	leal	-1(%r11), %edx
	movl	$1, %edi
	imulq	$1010, %rax, %rax
	movslq	%edx, %rdx
	leaq	.LC2(%rip), %rsi
	addq	%rdx, %rax
	movl	1020128(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	5100536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$5100544, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	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
.L2:
	.cfi_restore_state
	movl	12(%rsp), %r11d
.L19:
	subl	$1, %r9d
	jmp	.L4
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>
int main(){
  int h,w,i,j,M=1e9+7,d[1010][1010]={1};
  char s[1010][1010]={};
  scanf("%d %d",&h,&w);
  for(i=0;i<h;i++)scanf("%s",s[i]);
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      if(s[i][j]-'.')d[i][j]=0;//printf("%d ",d[i][j]);
      d[i+1][j]=(d[i+1][j]+d[i][j])%M;
      d[i][j+1]=(d[i][j+1]+d[i][j])%M;
    }//printf("\n");
  }
  printf("%d\n",d[h-1][w-1]);
  return 0;
}

5 3
..
.
..
.#
..
 3 4
...#
..#.
....
 5 3
..
.
..
#.
..
 3 4
...#
#...
....
 3 0
...#
#...
....
 5 9
..#..
.....
...#
.....
..#..
 5 2
..
.
..
#.
..
 3 7
...#
.#..
....
 6 4
...#
#...
....
 4 7
...#
.#..
....

0
 3
 0
 5
 0
 0
 1
 0
 0
 0

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 main(){
  int h,w,i,j,M=1e9+7,d[1010][1010]={1};
  char s[1010][1010]={};
  scanf("%d %d",&h,&w);
  for(i=0;i<h;i++)scanf("%s",s[i]);
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      if(s[i][j]-'.')d[i][j]=0;//printf("%d ",d[i][j]);
      d[i+1][j]=(d[i+1][j]+d[i][j])%M;
      d[i][j+1]=(d[i][j+1]+d[i][j])%M;
    }//printf("\n");
  }
  printf("%d\n",d[h-1][w-1]);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.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
	leaq	-5099520(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000007, -5100532(%rbp)
	leaq	-4080416(%rbp), %rax
	movl	$4080400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -4080416(%rbp)
	leaq	-5100528(%rbp), %rax
	movl	$1020100, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-5100544(%rbp), %rdx
	leaq	-5100548(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -5100540(%rbp)
	jmp	.L2
.L3:
	leaq	-5100528(%rbp), %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5100540(%rbp)
.L2:
	movl	-5100548(%rbp), %eax
	cmpl	%eax, -5100540(%rbp)
	jl	.L3
	movl	$0, -5100540(%rbp)
	jmp	.L4
.L8:
	movl	$0, -5100536(%rbp)
	jmp	.L5
.L7:
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$5100528, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L6
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movl	$0, -4080416(%rbp,%rax,4)
.L6:
	movl	-5100540(%rbp), %eax
	leal	1(%rax), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	-5100540(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	-5100532(%rbp)
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$1010, %rax, %rax
	addq	%rsi, %rax
	movl	%edx, -4080416(%rbp,%rax,4)
	movl	-5100536(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movl	-4080416(%rbp,%rax,4), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	-5100536(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	-5100532(%rbp)
	movslq	%ecx, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -4080416(%rbp,%rax,4)
	addl	$1, -5100536(%rbp)
.L5:
	movl	-5100544(%rbp), %eax
	cmpl	%eax, -5100536(%rbp)
	jl	.L7
	addl	$1, -5100540(%rbp)
.L4:
	movl	-5100548(%rbp), %eax
	cmpl	%eax, -5100540(%rbp)
	jl	.L8
	movl	-5100548(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-5100544(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.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
	leaq	-5099520(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1040, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000007, -5100532(%rbp)
	leaq	-4080416(%rbp), %rax
	movl	$4080400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -4080416(%rbp)
	leaq	-5100528(%rbp), %rax
	movl	$1020100, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-5100544(%rbp), %rdx
	leaq	-5100548(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -5100540(%rbp)
	jmp	.L2
.L3:
	leaq	-5100528(%rbp), %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5100540(%rbp)
.L2:
	movl	-5100548(%rbp), %eax
	cmpl	%eax, -5100540(%rbp)
	jl	.L3
	movl	$0, -5100540(%rbp)
	jmp	.L4
.L8:
	movl	$0, -5100536(%rbp)
	jmp	.L5
.L7:
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rbp, %rax
	addq	%rdx, %rax
	subq	$5100528, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L6
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movl	$0, -4080416(%rbp,%rax,4)
.L6:
	movl	-5100540(%rbp), %eax
	leal	1(%rax), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	-5100540(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	-5100532(%rbp)
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$1010, %rax, %rax
	addq	%rsi, %rax
	movl	%edx, -4080416(%rbp,%rax,4)
	movl	-5100536(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rdx, %rax
	movl	-4080416(%rbp,%rax,4), %edx
	movl	-5100536(%rbp), %eax
	movslq	%eax, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	-5100536(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	-5100532(%rbp)
	movslq	%ecx, %rcx
	movl	-5100540(%rbp), %eax
	cltq
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -4080416(%rbp,%rax,4)
	addl	$1, -5100536(%rbp)
.L5:
	movl	-5100544(%rbp), %eax
	cmpl	%eax, -5100536(%rbp)
	jl	.L7
	addl	$1, -5100540(%rbp)
.L4:
	movl	-5100548(%rbp), %eax
	cmpl	%eax, -5100540(%rbp)
	jl	.L8
	movl	-5100548(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-5100544(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1010, %rax, %rax
	addq	%rcx, %rax
	movl	-4080416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
