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 main(){
  int w,h,i,j,t,r,x[2550],y[2550],c,nx,ny,k;
  int X[8]={0,1,1,1,0,-1,-1,-1};
  int Y[8]={1,1,0,-1,-1,-1,0,1};
  while(scanf("%d %d",&w,&h),w||h){
    int m[52][52]={0};
    for(i=c=0;i<h;i++){
      for(j=0;j<w;j++){
	scanf("%d",&m[i+1][j+1]);
      }
    }
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	if(!m[i][j])continue;
	y[0  ]=i;
	x[t=0]=j;
	m[i][j]=0;
	c++;
	for(r=1;r-t;t++){
	  for(k=0;k<8;k++){
	    nx=x[t]+X[k];
	    ny=y[t]+Y[k];
	    if(!m[ny][nx])continue;
	    y[r  ]=ny;
	    x[r++]=nx;
	    m[ny][nx]=0;
	  }
	}
	/*for(k=0;k<w*h;k++){
	  if(k%w==0)printf("\n");
	  printf("%d ",m[k/w+1][k%w+1]);
	  }printf("\n");//*/
      }
    }
    printf("%d\n",c);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.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	-28672(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -31312(%rbp)
	movl	$1, -31308(%rbp)
	movl	$1, -31304(%rbp)
	movl	$1, -31300(%rbp)
	movl	$0, -31296(%rbp)
	movl	$-1, -31292(%rbp)
	movl	$-1, -31288(%rbp)
	movl	$-1, -31284(%rbp)
	movl	$1, -31280(%rbp)
	movl	$1, -31276(%rbp)
	movl	$0, -31272(%rbp)
	movl	$-1, -31268(%rbp)
	movl	$-1, -31264(%rbp)
	movl	$-1, -31260(%rbp)
	movl	$0, -31256(%rbp)
	movl	$1, -31252(%rbp)
	jmp	.L2
.L22:
	leaq	-10832(%rbp), %rax
	movl	$10816, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -31328(%rbp)
	movl	-31328(%rbp), %eax
	movl	%eax, -31344(%rbp)
	jmp	.L3
.L6:
	movl	$0, -31340(%rbp)
	jmp	.L4
.L5:
	movl	-31344(%rbp), %eax
	leal	1(%rax), %edx
	movl	-31340(%rbp), %eax
	addl	$1, %eax
	leaq	-10832(%rbp), %rcx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -31340(%rbp)
.L4:
	movl	-31352(%rbp), %eax
	cmpl	%eax, -31340(%rbp)
	jl	.L5
	addl	$1, -31344(%rbp)
.L3:
	movl	-31348(%rbp), %eax
	cmpl	%eax, -31344(%rbp)
	jl	.L6
	movl	$1, -31344(%rbp)
	jmp	.L7
.L18:
	movl	$1, -31340(%rbp)
	jmp	.L8
.L17:
	movl	-31340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31344(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-10832(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L25
	movl	-31344(%rbp), %eax
	movl	%eax, -21040(%rbp)
	movl	$0, -31336(%rbp)
	movl	-31336(%rbp), %eax
	cltq
	movl	-31340(%rbp), %edx
	movl	%edx, -31248(%rbp,%rax,4)
	movl	-31340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31344(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -10832(%rbp,%rax,4)
	addl	$1, -31328(%rbp)
	movl	$1, -31332(%rbp)
	jmp	.L11
.L16:
	movl	$0, -31324(%rbp)
	jmp	.L12
.L15:
	movl	-31336(%rbp), %eax
	cltq
	movl	-31248(%rbp,%rax,4), %edx
	movl	-31324(%rbp), %eax
	cltq
	movl	-31312(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -31320(%rbp)
	movl	-31336(%rbp), %eax
	cltq
	movl	-21040(%rbp,%rax,4), %edx
	movl	-31324(%rbp), %eax
	cltq
	movl	-31280(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -31316(%rbp)
	movl	-31320(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31316(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-10832(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L26
	movl	-31332(%rbp), %eax
	cltq
	movl	-31316(%rbp), %edx
	movl	%edx, -21040(%rbp,%rax,4)
	movl	-31332(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -31332(%rbp)
	cltq
	movl	-31320(%rbp), %edx
	movl	%edx, -31248(%rbp,%rax,4)
	movl	-31320(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31316(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -10832(%rbp,%rax,4)
	jmp	.L14
.L26:
	nop
.L14:
	addl	$1, -31324(%rbp)
.L12:
	cmpl	$7, -31324(%rbp)
	jle	.L15
	addl	$1, -31336(%rbp)
.L11:
	movl	-31332(%rbp), %eax
	cmpl	-31336(%rbp), %eax
	jne	.L16
	jmp	.L10
.L25:
	nop
.L10:
	addl	$1, -31340(%rbp)
.L8:
	movl	-31352(%rbp), %eax
	cmpl	%eax, -31340(%rbp)
	jle	.L17
	addl	$1, -31344(%rbp)
.L7:
	movl	-31348(%rbp), %eax
	cmpl	%eax, -31344(%rbp)
	jle	.L18
	movl	-31328(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-31348(%rbp), %rdx
	leaq	-31352(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-31352(%rbp), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-31348(%rbp), %eax
	testl	%eax, %eax
	je	.L20
.L19:
	movl	$1, %eax
	jmp	.L21
.L20:
	movl	$0, %eax
.L21:
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-28672(%rsp), %r11
	.cfi_def_cfa 11, 28728
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2648, %rsp
	.cfi_def_cfa_offset 31376
	movq	%fs:40, %rax
	movq	%rax, 31304(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 32(%rsp)
.L2:
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %ebx
	movl	60(%rsp), %ebp
	movl	%ebx, %eax
	orl	%ebp, %eax
	je	.L49
	leaq	20480(%rsp), %rdi
	movl	$10816, %edx
	xorl	%esi, %esi
	xorl	%r13d, %r13d
	call	memset@PLT
	leaq	20692(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	%rax, %r14
	testl	%ebp, %ebp
	jle	.L4
	addl	$1, %r13d
	testl	%ebx, %ebx
	jle	.L8
.L30:
	movq	%r14, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %ebx
	addq	$4, %r12
	cmpl	%ebx, %ebp
	jl	.L5
	movl	60(%rsp), %ebp
	cmpl	%r13d, %ebp
	jle	.L50
	addq	$208, %r14
	addl	$1, %r13d
	testl	%ebx, %ebx
	jg	.L30
.L8:
	leal	1(%rbp), %eax
	movl	%ebx, 28(%rsp)
	movl	$1, %r13d
	leal	1(%rbx), %r12d
	movl	%eax, 24(%rsp)
	movl	$0, 12(%rsp)
.L11:
	movl	28(%rsp), %eax
	movq	16(%rsp), %rbp
	movl	$1, %ebx
	testl	%eax, %eax
	jg	.L23
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %ebx
	addq	$4, %rbp
	cmpl	%ebx, %r12d
	je	.L26
.L23:
	movl	0(%rbp), %r15d
	testl	%r15d, %r15d
	je	.L12
	addl	$1, 12(%rsp)
	leaq	64(%rsp), %r8
	movl	%r13d, %esi
	movl	%ebx, %ecx
	movl	%r13d, 10272(%rsp)
	movl	$1, %eax
	xorl	%r11d, %r11d
	leaq	10272(%rsp), %rdi
	movl	%ebx, 64(%rsp)
	movl	$0, 0(%rbp)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L51:
	movslq	%edx, %r10
	leal	1(%rdx), %eax
	addq	$4, %r8
	addq	$4, %rdi
	movl	$0, 20480(%rsp,%r9,4)
	leal	1(%r11), %r9d
	movl	%esi, 10272(%rsp,%r10,4)
	movl	%ecx, 64(%rsp,%r10,4)
	cmpl	%edx, %r11d
	je	.L12
.L21:
	movl	(%r8), %ecx
	movl	(%rdi), %esi
	movl	%r9d, %r11d
.L22:
	leal	1(%rsi), %r15d
	movslq	%ecx, %rdx
	movslq	%r15d, %r9
	leaq	(%r9,%r9,2), %r10
	leaq	(%r9,%r10,4), %r10
	leaq	(%rdx,%r10,4), %r10
	movl	%eax, %edx
	movl	20480(%rsp,%r10,4), %r14d
	testl	%r14d, %r14d
	je	.L13
	cltq
	addl	$1, %edx
	movl	$0, 20480(%rsp,%r10,4)
	movl	%r15d, 10272(%rsp,%rax,4)
	movl	(%rdi), %esi
	movl	%ecx, 64(%rsp,%rax,4)
	movl	(%r8), %ecx
	leal	1(%rsi), %r15d
	movslq	%r15d, %r9
.L13:
	leaq	(%r9,%r9,2), %rax
	leal	1(%rcx), %r10d
	leaq	(%r9,%rax,4), %rax
	movslq	%r10d, %r14
	leaq	(%r14,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r9d
	testl	%r9d, %r9d
	je	.L14
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%r15d, 10272(%rsp,%rcx,4)
	movl	(%rdi), %esi
	movl	%r10d, 64(%rsp,%rcx,4)
	movl	(%r8), %ecx
	leal	1(%rcx), %r10d
	movslq	%r10d, %r14
.L14:
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %r9
	leaq	(%rax,%r9,4), %rax
	leaq	(%r14,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r9d
	testl	%r9d, %r9d
	je	.L15
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%esi, 10272(%rsp,%rcx,4)
	movl	(%rdi), %esi
	movl	%r10d, 64(%rsp,%rcx,4)
	movl	(%r8), %ecx
	leal	1(%rcx), %r10d
	movslq	%r10d, %r14
.L15:
	leal	-1(%rsi), %r9d
	movslq	%r9d, %rax
	leaq	(%rax,%rax,2), %r15
	leaq	(%rax,%r15,4), %r15
	leaq	(%r14,%r15,4), %r14
	movl	20480(%rsp,%r14,4), %r15d
	testl	%r15d, %r15d
	je	.L16
	movl	$0, 20480(%rsp,%r14,4)
	movslq	%edx, %rax
	addl	$1, %edx
	movl	%r9d, 10272(%rsp,%rax,4)
	movl	(%rdi), %esi
	movl	%r10d, 64(%rsp,%rax,4)
	movl	(%r8), %ecx
	leal	-1(%rsi), %r9d
	movslq	%r9d, %rax
.L16:
	leaq	(%rax,%rax,2), %r14
	movslq	%ecx, %r10
	leaq	(%rax,%r14,4), %r14
	leaq	(%r10,%r14,4), %r10
	movl	20480(%rsp,%r10,4), %r14d
	testl	%r14d, %r14d
	je	.L17
	movl	$0, 20480(%rsp,%r10,4)
	movslq	%edx, %rax
	addl	$1, %edx
	movl	%r9d, 10272(%rsp,%rax,4)
	movl	(%rdi), %esi
	movl	%ecx, 64(%rsp,%rax,4)
	movl	(%r8), %ecx
	leal	-1(%rsi), %r9d
	movslq	%r9d, %rax
.L17:
	subl	$1, %ecx
	leaq	(%rax,%rax,2), %r14
	movslq	%ecx, %r10
	leaq	(%rax,%r14,4), %rax
	leaq	(%r10,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r15d
	testl	%r15d, %r15d
	je	.L18
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %rsi
	addl	$1, %edx
	movl	%ecx, 64(%rsp,%rsi,4)
	movl	(%r8), %eax
	movl	%r9d, 10272(%rsp,%rsi,4)
	movl	(%rdi), %esi
	leal	-1(%rax), %ecx
	movslq	%ecx, %r10
.L18:
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %r9
	leaq	(%rax,%r9,4), %rax
	leaq	(%r10,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r14d
	testl	%r14d, %r14d
	je	.L19
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %r9
	addl	$1, %edx
	movl	%ecx, 64(%rsp,%r9,4)
	movl	(%r8), %eax
	movl	%esi, 10272(%rsp,%r9,4)
	movl	(%rdi), %esi
	leal	-1(%rax), %ecx
	movslq	%ecx, %r10
.L19:
	addl	$1, %esi
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %r9
	leaq	(%rax,%r9,4), %rax
	leaq	(%r10,%rax,4), %r9
	movl	20480(%rsp,%r9,4), %r10d
	testl	%r10d, %r10d
	jne	.L51
	leal	1(%r11), %r9d
	addq	$4, %r8
	addq	$4, %rdi
	cmpl	%edx, %r9d
	je	.L12
	movl	%edx, %eax
	jmp	.L21
.L26:
	addq	$208, 16(%rsp)
	addl	$1, %r13d
	cmpl	%r13d, 24(%rsp)
	jne	.L11
.L24:
	movl	12(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L50:
	testl	%ebp, %ebp
	jg	.L8
.L4:
	movl	$0, 12(%rsp)
	jmp	.L24
.L49:
	movq	31304(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$31320, %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
.L52:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-28672(%rsp), %r11
	.cfi_def_cfa 11, 28728
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2648, %rsp
	.cfi_def_cfa_offset 31376
	movq	%fs:40, %rax
	movq	%rax, 31304(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 32(%rsp)
.L2:
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %ebx
	movl	60(%rsp), %ebp
	movl	%ebx, %eax
	orl	%ebp, %eax
	je	.L49
	leaq	20480(%rsp), %rdi
	movl	$10816, %edx
	xorl	%esi, %esi
	xorl	%r13d, %r13d
	call	memset@PLT
	leaq	20692(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	%rax, %r14
	testl	%ebp, %ebp
	jle	.L4
	addl	$1, %r13d
	testl	%ebx, %ebx
	jle	.L8
.L30:
	movq	%r14, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %ebx
	addq	$4, %r12
	cmpl	%ebx, %ebp
	jl	.L5
	movl	60(%rsp), %ebp
	cmpl	%r13d, %ebp
	jle	.L50
	addq	$208, %r14
	addl	$1, %r13d
	testl	%ebx, %ebx
	jg	.L30
.L8:
	leal	1(%rbp), %eax
	movl	%ebx, 28(%rsp)
	movl	$1, %r13d
	leal	1(%rbx), %r12d
	movl	%eax, 24(%rsp)
	movl	$0, 12(%rsp)
.L11:
	movl	28(%rsp), %eax
	movq	16(%rsp), %rbp
	movl	$1, %ebx
	testl	%eax, %eax
	jg	.L23
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %ebx
	addq	$4, %rbp
	cmpl	%ebx, %r12d
	je	.L26
.L23:
	movl	0(%rbp), %r15d
	testl	%r15d, %r15d
	je	.L12
	addl	$1, 12(%rsp)
	leaq	64(%rsp), %r8
	movl	%r13d, %esi
	movl	%ebx, %ecx
	movl	%r13d, 10272(%rsp)
	movl	$1, %eax
	xorl	%r11d, %r11d
	leaq	10272(%rsp), %rdi
	movl	%ebx, 64(%rsp)
	movl	$0, 0(%rbp)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L51:
	movslq	%edx, %r10
	leal	1(%rdx), %eax
	addq	$4, %r8
	addq	$4, %rdi
	movl	$0, 20480(%rsp,%r9,4)
	leal	1(%r11), %r9d
	movl	%esi, 10272(%rsp,%r10,4)
	movl	%ecx, 64(%rsp,%r10,4)
	cmpl	%edx, %r11d
	je	.L12
.L21:
	movl	(%r8), %ecx
	movl	(%rdi), %esi
	movl	%r9d, %r11d
.L22:
	leal	1(%rsi), %r15d
	movslq	%ecx, %rdx
	movslq	%r15d, %r9
	leaq	(%r9,%r9,2), %r10
	leaq	(%r9,%r10,4), %r10
	leaq	(%rdx,%r10,4), %r10
	movl	%eax, %edx
	movl	20480(%rsp,%r10,4), %r14d
	testl	%r14d, %r14d
	je	.L13
	cltq
	addl	$1, %edx
	movl	$0, 20480(%rsp,%r10,4)
	movl	%r15d, 10272(%rsp,%rax,4)
	movl	(%rdi), %esi
	movl	%ecx, 64(%rsp,%rax,4)
	movl	(%r8), %ecx
	leal	1(%rsi), %r15d
	movslq	%r15d, %r9
.L13:
	leaq	(%r9,%r9,2), %rax
	leal	1(%rcx), %r10d
	leaq	(%r9,%rax,4), %rax
	movslq	%r10d, %r14
	leaq	(%r14,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r9d
	testl	%r9d, %r9d
	je	.L14
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%r15d, 10272(%rsp,%rcx,4)
	movl	(%rdi), %esi
	movl	%r10d, 64(%rsp,%rcx,4)
	movl	(%r8), %ecx
	leal	1(%rcx), %r10d
	movslq	%r10d, %r14
.L14:
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %r9
	leaq	(%rax,%r9,4), %rax
	leaq	(%r14,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r9d
	testl	%r9d, %r9d
	je	.L15
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%esi, 10272(%rsp,%rcx,4)
	movl	(%rdi), %esi
	movl	%r10d, 64(%rsp,%rcx,4)
	movl	(%r8), %ecx
	leal	1(%rcx), %r10d
	movslq	%r10d, %r14
.L15:
	leal	-1(%rsi), %r9d
	movslq	%r9d, %rax
	leaq	(%rax,%rax,2), %r15
	leaq	(%rax,%r15,4), %r15
	leaq	(%r14,%r15,4), %r14
	movl	20480(%rsp,%r14,4), %r15d
	testl	%r15d, %r15d
	je	.L16
	movl	$0, 20480(%rsp,%r14,4)
	movslq	%edx, %rax
	addl	$1, %edx
	movl	%r9d, 10272(%rsp,%rax,4)
	movl	(%rdi), %esi
	movl	%r10d, 64(%rsp,%rax,4)
	movl	(%r8), %ecx
	leal	-1(%rsi), %r9d
	movslq	%r9d, %rax
.L16:
	leaq	(%rax,%rax,2), %r14
	movslq	%ecx, %r10
	leaq	(%rax,%r14,4), %r14
	leaq	(%r10,%r14,4), %r10
	movl	20480(%rsp,%r10,4), %r14d
	testl	%r14d, %r14d
	je	.L17
	movl	$0, 20480(%rsp,%r10,4)
	movslq	%edx, %rax
	addl	$1, %edx
	movl	%r9d, 10272(%rsp,%rax,4)
	movl	(%rdi), %esi
	movl	%ecx, 64(%rsp,%rax,4)
	movl	(%r8), %ecx
	leal	-1(%rsi), %r9d
	movslq	%r9d, %rax
.L17:
	subl	$1, %ecx
	leaq	(%rax,%rax,2), %r14
	movslq	%ecx, %r10
	leaq	(%rax,%r14,4), %rax
	leaq	(%r10,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r15d
	testl	%r15d, %r15d
	je	.L18
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %rsi
	addl	$1, %edx
	movl	%ecx, 64(%rsp,%rsi,4)
	movl	(%r8), %eax
	movl	%r9d, 10272(%rsp,%rsi,4)
	movl	(%rdi), %esi
	leal	-1(%rax), %ecx
	movslq	%ecx, %r10
.L18:
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %r9
	leaq	(%rax,%r9,4), %rax
	leaq	(%r10,%rax,4), %rax
	movl	20480(%rsp,%rax,4), %r14d
	testl	%r14d, %r14d
	je	.L19
	movl	$0, 20480(%rsp,%rax,4)
	movslq	%edx, %r9
	addl	$1, %edx
	movl	%ecx, 64(%rsp,%r9,4)
	movl	(%r8), %eax
	movl	%esi, 10272(%rsp,%r9,4)
	movl	(%rdi), %esi
	leal	-1(%rax), %ecx
	movslq	%ecx, %r10
.L19:
	addl	$1, %esi
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %r9
	leaq	(%rax,%r9,4), %rax
	leaq	(%r10,%rax,4), %r9
	movl	20480(%rsp,%r9,4), %r10d
	testl	%r10d, %r10d
	jne	.L51
	leal	1(%r11), %r9d
	addq	$4, %r8
	addq	$4, %rdi
	cmpl	%edx, %r9d
	je	.L12
	movl	%edx, %eax
	jmp	.L21
.L26:
	addq	$208, 16(%rsp)
	addl	$1, %r13d
	cmpl	%r13d, 24(%rsp)
	jne	.L11
.L24:
	movl	12(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L50:
	testl	%ebp, %ebp
	jg	.L8
.L4:
	movl	$0, 12(%rsp)
	jmp	.L24
.L49:
	movq	31304(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$31320, %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
.L52:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>
int main(){
  int w,h,i,j,t,r,x[2550],y[2550],c,nx,ny,k;
  int X[8]={0,1,1,1,0,-1,-1,-1};
  int Y[8]={1,1,0,-1,-1,-1,0,1};
  while(scanf("%d %d",&w,&h),w||h){
    int m[52][52]={0};
    for(i=c=0;i<h;i++){
      for(j=0;j<w;j++){
	scanf("%d",&m[i+1][j+1]);
      }
    }
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	if(!m[i][j])continue;
	y[0  ]=i;
	x[t=0]=j;
	m[i][j]=0;
	c++;
	for(r=1;r-t;t++){
	  for(k=0;k<8;k++){
	    nx=x[t]+X[k];
	    ny=y[t]+Y[k];
	    if(!m[ny][nx])continue;
	    y[r  ]=ny;
	    x[r++]=nx;
	    m[ny][nx]=0;
	  }
	}
	/*for(k=0;k<w*h;k++){
	  if(k%w==0)printf("\n");
	  printf("%d ",m[k/w+1][k%w+1]);
	  }printf("\n");//*/
      }
    }
    printf("%d\n",c);
  }
  return 0;
}
1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
1 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 1
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
2 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 1
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 0
0 0
 1 1
0
2 2
0 1
2 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 0 1 0 0
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 0 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 1
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
0 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 1
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
0 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 1 1
0 0
 1 1
0
2 2
0 1
2 0
3 2
0 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 1 1 0 0
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 0 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
2 0 1 0 0
1 0 1 0 0
1 0 1 0 2
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
1 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 1
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0

0
1
1
3
1
8
 0
1
1
3
1
7
 0
1
1
3
1
5
 0
1
1
2
1
8
 0
1
1
3
1
6
 0
1
1
4
1
4
 0
1
0
1
2
2
8
 0
1
0
1
2
2
7
 0
1
1
3
1
4
 0
1
1
2
1
7

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 main(){
  int w,h,i,j,t,r,x[2550],y[2550],c,nx,ny,k;
  int X[8]={0,1,1,1,0,-1,-1,-1};
  int Y[8]={1,1,0,-1,-1,-1,0,1};
  while(scanf("%d %d",&w,&h),w||h){
    int m[52][52]={0};
    for(i=c=0;i<h;i++){
      for(j=0;j<w;j++){
	scanf("%d",&m[i+1][j+1]);
      }
    }
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
	if(!m[i][j])continue;
	y[0  ]=i;
	x[t=0]=j;
	m[i][j]=0;
	c++;
	for(r=1;r-t;t++){
	  for(k=0;k<8;k++){
	    nx=x[t]+X[k];
	    ny=y[t]+Y[k];
	    if(!m[ny][nx])continue;
	    y[r  ]=ny;
	    x[r++]=nx;
	    m[ny][nx]=0;
	  }
	}
	/*for(k=0;k<w*h;k++){
	  if(k%w==0)printf("\n");
	  printf("%d ",m[k/w+1][k%w+1]);
	  }printf("\n");//*/
      }
    }
    printf("%d\n",c);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.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	-28672(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -31312(%rbp)
	movl	$1, -31308(%rbp)
	movl	$1, -31304(%rbp)
	movl	$1, -31300(%rbp)
	movl	$0, -31296(%rbp)
	movl	$-1, -31292(%rbp)
	movl	$-1, -31288(%rbp)
	movl	$-1, -31284(%rbp)
	movl	$1, -31280(%rbp)
	movl	$1, -31276(%rbp)
	movl	$0, -31272(%rbp)
	movl	$-1, -31268(%rbp)
	movl	$-1, -31264(%rbp)
	movl	$-1, -31260(%rbp)
	movl	$0, -31256(%rbp)
	movl	$1, -31252(%rbp)
	jmp	.L2
.L22:
	leaq	-10832(%rbp), %rax
	movl	$10816, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -31328(%rbp)
	movl	-31328(%rbp), %eax
	movl	%eax, -31344(%rbp)
	jmp	.L3
.L6:
	movl	$0, -31340(%rbp)
	jmp	.L4
.L5:
	movl	-31344(%rbp), %eax
	leal	1(%rax), %edx
	movl	-31340(%rbp), %eax
	addl	$1, %eax
	leaq	-10832(%rbp), %rcx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -31340(%rbp)
.L4:
	movl	-31352(%rbp), %eax
	cmpl	%eax, -31340(%rbp)
	jl	.L5
	addl	$1, -31344(%rbp)
.L3:
	movl	-31348(%rbp), %eax
	cmpl	%eax, -31344(%rbp)
	jl	.L6
	movl	$1, -31344(%rbp)
	jmp	.L7
.L18:
	movl	$1, -31340(%rbp)
	jmp	.L8
.L17:
	movl	-31340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31344(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-10832(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L25
	movl	-31344(%rbp), %eax
	movl	%eax, -21040(%rbp)
	movl	$0, -31336(%rbp)
	movl	-31336(%rbp), %eax
	cltq
	movl	-31340(%rbp), %edx
	movl	%edx, -31248(%rbp,%rax,4)
	movl	-31340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31344(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -10832(%rbp,%rax,4)
	addl	$1, -31328(%rbp)
	movl	$1, -31332(%rbp)
	jmp	.L11
.L16:
	movl	$0, -31324(%rbp)
	jmp	.L12
.L15:
	movl	-31336(%rbp), %eax
	cltq
	movl	-31248(%rbp,%rax,4), %edx
	movl	-31324(%rbp), %eax
	cltq
	movl	-31312(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -31320(%rbp)
	movl	-31336(%rbp), %eax
	cltq
	movl	-21040(%rbp,%rax,4), %edx
	movl	-31324(%rbp), %eax
	cltq
	movl	-31280(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -31316(%rbp)
	movl	-31320(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31316(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-10832(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L26
	movl	-31332(%rbp), %eax
	cltq
	movl	-31316(%rbp), %edx
	movl	%edx, -21040(%rbp,%rax,4)
	movl	-31332(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -31332(%rbp)
	cltq
	movl	-31320(%rbp), %edx
	movl	%edx, -31248(%rbp,%rax,4)
	movl	-31320(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31316(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -10832(%rbp,%rax,4)
	jmp	.L14
.L26:
	nop
.L14:
	addl	$1, -31324(%rbp)
.L12:
	cmpl	$7, -31324(%rbp)
	jle	.L15
	addl	$1, -31336(%rbp)
.L11:
	movl	-31332(%rbp), %eax
	cmpl	-31336(%rbp), %eax
	jne	.L16
	jmp	.L10
.L25:
	nop
.L10:
	addl	$1, -31340(%rbp)
.L8:
	movl	-31352(%rbp), %eax
	cmpl	%eax, -31340(%rbp)
	jle	.L17
	addl	$1, -31344(%rbp)
.L7:
	movl	-31348(%rbp), %eax
	cmpl	%eax, -31344(%rbp)
	jle	.L18
	movl	-31328(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-31348(%rbp), %rdx
	leaq	-31352(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-31352(%rbp), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-31348(%rbp), %eax
	testl	%eax, %eax
	je	.L20
.L19:
	movl	$1, %eax
	jmp	.L21
.L20:
	movl	$0, %eax
.L21:
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.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	-28672(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -31312(%rbp)
	movl	$1, -31308(%rbp)
	movl	$1, -31304(%rbp)
	movl	$1, -31300(%rbp)
	movl	$0, -31296(%rbp)
	movl	$-1, -31292(%rbp)
	movl	$-1, -31288(%rbp)
	movl	$-1, -31284(%rbp)
	movl	$1, -31280(%rbp)
	movl	$1, -31276(%rbp)
	movl	$0, -31272(%rbp)
	movl	$-1, -31268(%rbp)
	movl	$-1, -31264(%rbp)
	movl	$-1, -31260(%rbp)
	movl	$0, -31256(%rbp)
	movl	$1, -31252(%rbp)
	jmp	.L2
.L22:
	leaq	-10832(%rbp), %rax
	movl	$10816, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -31328(%rbp)
	movl	-31328(%rbp), %eax
	movl	%eax, -31344(%rbp)
	jmp	.L3
.L6:
	movl	$0, -31340(%rbp)
	jmp	.L4
.L5:
	movl	-31344(%rbp), %eax
	leal	1(%rax), %edx
	movl	-31340(%rbp), %eax
	addl	$1, %eax
	leaq	-10832(%rbp), %rcx
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -31340(%rbp)
.L4:
	movl	-31352(%rbp), %eax
	cmpl	%eax, -31340(%rbp)
	jl	.L5
	addl	$1, -31344(%rbp)
.L3:
	movl	-31348(%rbp), %eax
	cmpl	%eax, -31344(%rbp)
	jl	.L6
	movl	$1, -31344(%rbp)
	jmp	.L7
.L18:
	movl	$1, -31340(%rbp)
	jmp	.L8
.L17:
	movl	-31340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31344(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-10832(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L25
	movl	-31344(%rbp), %eax
	movl	%eax, -21040(%rbp)
	movl	$0, -31336(%rbp)
	movl	-31336(%rbp), %eax
	cltq
	movl	-31340(%rbp), %edx
	movl	%edx, -31248(%rbp,%rax,4)
	movl	-31340(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31344(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -10832(%rbp,%rax,4)
	addl	$1, -31328(%rbp)
	movl	$1, -31332(%rbp)
	jmp	.L11
.L16:
	movl	$0, -31324(%rbp)
	jmp	.L12
.L15:
	movl	-31336(%rbp), %eax
	cltq
	movl	-31248(%rbp,%rax,4), %edx
	movl	-31324(%rbp), %eax
	cltq
	movl	-31312(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -31320(%rbp)
	movl	-31336(%rbp), %eax
	cltq
	movl	-21040(%rbp,%rax,4), %edx
	movl	-31324(%rbp), %eax
	cltq
	movl	-31280(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -31316(%rbp)
	movl	-31320(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31316(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-10832(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L26
	movl	-31332(%rbp), %eax
	cltq
	movl	-31316(%rbp), %edx
	movl	%edx, -21040(%rbp,%rax,4)
	movl	-31332(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -31332(%rbp)
	cltq
	movl	-31320(%rbp), %edx
	movl	%edx, -31248(%rbp,%rax,4)
	movl	-31320(%rbp), %eax
	movslq	%eax, %rcx
	movl	-31316(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -10832(%rbp,%rax,4)
	jmp	.L14
.L26:
	nop
.L14:
	addl	$1, -31324(%rbp)
.L12:
	cmpl	$7, -31324(%rbp)
	jle	.L15
	addl	$1, -31336(%rbp)
.L11:
	movl	-31332(%rbp), %eax
	cmpl	-31336(%rbp), %eax
	jne	.L16
	jmp	.L10
.L25:
	nop
.L10:
	addl	$1, -31340(%rbp)
.L8:
	movl	-31352(%rbp), %eax
	cmpl	%eax, -31340(%rbp)
	jle	.L17
	addl	$1, -31344(%rbp)
.L7:
	movl	-31348(%rbp), %eax
	cmpl	%eax, -31344(%rbp)
	jle	.L18
	movl	-31328(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-31348(%rbp), %rdx
	leaq	-31352(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-31352(%rbp), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-31348(%rbp), %eax
	testl	%eax, %eax
	je	.L20
.L19:
	movl	$1, %eax
	jmp	.L21
.L20:
	movl	$0, %eax
.L21:
	testl	%eax, %eax
	jne	.L22
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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:
