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 map[17][17][17][17];
int dp[17][17];
int p;
int gx,gy;
int ax,ay,bx,by;
int i,j,k,l;
int Tc,tc;
int main(){
  scanf("%d",&Tc);
  for(tc=0;tc<Tc;tc++){

    for(i=0;i<17;i++)
      for(j=0;j<17;j++)
	for(k=0;k<17;k++)
	  for(l=0;l<17;l++)
	    map[i][j][k][l]=0;



    scanf("%d %d",&gx,&gy);
    gx++;
    gy++;
    scanf("%d",&p);
	
    for(i=0;i<p;i++){
      scanf("%d %d %d %d",&ax,&ay,&bx,&by);
      ax++;
      ay++;
      bx++;
      by++;
      map[ax][ay][bx][by]=1;
      map[bx][by][ax][ay]=1;
    }

    for(i=1;i<=gx;i++){
      for(j=1;j<=gy;j++){
	if(i==1&&j==1){
	  dp[i][j]=1;
	}else{
	  dp[i][j]=0;
	  if(map[i][j][i-1][j]==0)dp[i][j]+=dp[i-1][j];
	  if(map[i][j][i][j-1]==0)dp[i][j]+=dp[i][j-1];
	}
      }
    }

    if(dp[gx][gy]==0){
      printf("Miserable Hokusai!\n");
    }else{
      printf("%d\n",dp[gx][gy]);
    }

  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 334084
map:
	.zero	334084
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1156
dp:
	.zero	1156
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	gx
	.align 4
	.type	gx, @object
	.size	gx, 4
gx:
	.zero	4
	.globl	gy
	.align 4
	.type	gy, @object
	.size	gy, 4
gy:
	.zero	4
	.globl	ax
	.align 4
	.type	ax, @object
	.size	ax, 4
ax:
	.zero	4
	.globl	ay
	.align 4
	.type	ay, @object
	.size	ay, 4
ay:
	.zero	4
	.globl	bx
	.align 4
	.type	bx, @object
	.size	bx, 4
bx:
	.zero	4
	.globl	by
	.align 4
	.type	by, @object
	.size	by, 4
by:
	.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	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	Tc
	.align 4
	.type	Tc, @object
	.size	Tc, 4
Tc:
	.zero	4
	.globl	tc
	.align 4
	.type	tc, @object
	.size	tc, 4
tc:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"Miserable Hokusai!"
.LC4:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	Tc(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, tc(%rip)
	jmp	.L2
.L22:
	movl	$0, i(%rip)
	jmp	.L3
.L10:
	movl	$0, j(%rip)
	jmp	.L4
.L9:
	movl	$0, k(%rip)
	jmp	.L5
.L8:
	movl	$0, l(%rip)
	jmp	.L6
.L7:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movl	l(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
.L6:
	movl	l(%rip), %eax
	cmpl	$16, %eax
	jle	.L7
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L5:
	movl	k(%rip), %eax
	cmpl	$16, %eax
	jle	.L8
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L4:
	movl	j(%rip), %eax
	cmpl	$16, %eax
	jle	.L9
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %eax
	cmpl	$16, %eax
	jle	.L10
	leaq	gy(%rip), %rax
	movq	%rax, %rdx
	leaq	gx(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	gx(%rip), %eax
	addl	$1, %eax
	movl	%eax, gx(%rip)
	movl	gy(%rip), %eax
	addl	$1, %eax
	movl	%eax, gy(%rip)
	leaq	p(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L11
.L12:
	leaq	by(%rip), %r8
	leaq	bx(%rip), %rax
	movq	%rax, %rcx
	leaq	ay(%rip), %rax
	movq	%rax, %rdx
	leaq	ax(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	ax(%rip), %eax
	addl	$1, %eax
	movl	%eax, ax(%rip)
	movl	ay(%rip), %eax
	addl	$1, %eax
	movl	%eax, ay(%rip)
	movl	bx(%rip), %eax
	addl	$1, %eax
	movl	%eax, bx(%rip)
	movl	by(%rip), %eax
	addl	$1, %eax
	movl	%eax, by(%rip)
	movl	ax(%rip), %eax
	movl	ay(%rip), %edx
	movl	bx(%rip), %ecx
	movl	by(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	bx(%rip), %eax
	movl	by(%rip), %edx
	movl	ax(%rip), %ecx
	movl	ay(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	$1, i(%rip)
	jmp	.L13
.L19:
	movl	$1, j(%rip)
	jmp	.L14
.L18:
	movl	i(%rip), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L16
.L15:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	i(%rip), %ecx
	leal	-1(%rcx), %esi
	movl	j(%rip), %ecx
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movslq	%esi, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	i(%rip), %eax
	leal	-1(%rax), %edx
	movl	j(%rip), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	addl	%esi, %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L17:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	i(%rip), %ecx
	movl	j(%rip), %esi
	subl	$1, %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L16
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	subl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	addl	%esi, %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L16:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L14:
	movl	j(%rip), %edx
	movl	gy(%rip), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L13:
	movl	i(%rip), %edx
	movl	gx(%rip), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	gx(%rip), %eax
	movl	gy(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L20
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L21
.L20:
	movl	gx(%rip), %eax
	movl	gy(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L21:
	movl	tc(%rip), %eax
	addl	$1, %eax
	movl	%eax, tc(%rip)
.L2:
	movl	tc(%rip), %edx
	movl	Tc(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"Miserable Hokusai!"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	Tc(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movl	Tc(%rip), %r9d
	movl	$0, tc(%rip)
	testl	%r9d, %r9d
	jle	.L21
.L2:
	leaq	19652+map(%rip), %rsi
	xorl	%eax, %eax
.L4:
	leaq	-19652(%rsi), %rdx
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	8(%rdx), %rdi
	movq	%rdx, %rcx
	movq	$0, (%rdx)
	addq	$1156, %rdx
	andq	$-8, %rdi
	movq	$0, -8(%rdx)
	subq	%rdi, %rcx
	addl	$1156, %ecx
	shrl	$3, %ecx
	rep stosq
	cmpq	%rsi, %rdx
	jne	.L3
	leaq	19652(%rdx), %rsi
	leaq	353736+map(%rip), %rbx
	cmpq	%rbx, %rsi
	jne	.L4
	leaq	gy(%rip), %rdx
	leaq	gx(%rip), %rsi
	xorl	%eax, %eax
	movl	$17, l(%rip)
	leaq	.LC1(%rip), %rdi
	movl	$17, k(%rip)
	leaq	.LC2(%rip), %r12
	subq	$353736, %rbx
	movl	$17, j(%rip)
	leaq	by(%rip), %rbp
	movl	$17, i(%rip)
	call	__isoc99_scanf@PLT
	leaq	p(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, gx(%rip)
	addl	$1, gy(%rip)
	call	__isoc99_scanf@PLT
	movl	p(%rip), %r8d
	movl	$0, i(%rip)
	testl	%r8d, %r8d
	jle	.L8
.L5:
	movq	%rbp, %r8
	leaq	bx(%rip), %rcx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	ay(%rip), %rdx
	leaq	ax(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	ax(%rip), %eax
	leal	1(%rax), %ecx
	movl	ay(%rip), %eax
	movl	%ecx, ax(%rip)
	movslq	%ecx, %rcx
	imulq	$4913, %rcx, %r8
	leal	1(%rax), %edx
	movl	bx(%rip), %eax
	movl	%edx, ay(%rip)
	movslq	%edx, %rdx
	leal	1(%rax), %esi
	movl	by(%rip), %eax
	movl	%esi, bx(%rip)
	movslq	%esi, %rsi
	leal	1(%rax), %edi
	leaq	(%rdx,%rdx,8), %rax
	salq	$5, %rax
	movl	%edi, by(%rip)
	movslq	%edi, %rdi
	addq	%rdx, %rax
	addq	%r8, %rax
	movq	%rsi, %r8
	salq	$4, %r8
	addq	%rsi, %r8
	imulq	$4913, %rsi, %rsi
	addq	%r8, %rax
	addq	%rdi, %rax
	movl	$1, (%rbx,%rax,4)
	leaq	(%rdi,%rdi,8), %rax
	salq	$5, %rax
	addq	%rdi, %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	salq	$4, %rsi
	addq	%rsi, %rcx
	addq	%rcx, %rax
	addq	%rdx, %rax
	movl	$1, (%rbx,%rax,4)
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	p(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L5
.L8:
	movslq	gx(%rip), %r12
	movslq	gy(%rip), %rbx
	movl	$1, i(%rip)
	testl	%r12d, %r12d
	jle	.L7
	testl	%ebx, %ebx
	leal	1(%rbx), %edx
	leal	-1(%rbx), %r8d
	movq	$-68, %r10
	leaq	20876+map(%rip), %rax
	leaq	dp(%rip), %r11
	movl	$1, %r13d
	movq	%rax, (%rsp)
	leal	1(%r12), %eax
	movl	%eax, 12(%rsp)
	movl	$1, %eax
	cmovg	%edx, %eax
	xorl	%r9d, %r9d
	addq	$2, %r8
	movl	%eax, 8(%rsp)
.L14:
	leaq	68(%r11), %r15
	testl	%ebx, %ebx
	jle	.L9
	cmpl	$1, %r13d
	leaq	68(%r11), %r15
	movq	(%rsp), %rcx
	movl	$1, %eax
	sete	%bpl
	movq	%r15, %rdx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	(%rcx,%r9), %rdi
	movl	$0, 4(%rdx)
	xorl	%esi, %esi
	movl	4(%rdi,%r10), %edi
	testl	%edi, %edi
	jne	.L12
	movl	(%r11,%rax,4), %esi
	movl	%esi, 4(%rdx)
.L12:
	movl	(%rcx), %edi
	testl	%edi, %edi
	jne	.L11
	addl	(%rdx), %esi
	movl	%esi, 4(%rdx)
.L11:
	addq	$1, %rax
	addq	$4, %rdx
	addq	$1160, %rcx
	cmpq	%r8, %rax
	je	.L9
.L13:
	cmpl	$1, %eax
	jne	.L10
	testb	%bpl, %bpl
	je	.L10
	movl	$1, 72+dp(%rip)
	jmp	.L11
.L9:
	addl	$1, %r13d
	addq	$68, %r9
	subq	$68, %r10
	movq	%r15, %r11
	addq	$19720, (%rsp)
	cmpl	12(%rsp), %r13d
	jne	.L14
	movl	8(%rsp), %eax
	movl	%r13d, i(%rip)
	movl	%eax, j(%rip)
.L7:
	movq	%r12, %rax
	salq	$4, %rax
	addq	%r12, %rax
	addq	%rbx, %rax
	leaq	dp(%rip), %rbx
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L15
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L38:
	movl	tc(%rip), %eax
	addl	$1, %eax
	cmpl	Tc(%rip), %eax
	movl	%eax, tc(%rip)
	jl	.L2
.L21:
	addq	$24, %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
.L15:
	.cfi_restore_state
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	tc
	.bss
	.align 4
	.type	tc, @object
	.size	tc, 4
tc:
	.zero	4
	.globl	Tc
	.align 4
	.type	Tc, @object
	.size	Tc, 4
Tc:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.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	by
	.align 4
	.type	by, @object
	.size	by, 4
by:
	.zero	4
	.globl	bx
	.align 4
	.type	bx, @object
	.size	bx, 4
bx:
	.zero	4
	.globl	ay
	.align 4
	.type	ay, @object
	.size	ay, 4
ay:
	.zero	4
	.globl	ax
	.align 4
	.type	ax, @object
	.size	ax, 4
ax:
	.zero	4
	.globl	gy
	.align 4
	.type	gy, @object
	.size	gy, 4
gy:
	.zero	4
	.globl	gx
	.align 4
	.type	gx, @object
	.size	gx, 4
gx:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1156
dp:
	.zero	1156
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 334084
map:
	.zero	334084
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"Miserable Hokusai!"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	Tc(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movl	Tc(%rip), %r9d
	movl	$0, tc(%rip)
	testl	%r9d, %r9d
	jle	.L21
.L2:
	leaq	19652+map(%rip), %rsi
	xorl	%eax, %eax
.L4:
	leaq	-19652(%rsi), %rdx
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	8(%rdx), %rdi
	movq	%rdx, %rcx
	movq	$0, (%rdx)
	addq	$1156, %rdx
	andq	$-8, %rdi
	movq	$0, -8(%rdx)
	subq	%rdi, %rcx
	addl	$1156, %ecx
	shrl	$3, %ecx
	rep stosq
	cmpq	%rsi, %rdx
	jne	.L3
	leaq	19652(%rdx), %rsi
	leaq	353736+map(%rip), %rbx
	cmpq	%rbx, %rsi
	jne	.L4
	leaq	gy(%rip), %rdx
	leaq	gx(%rip), %rsi
	xorl	%eax, %eax
	movl	$17, l(%rip)
	leaq	.LC1(%rip), %rdi
	movl	$17, k(%rip)
	leaq	.LC2(%rip), %r12
	subq	$353736, %rbx
	movl	$17, j(%rip)
	leaq	by(%rip), %rbp
	movl	$17, i(%rip)
	call	__isoc99_scanf@PLT
	leaq	p(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, gx(%rip)
	addl	$1, gy(%rip)
	call	__isoc99_scanf@PLT
	movl	p(%rip), %r8d
	movl	$0, i(%rip)
	testl	%r8d, %r8d
	jle	.L8
.L5:
	movq	%rbp, %r8
	leaq	bx(%rip), %rcx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	ay(%rip), %rdx
	leaq	ax(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	ax(%rip), %eax
	leal	1(%rax), %ecx
	movl	ay(%rip), %eax
	movl	%ecx, ax(%rip)
	movslq	%ecx, %rcx
	imulq	$4913, %rcx, %r8
	leal	1(%rax), %edx
	movl	bx(%rip), %eax
	movl	%edx, ay(%rip)
	movslq	%edx, %rdx
	leal	1(%rax), %esi
	movl	by(%rip), %eax
	movl	%esi, bx(%rip)
	movslq	%esi, %rsi
	leal	1(%rax), %edi
	leaq	(%rdx,%rdx,8), %rax
	salq	$5, %rax
	movl	%edi, by(%rip)
	movslq	%edi, %rdi
	addq	%rdx, %rax
	addq	%r8, %rax
	movq	%rsi, %r8
	salq	$4, %r8
	addq	%rsi, %r8
	imulq	$4913, %rsi, %rsi
	addq	%r8, %rax
	addq	%rdi, %rax
	movl	$1, (%rbx,%rax,4)
	leaq	(%rdi,%rdi,8), %rax
	salq	$5, %rax
	addq	%rdi, %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	salq	$4, %rsi
	addq	%rsi, %rcx
	addq	%rcx, %rax
	addq	%rdx, %rax
	movl	$1, (%rbx,%rax,4)
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	p(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L5
.L8:
	movslq	gx(%rip), %r12
	movslq	gy(%rip), %rbx
	movl	$1, i(%rip)
	testl	%r12d, %r12d
	jle	.L7
	testl	%ebx, %ebx
	leal	1(%rbx), %edx
	leal	-1(%rbx), %r8d
	movq	$-68, %r10
	leaq	20876+map(%rip), %rax
	leaq	dp(%rip), %r11
	movl	$1, %r13d
	movq	%rax, (%rsp)
	leal	1(%r12), %eax
	movl	%eax, 12(%rsp)
	movl	$1, %eax
	cmovg	%edx, %eax
	xorl	%r9d, %r9d
	addq	$2, %r8
	movl	%eax, 8(%rsp)
.L14:
	leaq	68(%r11), %r15
	testl	%ebx, %ebx
	jle	.L9
	cmpl	$1, %r13d
	leaq	68(%r11), %r15
	movq	(%rsp), %rcx
	movl	$1, %eax
	sete	%bpl
	movq	%r15, %rdx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	(%rcx,%r9), %rdi
	movl	$0, 4(%rdx)
	xorl	%esi, %esi
	movl	4(%rdi,%r10), %edi
	testl	%edi, %edi
	jne	.L12
	movl	(%r11,%rax,4), %esi
	movl	%esi, 4(%rdx)
.L12:
	movl	(%rcx), %edi
	testl	%edi, %edi
	jne	.L11
	addl	(%rdx), %esi
	movl	%esi, 4(%rdx)
.L11:
	addq	$1, %rax
	addq	$4, %rdx
	addq	$1160, %rcx
	cmpq	%r8, %rax
	je	.L9
.L13:
	cmpl	$1, %eax
	jne	.L10
	testb	%bpl, %bpl
	je	.L10
	movl	$1, 72+dp(%rip)
	jmp	.L11
.L9:
	addl	$1, %r13d
	addq	$68, %r9
	subq	$68, %r10
	movq	%r15, %r11
	addq	$19720, (%rsp)
	cmpl	12(%rsp), %r13d
	jne	.L14
	movl	8(%rsp), %eax
	movl	%r13d, i(%rip)
	movl	%eax, j(%rip)
.L7:
	movq	%r12, %rax
	salq	$4, %rax
	addq	%r12, %rax
	addq	%rbx, %rax
	leaq	dp(%rip), %rbx
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L15
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L38:
	movl	tc(%rip), %eax
	addl	$1, %eax
	cmpl	Tc(%rip), %eax
	movl	%eax, tc(%rip)
	jl	.L2
.L21:
	addq	$24, %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
.L15:
	.cfi_restore_state
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	tc
	.bss
	.align 4
	.type	tc, @object
	.size	tc, 4
tc:
	.zero	4
	.globl	Tc
	.align 4
	.type	Tc, @object
	.size	Tc, 4
Tc:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.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	by
	.align 4
	.type	by, @object
	.size	by, 4
by:
	.zero	4
	.globl	bx
	.align 4
	.type	bx, @object
	.size	bx, 4
bx:
	.zero	4
	.globl	ay
	.align 4
	.type	ay, @object
	.size	ay, 4
ay:
	.zero	4
	.globl	ax
	.align 4
	.type	ax, @object
	.size	ax, 4
ax:
	.zero	4
	.globl	gy
	.align 4
	.type	gy, @object
	.size	gy, 4
gy:
	.zero	4
	.globl	gx
	.align 4
	.type	gx, @object
	.size	gx, 4
gx:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1156
dp:
	.zero	1156
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 334084
map:
	.zero	334084
	.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 map[17][17][17][17];
int dp[17][17];
int p;
int gx,gy;
int ax,ay,bx,by;
int i,j,k,l;
int Tc,tc;
int main(){
  scanf("%d",&Tc);
  for(tc=0;tc<Tc;tc++){

    for(i=0;i<17;i++)
      for(j=0;j<17;j++)
	for(k=0;k<17;k++)
	  for(l=0;l<17;l++)
	    map[i][j][k][l]=0;



    scanf("%d %d",&gx,&gy);
    gx++;
    gy++;
    scanf("%d",&p);
	
    for(i=0;i<p;i++){
      scanf("%d %d %d %d",&ax,&ay,&bx,&by);
      ax++;
      ay++;
      bx++;
      by++;
      map[ax][ay][bx][by]=1;
      map[bx][by][ax][ay]=1;
    }

    for(i=1;i<=gx;i++){
      for(j=1;j<=gy;j++){
	if(i==1&&j==1){
	  dp[i][j]=1;
	}else{
	  dp[i][j]=0;
	  if(map[i][j][i-1][j]==0)dp[i][j]+=dp[i-1][j];
	  if(map[i][j][i][j-1]==0)dp[i][j]+=dp[i][j-1];
	}
      }
    }

    if(dp[gx][gy]==0){
      printf("Miserable Hokusai!\n");
    }else{
      printf("%d\n",dp[gx][gy]);
    }

  }
  return 0;
}
4
2 2
0
1 2
2
0 0 0 1
0 0 1 0
4 3
4
1 0 0 0
3 3 4 3
4 1 4 0
0 2 0 3
15 15
0
 4
2 2
0
1 2
2
0 0 0 1
0 0 1 0
4 3
4
1 0 0 0
3 3 4 3
4 0 4 0
0 2 0 3
15 3
0
 4
2 2
0
0 2
2
0 0 0 1
0 0 1 0
2 3
4
1 0 0 0
3 3 4 3
4 0 4 0
0 2 0 3
14 3
0
 4
2 3
0
1 1
2
0 0 0 1
0 0 1 0
4 3
4
1 0 0 0
3 3 4 3
4 1 4 0
0 2 0 3
15 15
0
 4
2 2
0
1 2
2
0 0 0 1
0 0 1 0
2 6
4
1 0 0 0
3 3 4 3
4 1 4 0
0 2 0 3
15 15
0
 4
2 2
0
1 2
2
0 0 0 1
0 0 1 0
4 3
4
1 0 0 0
3 3 2 3
4 0 4 0
0 2 0 3
15 3
0
 4
3 2
0
0 2
2
0 0 0 1
0 0 1 0
2 3
4
1 0 0 0
3 1 4 3
4 0 1 0
0 2 0 3
14 3
0
 4
2 2
0
1 2
2
0 0 0 1
0 0 1 0
4 3
4
1 0 0 0
3 3 2 3
4 0 4 0
0 2 0 3
1 3
0
 4
6 2
0
0 2
2
0 0 0 1
0 0 1 0
2 3
4
1 0 0 0
3 1 4 3
4 0 1 0
0 2 0 3
14 3
0
 4
2 2
0
1 2
2
1 0 0 1
0 0 1 0
4 3
4
1 0 0 0
3 3 4 3
4 1 4 0
0 2 0 3
15 15
0

6
Miserable Hokusai!
5
155117520
 6
Miserable Hokusai!
5
816
 6
Miserable Hokusai!
5
680
 10
Miserable Hokusai!
5
155117520
 6
Miserable Hokusai!
11
155117520
 6
Miserable Hokusai!
9
816
 10
Miserable Hokusai!
5
680
 6
Miserable Hokusai!
9
4
 28
Miserable Hokusai!
5
680
 6
2
5
155117520

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 map[17][17][17][17];
int dp[17][17];
int p;
int gx,gy;
int ax,ay,bx,by;
int i,j,k,l;
int Tc,tc;
int main(){
  scanf("%d",&Tc);
  for(tc=0;tc<Tc;tc++){

    for(i=0;i<17;i++)
      for(j=0;j<17;j++)
	for(k=0;k<17;k++)
	  for(l=0;l<17;l++)
	    map[i][j][k][l]=0;



    scanf("%d %d",&gx,&gy);
    gx++;
    gy++;
    scanf("%d",&p);
	
    for(i=0;i<p;i++){
      scanf("%d %d %d %d",&ax,&ay,&bx,&by);
      ax++;
      ay++;
      bx++;
      by++;
      map[ax][ay][bx][by]=1;
      map[bx][by][ax][ay]=1;
    }

    for(i=1;i<=gx;i++){
      for(j=1;j<=gy;j++){
	if(i==1&&j==1){
	  dp[i][j]=1;
	}else{
	  dp[i][j]=0;
	  if(map[i][j][i-1][j]==0)dp[i][j]+=dp[i-1][j];
	  if(map[i][j][i][j-1]==0)dp[i][j]+=dp[i][j-1];
	}
      }
    }

    if(dp[gx][gy]==0){
      printf("Miserable Hokusai!\n");
    }else{
      printf("%d\n",dp[gx][gy]);
    }

  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 334084
map:
	.zero	334084
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1156
dp:
	.zero	1156
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	gx
	.align 4
	.type	gx, @object
	.size	gx, 4
gx:
	.zero	4
	.globl	gy
	.align 4
	.type	gy, @object
	.size	gy, 4
gy:
	.zero	4
	.globl	ax
	.align 4
	.type	ax, @object
	.size	ax, 4
ax:
	.zero	4
	.globl	ay
	.align 4
	.type	ay, @object
	.size	ay, 4
ay:
	.zero	4
	.globl	bx
	.align 4
	.type	bx, @object
	.size	bx, 4
bx:
	.zero	4
	.globl	by
	.align 4
	.type	by, @object
	.size	by, 4
by:
	.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	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	Tc
	.align 4
	.type	Tc, @object
	.size	Tc, 4
Tc:
	.zero	4
	.globl	tc
	.align 4
	.type	tc, @object
	.size	tc, 4
tc:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"Miserable Hokusai!"
.LC4:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	Tc(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, tc(%rip)
	jmp	.L2
.L22:
	movl	$0, i(%rip)
	jmp	.L3
.L10:
	movl	$0, j(%rip)
	jmp	.L4
.L9:
	movl	$0, k(%rip)
	jmp	.L5
.L8:
	movl	$0, l(%rip)
	jmp	.L6
.L7:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movl	l(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
.L6:
	movl	l(%rip), %eax
	cmpl	$16, %eax
	jle	.L7
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L5:
	movl	k(%rip), %eax
	cmpl	$16, %eax
	jle	.L8
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L4:
	movl	j(%rip), %eax
	cmpl	$16, %eax
	jle	.L9
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %eax
	cmpl	$16, %eax
	jle	.L10
	leaq	gy(%rip), %rax
	movq	%rax, %rdx
	leaq	gx(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	gx(%rip), %eax
	addl	$1, %eax
	movl	%eax, gx(%rip)
	movl	gy(%rip), %eax
	addl	$1, %eax
	movl	%eax, gy(%rip)
	leaq	p(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L11
.L12:
	leaq	by(%rip), %r8
	leaq	bx(%rip), %rax
	movq	%rax, %rcx
	leaq	ay(%rip), %rax
	movq	%rax, %rdx
	leaq	ax(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	ax(%rip), %eax
	addl	$1, %eax
	movl	%eax, ax(%rip)
	movl	ay(%rip), %eax
	addl	$1, %eax
	movl	%eax, ay(%rip)
	movl	bx(%rip), %eax
	addl	$1, %eax
	movl	%eax, bx(%rip)
	movl	by(%rip), %eax
	addl	$1, %eax
	movl	%eax, by(%rip)
	movl	ax(%rip), %eax
	movl	ay(%rip), %edx
	movl	bx(%rip), %ecx
	movl	by(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	bx(%rip), %eax
	movl	by(%rip), %edx
	movl	ax(%rip), %ecx
	movl	ay(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	$1, i(%rip)
	jmp	.L13
.L19:
	movl	$1, j(%rip)
	jmp	.L14
.L18:
	movl	i(%rip), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L16
.L15:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	i(%rip), %ecx
	leal	-1(%rcx), %esi
	movl	j(%rip), %ecx
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movslq	%esi, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	i(%rip), %eax
	leal	-1(%rax), %edx
	movl	j(%rip), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	addl	%esi, %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L17:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	i(%rip), %ecx
	movl	j(%rip), %esi
	subl	$1, %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L16
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	subl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	addl	%esi, %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L16:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L14:
	movl	j(%rip), %edx
	movl	gy(%rip), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L13:
	movl	i(%rip), %edx
	movl	gx(%rip), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	gx(%rip), %eax
	movl	gy(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L20
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L21
.L20:
	movl	gx(%rip), %eax
	movl	gy(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L21:
	movl	tc(%rip), %eax
	addl	$1, %eax
	movl	%eax, tc(%rip)
.L2:
	movl	tc(%rip), %edx
	movl	Tc(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 334084
map:
	.zero	334084
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 1156
dp:
	.zero	1156
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	gx
	.align 4
	.type	gx, @object
	.size	gx, 4
gx:
	.zero	4
	.globl	gy
	.align 4
	.type	gy, @object
	.size	gy, 4
gy:
	.zero	4
	.globl	ax
	.align 4
	.type	ax, @object
	.size	ax, 4
ax:
	.zero	4
	.globl	ay
	.align 4
	.type	ay, @object
	.size	ay, 4
ay:
	.zero	4
	.globl	bx
	.align 4
	.type	bx, @object
	.size	bx, 4
bx:
	.zero	4
	.globl	by
	.align 4
	.type	by, @object
	.size	by, 4
by:
	.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	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	Tc
	.align 4
	.type	Tc, @object
	.size	Tc, 4
Tc:
	.zero	4
	.globl	tc
	.align 4
	.type	tc, @object
	.size	tc, 4
tc:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"Miserable Hokusai!"
.LC4:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	Tc(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, tc(%rip)
	jmp	.L2
.L22:
	movl	$0, i(%rip)
	jmp	.L3
.L10:
	movl	$0, j(%rip)
	jmp	.L4
.L9:
	movl	$0, k(%rip)
	jmp	.L5
.L8:
	movl	$0, l(%rip)
	jmp	.L6
.L7:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	k(%rip), %ecx
	movl	l(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
.L6:
	movl	l(%rip), %eax
	cmpl	$16, %eax
	jle	.L7
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L5:
	movl	k(%rip), %eax
	cmpl	$16, %eax
	jle	.L8
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L4:
	movl	j(%rip), %eax
	cmpl	$16, %eax
	jle	.L9
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %eax
	cmpl	$16, %eax
	jle	.L10
	leaq	gy(%rip), %rax
	movq	%rax, %rdx
	leaq	gx(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	gx(%rip), %eax
	addl	$1, %eax
	movl	%eax, gx(%rip)
	movl	gy(%rip), %eax
	addl	$1, %eax
	movl	%eax, gy(%rip)
	leaq	p(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L11
.L12:
	leaq	by(%rip), %r8
	leaq	bx(%rip), %rax
	movq	%rax, %rcx
	leaq	ay(%rip), %rax
	movq	%rax, %rdx
	leaq	ax(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	ax(%rip), %eax
	addl	$1, %eax
	movl	%eax, ax(%rip)
	movl	ay(%rip), %eax
	addl	$1, %eax
	movl	%eax, ay(%rip)
	movl	bx(%rip), %eax
	addl	$1, %eax
	movl	%eax, bx(%rip)
	movl	by(%rip), %eax
	addl	$1, %eax
	movl	%eax, by(%rip)
	movl	ax(%rip), %eax
	movl	ay(%rip), %edx
	movl	bx(%rip), %ecx
	movl	by(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	bx(%rip), %eax
	movl	by(%rip), %edx
	movl	ax(%rip), %ecx
	movl	ay(%rip), %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	p(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	$1, i(%rip)
	jmp	.L13
.L19:
	movl	$1, j(%rip)
	jmp	.L14
.L18:
	movl	i(%rip), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	j(%rip), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L16
.L15:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	i(%rip), %ecx
	leal	-1(%rcx), %esi
	movl	j(%rip), %ecx
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movslq	%esi, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	i(%rip), %eax
	leal	-1(%rax), %edx
	movl	j(%rip), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	addl	%esi, %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L17:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	i(%rip), %ecx
	movl	j(%rip), %esi
	subl	$1, %esi
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$5, %rax
	addq	%rdx, %rax
	imulq	$4913, %rsi, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L16
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	subl	$1, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	addl	%esi, %ecx
	movslq	%edx, %rsi
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L16:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L14:
	movl	j(%rip), %edx
	movl	gy(%rip), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L13:
	movl	i(%rip), %edx
	movl	gx(%rip), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	gx(%rip), %eax
	movl	gy(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L20
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L21
.L20:
	movl	gx(%rip), %eax
	movl	gy(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L21:
	movl	tc(%rip), %eax
	addl	$1, %eax
	movl	%eax, tc(%rip)
.L2:
	movl	tc(%rip), %edx
	movl	Tc(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
