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 d[30][30],w,h;
int X[]={0,1,0,-1};
int Y[]={1,0,-1,0};
int f(int x,int y,int m){
  int i,j,ny,nx,b;
  if(m==0)return 0;
  for(i=0;i<4;i++){
    for(j=1;d[y+Y[i]*j][x+X[i]*j]==1;j++);
    if(d[ny=y+Y[i]*j][nx=x+X[i]*j]==4)return 1;
    if(d[ny][nx]==0||j==1)continue;
    if(d[ny][nx]==2)b=2;
    else            b=1;
    d[ny][nx]=1;
    if(f(nx-X[i],ny-Y[i],m-1))return 1;
    d[ny][nx]=b;
  }
  return 0;
}
int main(){
  int i,j,sy,sx;
  while(scanf("%d %d",&w,&h),w||h){
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	scanf("%d",&d[i][j]);
	if(d[i][j]==2)d[sy=i][sx=j]=0;
	d[i][j]++;
      }
      d[i][j]=0;
    }
    for(j=1;j<=w;j++)d[i][j]=0;
    for(i=1;i<11;i++){
      if(f(sx,sy,i))break;
    }
    if(i-11)printf("%d\n",i);
    else    printf("-1\n");
  }
  return 0;
}
	```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 3600
d:
	.zero	3600
	.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
	.globl	X
	.data
	.align 16
	.type	X, @object
	.size	X, 16
X:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	Y
	.align 16
	.type	Y, @object
	.size	Y, 16
Y:
	.long	1
	.long	0
	.long	-1
	.long	0
	.text
	.globl	f
	.type	f, @function
f:
.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	%edx, -44(%rbp)
	cmpl	$0, -44(%rbp)
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$0, -20(%rbp)
	jmp	.L4
.L14:
	movl	$1, -16(%rbp)
	jmp	.L5
.L6:
	addl	$1, -16(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Y(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	X(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	je	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Y(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	X(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$4, %eax
	jne	.L7
	movl	$1, %eax
	jmp	.L3
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L15
	cmpl	$1, -16(%rbp)
	je	.L15
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L11
	movl	$2, -12(%rbp)
	jmp	.L12
.L11:
	movl	$1, -12(%rbp)
.L12:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Y(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	-8(%rbp), %eax
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	X(%rip), %rax
	movl	(%rsi,%rax), %esi
	movl	-4(%rbp), %eax
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L13
	movl	$1, %eax
	jmp	.L3
.L13:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L15:
	nop
.L10:
	addl	$1, -20(%rbp)
.L4:
	cmpl	$3, -20(%rbp)
	jle	.L14
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
.LC3:
	.string	"%d %d"
	.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	$16, %rsp
	jmp	.L17
.L33:
	movl	$1, -16(%rbp)
	jmp	.L18
.L22:
	movl	$1, -12(%rbp)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L20
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L19:
	movl	w(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L21
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L18:
	movl	h(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L22
	movl	$1, -12(%rbp)
	jmp	.L23
.L24:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L23:
	movl	w(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movl	$1, -16(%rbp)
	jmp	.L25
.L28:
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %ecx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	jne	.L35
	addl	$1, -16(%rbp)
.L25:
	cmpl	$10, -16(%rbp)
	jle	.L28
	jmp	.L27
.L35:
	nop
.L27:
	cmpl	$11, -16(%rbp)
	je	.L29
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L29:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L30
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L31
.L30:
	movl	$1, %eax
	jmp	.L32
.L31:
	movl	$0, %eax
.L32:
	testl	%eax, %eax
	jne	.L33
	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
	.type	f.part.0, @function
f.part.0:
.LFB25:
	.cfi_startproc
	leal	-1(%rdx), %r8d
	movslq	%esi, %rdx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rcx
	movq	%rdx, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	d(%rip), %r15
	movl	%ecx, %r9d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	salq	$4, %rax
	leaq	X(%rip), %r14
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	subq	%rdx, %rax
	leaq	Y(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	62(%rcx,%rax,2), %rax
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	(%r15,%rax,4), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rax, 8(%rsp)
.L2:
	movl	(%r12), %r10d
	movl	(%r14), %esi
	leal	0(%rbp,%r10), %edi
	leal	(%r9,%rsi), %ecx
	movslq	%edi, %rdx
	movslq	%ecx, %r11
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	leaq	(%r11,%rax,2), %rax
	movl	(%r15,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L38
	cmpl	$1, %esi
	jne	.L17
	cmpl	$1, %r10d
	movl	%r9d, %edx
	movq	8(%rsp), %r13
	leal	2(%rbp), %r11d
	setne	%al
	subl	%ebp, %edx
	testb	%al, %al
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L7:
	movl	0(%r13), %ebx
	movl	%r11d, %eax
	leal	(%rdx,%r11), %edi
	addq	$124, %r13
	addl	$1, %r11d
	cmpl	$1, %ebx
	je	.L7
	cmpl	$4, %ebx
	je	.L8
.L39:
	testl	%ebx, %ebx
	je	.L9
	movslq	%eax, %r13
	cmpl	$2, %ebx
	movl	$1, %ecx
	movq	%r13, %rdx
	cmovne	%ecx, %ebx
	movslq	%edi, %rcx
	salq	$4, %rdx
	subq	%r13, %rdx
	leaq	(%rcx,%rdx,2), %rdx
	movl	$1, (%r15,%rdx,4)
	testl	%r8d, %r8d
	je	.L12
	subl	%r10d, %eax
	subl	%esi, %edi
	movl	%r8d, %edx
	movl	%r9d, 28(%rsp)
	movl	%eax, %esi
	movq	%rcx, 16(%rsp)
	movl	%r8d, 24(%rsp)
	call	f.part.0
	movl	24(%rsp), %r8d
	movq	16(%rsp), %rcx
	testl	%eax, %eax
	movl	28(%rsp), %r9d
	jne	.L8
.L12:
	movq	%r13, %rax
	salq	$4, %rax
	subq	%r13, %rax
	leaq	(%rcx,%rax,2), %rax
	movl	%ebx, (%r15,%rax,4)
.L9:
	addq	$4, %r12
	leaq	16+Y(%rip), %rax
	addq	$4, %r14
	cmpq	%rax, %r12
	jne	.L2
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	leal	(%r10,%rdi), %edx
	movslq	%r10d, %rdi
	addl	%esi, %ecx
	movq	%rdi, %rax
	salq	$4, %rax
	subq	%rdi, %rax
	movslq	%esi, %rdi
	leaq	(%rdi,%rax,2), %r13
	movslq	%edx, %rdi
	movq	%rdi, %rax
	salq	$2, %r13
	salq	$4, %rax
	subq	%rdi, %rax
	movslq	%ecx, %rdi
	leaq	(%rdi,%rax,2), %rax
	leaq	(%r15,%rax,4), %r11
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r11), %ebx
	movl	%edx, %eax
	movl	%ecx, %edi
	addl	%r10d, %edx
	addl	%esi, %ecx
	addq	%r13, %r11
	cmpl	$1, %ebx
	je	.L5
	cmpl	$4, %ebx
	jne	.L39
.L8:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
.L38:
	.cfi_restore_state
	cmpl	$4, %eax
	jne	.L9
	jmp	.L8
	.cfi_endproc
.LFE25:
	.size	f.part.0, .-f.part.0
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	je	.L41
	jmp	f.part.0
	.p2align 4,,10
	.p2align 3
.L41:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L43:
	leaq	h(%rip), %rdx
	leaq	w(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	w(%rip), %rax
	movl	h(%rip), %esi
	movl	%eax, %edx
	orl	%esi, %edx
	je	.L65
	movq	$30, 8(%rsp)
	movl	$1, %r12d
	testl	%esi, %esi
	jle	.L49
	testl	%eax, %eax
	jle	.L73
.L52:
	movq	8(%rsp), %rcx
	leaq	d(%rip), %rax
	movl	$1, %r15d
	leaq	(%rax,%rcx,4), %rbx
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L74:
	addl	$1, %eax
	addl	$1, %r15d
	movl	%eax, 4(%rbx)
	movslq	w(%rip), %rax
	cmpl	%r15d, %eax
	jl	.L46
.L45:
	movq	%r14, %rbx
.L47:
	leaq	4(%rbx), %r14
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rbx), %eax
	cmpl	$2, %eax
	jne	.L74
	movslq	w(%rip), %rax
	leal	1(%r15), %esi
	movl	%r15d, 4(%rsp)
	movl	%r12d, %r13d
	movl	$1, 4(%rbx)
	movl	%esi, %r15d
	cmpl	%esi, %eax
	jge	.L45
.L46:
	movslq	%r12d, %rdi
	movslq	%r15d, %rdx
	movl	h(%rip), %esi
	addl	$1, %r12d
	movq	%rdi, %rcx
	salq	$4, %rcx
	subq	%rdi, %rcx
	leaq	(%rdx,%rcx,2), %rdx
	leaq	d(%rip), %rcx
	movl	$0, (%rcx,%rdx,4)
	cmpl	%r12d, %esi
	jl	.L49
	addq	$30, 8(%rsp)
	testl	%eax, %eax
	jg	.L52
.L73:
	movslq	%r12d, %rdx
	addl	$1, %r12d
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	leaq	d(%rip), %rdx
	movl	$0, 4(%rdx,%rax,8)
	cmpl	%esi, %r12d
	jg	.L56
	movslq	%r12d, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	leaq	d(%rip), %rdx
	leaq	(%rdx,%rax,8), %rax
	.p2align 4,,10
	.p2align 3
.L50:
	addl	$1, %r12d
	movl	$0, 4(%rax)
	addq	$120, %rax
	cmpl	%r12d, %esi
	jge	.L50
.L56:
	movl	4(%rsp), %ebx
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%r12d, %edx
	movl	%r13d, %esi
	movl	%ebx, %edi
	call	f.part.0
	testl	%eax, %eax
	jne	.L57
	addl	$1, %r12d
	cmpl	$11, %r12d
	jne	.L55
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L49:
	testl	%eax, %eax
	jle	.L56
	movslq	%r12d, %r12
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rcx
	xorl	%esi, %esi
	movq	%r12, %rax
	salq	$4, %rax
	subq	%r12, %rax
	leaq	4(%rcx,%rax,8), %rdi
	call	memset@PLT
	jmp	.L56
.L57:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L43
.L65:
	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
.LFE24:
	.size	main, .-main
	.globl	Y
	.data
	.align 16
	.type	Y, @object
	.size	Y, 16
Y:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	X
	.align 16
	.type	X, @object
	.size	X, 16
X:
	.long	0
	.long	1
	.long	0
	.long	-1
	.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	d
	.align 32
	.type	d, @object
	.size	d, 3600
d:
	.zero	3600
	.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	f.part.0, @function
f.part.0:
.LFB25:
	.cfi_startproc
	leal	-1(%rdx), %r8d
	movslq	%esi, %rdx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %rcx
	movq	%rdx, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	d(%rip), %r15
	movl	%ecx, %r9d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	salq	$4, %rax
	leaq	X(%rip), %r14
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	subq	%rdx, %rax
	leaq	Y(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	62(%rcx,%rax,2), %rax
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	(%r15,%rax,4), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rax, 8(%rsp)
.L2:
	movl	(%r12), %r10d
	movl	(%r14), %esi
	leal	0(%rbp,%r10), %edi
	leal	(%r9,%rsi), %ecx
	movslq	%edi, %rdx
	movslq	%ecx, %r11
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	leaq	(%r11,%rax,2), %rax
	movl	(%r15,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L38
	cmpl	$1, %esi
	jne	.L17
	cmpl	$1, %r10d
	movl	%r9d, %edx
	movq	8(%rsp), %r13
	leal	2(%rbp), %r11d
	setne	%al
	subl	%ebp, %edx
	testb	%al, %al
	jne	.L17
	.p2align 4,,10
	.p2align 3
.L7:
	movl	0(%r13), %ebx
	movl	%r11d, %eax
	leal	(%rdx,%r11), %edi
	addq	$124, %r13
	addl	$1, %r11d
	cmpl	$1, %ebx
	je	.L7
	cmpl	$4, %ebx
	je	.L8
.L39:
	testl	%ebx, %ebx
	je	.L9
	movslq	%eax, %r13
	cmpl	$2, %ebx
	movl	$1, %ecx
	movq	%r13, %rdx
	cmovne	%ecx, %ebx
	movslq	%edi, %rcx
	salq	$4, %rdx
	subq	%r13, %rdx
	leaq	(%rcx,%rdx,2), %rdx
	movl	$1, (%r15,%rdx,4)
	testl	%r8d, %r8d
	je	.L12
	subl	%r10d, %eax
	subl	%esi, %edi
	movl	%r8d, %edx
	movl	%r9d, 28(%rsp)
	movl	%eax, %esi
	movq	%rcx, 16(%rsp)
	movl	%r8d, 24(%rsp)
	call	f.part.0
	movl	24(%rsp), %r8d
	movq	16(%rsp), %rcx
	testl	%eax, %eax
	movl	28(%rsp), %r9d
	jne	.L8
.L12:
	movq	%r13, %rax
	salq	$4, %rax
	subq	%r13, %rax
	leaq	(%rcx,%rax,2), %rax
	movl	%ebx, (%r15,%rax,4)
.L9:
	addq	$4, %r12
	leaq	16+Y(%rip), %rax
	addq	$4, %r14
	cmpq	%rax, %r12
	jne	.L2
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	leal	(%r10,%rdi), %edx
	movslq	%r10d, %rdi
	addl	%esi, %ecx
	movq	%rdi, %rax
	salq	$4, %rax
	subq	%rdi, %rax
	movslq	%esi, %rdi
	leaq	(%rdi,%rax,2), %r13
	movslq	%edx, %rdi
	movq	%rdi, %rax
	salq	$2, %r13
	salq	$4, %rax
	subq	%rdi, %rax
	movslq	%ecx, %rdi
	leaq	(%rdi,%rax,2), %rax
	leaq	(%r15,%rax,4), %r11
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r11), %ebx
	movl	%edx, %eax
	movl	%ecx, %edi
	addl	%r10d, %edx
	addl	%esi, %ecx
	addq	%r13, %r11
	cmpl	$1, %ebx
	je	.L5
	cmpl	$4, %ebx
	jne	.L39
.L8:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
.L38:
	.cfi_restore_state
	cmpl	$4, %eax
	jne	.L9
	jmp	.L8
	.cfi_endproc
.LFE25:
	.size	f.part.0, .-f.part.0
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	je	.L41
	jmp	f.part.0
	.p2align 4,,10
	.p2align 3
.L41:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.p2align 4,,10
	.p2align 3
.L43:
	leaq	h(%rip), %rdx
	leaq	w(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	w(%rip), %rax
	movl	h(%rip), %esi
	movl	%eax, %edx
	orl	%esi, %edx
	je	.L65
	movq	$30, 8(%rsp)
	movl	$1, %r12d
	testl	%esi, %esi
	jle	.L49
	testl	%eax, %eax
	jle	.L73
.L52:
	movq	8(%rsp), %rcx
	leaq	d(%rip), %rax
	movl	$1, %r15d
	leaq	(%rax,%rcx,4), %rbx
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L74:
	addl	$1, %eax
	addl	$1, %r15d
	movl	%eax, 4(%rbx)
	movslq	w(%rip), %rax
	cmpl	%r15d, %eax
	jl	.L46
.L45:
	movq	%r14, %rbx
.L47:
	leaq	4(%rbx), %r14
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r14, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rbx), %eax
	cmpl	$2, %eax
	jne	.L74
	movslq	w(%rip), %rax
	leal	1(%r15), %esi
	movl	%r15d, 4(%rsp)
	movl	%r12d, %r13d
	movl	$1, 4(%rbx)
	movl	%esi, %r15d
	cmpl	%esi, %eax
	jge	.L45
.L46:
	movslq	%r12d, %rdi
	movslq	%r15d, %rdx
	movl	h(%rip), %esi
	addl	$1, %r12d
	movq	%rdi, %rcx
	salq	$4, %rcx
	subq	%rdi, %rcx
	leaq	(%rdx,%rcx,2), %rdx
	leaq	d(%rip), %rcx
	movl	$0, (%rcx,%rdx,4)
	cmpl	%r12d, %esi
	jl	.L49
	addq	$30, 8(%rsp)
	testl	%eax, %eax
	jg	.L52
.L73:
	movslq	%r12d, %rdx
	addl	$1, %r12d
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	leaq	d(%rip), %rdx
	movl	$0, 4(%rdx,%rax,8)
	cmpl	%esi, %r12d
	jg	.L56
	movslq	%r12d, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	leaq	d(%rip), %rdx
	leaq	(%rdx,%rax,8), %rax
	.p2align 4,,10
	.p2align 3
.L50:
	addl	$1, %r12d
	movl	$0, 4(%rax)
	addq	$120, %rax
	cmpl	%r12d, %esi
	jge	.L50
.L56:
	movl	4(%rsp), %ebx
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%r12d, %edx
	movl	%r13d, %esi
	movl	%ebx, %edi
	call	f.part.0
	testl	%eax, %eax
	jne	.L57
	addl	$1, %r12d
	cmpl	$11, %r12d
	jne	.L55
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L49:
	testl	%eax, %eax
	jle	.L56
	movslq	%r12d, %r12
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rcx
	xorl	%esi, %esi
	movq	%r12, %rax
	salq	$4, %rax
	subq	%r12, %rax
	leaq	4(%rcx,%rax,8), %rdi
	call	memset@PLT
	jmp	.L56
.L57:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L43
.L65:
	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
.LFE24:
	.size	main, .-main
	.globl	Y
	.data
	.align 16
	.type	Y, @object
	.size	Y, 16
Y:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	X
	.align 16
	.type	X, @object
	.size	X, 16
X:
	.long	0
	.long	1
	.long	0
	.long	-1
	.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	d
	.align 32
	.type	d, @object
	.size	d, 3600
d:
	.zero	3600
	.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 d[30][30],w,h;
int X[]={0,1,0,-1};
int Y[]={1,0,-1,0};
int f(int x,int y,int m){
  int i,j,ny,nx,b;
  if(m==0)return 0;
  for(i=0;i<4;i++){
    for(j=1;d[y+Y[i]*j][x+X[i]*j]==1;j++);
    if(d[ny=y+Y[i]*j][nx=x+X[i]*j]==4)return 1;
    if(d[ny][nx]==0||j==1)continue;
    if(d[ny][nx]==2)b=2;
    else            b=1;
    d[ny][nx]=1;
    if(f(nx-X[i],ny-Y[i],m-1))return 1;
    d[ny][nx]=b;
  }
  return 0;
}
int main(){
  int i,j,sy,sx;
  while(scanf("%d %d",&w,&h),w||h){
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	scanf("%d",&d[i][j]);
	if(d[i][j]==2)d[sy=i][sx=j]=0;
	d[i][j]++;
      }
      d[i][j]=0;
    }
    for(j=1;j<=w;j++)d[i][j]=0;
    for(i=1;i<11;i++){
      if(f(sx,sy,i))break;
    }
    if(i-11)printf("%d\n",i);
    else    printf("-1\n");
  }
  return 0;
}
	
2 1
3 2
6 6
1 0 0 2 1 -1
1 1 0 0 0 0
0 0 0 0 0 3
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 1
6 1
1 1 2 1 1 3
6 1
1 0 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
5 2
6 6
1 0 0 2 1 -1
1 1 0 0 0 0
0 0 0 0 0 3
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 1
6 1
1 1 2 1 1 3
6 1
1 0 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
3 2
6 6
1 0 0 2 1 0
1 1 0 0 0 0
0 0 0 0 0 3
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 0
6 1
1 1 2 1 1 3
6 1
1 1 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
3 2
6 6
1 0 0 2 1 0
1 1 -1 0 0 0
0 0 0 0 0 1
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 1
3 1
1 1 2 1 1 3
6 1
1 0 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
5 2
6 6
1 0 0 2 1 -1
1 1 0 0 0 0
0 0 0 0 0 3
0 0 -1 0 0 0
1 0 0 0 0 1
0 1 1 1 1 1
6 1
1 1 2 1 1 3
6 1
1 0 2 1 1 3
12 1
2 0 1 0 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
7 2
6 6
1 0 0 2 1 -1
1 1 0 0 0 0
0 0 0 0 0 3
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 1
6 1
1 1 2 0 1 3
6 1
1 0 2 1 1 3
12 1
2 0 1 0 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
3 2
6 6
1 0 0 2 1 0
1 1 0 0 0 0
0 0 0 0 0 3
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 1
6 1
1 1 2 1 1 3
6 1
1 0 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 4
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
3 2
6 6
1 0 0 2 1 0
1 1 0 0 0 0
0 0 0 1 0 3
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 0
6 1
1 1 2 1 1 3
6 1
1 1 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0
 2 1
3 2
6 6
1 0 0 2 1 0
1 1 0 0 0 0
0 0 0 0 0 3
0 0 0 0 0 0
1 0 0 0 0 1
0 1 1 1 1 1
6 1
1 1 2 1 1 3
6 1
0 0 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 0 1 1 3
0 0
 2 1
5 2
6 6
1 0 0 2 1 -1
1 1 0 0 0 0
0 0 0 0 0 3
0 0 -1 0 0 0
1 0 0 0 0 1
0 1 1 1 1 0
6 1
1 1 2 1 1 3
6 1
1 1 2 1 1 3
12 1
2 0 1 1 1 1 1 1 1 1 1 3
13 1
2 0 1 1 1 1 1 1 1 1 1 1 3
0 0

1
4
-1
4
10
-1
 -1
4
-1
4
10
-1
 1
4
-1
-1
10
-1
 1
-1
-1
-1
4
10
-1
 -1
4
-1
4
9
-1
 -1
4
2
4
9
-1
 1
4
-1
4
-1
-1
 1
5
-1
-1
10
-1
 1
4
-1
-1
10
10
 -1
4
-1
-1
10
-1

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

```c
#include<stdio.h>
int d[30][30],w,h;
int X[]={0,1,0,-1};
int Y[]={1,0,-1,0};
int f(int x,int y,int m){
  int i,j,ny,nx,b;
  if(m==0)return 0;
  for(i=0;i<4;i++){
    for(j=1;d[y+Y[i]*j][x+X[i]*j]==1;j++);
    if(d[ny=y+Y[i]*j][nx=x+X[i]*j]==4)return 1;
    if(d[ny][nx]==0||j==1)continue;
    if(d[ny][nx]==2)b=2;
    else            b=1;
    d[ny][nx]=1;
    if(f(nx-X[i],ny-Y[i],m-1))return 1;
    d[ny][nx]=b;
  }
  return 0;
}
int main(){
  int i,j,sy,sx;
  while(scanf("%d %d",&w,&h),w||h){
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	scanf("%d",&d[i][j]);
	if(d[i][j]==2)d[sy=i][sx=j]=0;
	d[i][j]++;
      }
      d[i][j]=0;
    }
    for(j=1;j<=w;j++)d[i][j]=0;
    for(i=1;i<11;i++){
      if(f(sx,sy,i))break;
    }
    if(i-11)printf("%d\n",i);
    else    printf("-1\n");
  }
  return 0;
}
	```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 3600
d:
	.zero	3600
	.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
	.globl	X
	.data
	.align 16
	.type	X, @object
	.size	X, 16
X:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	Y
	.align 16
	.type	Y, @object
	.size	Y, 16
Y:
	.long	1
	.long	0
	.long	-1
	.long	0
	.text
	.globl	f
	.type	f, @function
f:
.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	%edx, -44(%rbp)
	cmpl	$0, -44(%rbp)
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$0, -20(%rbp)
	jmp	.L4
.L14:
	movl	$1, -16(%rbp)
	jmp	.L5
.L6:
	addl	$1, -16(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Y(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	X(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	je	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Y(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	X(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$4, %eax
	jne	.L7
	movl	$1, %eax
	jmp	.L3
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L15
	cmpl	$1, -16(%rbp)
	je	.L15
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L11
	movl	$2, -12(%rbp)
	jmp	.L12
.L11:
	movl	$1, -12(%rbp)
.L12:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Y(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	-8(%rbp), %eax
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	X(%rip), %rax
	movl	(%rsi,%rax), %esi
	movl	-4(%rbp), %eax
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L13
	movl	$1, %eax
	jmp	.L3
.L13:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L15:
	nop
.L10:
	addl	$1, -20(%rbp)
.L4:
	cmpl	$3, -20(%rbp)
	jle	.L14
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
.LC3:
	.string	"%d %d"
	.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	$16, %rsp
	jmp	.L17
.L33:
	movl	$1, -16(%rbp)
	jmp	.L18
.L22:
	movl	$1, -12(%rbp)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L20
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L19:
	movl	w(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L21
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L18:
	movl	h(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L22
	movl	$1, -12(%rbp)
	jmp	.L23
.L24:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L23:
	movl	w(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movl	$1, -16(%rbp)
	jmp	.L25
.L28:
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %ecx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	jne	.L35
	addl	$1, -16(%rbp)
.L25:
	cmpl	$10, -16(%rbp)
	jle	.L28
	jmp	.L27
.L35:
	nop
.L27:
	cmpl	$11, -16(%rbp)
	je	.L29
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L29:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L30
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L31
.L30:
	movl	$1, %eax
	jmp	.L32
.L31:
	movl	$0, %eax
.L32:
	testl	%eax, %eax
	jne	.L33
	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
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 3600
d:
	.zero	3600
	.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
	.globl	X
	.data
	.align 16
	.type	X, @object
	.size	X, 16
X:
	.long	0
	.long	1
	.long	0
	.long	-1
	.globl	Y
	.align 16
	.type	Y, @object
	.size	Y, 16
Y:
	.long	1
	.long	0
	.long	-1
	.long	0
	.text
	.globl	f
	.type	f, @function
f:
.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	%edx, -44(%rbp)
	cmpl	$0, -44(%rbp)
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$0, -20(%rbp)
	jmp	.L4
.L14:
	movl	$1, -16(%rbp)
	jmp	.L5
.L6:
	addl	$1, -16(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Y(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	X(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	je	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Y(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	X(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$4, %eax
	jne	.L7
	movl	$1, %eax
	jmp	.L3
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L15
	cmpl	$1, -16(%rbp)
	je	.L15
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L11
	movl	$2, -12(%rbp)
	jmp	.L12
.L11:
	movl	$1, -12(%rbp)
.L12:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Y(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	-8(%rbp), %eax
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	X(%rip), %rax
	movl	(%rsi,%rax), %esi
	movl	-4(%rbp), %eax
	subl	%esi, %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	je	.L13
	movl	$1, %eax
	jmp	.L3
.L13:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L15:
	nop
.L10:
	addl	$1, -20(%rbp)
.L4:
	cmpl	$3, -20(%rbp)
	jle	.L14
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
.LC3:
	.string	"%d %d"
	.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	$16, %rsp
	jmp	.L17
.L33:
	movl	$1, -16(%rbp)
	jmp	.L18
.L22:
	movl	$1, -12(%rbp)
	jmp	.L19
.L21:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L20
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
.L20:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L19:
	movl	w(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L21
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L18:
	movl	h(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L22
	movl	$1, -12(%rbp)
	jmp	.L23
.L24:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	subq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L23:
	movl	w(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L24
	movl	$1, -16(%rbp)
	jmp	.L25
.L28:
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %ecx
	movl	-4(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	f
	testl	%eax, %eax
	jne	.L35
	addl	$1, -16(%rbp)
.L25:
	cmpl	$10, -16(%rbp)
	jle	.L28
	jmp	.L27
.L35:
	nop
.L27:
	cmpl	$11, -16(%rbp)
	je	.L29
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L29:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L17:
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L30
	movl	h(%rip), %eax
	testl	%eax, %eax
	je	.L31
.L30:
	movl	$1, %eax
	jmp	.L32
.L31:
	movl	$0, %eax
.L32:
	testl	%eax, %eax
	jne	.L33
	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:
