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 i,j,k;
	char c[21];
	int w,h;
	int map[22][22];
	int mapindex[22*22];
	int map_now,mapindex_now;
	
	while(1){
		scanf("%d %d",&w,&h);
		if(w==0){
			break;
		}
		for(i=0;i<22;i++){
			for(j=0;j<22;j++){
				map[i][j]=-1;
				mapindex[i*w+j]=0;
			}
		}
		for(j=0;j<=h;j++){
			gets(c);
			if(j!=0){
				for(i=1;i<=w;i++){
					switch(c[i-1]){
						case '#':map[i][j]=-1;break;
						case '@':map[i][j]=1;mapindex[1]=i+j*(w+1);break;
						case '.':map[i][j]=0;break;
						default :break;
					}
				}
			}
		}
		/*
		for(j=0;j<22;j++){
			for(i=0;i<22;i++){
				printf("%2d",map[i][j]);
			}
			printf("\n");
		}*/
		
		map_now=1;
		mapindex_now=1;
		while(mapindex[mapindex_now]!=0){
			int x=(mapindex[mapindex_now]-1)%(w+1)+1;
			int y=mapindex[mapindex_now]/(w+1);
			for(i=0;i<4;i++){
				if(i==0){
					if(map[x-1][y]==0){
						map_now++;
						map[x-1][y]=map_now;
						mapindex[map_now]=(x-1)+y*(w+1);
					}
				}else if(i==1){
					if(map[x+1][y]==0){
						map_now++;
						map[x+1][y]=map_now;
						mapindex[map_now]=(x+1)+y*(w+1);
					}
				}else if(i==2){
					if(map[x][y-1]==0){
						map_now++;
						map[x][y-1]=map_now;
						mapindex[map_now]=x+(y-1)*(w+1);
					}
				}else if(i==3){
					if(map[x][y+1]==0){
						map_now++;
						map[x][y+1]=map_now;
						mapindex[map_now]=x+(y+1)*(w+1);
					}
				}
			}
			mapindex_now++;
		}
		printf("%d\n",mapindex_now-1);
		/*for(j=0;j<22;j++){
			for(i=0;i<22;i++){
				printf("%2d",map[i][j]);
			}
			printf("\n");
		}
		for(i=0;i<10;i++){
			for(j=0;j<10;j++){
				printf("%d\n",mapindex[i*w+j]);
			}
			printf("\n");
		}*/
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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	$3936, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L26:
	leaq	-3932(%rbp), %rdx
	leaq	-3936(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-3936(%rbp), %eax
	testl	%eax, %eax
	je	.L30
	movl	$0, -3928(%rbp)
	jmp	.L4
.L7:
	movl	$0, -3924(%rbp)
	jmp	.L5
.L6:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$-1, -3904(%rbp,%rax,4)
	movl	-3936(%rbp), %eax
	imull	-3928(%rbp), %eax
	movl	%eax, %edx
	movl	-3924(%rbp), %eax
	addl	%edx, %eax
	cltq
	movl	$0, -1968(%rbp,%rax,4)
	addl	$1, -3924(%rbp)
.L5:
	cmpl	$21, -3924(%rbp)
	jle	.L6
	addl	$1, -3928(%rbp)
.L4:
	cmpl	$21, -3928(%rbp)
	jle	.L7
	movl	$0, -3924(%rbp)
	jmp	.L8
.L17:
	leaq	-32(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	gets@PLT
	cmpl	$0, -3924(%rbp)
	je	.L9
	movl	$1, -3928(%rbp)
	jmp	.L10
.L16:
	movl	-3928(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-32(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$64, %eax
	je	.L11
	cmpl	$64, %eax
	jg	.L31
	cmpl	$35, %eax
	je	.L13
	cmpl	$46, %eax
	je	.L14
	jmp	.L31
.L13:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$-1, -3904(%rbp,%rax,4)
	jmp	.L15
.L11:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$1, -3904(%rbp,%rax,4)
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3924(%rbp), %eax
	movl	%eax, %edx
	movl	-3928(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -1964(%rbp)
	jmp	.L15
.L14:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$0, -3904(%rbp,%rax,4)
	jmp	.L15
.L31:
	nop
.L15:
	addl	$1, -3928(%rbp)
.L10:
	movl	-3936(%rbp), %eax
	cmpl	%eax, -3928(%rbp)
	jle	.L16
.L9:
	addl	$1, -3924(%rbp)
.L8:
	movl	-3932(%rbp), %eax
	cmpl	%eax, -3924(%rbp)
	jle	.L17
	movl	$1, -3920(%rbp)
	movl	$1, -3916(%rbp)
	jmp	.L18
.L25:
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	-3936(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -3912(%rbp)
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	movl	-3936(%rbp), %edx
	leal	1(%rdx), %esi
	cltd
	idivl	%esi
	movl	%eax, -3908(%rbp)
	movl	$0, -3928(%rbp)
	jmp	.L19
.L24:
	cmpl	$0, -3928(%rbp)
	jne	.L20
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3908(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L20:
	cmpl	$1, -3928(%rbp)
	jne	.L22
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3908(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L22:
	cmpl	$2, -3928(%rbp)
	jne	.L23
	movl	-3908(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3908(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	%eax, %edx
	movl	-3912(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L23:
	cmpl	$3, -3928(%rbp)
	jne	.L21
	movl	-3908(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3908(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3908(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	%eax, %edx
	movl	-3912(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
.L21:
	addl	$1, -3928(%rbp)
.L19:
	cmpl	$3, -3928(%rbp)
	jle	.L24
	addl	$1, -3916(%rbp)
.L18:
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L25
	movl	-3916(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L30:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$3960, %rsp
	.cfi_def_cfa_offset 4016
	movq	%fs:40, %rax
	movq	%rax, 3944(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	leaq	3920(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	40(%rsp), %rax
	subl	%ebx, %r12d
	movq	%rax, (%rsp)
.L24:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	40(%rsp), %rdx
	testl	%edx, %edx
	je	.L43
	leaq	48(%rsp), %rsi
	movq	$-1, %rax
	pxor	%xmm0, %xmm0
	movl	$242, %ecx
	movq	%rsi, %rdi
	leaq	1984(%rsp), %rbp
	rep stosq
	leaq	0(,%rdx,4), %rcx
	movq	%rbp, %rax
	movl	$22, %edx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	$0, 80(%rax)
	movups	%xmm0, (%rax)
	movups	%xmm0, 16(%rax)
	movups	%xmm0, 32(%rax)
	movups	%xmm0, 48(%rax)
	movups	%xmm0, 64(%rax)
	addq	%rcx, %rax
	subl	$1, %edx
	jne	.L7
	movl	44(%rsp), %eax
	testl	%eax, %eax
	js	.L17
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	52(%rsp), %r13
	movl	$1, %r14d
	call	gets@PLT
	movl	44(%rsp), %eax
	leaq	3921(%rsp), %r15
	testl	%eax, %eax
	jle	.L17
	movq	%rbp, 24(%rsp)
	movq	%rbx, %rbp
	movl	20(%rsp), %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	gets@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	leal	1(%rax), %edx
	leal	-1(%rax), %esi
	movq	%r13, %rcx
	movq	%rbp, %rax
	imull	%r14d, %edx
	addq	%r15, %rsi
	xorl	%r9d, %r9d
	leal	(%r12,%rdx), %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L46:
	cmpb	$35, %dl
	je	.L44
.L13:
	addq	$1, %rax
	addq	$88, %rcx
	cmpq	%rax, %rsi
	je	.L45
.L14:
	movzbl	(%rax), %edx
	cmpb	$46, %dl
	je	.L11
	cmpb	$64, %dl
	jne	.L46
	leal	(%r8,%rax), %ebx
	addq	$1, %rax
	movl	$1, 88(%rcx)
	addq	$88, %rcx
	movl	$1, %r9d
	cmpq	%rax, %rsi
	jne	.L14
.L45:
	testb	%r9b, %r9b
	je	.L10
	movl	%ebx, 1988(%rsp)
.L10:
	addl	$1, %r14d
	addq	$4, %r13
	cmpl	%r14d, 44(%rsp)
	jge	.L16
	movl	%ebx, 20(%rsp)
	movq	%rbp, %rbx
	movq	24(%rsp), %rbp
.L17:
	movl	1988(%rsp), %r11d
	xorl	%r10d, %r10d
	testl	%r11d, %r11d
	je	.L6
	movl	40(%rsp), %eax
	movl	$1, %edi
	movl	$1, %r9d
	leal	1(%rax), %esi
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-1(%r11), %eax
	movl	%edi, %r10d
	cltd
	idivl	%esi
	movl	%r11d, %eax
	movl	%edx, %r8d
	leal	1(%rdx), %ecx
	cltd
	idivl	%esi
	movslq	%r8d, %rdx
	leaq	(%rdx,%rdx,4), %r13
	leaq	(%rdx,%r13,2), %rdx
	movslq	%eax, %r11
	leaq	(%r11,%rdx,2), %rdx
	movl	48(%rsp,%rdx,4), %r15d
	testl	%r15d, %r15d
	jne	.L18
	addl	$1, %r9d
	movl	%r9d, 48(%rsp,%rdx,4)
	movl	%esi, %edx
	movslq	%r9d, %r13
	imull	%eax, %edx
	addl	%r8d, %edx
	movl	%edx, 1984(%rsp,%r13,4)
.L18:
	addl	$2, %r8d
	movslq	%r8d, %rdx
	leaq	(%rdx,%rdx,4), %r13
	leaq	(%rdx,%r13,2), %rdx
	leaq	(%r11,%rdx,2), %rdx
	movl	48(%rsp,%rdx,4), %r14d
	testl	%r14d, %r14d
	jne	.L19
	addl	$1, %r9d
	movl	%r9d, 48(%rsp,%rdx,4)
	movl	%esi, %edx
	movslq	%r9d, %r11
	imull	%eax, %edx
	addl	%r8d, %edx
	movl	%edx, 1984(%rsp,%r11,4)
.L19:
	movslq	%ecx, %rdx
	leal	-1(%rax), %r8d
	leaq	(%rdx,%rdx,4), %r13
	movslq	%r8d, %r11
	leaq	(%rdx,%r13,2), %r13
	leaq	(%r11,%r13,2), %r11
	movl	48(%rsp,%r11,4), %r13d
	testl	%r13d, %r13d
	jne	.L20
	imull	%esi, %r8d
	addl	$1, %r9d
	movl	%r9d, 48(%rsp,%r11,4)
	movslq	%r9d, %r11
	addl	%ecx, %r8d
	movl	%r8d, 1984(%rsp,%r11,4)
.L20:
	leal	1(%rax), %r11d
	leaq	(%rdx,%rdx,4), %r8
	leaq	(%rdx,%r8,2), %rdx
	movslq	%r11d, %rax
	leaq	(%rax,%rdx,2), %rax
	movl	48(%rsp,%rax,4), %edx
	testl	%edx, %edx
	jne	.L21
	addl	$1, %r9d
	addq	$1, %rdi
	movl	%r9d, 48(%rsp,%rax,4)
	movl	%r11d, %eax
	movslq	%r9d, %rdx
	imull	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, 1984(%rsp,%rdx,4)
	movl	0(%rbp,%rdi,4), %r11d
	testl	%r11d, %r11d
	jne	.L23
.L6:
	movl	%r10d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L21:
	addq	$1, %rdi
	movl	0(%rbp,%rdi,4), %r11d
	testl	%r11d, %r11d
	jne	.L23
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$-1, 88(%rcx)
	jmp	.L13
.L11:
	movl	$0, 88(%rcx)
	jmp	.L13
.L43:
	movq	3944(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$3960, %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
.L47:
	.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 %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$3960, %rsp
	.cfi_def_cfa_offset 4016
	movq	%fs:40, %rax
	movq	%rax, 3944(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	leaq	3920(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	40(%rsp), %rax
	subl	%ebx, %r12d
	movq	%rax, (%rsp)
.L24:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	40(%rsp), %rdx
	testl	%edx, %edx
	je	.L43
	leaq	48(%rsp), %rsi
	movq	$-1, %rax
	pxor	%xmm0, %xmm0
	movl	$242, %ecx
	movq	%rsi, %rdi
	leaq	1984(%rsp), %rbp
	rep stosq
	leaq	0(,%rdx,4), %rcx
	movq	%rbp, %rax
	movl	$22, %edx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	$0, 80(%rax)
	movups	%xmm0, (%rax)
	movups	%xmm0, 16(%rax)
	movups	%xmm0, 32(%rax)
	movups	%xmm0, 48(%rax)
	movups	%xmm0, 64(%rax)
	addq	%rcx, %rax
	subl	$1, %edx
	jne	.L7
	movl	44(%rsp), %eax
	testl	%eax, %eax
	js	.L17
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	52(%rsp), %r13
	movl	$1, %r14d
	call	gets@PLT
	movl	44(%rsp), %eax
	leaq	3921(%rsp), %r15
	testl	%eax, %eax
	jle	.L17
	movq	%rbp, 24(%rsp)
	movq	%rbx, %rbp
	movl	20(%rsp), %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	gets@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	leal	1(%rax), %edx
	leal	-1(%rax), %esi
	movq	%r13, %rcx
	movq	%rbp, %rax
	imull	%r14d, %edx
	addq	%r15, %rsi
	xorl	%r9d, %r9d
	leal	(%r12,%rdx), %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L46:
	cmpb	$35, %dl
	je	.L44
.L13:
	addq	$1, %rax
	addq	$88, %rcx
	cmpq	%rax, %rsi
	je	.L45
.L14:
	movzbl	(%rax), %edx
	cmpb	$46, %dl
	je	.L11
	cmpb	$64, %dl
	jne	.L46
	leal	(%r8,%rax), %ebx
	addq	$1, %rax
	movl	$1, 88(%rcx)
	addq	$88, %rcx
	movl	$1, %r9d
	cmpq	%rax, %rsi
	jne	.L14
.L45:
	testb	%r9b, %r9b
	je	.L10
	movl	%ebx, 1988(%rsp)
.L10:
	addl	$1, %r14d
	addq	$4, %r13
	cmpl	%r14d, 44(%rsp)
	jge	.L16
	movl	%ebx, 20(%rsp)
	movq	%rbp, %rbx
	movq	24(%rsp), %rbp
.L17:
	movl	1988(%rsp), %r11d
	xorl	%r10d, %r10d
	testl	%r11d, %r11d
	je	.L6
	movl	40(%rsp), %eax
	movl	$1, %edi
	movl	$1, %r9d
	leal	1(%rax), %esi
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-1(%r11), %eax
	movl	%edi, %r10d
	cltd
	idivl	%esi
	movl	%r11d, %eax
	movl	%edx, %r8d
	leal	1(%rdx), %ecx
	cltd
	idivl	%esi
	movslq	%r8d, %rdx
	leaq	(%rdx,%rdx,4), %r13
	leaq	(%rdx,%r13,2), %rdx
	movslq	%eax, %r11
	leaq	(%r11,%rdx,2), %rdx
	movl	48(%rsp,%rdx,4), %r15d
	testl	%r15d, %r15d
	jne	.L18
	addl	$1, %r9d
	movl	%r9d, 48(%rsp,%rdx,4)
	movl	%esi, %edx
	movslq	%r9d, %r13
	imull	%eax, %edx
	addl	%r8d, %edx
	movl	%edx, 1984(%rsp,%r13,4)
.L18:
	addl	$2, %r8d
	movslq	%r8d, %rdx
	leaq	(%rdx,%rdx,4), %r13
	leaq	(%rdx,%r13,2), %rdx
	leaq	(%r11,%rdx,2), %rdx
	movl	48(%rsp,%rdx,4), %r14d
	testl	%r14d, %r14d
	jne	.L19
	addl	$1, %r9d
	movl	%r9d, 48(%rsp,%rdx,4)
	movl	%esi, %edx
	movslq	%r9d, %r11
	imull	%eax, %edx
	addl	%r8d, %edx
	movl	%edx, 1984(%rsp,%r11,4)
.L19:
	movslq	%ecx, %rdx
	leal	-1(%rax), %r8d
	leaq	(%rdx,%rdx,4), %r13
	movslq	%r8d, %r11
	leaq	(%rdx,%r13,2), %r13
	leaq	(%r11,%r13,2), %r11
	movl	48(%rsp,%r11,4), %r13d
	testl	%r13d, %r13d
	jne	.L20
	imull	%esi, %r8d
	addl	$1, %r9d
	movl	%r9d, 48(%rsp,%r11,4)
	movslq	%r9d, %r11
	addl	%ecx, %r8d
	movl	%r8d, 1984(%rsp,%r11,4)
.L20:
	leal	1(%rax), %r11d
	leaq	(%rdx,%rdx,4), %r8
	leaq	(%rdx,%r8,2), %rdx
	movslq	%r11d, %rax
	leaq	(%rax,%rdx,2), %rax
	movl	48(%rsp,%rax,4), %edx
	testl	%edx, %edx
	jne	.L21
	addl	$1, %r9d
	addq	$1, %rdi
	movl	%r9d, 48(%rsp,%rax,4)
	movl	%r11d, %eax
	movslq	%r9d, %rdx
	imull	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, 1984(%rsp,%rdx,4)
	movl	0(%rbp,%rdi,4), %r11d
	testl	%r11d, %r11d
	jne	.L23
.L6:
	movl	%r10d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L21:
	addq	$1, %rdi
	movl	0(%rbp,%rdi,4), %r11d
	testl	%r11d, %r11d
	jne	.L23
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$-1, 88(%rcx)
	jmp	.L13
.L11:
	movl	$0, 88(%rcx)
	jmp	.L13
.L43:
	movq	3944(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$3960, %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
.L47:
	.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 i,j,k;
	char c[21];
	int w,h;
	int map[22][22];
	int mapindex[22*22];
	int map_now,mapindex_now;
	
	while(1){
		scanf("%d %d",&w,&h);
		if(w==0){
			break;
		}
		for(i=0;i<22;i++){
			for(j=0;j<22;j++){
				map[i][j]=-1;
				mapindex[i*w+j]=0;
			}
		}
		for(j=0;j<=h;j++){
			gets(c);
			if(j!=0){
				for(i=1;i<=w;i++){
					switch(c[i-1]){
						case '#':map[i][j]=-1;break;
						case '@':map[i][j]=1;mapindex[1]=i+j*(w+1);break;
						case '.':map[i][j]=0;break;
						default :break;
					}
				}
			}
		}
		/*
		for(j=0;j<22;j++){
			for(i=0;i<22;i++){
				printf("%2d",map[i][j]);
			}
			printf("\n");
		}*/
		
		map_now=1;
		mapindex_now=1;
		while(mapindex[mapindex_now]!=0){
			int x=(mapindex[mapindex_now]-1)%(w+1)+1;
			int y=mapindex[mapindex_now]/(w+1);
			for(i=0;i<4;i++){
				if(i==0){
					if(map[x-1][y]==0){
						map_now++;
						map[x-1][y]=map_now;
						mapindex[map_now]=(x-1)+y*(w+1);
					}
				}else if(i==1){
					if(map[x+1][y]==0){
						map_now++;
						map[x+1][y]=map_now;
						mapindex[map_now]=(x+1)+y*(w+1);
					}
				}else if(i==2){
					if(map[x][y-1]==0){
						map_now++;
						map[x][y-1]=map_now;
						mapindex[map_now]=x+(y-1)*(w+1);
					}
				}else if(i==3){
					if(map[x][y+1]==0){
						map_now++;
						map[x][y+1]=map_now;
						mapindex[map_now]=x+(y+1)*(w+1);
					}
				}
			}
			mapindex_now++;
		}
		printf("%d\n",mapindex_now-1);
		/*for(j=0;j<22;j++){
			for(i=0;i<22;i++){
				printf("%2d",map[i][j]);
			}
			printf("\n");
		}
		for(i=0;i<10;i++){
			for(j=0;j<10;j++){
				printf("%d\n",mapindex[i*w+j]);
			}
			printf("\n");
		}*/
	}
	return 0;
}
6 9
....#.
.....#
......
......
......
......
......
@...#
.#..#.
11 9
.#.........
.#.#######.
.#.#.....#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#..#..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
#.#....
..#.#..
.###
...@...
.###
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
#@...#
.#..#.
11 9
.#.........
.#.#######.
.#.#.....#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#..#..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
..#.#..
..#.#..
###.###
...@...
###."##
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
@...#
."..#.
11 9
.#.........
.#.#######.
.#.....#.#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#..#..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
#.#....
..#.#..
.###
...@...
.###
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
@...#
."..#.
11 9
.#.........
.#.#######.
.#.....#.#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#.."..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
#.#....
..#.#..
.###
...@...
.###
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
@...#
.#..#.
11 9
.#.........
.#.#######.
.#.#.....#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
###..#..#..
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
..#.#..
..#.#..
.###
...@...
.###
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
#@...#
.#..#.
11 9
.#.........
.#.#######.
.#.#.....#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#..#..###
..#..#..#@.
..#..#..#..
..#..#..#..
13 7
..#.#..
..#.#..
###.###
...@...
###.###
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
#@...#
.#..#.
12 9
.#.........
.#.#######.
.#.#.....#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#..#..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
..#.#..
..#.#..
###.###
...@...
###."##
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
@...#
."..#.
11 9
.#.........
.#.#######.
.".....#.#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#.."..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
#.#....
..#.#..
.###
...@...
.###
..#.#..
..#.#..
0 0
 6 9
....#.
.....#
......
......
......
......
......
@...#
."..#.
11 9
.#.........
.#.#######.
##.....#...
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#..#..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
#.#....
..#.#..
.###
./.@...
.###
..#.#..
..#.#..
0 0
 6 9
./..#.
.....#
......
......
......
......
......
@...#
."..#.
11 9
.#.........
.#######.#.
.#.....#.#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#.."..#"#
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
#.#....
..#.#..
.###
...@...
.###
..#.#..
..#.#..
0 0

46
59
6
31
 45
59
6
13
 46
59
6
31
 46
59
6
31
 46
59
12
29
 45
59
6
13
 45
59
6
13
 46
59
6
31
 46
57
6
20
 45
59
6
31

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 i,j,k;
	char c[21];
	int w,h;
	int map[22][22];
	int mapindex[22*22];
	int map_now,mapindex_now;
	
	while(1){
		scanf("%d %d",&w,&h);
		if(w==0){
			break;
		}
		for(i=0;i<22;i++){
			for(j=0;j<22;j++){
				map[i][j]=-1;
				mapindex[i*w+j]=0;
			}
		}
		for(j=0;j<=h;j++){
			gets(c);
			if(j!=0){
				for(i=1;i<=w;i++){
					switch(c[i-1]){
						case '#':map[i][j]=-1;break;
						case '@':map[i][j]=1;mapindex[1]=i+j*(w+1);break;
						case '.':map[i][j]=0;break;
						default :break;
					}
				}
			}
		}
		/*
		for(j=0;j<22;j++){
			for(i=0;i<22;i++){
				printf("%2d",map[i][j]);
			}
			printf("\n");
		}*/
		
		map_now=1;
		mapindex_now=1;
		while(mapindex[mapindex_now]!=0){
			int x=(mapindex[mapindex_now]-1)%(w+1)+1;
			int y=mapindex[mapindex_now]/(w+1);
			for(i=0;i<4;i++){
				if(i==0){
					if(map[x-1][y]==0){
						map_now++;
						map[x-1][y]=map_now;
						mapindex[map_now]=(x-1)+y*(w+1);
					}
				}else if(i==1){
					if(map[x+1][y]==0){
						map_now++;
						map[x+1][y]=map_now;
						mapindex[map_now]=(x+1)+y*(w+1);
					}
				}else if(i==2){
					if(map[x][y-1]==0){
						map_now++;
						map[x][y-1]=map_now;
						mapindex[map_now]=x+(y-1)*(w+1);
					}
				}else if(i==3){
					if(map[x][y+1]==0){
						map_now++;
						map[x][y+1]=map_now;
						mapindex[map_now]=x+(y+1)*(w+1);
					}
				}
			}
			mapindex_now++;
		}
		printf("%d\n",mapindex_now-1);
		/*for(j=0;j<22;j++){
			for(i=0;i<22;i++){
				printf("%2d",map[i][j]);
			}
			printf("\n");
		}
		for(i=0;i<10;i++){
			for(j=0;j<10;j++){
				printf("%d\n",mapindex[i*w+j]);
			}
			printf("\n");
		}*/
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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	$3936, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L26:
	leaq	-3932(%rbp), %rdx
	leaq	-3936(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-3936(%rbp), %eax
	testl	%eax, %eax
	je	.L30
	movl	$0, -3928(%rbp)
	jmp	.L4
.L7:
	movl	$0, -3924(%rbp)
	jmp	.L5
.L6:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$-1, -3904(%rbp,%rax,4)
	movl	-3936(%rbp), %eax
	imull	-3928(%rbp), %eax
	movl	%eax, %edx
	movl	-3924(%rbp), %eax
	addl	%edx, %eax
	cltq
	movl	$0, -1968(%rbp,%rax,4)
	addl	$1, -3924(%rbp)
.L5:
	cmpl	$21, -3924(%rbp)
	jle	.L6
	addl	$1, -3928(%rbp)
.L4:
	cmpl	$21, -3928(%rbp)
	jle	.L7
	movl	$0, -3924(%rbp)
	jmp	.L8
.L17:
	leaq	-32(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	gets@PLT
	cmpl	$0, -3924(%rbp)
	je	.L9
	movl	$1, -3928(%rbp)
	jmp	.L10
.L16:
	movl	-3928(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-32(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$64, %eax
	je	.L11
	cmpl	$64, %eax
	jg	.L31
	cmpl	$35, %eax
	je	.L13
	cmpl	$46, %eax
	je	.L14
	jmp	.L31
.L13:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$-1, -3904(%rbp,%rax,4)
	jmp	.L15
.L11:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$1, -3904(%rbp,%rax,4)
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3924(%rbp), %eax
	movl	%eax, %edx
	movl	-3928(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -1964(%rbp)
	jmp	.L15
.L14:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$0, -3904(%rbp,%rax,4)
	jmp	.L15
.L31:
	nop
.L15:
	addl	$1, -3928(%rbp)
.L10:
	movl	-3936(%rbp), %eax
	cmpl	%eax, -3928(%rbp)
	jle	.L16
.L9:
	addl	$1, -3924(%rbp)
.L8:
	movl	-3932(%rbp), %eax
	cmpl	%eax, -3924(%rbp)
	jle	.L17
	movl	$1, -3920(%rbp)
	movl	$1, -3916(%rbp)
	jmp	.L18
.L25:
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	-3936(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -3912(%rbp)
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	movl	-3936(%rbp), %edx
	leal	1(%rdx), %esi
	cltd
	idivl	%esi
	movl	%eax, -3908(%rbp)
	movl	$0, -3928(%rbp)
	jmp	.L19
.L24:
	cmpl	$0, -3928(%rbp)
	jne	.L20
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3908(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L20:
	cmpl	$1, -3928(%rbp)
	jne	.L22
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3908(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L22:
	cmpl	$2, -3928(%rbp)
	jne	.L23
	movl	-3908(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3908(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	%eax, %edx
	movl	-3912(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L23:
	cmpl	$3, -3928(%rbp)
	jne	.L21
	movl	-3908(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3908(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3908(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	%eax, %edx
	movl	-3912(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
.L21:
	addl	$1, -3928(%rbp)
.L19:
	cmpl	$3, -3928(%rbp)
	jle	.L24
	addl	$1, -3916(%rbp)
.L18:
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L25
	movl	-3916(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L30:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	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 %d"
.LC1:
	.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	$3936, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L26:
	leaq	-3932(%rbp), %rdx
	leaq	-3936(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-3936(%rbp), %eax
	testl	%eax, %eax
	je	.L30
	movl	$0, -3928(%rbp)
	jmp	.L4
.L7:
	movl	$0, -3924(%rbp)
	jmp	.L5
.L6:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$-1, -3904(%rbp,%rax,4)
	movl	-3936(%rbp), %eax
	imull	-3928(%rbp), %eax
	movl	%eax, %edx
	movl	-3924(%rbp), %eax
	addl	%edx, %eax
	cltq
	movl	$0, -1968(%rbp,%rax,4)
	addl	$1, -3924(%rbp)
.L5:
	cmpl	$21, -3924(%rbp)
	jle	.L6
	addl	$1, -3928(%rbp)
.L4:
	cmpl	$21, -3928(%rbp)
	jle	.L7
	movl	$0, -3924(%rbp)
	jmp	.L8
.L17:
	leaq	-32(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	gets@PLT
	cmpl	$0, -3924(%rbp)
	je	.L9
	movl	$1, -3928(%rbp)
	jmp	.L10
.L16:
	movl	-3928(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-32(%rbp,%rax), %eax
	movsbl	%al, %eax
	cmpl	$64, %eax
	je	.L11
	cmpl	$64, %eax
	jg	.L31
	cmpl	$35, %eax
	je	.L13
	cmpl	$46, %eax
	je	.L14
	jmp	.L31
.L13:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$-1, -3904(%rbp,%rax,4)
	jmp	.L15
.L11:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$1, -3904(%rbp,%rax,4)
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3924(%rbp), %eax
	movl	%eax, %edx
	movl	-3928(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -1964(%rbp)
	jmp	.L15
.L14:
	movl	-3924(%rbp), %eax
	movslq	%eax, %rcx
	movl	-3928(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	$0, -3904(%rbp,%rax,4)
	jmp	.L15
.L31:
	nop
.L15:
	addl	$1, -3928(%rbp)
.L10:
	movl	-3936(%rbp), %eax
	cmpl	%eax, -3928(%rbp)
	jle	.L16
.L9:
	addl	$1, -3924(%rbp)
.L8:
	movl	-3932(%rbp), %eax
	cmpl	%eax, -3924(%rbp)
	jle	.L17
	movl	$1, -3920(%rbp)
	movl	$1, -3916(%rbp)
	jmp	.L18
.L25:
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	-3936(%rbp), %edx
	leal	1(%rdx), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -3912(%rbp)
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	movl	-3936(%rbp), %edx
	leal	1(%rdx), %esi
	cltd
	idivl	%esi
	movl	%eax, -3908(%rbp)
	movl	$0, -3928(%rbp)
	jmp	.L19
.L24:
	cmpl	$0, -3928(%rbp)
	jne	.L20
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3912(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3908(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L20:
	cmpl	$1, -3928(%rbp)
	jne	.L22
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3908(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3912(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	-3908(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L22:
	cmpl	$2, -3928(%rbp)
	jne	.L23
	movl	-3908(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3908(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	%eax, %edx
	movl	-3912(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
	jmp	.L21
.L23:
	cmpl	$3, -3928(%rbp)
	jne	.L21
	movl	-3908(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movl	-3904(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L21
	addl	$1, -3920(%rbp)
	movl	-3908(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-3912(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-3920(%rbp), %eax
	movl	%eax, -3904(%rbp,%rdx,4)
	movl	-3908(%rbp), %eax
	leal	1(%rax), %edx
	movl	-3936(%rbp), %eax
	addl	$1, %eax
	imull	%eax, %edx
	movl	-3912(%rbp), %eax
	addl	%eax, %edx
	movl	-3920(%rbp), %eax
	cltq
	movl	%edx, -1968(%rbp,%rax,4)
.L21:
	addl	$1, -3928(%rbp)
.L19:
	cmpl	$3, -3928(%rbp)
	jle	.L24
	addl	$1, -3916(%rbp)
.L18:
	movl	-3916(%rbp), %eax
	cltq
	movl	-1968(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L25
	movl	-3916(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L30:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	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:
