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

```c
#include<stdio.h>
#include<string.h>
int W,H,i,j;
char dp[71][71][71],g[2],tmp[71],res[71];

void ch(char x[],char y[])
{
	int s,t;
	while(x[0]=='0')
		memmove(x,x+1,strlen(x));
	while(y[0]=='0')
		memmove(y,y+1,strlen(y));
	s=strlen(x),t=strlen(y);
	if(s<t||(s==t&&strcmp(x,y)<0))
		strcpy(x,y);
}
int main()
{
	for(;scanf("%d%d\n",&W,&H),W;)
	{
		memset(dp,0,sizeof(dp));
		memset(res,0,sizeof(res));
		for(i=0;i<H;i++,getchar())
			for(j=0;j<W;j++)
			{
				tmp[0]=0;
				g[0]=getchar();
				if(g[0]<58)
				{
					if(i>0)
						ch(tmp,dp[i-1][j]);
					if(j>0)
						ch(tmp,dp[i][j-1]);
					sprintf(dp[i][j],"%s",strcat(tmp,g));
				}
				ch(res,dp[i][j]);
			}
		puts(res);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	W
	.bss
	.align 4
	.type	W, @object
	.size	W, 4
W:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 357911
dp:
	.zero	357911
	.globl	g
	.type	g, @object
	.size	g, 2
g:
	.zero	2
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 71
tmp:
	.zero	71
	.globl	res
	.align 32
	.type	res, @object
	.size	res, 71
res:
	.zero	71
	.text
	.globl	ch
	.type	ch, @function
ch:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memmove@PLT
.L2:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L3
	jmp	.L4
.L5:
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memmove@PLT
.L4:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L5
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L6
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L8
.L6:
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ch, .-ch
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L10
.L18:
	movl	$357911, %edx
	movl	$0, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$71, %edx
	movl	$0, %esi
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, i(%rip)
	jmp	.L11
.L17:
	movl	$0, j(%rip)
	jmp	.L12
.L16:
	movb	$0, tmp(%rip)
	call	getchar@PLT
	movb	%al, g(%rip)
	movzbl	g(%rip), %eax
	cmpb	$57, %al
	jg	.L13
	movl	i(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	movl	i(%rip), %eax
	leal	-1(%rax), %ecx
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	ch
.L14:
	movl	j(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	movl	i(%rip), %ecx
	movl	j(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	ch
.L15:
	leaq	g(%rip), %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	strcat@PLT
	movq	%rax, %rcx
	movl	i(%rip), %esi
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%esi, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rcx, %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
.L13:
	movl	i(%rip), %ecx
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	ch
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L12:
	movl	j(%rip), %edx
	movl	W(%rip), %eax
	cmpl	%eax, %edx
	jl	.L16
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	call	getchar@PLT
.L11:
	movl	i(%rip), %edx
	movl	H(%rip), %eax
	cmpl	%eax, %edx
	jl	.L17
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	leaq	H(%rip), %rax
	movq	%rax, %rdx
	leaq	W(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	W(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %eax
	popq	%rbp
	.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
	.type	ch.constprop.1, @function
ch.constprop.1:
.LFB37:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	tmp(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	1(%r12), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpb	$48, tmp(%rip)
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rdi
	call	strlen@PLT
	movl	$71, %ecx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	call	__memmove_chk@PLT
	cmpb	$48, (%r12)
	je	.L2
.L5:
	cmpb	$48, 0(%rbp)
	leaq	1(%rbp), %rbx
	jne	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, 0(%rbp)
	je	.L8
.L4:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	movq	%rax, %rbx
	cmpl	%eax, %r13d
	jl	.L6
	je	.L19
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L1
.L6:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	leaq	1(%rbx), %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$71, %ecx
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__memcpy_chk@PLT
	.cfi_endproc
.LFE37:
	.size	ch.constprop.1, .-ch.constprop.1
	.p2align 4
	.globl	ch
	.type	ch, @function
ch:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	1(%rdi), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpb	$48, (%rdi)
	jne	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, 0(%rbp)
	je	.L24
.L25:
	cmpb	$48, (%r12)
	leaq	1(%r12), %rbx
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, (%r12)
	je	.L28
.L23:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%r12, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	movq	%rax, %rbx
	cmpl	%eax, %r13d
	jl	.L26
	je	.L37
.L20:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L20
.L26:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	leaq	1(%rbx), %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	memcpy@PLT
	.cfi_endproc
.LFE35:
	.size	ch, .-ch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	res(%rip), %r12
	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
.L39:
	leaq	H(%rip), %rdx
	leaq	W(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	W(%rip), %ebx
	testl	%ebx, %ebx
	je	.L64
	movl	$357911, %edx
	leaq	dp(%rip), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	xorl	%eax, %eax
	movl	$8, %ecx
	movq	%r12, %rdi
	rep stosq
	movl	H(%rip), %edx
	xorl	%eax, %eax
	movl	$0, i(%rip)
	movl	$0, (%rdi)
	movw	%ax, 68+res(%rip)
	movb	$0, 70+res(%rip)
	testl	%edx, %edx
	jle	.L40
	xorl	%r15d, %r15d
	leaq	1+res(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$0, j(%rip)
	testl	%ebx, %ebx
	jle	.L41
	.p2align 4,,10
	.p2align 3
.L53:
	movq	stdin(%rip), %rdi
	movb	$0, tmp(%rip)
	call	getc@PLT
	leaq	g(%rip), %rcx
	movb	%al, (%rcx)
	cmpb	$57, %al
	jg	.L42
	movslq	i(%rip), %rbx
	testl	%ebx, %ebx
	jle	.L43
	leal	-1(%rbx), %eax
	movslq	j(%rip), %rdx
	leaq	tmp(%rip), %rdi
	cltq
	imulq	$5041, %rax, %rax
	leaq	(%rdx,%rdx,8), %rcx
	leaq	(%rax,%rcx,8), %rsi
	leaq	dp(%rip), %rax
	subq	%rdx, %rsi
	addq	%rax, %rsi
	call	ch.constprop.1
.L43:
	movl	j(%rip), %ebp
	imulq	$5041, %rbx, %rbx
	testl	%ebp, %ebp
	jle	.L44
	leal	-1(%rbp), %eax
	leaq	tmp(%rip), %rdi
	cltq
	leaq	(%rax,%rax,8), %rdx
	leaq	(%rbx,%rdx,8), %rsi
	subq	%rax, %rsi
	leaq	dp(%rip), %rax
	addq	%rax, %rsi
	call	ch.constprop.1
.L44:
	movl	$71, %edx
	leaq	g(%rip), %rsi
	leaq	tmp(%rip), %rdi
	call	__strcat_chk@PLT
	movslq	%ebp, %rdx
	movq	%rax, %rsi
	leaq	(%rdx,%rdx,8), %rax
	leaq	(%rbx,%rax,8), %rdi
	leaq	dp(%rip), %rax
	subq	%rdx, %rdi
	addq	%rax, %rdi
	call	strcpy@PLT
.L42:
	movslq	j(%rip), %rax
	movl	i(%rip), %r15d
	leaq	(%rax,%rax,8), %rbp
	movq	%rax, %r14
	salq	$3, %rbp
	subq	%rax, %rbp
	movslq	%r15d, %rax
	imulq	$5041, %rax, %rax
	addq	%rax, %rbp
	leaq	dp(%rip), %rax
	addq	%rax, %rbp
	cmpb	$48, (%r12)
	jne	.L48
	.p2align 4,,10
	.p2align 3
.L45:
	movq	%r12, %rdi
	call	strlen@PLT
	movl	$71, %ecx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	call	__memmove_chk@PLT
	cmpb	$48, (%r12)
	je	.L45
.L48:
	cmpb	$48, 0(%rbp)
	leaq	1(%rbp), %rbx
	jne	.L47
	.p2align 4,,10
	.p2align 3
.L51:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, 0(%rbp)
	je	.L51
.L47:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	movq	%rax, %rdx
	cmpl	%eax, %ebx
	jl	.L49
	je	.L65
.L52:
	addl	$1, %r14d
	cmpl	W(%rip), %r14d
	movl	%r14d, j(%rip)
	jl	.L53
.L41:
	movq	stdin(%rip), %rdi
	addl	$1, %r15d
	movl	%r15d, i(%rip)
	call	getc@PLT
	movl	i(%rip), %r15d
	cmpl	H(%rip), %r15d
	jge	.L40
	movl	W(%rip), %ebx
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L65:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movq	%rax, 8(%rsp)
	call	strcmp@PLT
	movq	8(%rsp), %rdx
	testl	%eax, %eax
	jns	.L52
.L49:
	addq	$1, %rdx
	movl	$71, %ecx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__memcpy_chk@PLT
	jmp	.L52
.L40:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L39
.L64:
	addq	$24, %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
.LFE36:
	.size	main, .-main
	.globl	res
	.bss
	.align 32
	.type	res, @object
	.size	res, 71
res:
	.zero	71
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 71
tmp:
	.zero	71
	.globl	g
	.type	g, @object
	.size	g, 2
g:
	.zero	2
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 357911
dp:
	.zero	357911
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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
	.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
	.type	ch.constprop.1, @function
ch.constprop.1:
.LFB37:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	tmp(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	1(%r12), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpb	$48, tmp(%rip)
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rdi
	call	strlen@PLT
	movl	$71, %ecx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	call	__memmove_chk@PLT
	cmpb	$48, (%r12)
	je	.L2
.L5:
	cmpb	$48, 0(%rbp)
	leaq	1(%rbp), %rbx
	jne	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, 0(%rbp)
	je	.L8
.L4:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	movq	%rax, %rbx
	cmpl	%eax, %r13d
	jl	.L6
	je	.L19
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L1
.L6:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	leaq	1(%rbx), %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$71, %ecx
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__memcpy_chk@PLT
	.cfi_endproc
.LFE37:
	.size	ch.constprop.1, .-ch.constprop.1
	.p2align 4
	.globl	ch
	.type	ch, @function
ch:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	1(%rdi), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpb	$48, (%rdi)
	jne	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, 0(%rbp)
	je	.L24
.L25:
	cmpb	$48, (%r12)
	leaq	1(%r12), %rbx
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, (%r12)
	je	.L28
.L23:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%r12, %rdi
	movq	%rax, %r13
	call	strlen@PLT
	movq	%rax, %rbx
	cmpl	%eax, %r13d
	jl	.L26
	je	.L37
.L20:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L20
.L26:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	leaq	1(%rbx), %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	memcpy@PLT
	.cfi_endproc
.LFE35:
	.size	ch, .-ch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	res(%rip), %r12
	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
.L39:
	leaq	H(%rip), %rdx
	leaq	W(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	W(%rip), %ebx
	testl	%ebx, %ebx
	je	.L64
	movl	$357911, %edx
	leaq	dp(%rip), %rdi
	xorl	%esi, %esi
	call	memset@PLT
	xorl	%eax, %eax
	movl	$8, %ecx
	movq	%r12, %rdi
	rep stosq
	movl	H(%rip), %edx
	xorl	%eax, %eax
	movl	$0, i(%rip)
	movl	$0, (%rdi)
	movw	%ax, 68+res(%rip)
	movb	$0, 70+res(%rip)
	testl	%edx, %edx
	jle	.L40
	xorl	%r15d, %r15d
	leaq	1+res(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$0, j(%rip)
	testl	%ebx, %ebx
	jle	.L41
	.p2align 4,,10
	.p2align 3
.L53:
	movq	stdin(%rip), %rdi
	movb	$0, tmp(%rip)
	call	getc@PLT
	leaq	g(%rip), %rcx
	movb	%al, (%rcx)
	cmpb	$57, %al
	jg	.L42
	movslq	i(%rip), %rbx
	testl	%ebx, %ebx
	jle	.L43
	leal	-1(%rbx), %eax
	movslq	j(%rip), %rdx
	leaq	tmp(%rip), %rdi
	cltq
	imulq	$5041, %rax, %rax
	leaq	(%rdx,%rdx,8), %rcx
	leaq	(%rax,%rcx,8), %rsi
	leaq	dp(%rip), %rax
	subq	%rdx, %rsi
	addq	%rax, %rsi
	call	ch.constprop.1
.L43:
	movl	j(%rip), %ebp
	imulq	$5041, %rbx, %rbx
	testl	%ebp, %ebp
	jle	.L44
	leal	-1(%rbp), %eax
	leaq	tmp(%rip), %rdi
	cltq
	leaq	(%rax,%rax,8), %rdx
	leaq	(%rbx,%rdx,8), %rsi
	subq	%rax, %rsi
	leaq	dp(%rip), %rax
	addq	%rax, %rsi
	call	ch.constprop.1
.L44:
	movl	$71, %edx
	leaq	g(%rip), %rsi
	leaq	tmp(%rip), %rdi
	call	__strcat_chk@PLT
	movslq	%ebp, %rdx
	movq	%rax, %rsi
	leaq	(%rdx,%rdx,8), %rax
	leaq	(%rbx,%rax,8), %rdi
	leaq	dp(%rip), %rax
	subq	%rdx, %rdi
	addq	%rax, %rdi
	call	strcpy@PLT
.L42:
	movslq	j(%rip), %rax
	movl	i(%rip), %r15d
	leaq	(%rax,%rax,8), %rbp
	movq	%rax, %r14
	salq	$3, %rbp
	subq	%rax, %rbp
	movslq	%r15d, %rax
	imulq	$5041, %rax, %rax
	addq	%rax, %rbp
	leaq	dp(%rip), %rax
	addq	%rax, %rbp
	cmpb	$48, (%r12)
	jne	.L48
	.p2align 4,,10
	.p2align 3
.L45:
	movq	%r12, %rdi
	call	strlen@PLT
	movl	$71, %ecx
	movq	%r13, %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	call	__memmove_chk@PLT
	cmpb	$48, (%r12)
	je	.L45
.L48:
	cmpb	$48, 0(%rbp)
	leaq	1(%rbp), %rbx
	jne	.L47
	.p2align 4,,10
	.p2align 3
.L51:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	%rax, %rdx
	call	memmove@PLT
	cmpb	$48, 0(%rbp)
	je	.L51
.L47:
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	movq	%rax, %rdx
	cmpl	%eax, %ebx
	jl	.L49
	je	.L65
.L52:
	addl	$1, %r14d
	cmpl	W(%rip), %r14d
	movl	%r14d, j(%rip)
	jl	.L53
.L41:
	movq	stdin(%rip), %rdi
	addl	$1, %r15d
	movl	%r15d, i(%rip)
	call	getc@PLT
	movl	i(%rip), %r15d
	cmpl	H(%rip), %r15d
	jge	.L40
	movl	W(%rip), %ebx
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L65:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movq	%rax, 8(%rsp)
	call	strcmp@PLT
	movq	8(%rsp), %rdx
	testl	%eax, %eax
	jns	.L52
.L49:
	addq	$1, %rdx
	movl	$71, %ecx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__memcpy_chk@PLT
	jmp	.L52
.L40:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L39
.L64:
	addq	$24, %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
.LFE36:
	.size	main, .-main
	.globl	res
	.bss
	.align 32
	.type	res, @object
	.size	res, 71
res:
	.zero	71
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 71
tmp:
	.zero	71
	.globl	g
	.type	g, @object
	.size	g, 2
g:
	.zero	2
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 357911
dp:
	.zero	357911
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<string.h>
int W,H,i,j;
char dp[71][71][71],g[2],tmp[71],res[71];

void ch(char x[],char y[])
{
	int s,t;
	while(x[0]=='0')
		memmove(x,x+1,strlen(x));
	while(y[0]=='0')
		memmove(y,y+1,strlen(y));
	s=strlen(x),t=strlen(y);
	if(s<t||(s==t&&strcmp(x,y)<0))
		strcpy(x,y);
}
int main()
{
	for(;scanf("%d%d\n",&W,&H),W;)
	{
		memset(dp,0,sizeof(dp));
		memset(res,0,sizeof(res));
		for(i=0;i<H;i++,getchar())
			for(j=0;j<W;j++)
			{
				tmp[0]=0;
				g[0]=getchar();
				if(g[0]<58)
				{
					if(i>0)
						ch(tmp,dp[i-1][j]);
					if(j>0)
						ch(tmp,dp[i][j-1]);
					sprintf(dp[i][j],"%s",strcat(tmp,g));
				}
				ch(res,dp[i][j]);
			}
		puts(res);
	}
	return 0;
}
7 4
9R2A993
0E314A0
8A900DE
820R037
6 7
JH03HE
ID7722
0DA1AH
30C9G5
99971A
CA7EAI
AHLBEM
20 2
HGEDBC4321987654321A
BDEDF908034265091499
0 0
 7 4
9R2A993
0E314A0
8A900DE
820R037
6 7
JI03HE
ID7722
0DA1AH
30C9G5
99971A
CA7EAI
AHLBEM
20 2
A1234567891234CBDEGH
BDEDF908034265091499
0 0
 7 4
9R2A993
0E314A0
8A900EE
820R037
6 7
JH03HE
ID7722
0DA1AH
30C9G5
99971A
CA7EAI
AHLBEM
20 2
HGEDBC4321987654321A
994190562430809FDEDB
0 0
 7 4
9R2A993
0E314A0
8A900DE
820R037
6 7
JI03HE
ID7722
0DA1AH
30C9G5
99179A
CA7EAI
AHLBEM
20 2
A1234567891234CBDEGH
BDEDF908034265091499
0 0
 7 4
9R2A993
0E314A0
8A900EE
820R037
6 7
JH03HE
ID7722
0DA1AH
30C8G5
99971A
CA7EAI
AHLBEM
20 2
HGEDBC4321987654321A
994190562430809FDEDB
0 0
 7 4
9R2A993
0E314A0
8A900DE
820703R
6 7
JI03HD
ID7722
0DA1AH
30C9G5
99179A
CB7EAI
AHLBEM
20 2
A1234567891234CBDEGH
BDEDF908034265091499
0 0
 7 4
9R9A923
0E314A0
8A900DE
820R037
6 7
JI03HE
ID7722
0DA1AH
30C9G5
99971A
CA7EAI
AHLBEM
20 2
A1234567891234CBDEGH
BDEDF908034265091499
0 0
 7 4
9R2A993
0E314A0
8AE009E
820R037
6 7
JH03HE
ID7722
0DA1AH
30C8G5
99971A
CA7EAI
AHLBEM
20 2
HGEDBC4321987654321A
994190562430809FDEDB
0 0
 7 4
9R2A993
0E314A0
8AE009E
820R037
6 7
JH03HE
ID7722
0DA1AH
30C8G5
9A9719
CA7EAI
AHLBEM
20 2
HGEDBC4321987654321A
994190562430809FDEDB
0 0
 7 4
9R2A993
0E314A0
8A900DE
820R037
6 7
JI03HD
2277DI
0DA1AH
30C9G5
99179A
CB7E@I
AHLBEM
20 2
A1234567891234CBDEGH
BDEDF908034265091499
0 0

23900037
771971
908034265091499
 23900037
771971
12345908034265091499
 23900037
771971
994190562430809
 23900037
771979
12345908034265091499
 23900037
771871
994190562430809
 908820703
771979
12345908034265091499
 93900037
771971
12345908034265091499
 23140937
771871
994190562430809
 23140937
7718719
994190562430809
 23900037
22771979
12345908034265091499

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

```c
#include<stdio.h>
#include<string.h>
int W,H,i,j;
char dp[71][71][71],g[2],tmp[71],res[71];

void ch(char x[],char y[])
{
	int s,t;
	while(x[0]=='0')
		memmove(x,x+1,strlen(x));
	while(y[0]=='0')
		memmove(y,y+1,strlen(y));
	s=strlen(x),t=strlen(y);
	if(s<t||(s==t&&strcmp(x,y)<0))
		strcpy(x,y);
}
int main()
{
	for(;scanf("%d%d\n",&W,&H),W;)
	{
		memset(dp,0,sizeof(dp));
		memset(res,0,sizeof(res));
		for(i=0;i<H;i++,getchar())
			for(j=0;j<W;j++)
			{
				tmp[0]=0;
				g[0]=getchar();
				if(g[0]<58)
				{
					if(i>0)
						ch(tmp,dp[i-1][j]);
					if(j>0)
						ch(tmp,dp[i][j-1]);
					sprintf(dp[i][j],"%s",strcat(tmp,g));
				}
				ch(res,dp[i][j]);
			}
		puts(res);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	W
	.bss
	.align 4
	.type	W, @object
	.size	W, 4
W:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 357911
dp:
	.zero	357911
	.globl	g
	.type	g, @object
	.size	g, 2
g:
	.zero	2
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 71
tmp:
	.zero	71
	.globl	res
	.align 32
	.type	res, @object
	.size	res, 71
res:
	.zero	71
	.text
	.globl	ch
	.type	ch, @function
ch:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memmove@PLT
.L2:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L3
	jmp	.L4
.L5:
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memmove@PLT
.L4:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L5
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L6
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L8
.L6:
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ch, .-ch
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L10
.L18:
	movl	$357911, %edx
	movl	$0, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$71, %edx
	movl	$0, %esi
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, i(%rip)
	jmp	.L11
.L17:
	movl	$0, j(%rip)
	jmp	.L12
.L16:
	movb	$0, tmp(%rip)
	call	getchar@PLT
	movb	%al, g(%rip)
	movzbl	g(%rip), %eax
	cmpb	$57, %al
	jg	.L13
	movl	i(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	movl	i(%rip), %eax
	leal	-1(%rax), %ecx
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	ch
.L14:
	movl	j(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	movl	i(%rip), %ecx
	movl	j(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	ch
.L15:
	leaq	g(%rip), %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	strcat@PLT
	movq	%rax, %rcx
	movl	i(%rip), %esi
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%esi, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rcx, %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
.L13:
	movl	i(%rip), %ecx
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	ch
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L12:
	movl	j(%rip), %edx
	movl	W(%rip), %eax
	cmpl	%eax, %edx
	jl	.L16
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	call	getchar@PLT
.L11:
	movl	i(%rip), %edx
	movl	H(%rip), %eax
	cmpl	%eax, %edx
	jl	.L17
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	leaq	H(%rip), %rax
	movq	%rax, %rdx
	leaq	W(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	W(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %eax
	popq	%rbp
	.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	W
	.bss
	.align 4
	.type	W, @object
	.size	W, 4
W:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 357911
dp:
	.zero	357911
	.globl	g
	.type	g, @object
	.size	g, 2
g:
	.zero	2
	.globl	tmp
	.align 32
	.type	tmp, @object
	.size	tmp, 71
tmp:
	.zero	71
	.globl	res
	.align 32
	.type	res, @object
	.size	res, 71
res:
	.zero	71
	.text
	.globl	ch
	.type	ch, @function
ch:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memmove@PLT
.L2:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L3
	jmp	.L4
.L5:
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memmove@PLT
.L4:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L5
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L6
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jns	.L8
.L6:
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcpy@PLT
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	ch, .-ch
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L10
.L18:
	movl	$357911, %edx
	movl	$0, %esi
	leaq	dp(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$71, %edx
	movl	$0, %esi
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, i(%rip)
	jmp	.L11
.L17:
	movl	$0, j(%rip)
	jmp	.L12
.L16:
	movb	$0, tmp(%rip)
	call	getchar@PLT
	movb	%al, g(%rip)
	movzbl	g(%rip), %eax
	cmpb	$57, %al
	jg	.L13
	movl	i(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	movl	i(%rip), %eax
	leal	-1(%rax), %ecx
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	ch
.L14:
	movl	j(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	movl	i(%rip), %ecx
	movl	j(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	ch
.L15:
	leaq	g(%rip), %rax
	movq	%rax, %rsi
	leaq	tmp(%rip), %rax
	movq	%rax, %rdi
	call	strcat@PLT
	movq	%rax, %rcx
	movl	i(%rip), %esi
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%esi, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rcx, %rdx
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
.L13:
	movl	i(%rip), %ecx
	movl	j(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	movslq	%ecx, %rdx
	imulq	$5041, %rdx, %rdx
	addq	%rax, %rdx
	leaq	dp(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	ch
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L12:
	movl	j(%rip), %edx
	movl	W(%rip), %eax
	cmpl	%eax, %edx
	jl	.L16
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	call	getchar@PLT
.L11:
	movl	i(%rip), %edx
	movl	H(%rip), %eax
	cmpl	%eax, %edx
	jl	.L17
	leaq	res(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	leaq	H(%rip), %rax
	movq	%rax, %rdx
	leaq	W(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	W(%rip), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %eax
	popq	%rbp
	.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:
