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 Max(x,y) ((x>y)?x:y)
int dx[2][7]={{0,1,1,1,0,-1},
			  {-1,0,1,0,-1,-1}};
int dy[6]={-1,-1,0,1,1,0,};
int map[105][105];
typedef struct p{
	int x,y;
}P;
P q[500],sq[500],c;
int qn,sqn;
int main(){
	int i,j,w,h,ans=0;
	scanf("%d%d",&w,&h);
	memset(map,0,sizeof(map));
	for(i=0;i<=h+3;i++)map[i][0]=map[i][w+3]=-1;
	for(i=1;i<=w+2;i++)map[0][i]=map[h+3][i]=-1;
	for(i=2;i<=h+1;i++){
		for(j=2;j<=w+1;j++){
			scanf("%d",&map[i][j]);
		}
	}
	q[0]=(P){1,1};qn=1;
	map[1][1]=2;
	while(qn!=0){
		sqn=0;
		for(i=0;i<qn;i++){
			for(j=0;j<6;j++){
				c=(P){q[i].x+dx[q[i].y%2][j],q[i].y+dy[j]};
				if(map[c.y][c.x]==1)ans++;
				else if(map[c.y][c.x]==0){
					sq[sqn]=c;
					sqn++;
					map[c.y][c.x]=2;
				}
			}
		}
		memcpy(q,sq,sizeof(P)*sqn);
		qn=sqn;
	}
	printf("%d\n",ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dx
	.data
	.align 32
	.type	dx, @object
	.size	dx, 56
dx:
	.long	0
	.long	1
	.long	1
	.long	1
	.long	0
	.long	-1
	.zero	4
	.long	-1
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	-1
	.zero	4
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 24
dy:
	.long	-1
	.long	-1
	.long	0
	.long	1
	.long	1
	.long	0
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 44100
map:
	.zero	44100
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 4000
q:
	.zero	4000
	.globl	sq
	.align 32
	.type	sq, @object
	.size	sq, 4000
sq:
	.zero	4000
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	qn
	.align 4
	.type	qn, @object
	.size	qn, 4
qn:
	.zero	4
	.globl	sqn
	.align 4
	.type	sqn, @object
	.size	sqn, 4
sqn:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$44100, %edx
	movl	$0, %esi
	leaq	map(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-28(%rbp), %eax
	leal	3(%rax), %ecx
	movslq	%ecx, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movslq	%ecx, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	imulq	$420, %rax, %rax
	leaq	map(%rip), %rcx
	movl	%edx, (%rax,%rcx)
	addl	$1, -20(%rbp)
.L2:
	movl	-24(%rbp), %eax
	addl	$3, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L3
	movl	$1, -20(%rbp)
	jmp	.L4
.L5:
	movl	-24(%rbp), %eax
	leal	3(%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	map(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-28(%rbp), %eax
	addl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L5
	movl	$2, -20(%rbp)
	jmp	.L6
.L9:
	movl	$2, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%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)
.L7:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jle	.L8
	addl	$1, -20(%rbp)
.L6:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L9
	movl	$1, q(%rip)
	movl	$1, 4+q(%rip)
	movl	$1, qn(%rip)
	movl	$2, 424+map(%rip)
	jmp	.L10
.L17:
	movl	$0, sqn(%rip)
	movl	$0, -20(%rbp)
	jmp	.L11
.L16:
	movl	$0, -16(%rbp)
	jmp	.L12
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+q(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dy(%rip), %rax
	movl	(%rcx,%rax), %eax
	addl	%esi, %eax
	movl	%edx, c(%rip)
	movl	%eax, 4+c(%rip)
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	addl	$1, -12(%rbp)
	jmp	.L14
.L13:
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	sqn(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sq(%rip), %rdx
	movq	c(%rip), %rax
	movq	%rax, (%rcx,%rdx)
	movl	sqn(%rip), %eax
	addl	$1, %eax
	movl	%eax, sqn(%rip)
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$2, (%rdx,%rax)
.L14:
	addl	$1, -16(%rbp)
.L12:
	cmpl	$5, -16(%rbp)
	jle	.L15
	addl	$1, -20(%rbp)
.L11:
	movl	qn(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	sqn(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	sq(%rip), %rax
	movq	%rax, %rsi
	leaq	q(%rip), %rax
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	sqn(%rip), %eax
	movl	%eax, qn(%rip)
.L10:
	movl	qn(%rip), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	map(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	movl	$44100, %edx
	xorl	%esi, %esi
	call	memset@PLT
	movl	36(%rsp), %edi
	movl	32(%rsp), %eax
	movl	%edi, %r8d
	addl	$3, %r8d
	js	.L4
	movl	%r8d, %r9d
	leal	3(%rax), %esi
	leaq	(%r9,%r9,2), %r10
	movslq	%esi, %rsi
	leaq	(%r9,%r10,4), %r10
	leaq	0(,%rsi,4), %rcx
	leaq	(%r9,%r10,8), %r9
	leaq	0(%rbp,%rcx), %rdx
	negq	%rcx
	addq	%r9, %rsi
	leaq	420(%rbp), %r9
	leaq	(%r9,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$-1, (%rdx)
	addq	$420, %rdx
	movl	$-1, -420(%rdx,%rcx)
	cmpq	%rdx, %rsi
	jne	.L3
.L4:
	leal	2(%rax), %esi
	testl	%esi, %esi
	jle	.L11
	movslq	%edi, %rcx
	movq	$-1264, %rdx
	leal	1(%rax), %r9d
	imulq	$420, %rcx, %rcx
	subq	%rcx, %rdx
	cmpq	$8, %rdx
	jbe	.L8
	cmpl	$3, %r9d
	jbe	.L8
	leaq	1264(%rbp,%rcx), %r10
	movl	%esi, %ecx
	leaq	4+map(%rip), %r9
	xorl	%edx, %edx
	shrl	$2, %ecx
	pcmpeqd	%xmm0, %xmm0
	salq	$4, %rcx
.L9:
	movups	%xmm0, (%r10,%rdx)
	movups	%xmm0, (%r9,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	.L9
	movl	%esi, %edx
	andl	$-4, %edx
	leal	1(%rdx), %r9d
	cmpl	%esi, %edx
	je	.L11
	movslq	%r8d, %rcx
	movslq	%r9d, %r9
	imulq	$105, %rcx, %rcx
	leaq	(%rcx,%r9), %r8
	movl	$-1, 0(%rbp,%r8,4)
	leal	2(%rdx), %r8d
	movl	$-1, 0(%rbp,%r9,4)
	cmpl	%eax, %edx
	jg	.L11
	movslq	%r8d, %r8
	addl	$3, %edx
	leaq	(%rcx,%r8), %r9
	movl	$-1, 0(%rbp,%r9,4)
	movl	$-1, 0(%rbp,%r8,4)
	cmpl	%edx, %esi
	jl	.L11
	movslq	%edx, %rdx
	addq	%rdx, %rcx
	movl	$-1, 0(%rbp,%rcx,4)
	movl	$-1, 0(%rbp,%rdx,4)
.L11:
	leaq	848+map(%rip), %r15
	movl	$2, %r14d
	leaq	.LC1(%rip), %r13
	testl	%edi, %edi
	jle	.L7
	testl	%eax, %eax
	jle	.L7
.L37:
	movq	%r15, %r12
	movl	$2, %ebx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	movl	%ebx, %edx
	addl	$1, %ebx
	cmpl	%edx, %eax
	jge	.L15
	cmpl	36(%rsp), %r14d
	jg	.L7
	addl	$1, %r14d
	addq	$420, %r15
	testl	%eax, %eax
	jg	.L37
.L7:
	movq	.LC2(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r9d, %r9d
	movl	$1, %edx
	movl	$1, %ecx
	movl	$1, qn(%rip)
	movl	$1, %r8d
	movq	%rax, q(%rip)
	movl	dy(%rip), %eax
	leaq	q(%rip), %rdi
	leaq	dx(%rip), %r13
	leaq	c(%rip), %r12
	leaq	sq(%rip), %r15
	movl	$2, 424+map(%rip)
	movl	%eax, 8(%rsp)
	movl	4+dy(%rip), %eax
	movl	$0, sqn(%rip)
	movl	%eax, 12(%rsp)
	movl	8+dy(%rip), %eax
	movl	%eax, 16(%rsp)
	movl	12+dy(%rip), %eax
	movl	%eax, 20(%rsp)
	movl	16+dy(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	20+dy(%rip), %eax
	movl	%eax, 28(%rsp)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L55:
	testl	%r10d, %r10d
	jne	.L19
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L19:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	4(%r13,%rsi,4), %r10d
	movl	12(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm2
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm2, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L20
	testl	%r10d, %r10d
	jne	.L21
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L21:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	8(%r13,%rsi,4), %r10d
	movl	16(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm3
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm3, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L22
	testl	%r10d, %r10d
	jne	.L23
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L23:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	12(%r13,%rsi,4), %r10d
	movl	20(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm4
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm4, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L24
	testl	%r10d, %r10d
	jne	.L25
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L25:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	16(%r13,%rsi,4), %r10d
	movl	24(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm5
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm5, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L26
	testl	%r10d, %r10d
	jne	.L27
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L27:
	addl	28(%rsp), %edx
	leaq	0(,%rax,8), %rsi
	movd	%edx, %xmm6
	movslq	%edx, %rdx
	subq	%rax, %rsi
	leaq	(%rdx,%rdx,2), %rax
	addl	20(%r13,%rsi,4), %ecx
	leaq	(%rdx,%rax,4), %rax
	movd	%ecx, %xmm0
	movslq	%ecx, %rcx
	leaq	(%rdx,%rax,8), %rax
	punpckldq	%xmm6, %xmm0
	addq	%rcx, %rax
	movq	%xmm0, (%r12)
	movl	0(%rbp,%rax,4), %edx
	cmpl	$1, %edx
	je	.L28
	testl	%edx, %edx
	jne	.L29
	movq	c(%rip), %rcx
	movslq	%ebx, %rdx
	addl	$1, %r9d
	addl	$1, %ebx
	movl	%ebx, sqn(%rip)
	movq	%rcx, (%r15,%rdx,8)
	movl	$2, 0(%rbp,%rax,4)
	cmpl	%r9d, %r8d
	jle	.L54
.L33:
	movslq	%r9d, %rax
	movl	(%rdi,%rax,8), %ecx
	movl	4(%rdi,%rax,8), %edx
.L17:
	movl	%edx, %esi
	shrl	$31, %esi
	leal	(%rdx,%rsi), %eax
	andl	$1, %eax
	subl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	0(%r13,%rsi,4), %r10d
	movl	8(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm1
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm1, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	jne	.L55
	addl	$1, %r14d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L28:
	addl	$1, %r14d
.L29:
	addl	$1, %r9d
	cmpl	%r9d, %r8d
	jg	.L33
	movslq	%ebx, %rdx
	movl	$4000, %ecx
	movq	%r15, %rsi
	salq	$3, %rdx
	call	__memcpy_chk@PLT
	movl	%ebx, qn(%rip)
	movq	%rax, %rdi
	testl	%ebx, %ebx
	je	.L56
.L34:
	movl	$0, sqn(%rip)
	movl	%ebx, %r8d
	xorl	%r9d, %r9d
	xorl	%ebx, %ebx
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L26:
	addl	$1, %r14d
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %r14d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L20:
	addl	$1, %r14d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	addl	$1, %r14d
	jmp	.L23
.L54:
	movslq	%ebx, %rdx
	movl	$4000, %ecx
	movq	%r15, %rsi
	salq	$3, %rdx
	call	__memcpy_chk@PLT
	movl	%ebx, qn(%rip)
	movq	%rax, %rdi
	jmp	.L34
.L56:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$56, %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
.L8:
	.cfi_restore_state
	leaq	4+map(%rip), %rdx
	addq	$1260, %rcx
	leaq	4(%rdx), %rsi
	leaq	(%rsi,%r9,4), %rsi
.L13:
	movl	$-1, (%rdx,%rcx)
	addq	$4, %rdx
	movl	$-1, -4(%rdx)
	cmpq	%rsi, %rdx
	jne	.L13
	jmp	.L11
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	sqn
	.bss
	.align 4
	.type	sqn, @object
	.size	sqn, 4
sqn:
	.zero	4
	.globl	qn
	.align 4
	.type	qn, @object
	.size	qn, 4
qn:
	.zero	4
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	sq
	.align 32
	.type	sq, @object
	.size	sq, 4000
sq:
	.zero	4000
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 4000
q:
	.zero	4000
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 44100
map:
	.zero	44100
	.globl	dy
	.data
	.align 16
	.type	dy, @object
	.size	dy, 24
dy:
	.long	-1
	.long	-1
	.long	0
	.long	1
	.long	1
	.long	0
	.globl	dx
	.align 32
	.type	dx, @object
	.size	dx, 56
dx:
	.long	0
	.long	1
	.long	1
	.long	1
	.long	0
	.long	-1
	.zero	4
	.long	-1
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	-1
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	map(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	movl	$44100, %edx
	xorl	%esi, %esi
	call	memset@PLT
	movl	36(%rsp), %edi
	movl	32(%rsp), %eax
	movl	%edi, %r8d
	addl	$3, %r8d
	js	.L4
	movl	%r8d, %r9d
	leal	3(%rax), %esi
	leaq	(%r9,%r9,2), %r10
	movslq	%esi, %rsi
	leaq	(%r9,%r10,4), %r10
	leaq	0(,%rsi,4), %rcx
	leaq	(%r9,%r10,8), %r9
	leaq	0(%rbp,%rcx), %rdx
	negq	%rcx
	addq	%r9, %rsi
	leaq	420(%rbp), %r9
	leaq	(%r9,%rsi,4), %rsi
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$-1, (%rdx)
	addq	$420, %rdx
	movl	$-1, -420(%rdx,%rcx)
	cmpq	%rdx, %rsi
	jne	.L3
.L4:
	leal	2(%rax), %esi
	testl	%esi, %esi
	jle	.L11
	movslq	%edi, %rcx
	movq	$-1264, %rdx
	leal	1(%rax), %r9d
	imulq	$420, %rcx, %rcx
	subq	%rcx, %rdx
	cmpq	$8, %rdx
	jbe	.L8
	cmpl	$3, %r9d
	jbe	.L8
	leaq	1264(%rbp,%rcx), %r10
	movl	%esi, %ecx
	leaq	4+map(%rip), %r9
	xorl	%edx, %edx
	shrl	$2, %ecx
	pcmpeqd	%xmm0, %xmm0
	salq	$4, %rcx
.L9:
	movups	%xmm0, (%r10,%rdx)
	movups	%xmm0, (%r9,%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	.L9
	movl	%esi, %edx
	andl	$-4, %edx
	leal	1(%rdx), %r9d
	cmpl	%esi, %edx
	je	.L11
	movslq	%r8d, %rcx
	movslq	%r9d, %r9
	imulq	$105, %rcx, %rcx
	leaq	(%rcx,%r9), %r8
	movl	$-1, 0(%rbp,%r8,4)
	leal	2(%rdx), %r8d
	movl	$-1, 0(%rbp,%r9,4)
	cmpl	%eax, %edx
	jg	.L11
	movslq	%r8d, %r8
	addl	$3, %edx
	leaq	(%rcx,%r8), %r9
	movl	$-1, 0(%rbp,%r9,4)
	movl	$-1, 0(%rbp,%r8,4)
	cmpl	%edx, %esi
	jl	.L11
	movslq	%edx, %rdx
	addq	%rdx, %rcx
	movl	$-1, 0(%rbp,%rcx,4)
	movl	$-1, 0(%rbp,%rdx,4)
.L11:
	leaq	848+map(%rip), %r15
	movl	$2, %r14d
	leaq	.LC1(%rip), %r13
	testl	%edi, %edi
	jle	.L7
	testl	%eax, %eax
	jle	.L7
.L37:
	movq	%r15, %r12
	movl	$2, %ebx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$4, %r12
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	movl	%ebx, %edx
	addl	$1, %ebx
	cmpl	%edx, %eax
	jge	.L15
	cmpl	36(%rsp), %r14d
	jg	.L7
	addl	$1, %r14d
	addq	$420, %r15
	testl	%eax, %eax
	jg	.L37
.L7:
	movq	.LC2(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r9d, %r9d
	movl	$1, %edx
	movl	$1, %ecx
	movl	$1, qn(%rip)
	movl	$1, %r8d
	movq	%rax, q(%rip)
	movl	dy(%rip), %eax
	leaq	q(%rip), %rdi
	leaq	dx(%rip), %r13
	leaq	c(%rip), %r12
	leaq	sq(%rip), %r15
	movl	$2, 424+map(%rip)
	movl	%eax, 8(%rsp)
	movl	4+dy(%rip), %eax
	movl	$0, sqn(%rip)
	movl	%eax, 12(%rsp)
	movl	8+dy(%rip), %eax
	movl	%eax, 16(%rsp)
	movl	12+dy(%rip), %eax
	movl	%eax, 20(%rsp)
	movl	16+dy(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	20+dy(%rip), %eax
	movl	%eax, 28(%rsp)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L55:
	testl	%r10d, %r10d
	jne	.L19
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L19:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	4(%r13,%rsi,4), %r10d
	movl	12(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm2
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm2, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L20
	testl	%r10d, %r10d
	jne	.L21
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L21:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	8(%r13,%rsi,4), %r10d
	movl	16(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm3
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm3, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L22
	testl	%r10d, %r10d
	jne	.L23
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L23:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	12(%r13,%rsi,4), %r10d
	movl	20(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm4
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm4, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L24
	testl	%r10d, %r10d
	jne	.L25
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L25:
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	16(%r13,%rsi,4), %r10d
	movl	24(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm5
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm5, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	je	.L26
	testl	%r10d, %r10d
	jne	.L27
	movq	c(%rip), %r11
	movslq	%ebx, %r10
	addl	$1, %ebx
	movl	$2, 0(%rbp,%rsi,4)
	movl	%ebx, sqn(%rip)
	movq	%r11, (%r15,%r10,8)
.L27:
	addl	28(%rsp), %edx
	leaq	0(,%rax,8), %rsi
	movd	%edx, %xmm6
	movslq	%edx, %rdx
	subq	%rax, %rsi
	leaq	(%rdx,%rdx,2), %rax
	addl	20(%r13,%rsi,4), %ecx
	leaq	(%rdx,%rax,4), %rax
	movd	%ecx, %xmm0
	movslq	%ecx, %rcx
	leaq	(%rdx,%rax,8), %rax
	punpckldq	%xmm6, %xmm0
	addq	%rcx, %rax
	movq	%xmm0, (%r12)
	movl	0(%rbp,%rax,4), %edx
	cmpl	$1, %edx
	je	.L28
	testl	%edx, %edx
	jne	.L29
	movq	c(%rip), %rcx
	movslq	%ebx, %rdx
	addl	$1, %r9d
	addl	$1, %ebx
	movl	%ebx, sqn(%rip)
	movq	%rcx, (%r15,%rdx,8)
	movl	$2, 0(%rbp,%rax,4)
	cmpl	%r9d, %r8d
	jle	.L54
.L33:
	movslq	%r9d, %rax
	movl	(%rdi,%rax,8), %ecx
	movl	4(%rdi,%rax,8), %edx
.L17:
	movl	%edx, %esi
	shrl	$31, %esi
	leal	(%rdx,%rsi), %eax
	andl	$1, %eax
	subl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	subq	%rax, %rsi
	movl	0(%r13,%rsi,4), %r10d
	movl	8(%rsp), %esi
	addl	%edx, %esi
	addl	%ecx, %r10d
	movd	%esi, %xmm1
	movslq	%esi, %rsi
	movd	%r10d, %xmm0
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,2), %r11
	punpckldq	%xmm1, %xmm0
	leaq	(%rsi,%r11,4), %r11
	movq	%xmm0, (%r12)
	leaq	(%rsi,%r11,8), %rsi
	addq	%r10, %rsi
	movl	0(%rbp,%rsi,4), %r10d
	cmpl	$1, %r10d
	jne	.L55
	addl	$1, %r14d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L28:
	addl	$1, %r14d
.L29:
	addl	$1, %r9d
	cmpl	%r9d, %r8d
	jg	.L33
	movslq	%ebx, %rdx
	movl	$4000, %ecx
	movq	%r15, %rsi
	salq	$3, %rdx
	call	__memcpy_chk@PLT
	movl	%ebx, qn(%rip)
	movq	%rax, %rdi
	testl	%ebx, %ebx
	je	.L56
.L34:
	movl	$0, sqn(%rip)
	movl	%ebx, %r8d
	xorl	%r9d, %r9d
	xorl	%ebx, %ebx
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L26:
	addl	$1, %r14d
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %r14d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L20:
	addl	$1, %r14d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	addl	$1, %r14d
	jmp	.L23
.L54:
	movslq	%ebx, %rdx
	movl	$4000, %ecx
	movq	%r15, %rsi
	salq	$3, %rdx
	call	__memcpy_chk@PLT
	movl	%ebx, qn(%rip)
	movq	%rax, %rdi
	jmp	.L34
.L56:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$56, %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
.L8:
	.cfi_restore_state
	leaq	4+map(%rip), %rdx
	addq	$1260, %rcx
	leaq	4(%rdx), %rsi
	leaq	(%rsi,%r9,4), %rsi
.L13:
	movl	$-1, (%rdx,%rcx)
	addq	$4, %rdx
	movl	$-1, -4(%rdx)
	cmpq	%rsi, %rdx
	jne	.L13
	jmp	.L11
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	sqn
	.bss
	.align 4
	.type	sqn, @object
	.size	sqn, 4
sqn:
	.zero	4
	.globl	qn
	.align 4
	.type	qn, @object
	.size	qn, 4
qn:
	.zero	4
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	sq
	.align 32
	.type	sq, @object
	.size	sq, 4000
sq:
	.zero	4000
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 4000
q:
	.zero	4000
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 44100
map:
	.zero	44100
	.globl	dy
	.data
	.align 16
	.type	dy, @object
	.size	dy, 24
dy:
	.long	-1
	.long	-1
	.long	0
	.long	1
	.long	1
	.long	0
	.globl	dx
	.align 32
	.type	dx, @object
	.size	dx, 56
dx:
	.long	0
	.long	1
	.long	1
	.long	1
	.long	0
	.long	-1
	.zero	4
	.long	-1
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	-1
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	1
	.long	1
	.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 Max(x,y) ((x>y)?x:y)
int dx[2][7]={{0,1,1,1,0,-1},
			  {-1,0,1,0,-1,-1}};
int dy[6]={-1,-1,0,1,1,0,};
int map[105][105];
typedef struct p{
	int x,y;
}P;
P q[500],sq[500],c;
int qn,sqn;
int main(){
	int i,j,w,h,ans=0;
	scanf("%d%d",&w,&h);
	memset(map,0,sizeof(map));
	for(i=0;i<=h+3;i++)map[i][0]=map[i][w+3]=-1;
	for(i=1;i<=w+2;i++)map[0][i]=map[h+3][i]=-1;
	for(i=2;i<=h+1;i++){
		for(j=2;j<=w+1;j++){
			scanf("%d",&map[i][j]);
		}
	}
	q[0]=(P){1,1};qn=1;
	map[1][1]=2;
	while(qn!=0){
		sqn=0;
		for(i=0;i<qn;i++){
			for(j=0;j<6;j++){
				c=(P){q[i].x+dx[q[i].y%2][j],q[i].y+dy[j]};
				if(map[c.y][c.x]==1)ans++;
				else if(map[c.y][c.x]==0){
					sq[sqn]=c;
					sqn++;
					map[c.y][c.x]=2;
				}
			}
		}
		memcpy(q,sq,sizeof(P)*sqn);
		qn=sqn;
	}
	printf("%d\n",ans);
	return 0;
}
8 4
0 1 0 1 1 1 1 1
0 1 1 0 0 1 0 0
1 0 1 0 1 1 1 1
0 1 1 0 1 0 1 0
 8 0
0 1 0 1 1 1 1 1
0 1 1 0 0 1 0 0
1 0 1 0 1 1 1 1
0 1 1 0 1 0 1 0
 8 1
0 1 0 1 0 1 1 1
0 1 1 -1 0 1 -1 1
2 1 1 0 1 1 1 1
0 1 1 1 1 0 0 0
 11 1
0 1 0 1 0 1 1 1
0 1 1 -4 0 1 -1 1
2 1 1 0 1 1 1 1
0 1 1 1 1 0 -1 0
 8 0
0 1 0 1 1 1 1 0
0 1 1 0 0 1 0 0
1 0 1 0 1 1 1 1
0 1 1 0 1 0 1 0
 8 0
0 1 0 2 1 1 1 0
0 1 1 0 0 1 0 0
1 0 1 0 1 1 1 1
0 1 1 0 1 0 1 0
 8 0
0 1 0 2 1 1 1 0
0 1 1 0 0 1 0 0
1 0 1 0 2 1 1 1
0 1 1 0 1 0 1 0
 8 0
0 1 0 2 1 1 1 0
0 2 1 0 0 1 0 0
1 0 1 0 2 1 1 1
0 1 1 0 1 0 1 0
 8 0
0 1 0 2 1 1 2 0
0 2 1 0 0 1 0 0
1 0 1 0 2 1 1 1
0 1 1 0 1 0 1 0
 8 0
0 1 0 2 1 1 2 0
0 2 1 0 0 1 0 0
1 0 1 0 2 1 1 1
0 1 1 0 1 0 1 1

64
 0
 26
 36
 0
 0
 0
 0
 0
 0

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

```c
#include<stdio.h>
#include<string.h>
#define Max(x,y) ((x>y)?x:y)
int dx[2][7]={{0,1,1,1,0,-1},
			  {-1,0,1,0,-1,-1}};
int dy[6]={-1,-1,0,1,1,0,};
int map[105][105];
typedef struct p{
	int x,y;
}P;
P q[500],sq[500],c;
int qn,sqn;
int main(){
	int i,j,w,h,ans=0;
	scanf("%d%d",&w,&h);
	memset(map,0,sizeof(map));
	for(i=0;i<=h+3;i++)map[i][0]=map[i][w+3]=-1;
	for(i=1;i<=w+2;i++)map[0][i]=map[h+3][i]=-1;
	for(i=2;i<=h+1;i++){
		for(j=2;j<=w+1;j++){
			scanf("%d",&map[i][j]);
		}
	}
	q[0]=(P){1,1};qn=1;
	map[1][1]=2;
	while(qn!=0){
		sqn=0;
		for(i=0;i<qn;i++){
			for(j=0;j<6;j++){
				c=(P){q[i].x+dx[q[i].y%2][j],q[i].y+dy[j]};
				if(map[c.y][c.x]==1)ans++;
				else if(map[c.y][c.x]==0){
					sq[sqn]=c;
					sqn++;
					map[c.y][c.x]=2;
				}
			}
		}
		memcpy(q,sq,sizeof(P)*sqn);
		qn=sqn;
	}
	printf("%d\n",ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dx
	.data
	.align 32
	.type	dx, @object
	.size	dx, 56
dx:
	.long	0
	.long	1
	.long	1
	.long	1
	.long	0
	.long	-1
	.zero	4
	.long	-1
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	-1
	.zero	4
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 24
dy:
	.long	-1
	.long	-1
	.long	0
	.long	1
	.long	1
	.long	0
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 44100
map:
	.zero	44100
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 4000
q:
	.zero	4000
	.globl	sq
	.align 32
	.type	sq, @object
	.size	sq, 4000
sq:
	.zero	4000
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	qn
	.align 4
	.type	qn, @object
	.size	qn, 4
qn:
	.zero	4
	.globl	sqn
	.align 4
	.type	sqn, @object
	.size	sqn, 4
sqn:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$44100, %edx
	movl	$0, %esi
	leaq	map(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-28(%rbp), %eax
	leal	3(%rax), %ecx
	movslq	%ecx, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movslq	%ecx, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	imulq	$420, %rax, %rax
	leaq	map(%rip), %rcx
	movl	%edx, (%rax,%rcx)
	addl	$1, -20(%rbp)
.L2:
	movl	-24(%rbp), %eax
	addl	$3, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L3
	movl	$1, -20(%rbp)
	jmp	.L4
.L5:
	movl	-24(%rbp), %eax
	leal	3(%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	map(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-28(%rbp), %eax
	addl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L5
	movl	$2, -20(%rbp)
	jmp	.L6
.L9:
	movl	$2, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%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)
.L7:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jle	.L8
	addl	$1, -20(%rbp)
.L6:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L9
	movl	$1, q(%rip)
	movl	$1, 4+q(%rip)
	movl	$1, qn(%rip)
	movl	$2, 424+map(%rip)
	jmp	.L10
.L17:
	movl	$0, sqn(%rip)
	movl	$0, -20(%rbp)
	jmp	.L11
.L16:
	movl	$0, -16(%rbp)
	jmp	.L12
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+q(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dy(%rip), %rax
	movl	(%rcx,%rax), %eax
	addl	%esi, %eax
	movl	%edx, c(%rip)
	movl	%eax, 4+c(%rip)
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	addl	$1, -12(%rbp)
	jmp	.L14
.L13:
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	sqn(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sq(%rip), %rdx
	movq	c(%rip), %rax
	movq	%rax, (%rcx,%rdx)
	movl	sqn(%rip), %eax
	addl	$1, %eax
	movl	%eax, sqn(%rip)
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$2, (%rdx,%rax)
.L14:
	addl	$1, -16(%rbp)
.L12:
	cmpl	$5, -16(%rbp)
	jle	.L15
	addl	$1, -20(%rbp)
.L11:
	movl	qn(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	sqn(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	sq(%rip), %rax
	movq	%rax, %rsi
	leaq	q(%rip), %rax
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	sqn(%rip), %eax
	movl	%eax, qn(%rip)
.L10:
	movl	qn(%rip), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	dx
	.data
	.align 32
	.type	dx, @object
	.size	dx, 56
dx:
	.long	0
	.long	1
	.long	1
	.long	1
	.long	0
	.long	-1
	.zero	4
	.long	-1
	.long	0
	.long	1
	.long	0
	.long	-1
	.long	-1
	.zero	4
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 24
dy:
	.long	-1
	.long	-1
	.long	0
	.long	1
	.long	1
	.long	0
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 44100
map:
	.zero	44100
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 4000
q:
	.zero	4000
	.globl	sq
	.align 32
	.type	sq, @object
	.size	sq, 4000
sq:
	.zero	4000
	.globl	c
	.align 8
	.type	c, @object
	.size	c, 8
c:
	.zero	8
	.globl	qn
	.align 4
	.type	qn, @object
	.size	qn, 4
qn:
	.zero	4
	.globl	sqn
	.align 4
	.type	sqn, @object
	.size	sqn, 4
sqn:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$44100, %edx
	movl	$0, %esi
	leaq	map(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-28(%rbp), %eax
	leal	3(%rax), %ecx
	movslq	%ecx, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movslq	%ecx, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	imulq	$420, %rax, %rax
	leaq	map(%rip), %rcx
	movl	%edx, (%rax,%rcx)
	addl	$1, -20(%rbp)
.L2:
	movl	-24(%rbp), %eax
	addl	$3, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L3
	movl	$1, -20(%rbp)
	jmp	.L4
.L5:
	movl	-24(%rbp), %eax
	leal	3(%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	map(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-28(%rbp), %eax
	addl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L5
	movl	$2, -20(%rbp)
	jmp	.L6
.L9:
	movl	$2, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%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)
.L7:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -16(%rbp)
	jle	.L8
	addl	$1, -20(%rbp)
.L6:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L9
	movl	$1, q(%rip)
	movl	$1, 4+q(%rip)
	movl	$1, qn(%rip)
	movl	$2, 424+map(%rip)
	jmp	.L10
.L17:
	movl	$0, sqn(%rip)
	movl	$0, -20(%rbp)
	jmp	.L11
.L16:
	movl	$0, -16(%rbp)
	jmp	.L12
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+q(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dy(%rip), %rax
	movl	(%rcx,%rax), %eax
	addl	%esi, %eax
	movl	%edx, c(%rip)
	movl	%eax, 4+c(%rip)
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L13
	addl	$1, -12(%rbp)
	jmp	.L14
.L13:
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	sqn(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sq(%rip), %rdx
	movq	c(%rip), %rax
	movq	%rax, (%rcx,%rdx)
	movl	sqn(%rip), %eax
	addl	$1, %eax
	movl	%eax, sqn(%rip)
	movl	4+c(%rip), %eax
	movl	c(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	$2, (%rdx,%rax)
.L14:
	addl	$1, -16(%rbp)
.L12:
	cmpl	$5, -16(%rbp)
	jle	.L15
	addl	$1, -20(%rbp)
.L11:
	movl	qn(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L16
	movl	sqn(%rip), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	sq(%rip), %rax
	movq	%rax, %rsi
	leaq	q(%rip), %rax
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	sqn(%rip), %eax
	movl	%eax, qn(%rip)
.L10:
	movl	qn(%rip), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
