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 a[10][10],c[10][10];
void f(int x,int y){
  int ny,nx,i,j;
  int X[]={0,0,1,0,-1};
  int Y[]={0,1,0,-1,0};
  a[y][x]=1;
  for(i=0;i<5;i++){
    nx=x+X[i];
    ny=y+Y[i];
    if(nx<0||ny<0||9<ny||9<nx)continue;
    c[ny][nx]=1-c[ny][nx];
  }
}
int main(){
  int n,d[10][10],i,j,k,s;
  scanf("%d",&n);
  while(n--){
    for(i=0;i<10;i++){
      for(j=0;j<10;j++)scanf("%d",&d[i][j]);
    }
    for(i=0;i<1<<10;i++){
      for(j=0;j<100;j++){
	a[j/10][j%10]=0;
	c[j/10][j%10]=d[j/10][j%10];
      }
      for(j=0;j<10;j++){
	if(i&1<<j)f(j,0);
      }
      for(j=0;j<9;j++){
	for(k=0;k<10;k++){
	  if(c[j][k])f(k,j+1);
	}
      }
      for(j=s=0;j<10;j++)s+=c[9][j];
      if(s==0)break;
    }//printf("%d\n",i);
    for(i=0;i<10;i++){
      for(j=0;j<10;j++){
	if(j)printf(" ");
	printf("%d",a[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400
c:
	.zero	400
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movl	%edi, -84(%rbp)
	movl	%esi, -88(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$-1, -48(%rbp)
	movl	$0, -32(%rbp)
	movl	$1, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	-84(%rbp), %eax
	movslq	%eax, %rcx
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, -76(%rbp)
	jmp	.L2
.L6:
	movl	-76(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -72(%rbp)
	movl	-76(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -68(%rbp)
	cmpl	$0, -72(%rbp)
	js	.L8
	cmpl	$0, -68(%rbp)
	js	.L8
	cmpl	$9, -68(%rbp)
	jg	.L8
	cmpl	$9, -72(%rbp)
	jg	.L8
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	$1, %edx
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rsi
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L5
.L8:
	nop
.L5:
	addl	$1, -76(%rbp)
.L2:
	cmpl	$4, -76(%rbp)
	jle	.L6
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L36:
	movl	$0, -432(%rbp)
	jmp	.L11
.L14:
	movl	$0, -428(%rbp)
	jmp	.L12
.L13:
	leaq	-416(%rbp), %rcx
	movl	-428(%rbp), %eax
	movslq	%eax, %rsi
	movl	-432(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %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, -428(%rbp)
.L12:
	cmpl	$9, -428(%rbp)
	jle	.L13
	addl	$1, -432(%rbp)
.L11:
	cmpl	$9, -432(%rbp)
	jle	.L14
	movl	$0, -432(%rbp)
	jmp	.L15
.L30:
	movl	$0, -428(%rbp)
	jmp	.L16
.L17:
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-428(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %edi
	sarl	$31, %edi
	subl	%edi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %r8d
	movl	-428(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-428(%rbp), %esi
	movslq	%esi, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%esi, %r9d
	sarl	$31, %r9d
	subl	%r9d, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %esi
	movl	%esi, %edx
	movslq	%ecx, %rsi
	movslq	%r8d, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%edx, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -428(%rbp)
.L16:
	cmpl	$99, -428(%rbp)
	jle	.L17
	movl	$0, -428(%rbp)
	jmp	.L18
.L20:
	movl	-428(%rbp), %eax
	movl	-432(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L19
	movl	-428(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	f
.L19:
	addl	$1, -428(%rbp)
.L18:
	cmpl	$9, -428(%rbp)
	jle	.L20
	movl	$0, -428(%rbp)
	jmp	.L21
.L25:
	movl	$0, -424(%rbp)
	jmp	.L22
.L24:
	movl	-424(%rbp), %eax
	movslq	%eax, %rcx
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L23
	movl	-428(%rbp), %eax
	leal	1(%rax), %edx
	movl	-424(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	f
.L23:
	addl	$1, -424(%rbp)
.L22:
	cmpl	$9, -424(%rbp)
	jle	.L24
	addl	$1, -428(%rbp)
.L21:
	cmpl	$8, -428(%rbp)
	jle	.L25
	movl	$0, -420(%rbp)
	movl	-420(%rbp), %eax
	movl	%eax, -428(%rbp)
	jmp	.L26
.L27:
	movl	-428(%rbp), %eax
	cltq
	addq	$90, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -420(%rbp)
	addl	$1, -428(%rbp)
.L26:
	cmpl	$9, -428(%rbp)
	jle	.L27
	cmpl	$0, -420(%rbp)
	je	.L39
	addl	$1, -432(%rbp)
.L15:
	cmpl	$1023, -432(%rbp)
	jle	.L30
	jmp	.L29
.L39:
	nop
.L29:
	movl	$0, -432(%rbp)
	jmp	.L31
.L35:
	movl	$0, -428(%rbp)
	jmp	.L32
.L34:
	cmpl	$0, -428(%rbp)
	je	.L33
	movl	$32, %edi
	call	putchar@PLT
.L33:
	movl	-428(%rbp), %eax
	movslq	%eax, %rcx
	movl	-432(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -428(%rbp)
.L32:
	cmpl	$9, -428(%rbp)
	jle	.L34
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -432(%rbp)
.L31:
	cmpl	$9, -432(%rbp)
	jle	.L35
.L10:
	movl	-436(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -436(%rbp)
	testl	%eax, %eax
	jne	.L36
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movslq	%edi, %r9
	leaq	a(%rip), %rcx
	cmpl	$9, %esi
	leaq	(%rsi,%rsi,4), %rdx
	movq	%rsi, %rax
	leaq	(%r9,%rdx,2), %rdx
	seta	%r8b
	cmpl	$9, %edi
	movl	$1, (%rcx,%rdx,4)
	seta	%cl
	ja	.L2
	testb	%r8b, %r8b
	jne	.L2
	leaq	c(%rip), %r11
	movl	$1, %r10d
	subl	(%r11,%rdx,4), %r10d
	movl	%r10d, (%r11,%rdx,4)
.L2:
	leal	1(%rax), %edx
	cmpl	$9, %edx
	ja	.L3
	testb	%cl, %cl
	jne	.L3
	movslq	%edx, %rdx
	leaq	c(%rip), %r10
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r9,%rdx,2), %r11
	movl	$1, %edx
	subl	(%r10,%r11,4), %edx
	movl	%edx, (%r10,%r11,4)
.L3:
	leal	1(%rdi), %edx
	cmpl	$9, %edx
	ja	.L4
	testb	%r8b, %r8b
	jne	.L4
	movslq	%edx, %rdx
	leaq	(%rsi,%rsi,4), %r11
	leaq	c(%rip), %r10
	leaq	(%rdx,%r11,2), %r11
	movl	$1, %edx
	subl	(%r10,%r11,4), %edx
	movl	%edx, (%r10,%r11,4)
.L4:
	subl	$1, %eax
	cmpl	$9, %eax
	ja	.L5
	testb	%cl, %cl
	jne	.L5
	cltq
	leaq	c(%rip), %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%r9,%rax,2), %rcx
	movl	$1, %eax
	subl	(%rdx,%rcx,4), %eax
	movl	%eax, (%rdx,%rcx,4)
.L5:
	leal	-1(%rdi), %eax
	cmpl	$9, %eax
	ja	.L1
	testb	%r8b, %r8b
	jne	.L1
	cltq
	leaq	(%rsi,%rsi,4), %rcx
	leaq	c(%rip), %rdx
	leaq	(%rax,%rcx,2), %rcx
	movl	$1, %eax
	subl	(%rdx,%rcx,4), %eax
	movl	%eax, (%rdx,%rcx,4)
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	a(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	c(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$3435973837, %ebx
	subq	$472, %rsp
	.cfi_def_cfa_offset 528
	movq	%fs:40, %rax
	movq	%rax, 456(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	leaq	88(%rsp), %rcx
	movq	%rcx, 24(%rsp)
	leaq	488(%rsp), %rcx
	leal	-1(%rax), %edx
	movq	%rcx, 16(%rsp)
	movl	%edx, 44(%rsp)
	testl	%eax, %eax
	je	.L41
.L9:
	movq	24(%rsp), %rbp
.L11:
	leaq	-40(%rbp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	cmpq	%r13, %rbp
	jne	.L10
	addq	$40, %rbp
	cmpq	%rbp, 16(%rsp)
	jne	.L11
	movl	$0, 8(%rsp)
	movq	.LC1(%rip), %xmm2
.L12:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edx, %eax
	movl	%edx, %esi
	addl	$1, %edx
	imulq	%rbx, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %edi
	cltq
	addl	%edi, %edi
	leaq	(%rax,%rax,4), %rax
	subl	%edi, %esi
	movslq	%esi, %rsi
	leaq	(%rsi,%rax,2), %rax
	movl	48(%rsp,%rax,4), %esi
	movl	$0, (%r15,%rax,4)
	movl	%esi, (%r14,%rax,4)
	cmpl	$100, %edx
	jne	.L13
	testb	$1, 8(%rsp)
	jne	.L91
	testb	$2, 8(%rsp)
	jne	.L92
.L15:
	testb	$4, 8(%rsp)
	jne	.L93
.L16:
	testb	$8, 8(%rsp)
	jne	.L94
.L17:
	testb	$16, 8(%rsp)
	jne	.L95
.L18:
	testb	$32, 8(%rsp)
	jne	.L96
.L19:
	testb	$64, 8(%rsp)
	jne	.L97
.L20:
	testb	$-128, 8(%rsp)
	jne	.L98
.L21:
	testl	$256, 8(%rsp)
	jne	.L99
.L22:
	testl	$512, 8(%rsp)
	jne	.L100
.L23:
	leaq	c(%rip), %r13
	xorl	%ebp, %ebp
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L24:
	movl	4(%r13), %r11d
	testl	%r11d, %r11d
	jne	.L101
.L25:
	movl	8(%r13), %r10d
	testl	%r10d, %r10d
	jne	.L102
.L26:
	movl	12(%r13), %r9d
	testl	%r9d, %r9d
	jne	.L103
.L27:
	movl	16(%r13), %r8d
	testl	%r8d, %r8d
	jne	.L104
.L28:
	movl	20(%r13), %edi
	testl	%edi, %edi
	jne	.L105
.L29:
	movl	24(%r13), %esi
	testl	%esi, %esi
	jne	.L106
.L30:
	movl	28(%r13), %ecx
	testl	%ecx, %ecx
	jne	.L107
.L31:
	movl	32(%r13), %edx
	testl	%edx, %edx
	jne	.L108
.L32:
	movl	36(%r13), %eax
	testl	%eax, %eax
	jne	.L109
.L33:
	addq	$40, %r13
	cmpl	$9, %ebp
	je	.L110
.L34:
	movl	0(%r13), %eax
	addl	$1, %ebp
	testl	%eax, %eax
	je	.L24
	movl	%ebp, %esi
	xorl	%edi, %edi
	call	f
	movl	4(%r13), %r11d
	testl	%r11d, %r11d
	je	.L25
.L101:
	movl	%ebp, %esi
	movl	$1, %edi
	call	f
	movl	8(%r13), %r10d
	testl	%r10d, %r10d
	je	.L26
.L102:
	movl	%ebp, %esi
	movl	$2, %edi
	call	f
	movl	12(%r13), %r9d
	testl	%r9d, %r9d
	je	.L27
.L103:
	movl	%ebp, %esi
	movl	$3, %edi
	call	f
	movl	16(%r13), %r8d
	testl	%r8d, %r8d
	je	.L28
.L104:
	movl	$4, %edi
	movl	%ebp, %esi
	call	f
	movl	20(%r13), %edi
	testl	%edi, %edi
	je	.L29
.L105:
	movl	%ebp, %esi
	movl	$5, %edi
	call	f
	movl	24(%r13), %esi
	testl	%esi, %esi
	je	.L30
.L106:
	movl	%ebp, %esi
	movl	$6, %edi
	call	f
	movl	28(%r13), %ecx
	testl	%ecx, %ecx
	je	.L31
.L107:
	movl	%ebp, %esi
	movl	$7, %edi
	call	f
	movl	32(%r13), %edx
	testl	%edx, %edx
	je	.L32
.L108:
	movl	%ebp, %esi
	movl	$8, %edi
	call	f
	movl	36(%r13), %eax
	testl	%eax, %eax
	je	.L33
.L109:
	movl	%ebp, %esi
	movl	$9, %edi
	addq	$40, %r13
	call	f
	cmpl	$9, %ebp
	jne	.L34
.L110:
	movl	364+c(%rip), %eax
	addl	360+c(%rip), %eax
	addl	368+c(%rip), %eax
	addl	372+c(%rip), %eax
	addl	376+c(%rip), %eax
	addl	380+c(%rip), %eax
	addl	384+c(%rip), %eax
	addl	388+c(%rip), %eax
	addl	392+c(%rip), %eax
	addl	396+c(%rip), %eax
	je	.L35
	addl	$1, 8(%rsp)
	movl	8(%rsp), %eax
	cmpl	$1024, %eax
	jne	.L12
.L35:
	leaq	a(%rip), %rax
	movq	%rax, 8(%rsp)
.L38:
	movq	8(%rsp), %rbp
	xorl	%r13d, %r13d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L36:
	movl	0(%rbp), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L37:
	addq	$4, %rbp
.L40:
	addl	$1, %r13d
	cmpl	$1, %r13d
	je	.L36
	movl	$32, %edi
	call	putchar@PLT
	movl	0(%rbp), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$10, %r13d
	jne	.L37
	movl	$10, %edi
	call	putchar@PLT
	addq	$40, 8(%rsp)
	movq	8(%rsp), %rax
	leaq	400+a(%rip), %rcx
	cmpq	%rcx, %rax
	jne	.L38
	movl	44(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 44(%rsp)
	testl	%eax, %eax
	jne	.L9
.L41:
	movq	456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L111
	addq	$472, %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
.L91:
	.cfi_restore_state
	movq	(%r14), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, a(%rip)
	subl	40+c(%rip), %eax
	psubd	%xmm1, %xmm0
	movl	%eax, 40+c(%rip)
	movq	%xmm0, (%r14)
	testb	$2, 8(%rsp)
	je	.L15
.L92:
	movq	(%r14), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 4+a(%rip)
	movl	%eax, %edx
	subl	8+c(%rip), %eax
	subl	44+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 44+c(%rip)
	movl	%eax, 8+c(%rip)
	movq	%xmm0, (%r14)
	testb	$4, 8(%rsp)
	je	.L16
.L93:
	movq	4+c(%rip), %xmm1
	movdqa	%xmm2, %xmm0
	movl	$1, %eax
	movl	$1, 8+a(%rip)
	movl	%eax, %edx
	subl	12+c(%rip), %eax
	subl	48+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 48+c(%rip)
	movl	%eax, 12+c(%rip)
	movq	%xmm0, 4+c(%rip)
	testb	$8, 8(%rsp)
	je	.L17
.L94:
	movq	8+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 12+a(%rip)
	movl	%eax, %edx
	subl	16+c(%rip), %eax
	subl	52+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 52+c(%rip)
	movl	%eax, 16+c(%rip)
	movq	%xmm0, 8+c(%rip)
	testb	$16, 8(%rsp)
	je	.L18
.L95:
	movq	12+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 16+a(%rip)
	movl	%eax, %edx
	subl	20+c(%rip), %eax
	subl	56+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 56+c(%rip)
	movl	%eax, 20+c(%rip)
	movq	%xmm0, 12+c(%rip)
	testb	$32, 8(%rsp)
	je	.L19
.L96:
	movq	16+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 20+a(%rip)
	movl	%eax, %edx
	subl	24+c(%rip), %eax
	subl	60+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 60+c(%rip)
	movl	%eax, 24+c(%rip)
	movq	%xmm0, 16+c(%rip)
	testb	$64, 8(%rsp)
	je	.L20
.L97:
	movq	20+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 24+a(%rip)
	movl	%eax, %edx
	subl	28+c(%rip), %eax
	subl	64+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 64+c(%rip)
	movl	%eax, 28+c(%rip)
	movq	%xmm0, 20+c(%rip)
	testb	$-128, 8(%rsp)
	je	.L21
.L98:
	movq	24+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 28+a(%rip)
	movl	%eax, %edx
	subl	32+c(%rip), %eax
	subl	68+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 68+c(%rip)
	movl	%eax, 32+c(%rip)
	movq	%xmm0, 24+c(%rip)
	testl	$256, 8(%rsp)
	je	.L22
.L99:
	movq	28+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 32+a(%rip)
	movl	%eax, %edx
	subl	36+c(%rip), %eax
	subl	72+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 72+c(%rip)
	movl	%eax, 36+c(%rip)
	movq	%xmm0, 28+c(%rip)
	testl	$512, 8(%rsp)
	je	.L23
.L100:
	movq	32+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 36+a(%rip)
	subl	76+c(%rip), %eax
	psubd	%xmm1, %xmm0
	movl	%eax, 76+c(%rip)
	movq	%xmm0, 32+c(%rip)
	jmp	.L23
.L111:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 400
c:
	.zero	400
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.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
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movslq	%edi, %r9
	leaq	a(%rip), %rcx
	cmpl	$9, %esi
	leaq	(%rsi,%rsi,4), %rdx
	movq	%rsi, %rax
	leaq	(%r9,%rdx,2), %rdx
	seta	%r8b
	cmpl	$9, %edi
	movl	$1, (%rcx,%rdx,4)
	seta	%cl
	ja	.L2
	testb	%r8b, %r8b
	jne	.L2
	leaq	c(%rip), %r11
	movl	$1, %r10d
	subl	(%r11,%rdx,4), %r10d
	movl	%r10d, (%r11,%rdx,4)
.L2:
	leal	1(%rax), %edx
	cmpl	$9, %edx
	ja	.L3
	testb	%cl, %cl
	jne	.L3
	movslq	%edx, %rdx
	leaq	c(%rip), %r10
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r9,%rdx,2), %r11
	movl	$1, %edx
	subl	(%r10,%r11,4), %edx
	movl	%edx, (%r10,%r11,4)
.L3:
	leal	1(%rdi), %edx
	cmpl	$9, %edx
	ja	.L4
	testb	%r8b, %r8b
	jne	.L4
	movslq	%edx, %rdx
	leaq	(%rsi,%rsi,4), %r11
	leaq	c(%rip), %r10
	leaq	(%rdx,%r11,2), %r11
	movl	$1, %edx
	subl	(%r10,%r11,4), %edx
	movl	%edx, (%r10,%r11,4)
.L4:
	subl	$1, %eax
	cmpl	$9, %eax
	ja	.L5
	testb	%cl, %cl
	jne	.L5
	cltq
	leaq	c(%rip), %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%r9,%rax,2), %rcx
	movl	$1, %eax
	subl	(%rdx,%rcx,4), %eax
	movl	%eax, (%rdx,%rcx,4)
.L5:
	leal	-1(%rdi), %eax
	cmpl	$9, %eax
	ja	.L1
	testb	%r8b, %r8b
	jne	.L1
	cltq
	leaq	(%rsi,%rsi,4), %rcx
	leaq	c(%rip), %rdx
	leaq	(%rax,%rcx,2), %rcx
	movl	$1, %eax
	subl	(%rdx,%rcx,4), %eax
	movl	%eax, (%rdx,%rcx,4)
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	a(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	c(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$3435973837, %ebx
	subq	$472, %rsp
	.cfi_def_cfa_offset 528
	movq	%fs:40, %rax
	movq	%rax, 456(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	leaq	88(%rsp), %rcx
	movq	%rcx, 24(%rsp)
	leaq	488(%rsp), %rcx
	leal	-1(%rax), %edx
	movq	%rcx, 16(%rsp)
	movl	%edx, 44(%rsp)
	testl	%eax, %eax
	je	.L41
.L9:
	movq	24(%rsp), %rbp
.L11:
	leaq	-40(%rbp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	cmpq	%r13, %rbp
	jne	.L10
	addq	$40, %rbp
	cmpq	%rbp, 16(%rsp)
	jne	.L11
	movl	$0, 8(%rsp)
	movq	.LC1(%rip), %xmm2
.L12:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edx, %eax
	movl	%edx, %esi
	addl	$1, %edx
	imulq	%rbx, %rax
	shrq	$35, %rax
	leal	(%rax,%rax,4), %edi
	cltq
	addl	%edi, %edi
	leaq	(%rax,%rax,4), %rax
	subl	%edi, %esi
	movslq	%esi, %rsi
	leaq	(%rsi,%rax,2), %rax
	movl	48(%rsp,%rax,4), %esi
	movl	$0, (%r15,%rax,4)
	movl	%esi, (%r14,%rax,4)
	cmpl	$100, %edx
	jne	.L13
	testb	$1, 8(%rsp)
	jne	.L91
	testb	$2, 8(%rsp)
	jne	.L92
.L15:
	testb	$4, 8(%rsp)
	jne	.L93
.L16:
	testb	$8, 8(%rsp)
	jne	.L94
.L17:
	testb	$16, 8(%rsp)
	jne	.L95
.L18:
	testb	$32, 8(%rsp)
	jne	.L96
.L19:
	testb	$64, 8(%rsp)
	jne	.L97
.L20:
	testb	$-128, 8(%rsp)
	jne	.L98
.L21:
	testl	$256, 8(%rsp)
	jne	.L99
.L22:
	testl	$512, 8(%rsp)
	jne	.L100
.L23:
	leaq	c(%rip), %r13
	xorl	%ebp, %ebp
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L24:
	movl	4(%r13), %r11d
	testl	%r11d, %r11d
	jne	.L101
.L25:
	movl	8(%r13), %r10d
	testl	%r10d, %r10d
	jne	.L102
.L26:
	movl	12(%r13), %r9d
	testl	%r9d, %r9d
	jne	.L103
.L27:
	movl	16(%r13), %r8d
	testl	%r8d, %r8d
	jne	.L104
.L28:
	movl	20(%r13), %edi
	testl	%edi, %edi
	jne	.L105
.L29:
	movl	24(%r13), %esi
	testl	%esi, %esi
	jne	.L106
.L30:
	movl	28(%r13), %ecx
	testl	%ecx, %ecx
	jne	.L107
.L31:
	movl	32(%r13), %edx
	testl	%edx, %edx
	jne	.L108
.L32:
	movl	36(%r13), %eax
	testl	%eax, %eax
	jne	.L109
.L33:
	addq	$40, %r13
	cmpl	$9, %ebp
	je	.L110
.L34:
	movl	0(%r13), %eax
	addl	$1, %ebp
	testl	%eax, %eax
	je	.L24
	movl	%ebp, %esi
	xorl	%edi, %edi
	call	f
	movl	4(%r13), %r11d
	testl	%r11d, %r11d
	je	.L25
.L101:
	movl	%ebp, %esi
	movl	$1, %edi
	call	f
	movl	8(%r13), %r10d
	testl	%r10d, %r10d
	je	.L26
.L102:
	movl	%ebp, %esi
	movl	$2, %edi
	call	f
	movl	12(%r13), %r9d
	testl	%r9d, %r9d
	je	.L27
.L103:
	movl	%ebp, %esi
	movl	$3, %edi
	call	f
	movl	16(%r13), %r8d
	testl	%r8d, %r8d
	je	.L28
.L104:
	movl	$4, %edi
	movl	%ebp, %esi
	call	f
	movl	20(%r13), %edi
	testl	%edi, %edi
	je	.L29
.L105:
	movl	%ebp, %esi
	movl	$5, %edi
	call	f
	movl	24(%r13), %esi
	testl	%esi, %esi
	je	.L30
.L106:
	movl	%ebp, %esi
	movl	$6, %edi
	call	f
	movl	28(%r13), %ecx
	testl	%ecx, %ecx
	je	.L31
.L107:
	movl	%ebp, %esi
	movl	$7, %edi
	call	f
	movl	32(%r13), %edx
	testl	%edx, %edx
	je	.L32
.L108:
	movl	%ebp, %esi
	movl	$8, %edi
	call	f
	movl	36(%r13), %eax
	testl	%eax, %eax
	je	.L33
.L109:
	movl	%ebp, %esi
	movl	$9, %edi
	addq	$40, %r13
	call	f
	cmpl	$9, %ebp
	jne	.L34
.L110:
	movl	364+c(%rip), %eax
	addl	360+c(%rip), %eax
	addl	368+c(%rip), %eax
	addl	372+c(%rip), %eax
	addl	376+c(%rip), %eax
	addl	380+c(%rip), %eax
	addl	384+c(%rip), %eax
	addl	388+c(%rip), %eax
	addl	392+c(%rip), %eax
	addl	396+c(%rip), %eax
	je	.L35
	addl	$1, 8(%rsp)
	movl	8(%rsp), %eax
	cmpl	$1024, %eax
	jne	.L12
.L35:
	leaq	a(%rip), %rax
	movq	%rax, 8(%rsp)
.L38:
	movq	8(%rsp), %rbp
	xorl	%r13d, %r13d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L36:
	movl	0(%rbp), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L37:
	addq	$4, %rbp
.L40:
	addl	$1, %r13d
	cmpl	$1, %r13d
	je	.L36
	movl	$32, %edi
	call	putchar@PLT
	movl	0(%rbp), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$10, %r13d
	jne	.L37
	movl	$10, %edi
	call	putchar@PLT
	addq	$40, 8(%rsp)
	movq	8(%rsp), %rax
	leaq	400+a(%rip), %rcx
	cmpq	%rcx, %rax
	jne	.L38
	movl	44(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 44(%rsp)
	testl	%eax, %eax
	jne	.L9
.L41:
	movq	456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L111
	addq	$472, %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
.L91:
	.cfi_restore_state
	movq	(%r14), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, a(%rip)
	subl	40+c(%rip), %eax
	psubd	%xmm1, %xmm0
	movl	%eax, 40+c(%rip)
	movq	%xmm0, (%r14)
	testb	$2, 8(%rsp)
	je	.L15
.L92:
	movq	(%r14), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 4+a(%rip)
	movl	%eax, %edx
	subl	8+c(%rip), %eax
	subl	44+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 44+c(%rip)
	movl	%eax, 8+c(%rip)
	movq	%xmm0, (%r14)
	testb	$4, 8(%rsp)
	je	.L16
.L93:
	movq	4+c(%rip), %xmm1
	movdqa	%xmm2, %xmm0
	movl	$1, %eax
	movl	$1, 8+a(%rip)
	movl	%eax, %edx
	subl	12+c(%rip), %eax
	subl	48+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 48+c(%rip)
	movl	%eax, 12+c(%rip)
	movq	%xmm0, 4+c(%rip)
	testb	$8, 8(%rsp)
	je	.L17
.L94:
	movq	8+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 12+a(%rip)
	movl	%eax, %edx
	subl	16+c(%rip), %eax
	subl	52+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 52+c(%rip)
	movl	%eax, 16+c(%rip)
	movq	%xmm0, 8+c(%rip)
	testb	$16, 8(%rsp)
	je	.L18
.L95:
	movq	12+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 16+a(%rip)
	movl	%eax, %edx
	subl	20+c(%rip), %eax
	subl	56+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 56+c(%rip)
	movl	%eax, 20+c(%rip)
	movq	%xmm0, 12+c(%rip)
	testb	$32, 8(%rsp)
	je	.L19
.L96:
	movq	16+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 20+a(%rip)
	movl	%eax, %edx
	subl	24+c(%rip), %eax
	subl	60+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 60+c(%rip)
	movl	%eax, 24+c(%rip)
	movq	%xmm0, 16+c(%rip)
	testb	$64, 8(%rsp)
	je	.L20
.L97:
	movq	20+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 24+a(%rip)
	movl	%eax, %edx
	subl	28+c(%rip), %eax
	subl	64+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 64+c(%rip)
	movl	%eax, 28+c(%rip)
	movq	%xmm0, 20+c(%rip)
	testb	$-128, 8(%rsp)
	je	.L21
.L98:
	movq	24+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 28+a(%rip)
	movl	%eax, %edx
	subl	32+c(%rip), %eax
	subl	68+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 68+c(%rip)
	movl	%eax, 32+c(%rip)
	movq	%xmm0, 24+c(%rip)
	testl	$256, 8(%rsp)
	je	.L22
.L99:
	movq	28+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 32+a(%rip)
	movl	%eax, %edx
	subl	36+c(%rip), %eax
	subl	72+c(%rip), %edx
	psubd	%xmm1, %xmm0
	movl	%edx, 72+c(%rip)
	movl	%eax, 36+c(%rip)
	movq	%xmm0, 28+c(%rip)
	testl	$512, 8(%rsp)
	je	.L23
.L100:
	movq	32+c(%rip), %xmm1
	movl	$1, %eax
	movq	.LC1(%rip), %xmm0
	movl	$1, 36+a(%rip)
	subl	76+c(%rip), %eax
	psubd	%xmm1, %xmm0
	movl	%eax, 76+c(%rip)
	movq	%xmm0, 32+c(%rip)
	jmp	.L23
.L111:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 400
c:
	.zero	400
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.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>
int a[10][10],c[10][10];
void f(int x,int y){
  int ny,nx,i,j;
  int X[]={0,0,1,0,-1};
  int Y[]={0,1,0,-1,0};
  a[y][x]=1;
  for(i=0;i<5;i++){
    nx=x+X[i];
    ny=y+Y[i];
    if(nx<0||ny<0||9<ny||9<nx)continue;
    c[ny][nx]=1-c[ny][nx];
  }
}
int main(){
  int n,d[10][10],i,j,k,s;
  scanf("%d",&n);
  while(n--){
    for(i=0;i<10;i++){
      for(j=0;j<10;j++)scanf("%d",&d[i][j]);
    }
    for(i=0;i<1<<10;i++){
      for(j=0;j<100;j++){
	a[j/10][j%10]=0;
	c[j/10][j%10]=d[j/10][j%10];
      }
      for(j=0;j<10;j++){
	if(i&1<<j)f(j,0);
      }
      for(j=0;j<9;j++){
	for(k=0;k<10;k++){
	  if(c[j][k])f(k,j+1);
	}
      }
      for(j=s=0;j<10;j++)s+=c[9][j];
      if(s==0)break;
    }//printf("%d\n",i);
    for(i=0;i<10;i++){
      for(j=0;j<10;j++){
	if(j)printf(" ");
	printf("%d",a[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}
1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 0
0 0 1 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
1 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 0
0 0 1 0 0 1 0 0 0 0
0 0 0 1 0 0 1 1 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 1 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0
 1
0 1 0 0 0 0 0 1 0 0
1 1 1 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 1 0 0 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0

0 0 0 0 1 0 1 0 0 0
0 1 0 1 1 0 1 1 0 0
0 0 1 0 1 0 1 0 1 0
0 1 1 1 0 0 0 1 1 1
1 0 0 0 0 1 0 0 0 0
1 0 1 0 1 1 0 1 1 1
0 0 1 0 1 0 0 0 1 0
1 1 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
1 1 0 1 1 1 0 1 1 1
 1 1 0 0 1 1 0 0 1 1
0 1 1 1 0 0 1 1 0 0
1 0 0 0 0 0 0 0 0 1
0 1 1 1 0 0 1 1 1 1
0 0 1 0 1 0 0 1 1 1
0 0 0 0 1 1 1 1 0 1
0 0 1 1 0 0 1 1 1 0
0 1 0 0 0 0 1 0 0 0
1 1 0 1 0 1 0 0 0 0
0 1 0 1 0 1 0 1 1 1
 1 0 0 0 1 1 0 0 1 0
1 0 0 1 0 0 1 1 1 1
1 0 0 1 0 0 0 0 0 0
1 0 1 0 1 0 1 1 1 1
0 0 1 1 1 1 0 1 1 0
1 1 1 0 0 0 0 1 1 0
0 1 1 0 0 0 1 1 1 1
0 1 1 1 0 1 0 0 0 0
1 1 0 0 0 1 0 1 0 1
0 1 0 1 1 0 0 0 1 0
 0 1 0 1 1 0 1 0 1 0
1 0 0 0 0 0 1 0 1 1
0 1 1 1 1 1 0 1 1 0
1 1 1 1 1 0 1 0 1 0
0 0 0 0 1 0 1 1 0 1
1 1 1 1 0 0 0 0 1 1
0 1 1 0 1 1 1 0 0 1
0 1 1 1 0 1 0 1 0 0
1 1 0 0 1 0 1 1 0 1
0 1 0 1 1 1 0 0 1 0
 0 1 0 1 1 0 0 0 0 0
1 0 0 0 0 1 0 0 0 0
0 1 1 1 0 1 1 1 0 0
1 1 1 0 0 1 1 0 1 0
0 0 0 0 1 0 1 1 1 1
1 1 1 0 1 1 0 1 0 0
0 1 0 0 0 1 1 0 0 1
0 0 0 0 0 1 0 0 1 1
0 1 0 0 1 0 0 1 1 1
1 1 1 0 1 0 1 1 1 0
 0 0 1 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0 0 0
1 0 0 0 1 0 0 0 0 0
1 0 1 0 1 1 0 0 0 0
0 0 1 0 1 1 1 0 0 0
1 1 0 1 1 0 1 1 0 0
1 0 1 0 0 0 1 0 1 0
0 1 1 0 1 1 0 1 1 1
0 0 1 0 0 0 1 0 1 0
0 0 0 1 1 0 1 0 1 1
 1 0 0 0 1 1 0 1 1 0
1 0 0 1 0 0 0 0 0 1
1 0 0 1 0 1 0 0 0 1
1 0 1 0 0 1 1 0 1 0
0 0 0 0 1 0 0 0 1 0
1 0 1 0 1 0 0 0 0 1
1 0 1 0 1 0 0 0 0 1
0 0 0 0 0 1 0 0 1 0
1 0 1 0 0 1 1 1 0 0
1 0 1 0 1 1 1 1 1 1
 0 0 0 0 1 0 0 0 0 0
0 1 0 1 1 1 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 1 1 0 1 1 0 0 0 0
1 0 1 0 1 1 1 0 0 0
1 1 0 1 1 0 1 1 0 0
1 0 1 0 0 0 1 0 1 0
0 1 1 0 1 1 0 1 1 1
0 0 1 0 0 0 1 0 1 0
0 0 0 1 1 0 1 0 1 1
 0 1 1 0 0 0 0 0 1 1
1 1 0 1 0 0 0 1 0 0
1 0 0 1 1 0 1 1 0 1
1 1 1 1 0 0 0 1 0 1
1 1 1 1 0 1 0 0 0 0
1 0 0 0 0 1 0 1 0 1
0 0 1 1 0 1 0 1 0 1
0 1 0 0 0 0 0 0 0 0
1 1 0 1 0 1 0 1 1 1
0 1 0 1 0 1 0 1 0 1
 0 1 1 0 0 0 0 1 1 1
1 1 0 1 0 0 1 1 1 0
1 0 0 1 1 1 0 1 1 0
1 1 1 1 1 0 1 1 1 1
1 1 1 0 1 0 0 0 0 0
1 0 1 0 0 1 0 1 1 1
0 1 0 1 1 0 0 0 1 0
0 1 1 0 0 0 0 0 0 0
1 1 0 0 1 0 0 0 0 0
0 1 0 1 1 1 0 1 1 1

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

```c
#include<stdio.h>
int a[10][10],c[10][10];
void f(int x,int y){
  int ny,nx,i,j;
  int X[]={0,0,1,0,-1};
  int Y[]={0,1,0,-1,0};
  a[y][x]=1;
  for(i=0;i<5;i++){
    nx=x+X[i];
    ny=y+Y[i];
    if(nx<0||ny<0||9<ny||9<nx)continue;
    c[ny][nx]=1-c[ny][nx];
  }
}
int main(){
  int n,d[10][10],i,j,k,s;
  scanf("%d",&n);
  while(n--){
    for(i=0;i<10;i++){
      for(j=0;j<10;j++)scanf("%d",&d[i][j]);
    }
    for(i=0;i<1<<10;i++){
      for(j=0;j<100;j++){
	a[j/10][j%10]=0;
	c[j/10][j%10]=d[j/10][j%10];
      }
      for(j=0;j<10;j++){
	if(i&1<<j)f(j,0);
      }
      for(j=0;j<9;j++){
	for(k=0;k<10;k++){
	  if(c[j][k])f(k,j+1);
	}
      }
      for(j=s=0;j<10;j++)s+=c[9][j];
      if(s==0)break;
    }//printf("%d\n",i);
    for(i=0;i<10;i++){
      for(j=0;j<10;j++){
	if(j)printf(" ");
	printf("%d",a[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400
c:
	.zero	400
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movl	%edi, -84(%rbp)
	movl	%esi, -88(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$-1, -48(%rbp)
	movl	$0, -32(%rbp)
	movl	$1, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	-84(%rbp), %eax
	movslq	%eax, %rcx
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, -76(%rbp)
	jmp	.L2
.L6:
	movl	-76(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -72(%rbp)
	movl	-76(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -68(%rbp)
	cmpl	$0, -72(%rbp)
	js	.L8
	cmpl	$0, -68(%rbp)
	js	.L8
	cmpl	$9, -68(%rbp)
	jg	.L8
	cmpl	$9, -72(%rbp)
	jg	.L8
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	$1, %edx
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rsi
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L5
.L8:
	nop
.L5:
	addl	$1, -76(%rbp)
.L2:
	cmpl	$4, -76(%rbp)
	jle	.L6
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L36:
	movl	$0, -432(%rbp)
	jmp	.L11
.L14:
	movl	$0, -428(%rbp)
	jmp	.L12
.L13:
	leaq	-416(%rbp), %rcx
	movl	-428(%rbp), %eax
	movslq	%eax, %rsi
	movl	-432(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %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, -428(%rbp)
.L12:
	cmpl	$9, -428(%rbp)
	jle	.L13
	addl	$1, -432(%rbp)
.L11:
	cmpl	$9, -432(%rbp)
	jle	.L14
	movl	$0, -432(%rbp)
	jmp	.L15
.L30:
	movl	$0, -428(%rbp)
	jmp	.L16
.L17:
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-428(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %edi
	sarl	$31, %edi
	subl	%edi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %r8d
	movl	-428(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-428(%rbp), %esi
	movslq	%esi, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%esi, %r9d
	sarl	$31, %r9d
	subl	%r9d, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %esi
	movl	%esi, %edx
	movslq	%ecx, %rsi
	movslq	%r8d, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%edx, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -428(%rbp)
.L16:
	cmpl	$99, -428(%rbp)
	jle	.L17
	movl	$0, -428(%rbp)
	jmp	.L18
.L20:
	movl	-428(%rbp), %eax
	movl	-432(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L19
	movl	-428(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	f
.L19:
	addl	$1, -428(%rbp)
.L18:
	cmpl	$9, -428(%rbp)
	jle	.L20
	movl	$0, -428(%rbp)
	jmp	.L21
.L25:
	movl	$0, -424(%rbp)
	jmp	.L22
.L24:
	movl	-424(%rbp), %eax
	movslq	%eax, %rcx
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L23
	movl	-428(%rbp), %eax
	leal	1(%rax), %edx
	movl	-424(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	f
.L23:
	addl	$1, -424(%rbp)
.L22:
	cmpl	$9, -424(%rbp)
	jle	.L24
	addl	$1, -428(%rbp)
.L21:
	cmpl	$8, -428(%rbp)
	jle	.L25
	movl	$0, -420(%rbp)
	movl	-420(%rbp), %eax
	movl	%eax, -428(%rbp)
	jmp	.L26
.L27:
	movl	-428(%rbp), %eax
	cltq
	addq	$90, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -420(%rbp)
	addl	$1, -428(%rbp)
.L26:
	cmpl	$9, -428(%rbp)
	jle	.L27
	cmpl	$0, -420(%rbp)
	je	.L39
	addl	$1, -432(%rbp)
.L15:
	cmpl	$1023, -432(%rbp)
	jle	.L30
	jmp	.L29
.L39:
	nop
.L29:
	movl	$0, -432(%rbp)
	jmp	.L31
.L35:
	movl	$0, -428(%rbp)
	jmp	.L32
.L34:
	cmpl	$0, -428(%rbp)
	je	.L33
	movl	$32, %edi
	call	putchar@PLT
.L33:
	movl	-428(%rbp), %eax
	movslq	%eax, %rcx
	movl	-432(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -428(%rbp)
.L32:
	cmpl	$9, -428(%rbp)
	jle	.L34
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -432(%rbp)
.L31:
	cmpl	$9, -432(%rbp)
	jle	.L35
.L10:
	movl	-436(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -436(%rbp)
	testl	%eax, %eax
	jne	.L36
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400
a:
	.zero	400
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400
c:
	.zero	400
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movl	%edi, -84(%rbp)
	movl	%esi, -88(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$-1, -48(%rbp)
	movl	$0, -32(%rbp)
	movl	$1, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	-84(%rbp), %eax
	movslq	%eax, %rcx
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	$0, -76(%rbp)
	jmp	.L2
.L6:
	movl	-76(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -72(%rbp)
	movl	-76(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -68(%rbp)
	cmpl	$0, -72(%rbp)
	js	.L8
	cmpl	$0, -68(%rbp)
	js	.L8
	cmpl	$9, -68(%rbp)
	jg	.L8
	cmpl	$9, -72(%rbp)
	jg	.L8
	movl	-72(%rbp), %eax
	movslq	%eax, %rcx
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	$1, %edx
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-72(%rbp), %eax
	movslq	%eax, %rsi
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L5
.L8:
	nop
.L5:
	addl	$1, -76(%rbp)
.L2:
	cmpl	$4, -76(%rbp)
	jle	.L6
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L36:
	movl	$0, -432(%rbp)
	jmp	.L11
.L14:
	movl	$0, -428(%rbp)
	jmp	.L12
.L13:
	leaq	-416(%rbp), %rcx
	movl	-428(%rbp), %eax
	movslq	%eax, %rsi
	movl	-432(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %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, -428(%rbp)
.L12:
	cmpl	$9, -428(%rbp)
	jle	.L13
	addl	$1, -432(%rbp)
.L11:
	cmpl	$9, -432(%rbp)
	jle	.L14
	movl	$0, -432(%rbp)
	jmp	.L15
.L30:
	movl	$0, -428(%rbp)
	jmp	.L16
.L17:
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-428(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %edi
	sarl	$31, %edi
	subl	%edi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%esi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %r8d
	movl	-428(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-428(%rbp), %esi
	movslq	%esi, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%esi, %r9d
	sarl	$31, %r9d
	subl	%r9d, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %esi
	movl	%esi, %edx
	movslq	%ecx, %rsi
	movslq	%r8d, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%edx, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -428(%rbp)
.L16:
	cmpl	$99, -428(%rbp)
	jle	.L17
	movl	$0, -428(%rbp)
	jmp	.L18
.L20:
	movl	-428(%rbp), %eax
	movl	-432(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L19
	movl	-428(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	f
.L19:
	addl	$1, -428(%rbp)
.L18:
	cmpl	$9, -428(%rbp)
	jle	.L20
	movl	$0, -428(%rbp)
	jmp	.L21
.L25:
	movl	$0, -424(%rbp)
	jmp	.L22
.L24:
	movl	-424(%rbp), %eax
	movslq	%eax, %rcx
	movl	-428(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L23
	movl	-428(%rbp), %eax
	leal	1(%rax), %edx
	movl	-424(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	f
.L23:
	addl	$1, -424(%rbp)
.L22:
	cmpl	$9, -424(%rbp)
	jle	.L24
	addl	$1, -428(%rbp)
.L21:
	cmpl	$8, -428(%rbp)
	jle	.L25
	movl	$0, -420(%rbp)
	movl	-420(%rbp), %eax
	movl	%eax, -428(%rbp)
	jmp	.L26
.L27:
	movl	-428(%rbp), %eax
	cltq
	addq	$90, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -420(%rbp)
	addl	$1, -428(%rbp)
.L26:
	cmpl	$9, -428(%rbp)
	jle	.L27
	cmpl	$0, -420(%rbp)
	je	.L39
	addl	$1, -432(%rbp)
.L15:
	cmpl	$1023, -432(%rbp)
	jle	.L30
	jmp	.L29
.L39:
	nop
.L29:
	movl	$0, -432(%rbp)
	jmp	.L31
.L35:
	movl	$0, -428(%rbp)
	jmp	.L32
.L34:
	cmpl	$0, -428(%rbp)
	je	.L33
	movl	$32, %edi
	call	putchar@PLT
.L33:
	movl	-428(%rbp), %eax
	movslq	%eax, %rcx
	movl	-432(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -428(%rbp)
.L32:
	cmpl	$9, -428(%rbp)
	jle	.L34
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -432(%rbp)
.L31:
	cmpl	$9, -432(%rbp)
	jle	.L35
.L10:
	movl	-436(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -436(%rbp)
	testl	%eax, %eax
	jne	.L36
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
