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>

#define N 90
#define MAX(D,S) \
  { \
    int __temp = (S); \
    (D) = ( (D) > __temp ? (D) : __temp ); \
  }

static
int d[ N ][ N ];
static
int m, n;

int dfs (
  int x,
  int y
  )
{
  int res = 0;

#if 0
  if ( x < 0 || x >= m
    || y < 0 || y >= n )  return ( 0 );
  if ( !d[ x ][ y ] )     return ( 0 );
#endif

  d[ x ][ y ] = 0;
  if ( x > 0 && d[ x - 1 ][ y ] )       MAX( res, dfs ( x - 1, y ) );
  if ( x < m - 1 && d[ x + 1 ][ y ] )   MAX( res, dfs ( x + 1, y ) );
  if ( y > 0 && d[ x ][ y - 1 ] )       MAX( res, dfs ( x, y - 1 ) );
  if ( y < n - 1 && d[ x ][ y + 1 ] )   MAX( res, dfs ( x, y + 1 ) );
  d[ x ][ y ] = 1;

  return ( res + 1 );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int x, y;

  for ( ; ; )
  {
    int res = 0;

    scanf ( "%d%d", &m, &n );
    if ( !( m | n ) ) break ;

    for ( y = 0; y < n; ++y )
    for ( x = 0; x < m; ++x )
    {
      scanf ( "%d", &d[ x ][ y ] );
    }

    for ( y = 0; y < n; ++y )
    for ( x = 0; x < m; ++x )
    {
      if ( d[ x ][ y ] )
      MAX( res, dfs ( x, y ) );
    }

    printf ( "%d\n", res );
  }

  return ( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	d
	.comm	d,32400,32
	.local	m
	.comm	m,4,4
	.local	n
	.comm	n,4,4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$0, -20(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	cmpl	$0, -36(%rbp)
	jle	.L2
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$90, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dfs
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L2:
	movl	m(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L3
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$90, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L3
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L3:
	cmpl	$0, -40(%rbp)
	jle	.L4
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L4:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -40(%rbp)
	jge	.L5
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L5:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%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
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
.L19:
	movl	$0, -8(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movl	n(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L22
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L11:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, -12(%rbp)
	jmp	.L14
.L18:
	movl	$0, -16(%rbp)
	jmp	.L15
.L17:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -8(%rbp)
.L16:
	addl	$1, -16(%rbp)
.L15:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L17
	addl	$1, -12(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L22:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	d(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%edi, %r12
	imulq	$90, %r12, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %r13
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r15, %rbx
	addq	%r15, %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movl	$0, (%r14,%rax,4)
	testl	%r12d, %r12d
	jle	.L2
	leal	-1(%r12), %edi
	movslq	%edi, %rax
	imulq	$90, %rax, %rax
	addq	%r15, %rax
	movl	(%r14,%rax,4), %ebp
	testl	%ebp, %ebp
	jne	.L12
.L2:
	movl	m(%rip), %eax
	subl	$1, %eax
	cmpl	%r13d, %eax
	jle	.L3
	leal	1(%r13), %edi
	movslq	%edi, %rax
	imulq	$90, %rax, %rax
	addq	%r15, %rax
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L13
.L3:
	testl	%ebx, %ebx
	jle	.L4
	imulq	$90, %r12, %rax
	leal	-1(%rbx), %esi
	movslq	%esi, %rdx
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %edx
	testl	%edx, %edx
	jne	.L14
.L4:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%ebx, %eax
	jle	.L5
	imulq	$90, %r12, %rax
	leal	1(%rbx), %esi
	movslq	%esi, %rdx
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
.L5:
	imulq	$90, %r12, %rax
	addq	%r15, %rax
	movl	$1, (%r14,%rax,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	leal	1(%rbp), %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	%r13d, %edi
	call	dfs
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r15d, %esi
	call	dfs
	xorl	%edx, %edx
	testl	%eax, %eax
	cmovns	%eax, %edx
	movl	%edx, %ebp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r13d, %edi
	call	dfs
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ebx, %esi
	call	dfs
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%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
	leaq	n(%rip), %r15
	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	d(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%r15, %rdx
	xorl	%eax, %eax
	leaq	m(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	movl	n(%rip), %edx
	movl	%eax, %ecx
	orl	%edx, %ecx
	je	.L38
	xorl	%ebp, %ebp
	testl	%edx, %edx
	jle	.L19
	testl	%eax, %eax
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L25:
	leaq	(%r12,%rbp,4), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	addq	$360, %r14
	cmpl	%r13d, %eax
	jg	.L20
	movl	n(%rip), %edx
	leal	1(%rbp), %ecx
	cmpl	%ecx, %edx
	jle	.L43
	addq	$1, %rbp
	testl	%eax, %eax
	jg	.L25
.L23:
	leaq	d(%rip), %r10
	xorl	%r11d, %r11d
	xorl	%ebp, %ebp
	testl	%eax, %eax
	jle	.L32
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%r10, %r9
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L30:
	movl	(%r9), %edx
	testl	%edx, %edx
	jne	.L44
	addl	$1, %r8d
	addq	$360, %r9
	cmpl	%eax, %r8d
	jl	.L30
.L29:
	addl	$1, %ebp
	cmpl	%ebp, n(%rip)
	jle	.L32
	addq	$4, %r10
	testl	%eax, %eax
	jg	.L37
.L32:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L44:
	movl	%r8d, %edi
	movl	%ebp, %esi
	call	dfs
	cmpl	%eax, %r11d
	cmovl	%eax, %r11d
	movl	m(%rip), %eax
	addl	$1, %r8d
	addq	$360, %r9
	cmpl	%r8d, %eax
	jg	.L30
	jmp	.L29
.L38:
	addq	$8, %rsp
	.cfi_remember_state
	.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
.L43:
	.cfi_restore_state
	testl	%edx, %edx
	jg	.L23
.L19:
	xorl	%r11d, %r11d
	jmp	.L32
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.local	n
	.comm	n,4,4
	.local	m
	.comm	m,4,4
	.local	d
	.comm	d,32400,32
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	d(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%edi, %r12
	imulq	$90, %r12, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %r13
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r15, %rbx
	addq	%r15, %rax
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movl	$0, (%r14,%rax,4)
	testl	%r12d, %r12d
	jle	.L2
	leal	-1(%r12), %edi
	movslq	%edi, %rax
	imulq	$90, %rax, %rax
	addq	%r15, %rax
	movl	(%r14,%rax,4), %ebp
	testl	%ebp, %ebp
	jne	.L12
.L2:
	movl	m(%rip), %eax
	subl	$1, %eax
	cmpl	%r13d, %eax
	jle	.L3
	leal	1(%r13), %edi
	movslq	%edi, %rax
	imulq	$90, %rax, %rax
	addq	%r15, %rax
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L13
.L3:
	testl	%ebx, %ebx
	jle	.L4
	imulq	$90, %r12, %rax
	leal	-1(%rbx), %esi
	movslq	%esi, %rdx
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %edx
	testl	%edx, %edx
	jne	.L14
.L4:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%ebx, %eax
	jle	.L5
	imulq	$90, %r12, %rax
	leal	1(%rbx), %esi
	movslq	%esi, %rdx
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
.L5:
	imulq	$90, %r12, %rax
	addq	%r15, %rax
	movl	$1, (%r14,%rax,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	leal	1(%rbp), %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	%r13d, %edi
	call	dfs
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r15d, %esi
	call	dfs
	xorl	%edx, %edx
	testl	%eax, %eax
	cmovns	%eax, %edx
	movl	%edx, %ebp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r13d, %edi
	call	dfs
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ebx, %esi
	call	dfs
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%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
	leaq	n(%rip), %r15
	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	d(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%r15, %rdx
	xorl	%eax, %eax
	leaq	m(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	movl	n(%rip), %edx
	movl	%eax, %ecx
	orl	%edx, %ecx
	je	.L38
	xorl	%ebp, %ebp
	testl	%edx, %edx
	jle	.L19
	testl	%eax, %eax
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L25:
	leaq	(%r12,%rbp,4), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	addq	$360, %r14
	cmpl	%r13d, %eax
	jg	.L20
	movl	n(%rip), %edx
	leal	1(%rbp), %ecx
	cmpl	%ecx, %edx
	jle	.L43
	addq	$1, %rbp
	testl	%eax, %eax
	jg	.L25
.L23:
	leaq	d(%rip), %r10
	xorl	%r11d, %r11d
	xorl	%ebp, %ebp
	testl	%eax, %eax
	jle	.L32
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%r10, %r9
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L30:
	movl	(%r9), %edx
	testl	%edx, %edx
	jne	.L44
	addl	$1, %r8d
	addq	$360, %r9
	cmpl	%eax, %r8d
	jl	.L30
.L29:
	addl	$1, %ebp
	cmpl	%ebp, n(%rip)
	jle	.L32
	addq	$4, %r10
	testl	%eax, %eax
	jg	.L37
.L32:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L44:
	movl	%r8d, %edi
	movl	%ebp, %esi
	call	dfs
	cmpl	%eax, %r11d
	cmovl	%eax, %r11d
	movl	m(%rip), %eax
	addl	$1, %r8d
	addq	$360, %r9
	cmpl	%r8d, %eax
	jg	.L30
	jmp	.L29
.L38:
	addq	$8, %rsp
	.cfi_remember_state
	.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
.L43:
	.cfi_restore_state
	testl	%edx, %edx
	jg	.L23
.L19:
	xorl	%r11d, %r11d
	jmp	.L32
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.local	n
	.comm	n,4,4
	.local	m
	.comm	m,4,4
	.local	d
	.comm	d,32400,32
	.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>

#define N 90
#define MAX(D,S) \
  { \
    int __temp = (S); \
    (D) = ( (D) > __temp ? (D) : __temp ); \
  }

static
int d[ N ][ N ];
static
int m, n;

int dfs (
  int x,
  int y
  )
{
  int res = 0;

#if 0
  if ( x < 0 || x >= m
    || y < 0 || y >= n )  return ( 0 );
  if ( !d[ x ][ y ] )     return ( 0 );
#endif

  d[ x ][ y ] = 0;
  if ( x > 0 && d[ x - 1 ][ y ] )       MAX( res, dfs ( x - 1, y ) );
  if ( x < m - 1 && d[ x + 1 ][ y ] )   MAX( res, dfs ( x + 1, y ) );
  if ( y > 0 && d[ x ][ y - 1 ] )       MAX( res, dfs ( x, y - 1 ) );
  if ( y < n - 1 && d[ x ][ y + 1 ] )   MAX( res, dfs ( x, y + 1 ) );
  d[ x ][ y ] = 1;

  return ( res + 1 );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int x, y;

  for ( ; ; )
  {
    int res = 0;

    scanf ( "%d%d", &m, &n );
    if ( !( m | n ) ) break ;

    for ( y = 0; y < n; ++y )
    for ( x = 0; x < m; ++x )
    {
      scanf ( "%d", &d[ x ][ y ] );
    }

    for ( y = 0; y < n; ++y )
    for ( x = 0; x < m; ++x )
    {
      if ( d[ x ][ y ] )
      MAX( res, dfs ( x, y ) );
    }

    printf ( "%d\n", res );
  }

  return ( 0 );
}
3
3
1 1 0
1 0 1
1 1 0
5
3
1 1 1 0 1
1 1 0 1 0
1 0 0 0 1
0
0
 3
3
1 1 0
1 0 1
0 1 0
5
3
1 1 0 0 1
1 1 0 1 0
1 0 0 0 1
0
0
 3
3
1 1 0
1 0 1
0 1 0
5
3
1 1 0 0 1
1 1 0 1 0
1 1 1 0 1
0
0
 3
3
1 1 0
1 0 1
1 1 0
5
3
1 0 1 0 1
1 1 0 1 0
1 0 0 0 1
0
0
 3
3
1 1 0
0 0 1
0 1 0
5
3
1 1 0 0 1
1 1 0 1 0
1 0 0 0 1
0
0
 3
3
1 0 0
1 0 1
1 1 0
5
3
1 0 1 0 1
1 1 0 1 0
1 0 0 0 1
0
0
 3
3
1 1 0
1 0 1
0 1 0
5
3
0 1 0 0 1
1 1 0 1 0
1 1 1 0 1
0
0
 3
3
1 1 0
1 0 1
0 1 0
5
3
1 1 1 0 1
0 1 0 0 0
1 0 1 0 1
0
0
 3
3
1 1 0
1 0 1
1 0 0
5
3
1 1 1 0 1
1 1 0 0 0
1 0 0 0 1
0
0
 3
3
1 1 0
1 0 1
1 1 1
5
3
1 0 1 0 1
1 0 0 1 0
1 0 0 0 1
0
0

5
5
 3
5
 3
7
 5
3
 2
5
 4
3
 3
6
 3
3
 4
5
 7
3

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

```c
#include <stdio.h>
#include <string.h>

#define N 90
#define MAX(D,S) \
  { \
    int __temp = (S); \
    (D) = ( (D) > __temp ? (D) : __temp ); \
  }

static
int d[ N ][ N ];
static
int m, n;

int dfs (
  int x,
  int y
  )
{
  int res = 0;

#if 0
  if ( x < 0 || x >= m
    || y < 0 || y >= n )  return ( 0 );
  if ( !d[ x ][ y ] )     return ( 0 );
#endif

  d[ x ][ y ] = 0;
  if ( x > 0 && d[ x - 1 ][ y ] )       MAX( res, dfs ( x - 1, y ) );
  if ( x < m - 1 && d[ x + 1 ][ y ] )   MAX( res, dfs ( x + 1, y ) );
  if ( y > 0 && d[ x ][ y - 1 ] )       MAX( res, dfs ( x, y - 1 ) );
  if ( y < n - 1 && d[ x ][ y + 1 ] )   MAX( res, dfs ( x, y + 1 ) );
  d[ x ][ y ] = 1;

  return ( res + 1 );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int x, y;

  for ( ; ; )
  {
    int res = 0;

    scanf ( "%d%d", &m, &n );
    if ( !( m | n ) ) break ;

    for ( y = 0; y < n; ++y )
    for ( x = 0; x < m; ++x )
    {
      scanf ( "%d", &d[ x ][ y ] );
    }

    for ( y = 0; y < n; ++y )
    for ( x = 0; x < m; ++x )
    {
      if ( d[ x ][ y ] )
      MAX( res, dfs ( x, y ) );
    }

    printf ( "%d\n", res );
  }

  return ( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	d
	.comm	d,32400,32
	.local	m
	.comm	m,4,4
	.local	n
	.comm	n,4,4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$0, -20(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	cmpl	$0, -36(%rbp)
	jle	.L2
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$90, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dfs
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L2:
	movl	m(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L3
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$90, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L3
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L3:
	cmpl	$0, -40(%rbp)
	jle	.L4
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L4:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -40(%rbp)
	jge	.L5
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L5:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%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
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
.L19:
	movl	$0, -8(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movl	n(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L22
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L11:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, -12(%rbp)
	jmp	.L14
.L18:
	movl	$0, -16(%rbp)
	jmp	.L15
.L17:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -8(%rbp)
.L16:
	addl	$1, -16(%rbp)
.L15:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L17
	addl	$1, -12(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L22:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.local	d
	.comm	d,32400,32
	.local	m
	.comm	m,4,4
	.local	n
	.comm	n,4,4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$0, -20(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	cmpl	$0, -36(%rbp)
	jle	.L2
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$90, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L2
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dfs
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L2:
	movl	m(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jge	.L3
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$90, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L3
	movl	-36(%rbp), %eax
	leal	1(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dfs
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L3:
	cmpl	$0, -40(%rbp)
	jle	.L4
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L4
	movl	-40(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L4:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -40(%rbp)
	jge	.L5
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -20(%rbp)
.L5:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%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
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
.L19:
	movl	$0, -8(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edx
	movl	n(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L22
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -16(%rbp)
.L11:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	addl	$1, -12(%rbp)
.L10:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L13
	movl	$0, -12(%rbp)
	jmp	.L14
.L18:
	movl	$0, -16(%rbp)
	jmp	.L15
.L17:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$90, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L16
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -8(%rbp)
.L16:
	addl	$1, -16(%rbp)
.L15:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L17
	addl	$1, -12(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L22:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
