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

```c
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
typedef long long int ll;
typedef unsigned long long int ull;
int asc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return -1;else if(x==y)return 0;else return 1;}
int desc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return 1;else if(x==y)return 0;else return -1;}

int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int h,w;
char map[100][100];


typedef struct{
	int x;
	int y;
}queue_t;

int max(int x,int y){return x>y?x:y;}
int search(int start_x,int start_y,int end_x,int end_y){
    int dist[100][100]={{}};
	int now_x=start_x,now_y=start_y;
	int flg=0;
	int ret;

	queue_t queue[200000];
	int front=0,back=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			dist[i][j]=-1;
		}
	}
	queue[back].x=start_x;
	queue[back++].y=start_y;
	dist[start_y][start_x]=0;
	while(front!=back){
		flg=0;
		for(int i=0;i<4;i++){
			now_x=queue[front].x+dx[i];
			now_y=queue[front].y+dy[i];
			if(now_x<0||w<=now_x||now_y<0||h<=now_y)continue;
			if(dist[now_y][now_x]!=-1||map[now_y][now_x]=='#')continue;
			queue[back].x=now_x;
			queue[back++].y=now_y;
			flg=1;
			dist[now_y][now_x]=dist[queue[front].y][queue[front].x]+1;
		}
		front++;
		if(!flg){
			//return -1;
		}
		if(dist[end_y][end_x]!=-1){
			//printf("==>%d\n",dist[end_y][end_x]);
			ret=dist[end_y][end_x];
			return ret;
		}
	}
}

int main(){
    scanf("%d %d",&h,&w);
    for(int i=0;i<h;i++)scanf("%s",map[i]);
    
    int cnt;
	int dist[200][200];
	int ans=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            for(int ii=0;ii<h;ii++){
                for(int jj=0;jj<w;jj++){
                    if(i==ii&&j==jj)continue;
					if(map[i][j]=='#'||map[ii][jj]=='#')continue;
					//printf("start x=%d y=%d end x=%d y=%d\n",j,i,jj,ii);
					cnt=search(j,i,jj,ii);
					//printf("=>%d\n",cnt);
					if(cnt>ans)ans=cnt;
                }	
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	asc_cmp
	.type	asc_cmp, @function
asc_cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc_cmp, .-asc_cmp
	.globl	desc_cmp
	.type	desc_cmp, @function
desc_cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movl	$0, %eax
	jmp	.L7
.L8:
	movl	$-1, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	desc_cmp, .-desc_cmp
	.globl	dx
	.data
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	0
	.long	-1
	.long	0
	.long	1
	.globl	h
	.bss
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.text
	.globl	max
	.type	max, @function
max:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	max, .-max
	.globl	search
	.type	search, @function
search:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1638400(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1680, %rsp
	movl	%edi, -1640068(%rbp)
	movl	%esi, -1640072(%rbp)
	movl	%edx, -1640076(%rbp)
	movl	%ecx, -1640080(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1640016(%rbp), %rax
	movl	$40000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-1640068(%rbp), %eax
	movl	%eax, -1640032(%rbp)
	movl	-1640072(%rbp), %eax
	movl	%eax, -1640028(%rbp)
	movl	$0, -1640024(%rbp)
	movl	$0, -1640052(%rbp)
	movl	$0, -1640048(%rbp)
	movl	$0, -1640044(%rbp)
	jmp	.L12
.L15:
	movl	$0, -1640040(%rbp)
	jmp	.L13
.L14:
	movl	-1640040(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640044(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$-1, -1640016(%rbp,%rax,4)
	addl	$1, -1640040(%rbp)
.L13:
	movl	w(%rip), %eax
	cmpl	%eax, -1640040(%rbp)
	jl	.L14
	addl	$1, -1640044(%rbp)
.L12:
	movl	h(%rip), %eax
	cmpl	%eax, -1640044(%rbp)
	jl	.L15
	movl	-1640048(%rbp), %eax
	cltq
	movl	-1640068(%rbp), %edx
	movl	%edx, -1600016(%rbp,%rax,8)
	movl	-1640048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1640048(%rbp)
	cltq
	movl	-1640072(%rbp), %edx
	movl	%edx, -1600012(%rbp,%rax,8)
	movl	-1640068(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -1640016(%rbp,%rax,4)
	jmp	.L16
.L25:
	movl	$0, -1640024(%rbp)
	movl	$0, -1640036(%rbp)
	jmp	.L17
.L23:
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,8), %ecx
	movl	-1640036(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -1640032(%rbp)
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600012(%rbp,%rax,8), %ecx
	movl	-1640036(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -1640028(%rbp)
	cmpl	$0, -1640032(%rbp)
	js	.L27
	movl	w(%rip), %eax
	cmpl	%eax, -1640032(%rbp)
	jge	.L27
	cmpl	$0, -1640028(%rbp)
	js	.L27
	movl	h(%rip), %eax
	cmpl	%eax, -1640028(%rbp)
	jge	.L27
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L28
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L28
	movl	-1640048(%rbp), %eax
	cltq
	movl	-1640032(%rbp), %edx
	movl	%edx, -1600016(%rbp,%rax,8)
	movl	-1640048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1640048(%rbp)
	cltq
	movl	-1640028(%rbp), %edx
	movl	%edx, -1600012(%rbp,%rax,8)
	movl	$1, -1640024(%rbp)
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600012(%rbp,%rax,8), %edx
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,8), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	leal	1(%rax), %ecx
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rsi
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	%ecx, -1640016(%rbp,%rax,4)
	jmp	.L20
.L27:
	nop
	jmp	.L20
.L28:
	nop
.L20:
	addl	$1, -1640036(%rbp)
.L17:
	cmpl	$3, -1640036(%rbp)
	jle	.L23
	addl	$1, -1640052(%rbp)
	movl	-1640076(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640080(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L16
	movl	-1640076(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640080(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	movl	%eax, -1640020(%rbp)
	movl	-1640020(%rbp), %eax
	jmp	.L11
.L16:
	movl	-1640052(%rbp), %eax
	cmpl	-1640048(%rbp), %eax
	jne	.L25
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	subq	$304, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -160044(%rbp)
	jmp	.L30
.L31:
	movl	-160044(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	map(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -160044(%rbp)
.L30:
	movl	h(%rip), %eax
	cmpl	%eax, -160044(%rbp)
	jl	.L31
	movl	$0, -160040(%rbp)
	movl	$0, -160036(%rbp)
	jmp	.L32
.L43:
	movl	$0, -160032(%rbp)
	jmp	.L33
.L42:
	movl	$0, -160028(%rbp)
	jmp	.L34
.L41:
	movl	$0, -160024(%rbp)
	jmp	.L35
.L40:
	movl	-160036(%rbp), %eax
	cmpl	-160028(%rbp), %eax
	jne	.L36
	movl	-160032(%rbp), %eax
	cmpl	-160024(%rbp), %eax
	je	.L46
.L36:
	movl	-160032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-160036(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L47
	movl	-160024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-160028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L47
	movl	-160028(%rbp), %ecx
	movl	-160024(%rbp), %edx
	movl	-160036(%rbp), %esi
	movl	-160032(%rbp), %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -160020(%rbp)
	movl	-160020(%rbp), %eax
	cmpl	-160040(%rbp), %eax
	jle	.L37
	movl	-160020(%rbp), %eax
	movl	%eax, -160040(%rbp)
	jmp	.L37
.L46:
	nop
	jmp	.L37
.L47:
	nop
.L37:
	addl	$1, -160024(%rbp)
.L35:
	movl	w(%rip), %eax
	cmpl	%eax, -160024(%rbp)
	jl	.L40
	addl	$1, -160028(%rbp)
.L34:
	movl	h(%rip), %eax
	cmpl	%eax, -160028(%rbp)
	jl	.L41
	addl	$1, -160032(%rbp)
.L33:
	movl	w(%rip), %eax
	cmpl	%eax, -160032(%rbp)
	jl	.L42
	addl	$1, -160036(%rbp)
.L32:
	movl	h(%rip), %eax
	cmpl	%eax, -160036(%rbp)
	jl	.L43
	movl	-160040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	asc_cmp
	.type	asc_cmp, @function
asc_cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$-1, %eax
	cmpl	%edx, (%rdi)
	jl	.L1
	setne	%al
	movzbl	%al, %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	asc_cmp, .-asc_cmp
	.p2align 4
	.globl	desc_cmp
	.type	desc_cmp, @function
desc_cmp:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, (%rdi)
	jl	.L5
	setne	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	desc_cmp, .-desc_cmp
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB53:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	max, .-max
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB54:
	.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	-1638400(%rsp), %r11
	.cfi_def_cfa 11, 1638456
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1672, %rsp
	.cfi_def_cfa_offset 1640128
	movl	%ecx, 12(%rsp)
	movd	%esi, %xmm5
	movd	%edi, %xmm4
	movl	%edi, %ebx
	punpckldq	%xmm5, %xmm4
	movl	%esi, %ebp
	movslq	%edx, %r14
	xorl	%esi, %esi
	leaq	48(%rsp), %rdi
	movl	$40000, %edx
	movq	%fs:40, %rax
	movq	%rax, 1640056(%rsp)
	xorl	%eax, %eax
	movq	%xmm4, (%rsp)
	call	memset@PLT
	movl	h(%rip), %r13d
	movl	w(%rip), %ecx
	testl	%r13d, %r13d
	jle	.L10
	testl	%ecx, %ecx
	jle	.L10
	movq	%rax, %rdi
	leal	-1(%r13), %eax
	movl	%ecx, 16(%rsp)
	movslq	%ecx, %r12
	leaq	(%rax,%rax,4), %rax
	salq	$2, %r12
	leaq	(%rax,%rax,4), %rax
	salq	$4, %rax
	leaq	448(%rsp,%rax), %r15
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rdx
	movl	$255, %esi
	call	memset@PLT
	movq	%rax, %rdi
	addq	$400, %rdi
	cmpq	%rdi, %r15
	jne	.L12
	movl	16(%rsp), %ecx
.L10:
	movq	(%rsp), %rax
	movslq	%ebp, %rdx
	movslq	12(%rsp), %rsi
	movl	$1, %edi
	leaq	(%rdx,%rdx,4), %rdx
	movl	dx(%rip), %r10d
	movl	8+dx(%rip), %r8d
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, 40048(%rsp)
	movslq	%ebx, %rax
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rsi,%rsi,4), %rsi
	xorl	%edx, %edx
	movl	%r8d, 12(%rsp)
	movl	$0, 48(%rsp,%rax,4)
	movl	dy(%rip), %eax
	leaq	(%r14,%rsi,4), %rsi
	movl	%r10d, %r14d
	movq	%rsi, (%rsp)
	movl	4+dx(%rip), %r15d
	movl	%eax, 16(%rsp)
	movl	4+dy(%rip), %eax
	movl	12+dx(%rip), %r9d
	movl	%eax, 20(%rsp)
	movl	8+dy(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	12+dy(%rip), %eax
	movl	%eax, 28(%rsp)
	leaq	40048(%rsp), %rax
	movq	%rax, 32(%rsp)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L25:
	movl	(%rax), %ebx
	movl	4(%rax), %ebp
.L13:
	movl	%ebx, %r10d
	addl	%r14d, %r10d
	js	.L15
	movl	16(%rsp), %esi
	addl	%ebp, %esi
	cmpl	%ecx, %r10d
	movl	%esi, %r11d
	setge	%r12b
	shrl	$31, %r11d
	orb	%r12b, %r11b
	jne	.L15
	cmpl	%esi, %r13d
	jle	.L15
	movslq	%esi, %r11
	movslq	%r10d, %r12
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	salq	$2, %r11
	leaq	(%r11,%r12), %r8
	cmpl	$-1, 48(%rsp,%r8,4)
	movq	%r8, 40(%rsp)
	jne	.L15
	leaq	map(%rip), %r8
	addq	%r8, %r11
	cmpb	$35, (%r11,%r12)
	je	.L15
	movslq	%edi, %r11
	movq	40(%rsp), %r8
	addl	$1, %edi
	movl	%r10d, 40048(%rsp,%r11,8)
	movl	%esi, 40052(%rsp,%r11,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r10
	movq	%rsi, %rbp
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	movq	%r10, %rbx
	leaq	(%r10,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r8,4)
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r15d, %r10d
	addl	%ebx, %r10d
	js	.L16
	movl	20(%rsp), %esi
	movd	%r10d, %xmm0
	addl	%ebp, %esi
	cmpl	%ecx, %r10d
	movl	%esi, %r11d
	setge	%r12b
	movd	%esi, %xmm1
	shrl	$31, %r11d
	punpckldq	%xmm1, %xmm0
	orb	%r12b, %r11b
	jne	.L16
	cmpl	%esi, %r13d
	jle	.L16
	movslq	%esi, %rsi
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	salq	$2, %rsi
	leaq	(%rsi,%r10), %r11
	cmpl	$-1, 48(%rsp,%r11,4)
	jne	.L16
	leaq	map(%rip), %r8
	addq	%r8, %rsi
	cmpb	$35, (%rsi,%r10)
	je	.L16
	movq	32(%rsp), %rbx
	movslq	%edi, %rsi
	addl	$1, %edi
	movq	%xmm0, (%rbx,%rsi,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r10
	movq	%rsi, %rbp
	leaq	(%rsi,%rsi,4), %rsi
	movq	%r10, %rbx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r10,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r11,4)
	.p2align 4,,10
	.p2align 3
.L16:
	movl	12(%rsp), %r10d
	addl	%ebx, %r10d
	js	.L17
	movl	24(%rsp), %esi
	movd	%r10d, %xmm0
	addl	%ebp, %esi
	cmpl	%ecx, %r10d
	movl	%esi, %r11d
	setge	%r12b
	movd	%esi, %xmm2
	shrl	$31, %r11d
	punpckldq	%xmm2, %xmm0
	orb	%r12b, %r11b
	jne	.L17
	cmpl	%esi, %r13d
	jle	.L17
	movslq	%esi, %rsi
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	salq	$2, %rsi
	leaq	(%rsi,%r10), %r11
	cmpl	$-1, 48(%rsp,%r11,4)
	jne	.L17
	leaq	map(%rip), %r8
	addq	%r8, %rsi
	cmpb	$35, (%rsi,%r10)
	je	.L17
	movq	32(%rsp), %rbx
	movslq	%edi, %rsi
	addl	$1, %edi
	movq	%xmm0, (%rbx,%rsi,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r10
	movq	%rsi, %rbp
	leaq	(%rsi,%rsi,4), %rsi
	movq	%r10, %rbx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r10,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r11,4)
	.p2align 4,,10
	.p2align 3
.L17:
	addl	%r9d, %ebx
	js	.L18
	addl	28(%rsp), %ebp
	cmpl	%ecx, %ebx
	movd	%ebx, %xmm0
	movl	%ebp, %esi
	setge	%r10b
	movd	%ebp, %xmm3
	shrl	$31, %esi
	punpckldq	%xmm3, %xmm0
	orb	%r10b, %sil
	jne	.L18
	cmpl	%ebp, %r13d
	jle	.L18
	movslq	%ebp, %rbp
	movslq	%ebx, %rbx
	leaq	0(%rbp,%rbp,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	salq	$2, %rsi
	leaq	(%rsi,%rbx), %r10
	cmpl	$-1, 48(%rsp,%r10,4)
	jne	.L18
	leaq	map(%rip), %r8
	addq	%r8, %rsi
	cmpb	$35, (%rsi,%rbx)
	je	.L18
	movq	32(%rsp), %rbx
	movslq	%edi, %rsi
	addl	$1, %edi
	movq	%xmm0, (%rbx,%rsi,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r11
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r11,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r10,4)
	.p2align 4,,10
	.p2align 3
.L18:
	movq	(%rsp), %rbx
	addl	$1, %edx
	movl	48(%rsp,%rbx,4), %r11d
	cmpl	$-1, %r11d
	jne	.L9
	addq	$8, %rax
	cmpl	%edi, %edx
	jne	.L25
.L9:
	movq	1640056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$1640072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r11d, %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
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	call	__isoc99_scanf@PLT
	movl	h(%rip), %edx
	testl	%edx, %edx
	jle	.L28
	leaq	map(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
.L29:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	h(%rip), %eax
	addq	$100, %rbp
	movl	%eax, 32(%rsp)
	cmpl	%ebx, %eax
	jg	.L29
	testl	%eax, %eax
	jle	.L28
	movslq	w(%rip), %rbx
	leaq	map(%rip), %rcx
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	movq	%rcx, 40(%rsp)
	movl	%ebx, 36(%rsp)
.L30:
	movq	40(%rsp), %rax
	xorl	%r13d, %r13d
	movq	%rax, 16(%rsp)
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	map(%rip), %rax
	xorl	%ebp, %ebp
	movq	%rax, 24(%rsp)
	movq	%rbx, %rax
	movl	%ebp, %ebx
	movq	%rax, %rbp
	.p2align 4,,10
	.p2align 3
.L34:
	cmpl	%ebx, %r14d
	sete	15(%rsp)
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%r12d, %edx
	cmpl	%r12d, %r13d
	jne	.L39
	cmpb	$0, 15(%rsp)
	jne	.L31
.L39:
	movq	16(%rsp), %rax
	cmpb	$35, (%rax)
	je	.L31
	movq	24(%rsp), %rax
	cmpb	$35, (%rax,%r12)
	je	.L31
	movl	%ebx, %ecx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	search
	cmpl	%eax, %r15d
	cmovl	%eax, %r15d
.L31:
	addq	$1, %r12
	cmpq	%r12, %rbp
	jne	.L33
	addq	$100, 24(%rsp)
	addl	$1, %ebx
	cmpl	%ebx, 32(%rsp)
	jne	.L34
	addq	$1, 16(%rsp)
	movq	%rbp, %rbx
	addl	$1, %r13d
	cmpl	%r13d, 36(%rsp)
	jne	.L37
.L35:
	addq	$100, 40(%rsp)
	addl	$1, %r14d
	cmpl	%r14d, 32(%rsp)
	jne	.L30
.L36:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L36
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	dy
	.data
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	0
	.long	-1
	.long	0
	.long	1
	.globl	dx
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.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	asc_cmp
	.type	asc_cmp, @function
asc_cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$-1, %eax
	cmpl	%edx, (%rdi)
	jl	.L1
	setne	%al
	movzbl	%al, %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	asc_cmp, .-asc_cmp
	.p2align 4
	.globl	desc_cmp
	.type	desc_cmp, @function
desc_cmp:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, (%rdi)
	jl	.L5
	setne	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	desc_cmp, .-desc_cmp
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB53:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	max, .-max
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB54:
	.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	-1638400(%rsp), %r11
	.cfi_def_cfa 11, 1638456
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1672, %rsp
	.cfi_def_cfa_offset 1640128
	movl	%ecx, 12(%rsp)
	movd	%esi, %xmm5
	movd	%edi, %xmm4
	movl	%edi, %ebx
	punpckldq	%xmm5, %xmm4
	movl	%esi, %ebp
	movslq	%edx, %r14
	xorl	%esi, %esi
	leaq	48(%rsp), %rdi
	movl	$40000, %edx
	movq	%fs:40, %rax
	movq	%rax, 1640056(%rsp)
	xorl	%eax, %eax
	movq	%xmm4, (%rsp)
	call	memset@PLT
	movl	h(%rip), %r13d
	movl	w(%rip), %ecx
	testl	%r13d, %r13d
	jle	.L10
	testl	%ecx, %ecx
	jle	.L10
	movq	%rax, %rdi
	leal	-1(%r13), %eax
	movl	%ecx, 16(%rsp)
	movslq	%ecx, %r12
	leaq	(%rax,%rax,4), %rax
	salq	$2, %r12
	leaq	(%rax,%rax,4), %rax
	salq	$4, %rax
	leaq	448(%rsp,%rax), %r15
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rdx
	movl	$255, %esi
	call	memset@PLT
	movq	%rax, %rdi
	addq	$400, %rdi
	cmpq	%rdi, %r15
	jne	.L12
	movl	16(%rsp), %ecx
.L10:
	movq	(%rsp), %rax
	movslq	%ebp, %rdx
	movslq	12(%rsp), %rsi
	movl	$1, %edi
	leaq	(%rdx,%rdx,4), %rdx
	movl	dx(%rip), %r10d
	movl	8+dx(%rip), %r8d
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, 40048(%rsp)
	movslq	%ebx, %rax
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rsi,%rsi,4), %rsi
	xorl	%edx, %edx
	movl	%r8d, 12(%rsp)
	movl	$0, 48(%rsp,%rax,4)
	movl	dy(%rip), %eax
	leaq	(%r14,%rsi,4), %rsi
	movl	%r10d, %r14d
	movq	%rsi, (%rsp)
	movl	4+dx(%rip), %r15d
	movl	%eax, 16(%rsp)
	movl	4+dy(%rip), %eax
	movl	12+dx(%rip), %r9d
	movl	%eax, 20(%rsp)
	movl	8+dy(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	12+dy(%rip), %eax
	movl	%eax, 28(%rsp)
	leaq	40048(%rsp), %rax
	movq	%rax, 32(%rsp)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L25:
	movl	(%rax), %ebx
	movl	4(%rax), %ebp
.L13:
	movl	%ebx, %r10d
	addl	%r14d, %r10d
	js	.L15
	movl	16(%rsp), %esi
	addl	%ebp, %esi
	cmpl	%ecx, %r10d
	movl	%esi, %r11d
	setge	%r12b
	shrl	$31, %r11d
	orb	%r12b, %r11b
	jne	.L15
	cmpl	%esi, %r13d
	jle	.L15
	movslq	%esi, %r11
	movslq	%r10d, %r12
	leaq	(%r11,%r11,4), %r11
	leaq	(%r11,%r11,4), %r11
	salq	$2, %r11
	leaq	(%r11,%r12), %r8
	cmpl	$-1, 48(%rsp,%r8,4)
	movq	%r8, 40(%rsp)
	jne	.L15
	leaq	map(%rip), %r8
	addq	%r8, %r11
	cmpb	$35, (%r11,%r12)
	je	.L15
	movslq	%edi, %r11
	movq	40(%rsp), %r8
	addl	$1, %edi
	movl	%r10d, 40048(%rsp,%r11,8)
	movl	%esi, 40052(%rsp,%r11,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r10
	movq	%rsi, %rbp
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	movq	%r10, %rbx
	leaq	(%r10,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r8,4)
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r15d, %r10d
	addl	%ebx, %r10d
	js	.L16
	movl	20(%rsp), %esi
	movd	%r10d, %xmm0
	addl	%ebp, %esi
	cmpl	%ecx, %r10d
	movl	%esi, %r11d
	setge	%r12b
	movd	%esi, %xmm1
	shrl	$31, %r11d
	punpckldq	%xmm1, %xmm0
	orb	%r12b, %r11b
	jne	.L16
	cmpl	%esi, %r13d
	jle	.L16
	movslq	%esi, %rsi
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	salq	$2, %rsi
	leaq	(%rsi,%r10), %r11
	cmpl	$-1, 48(%rsp,%r11,4)
	jne	.L16
	leaq	map(%rip), %r8
	addq	%r8, %rsi
	cmpb	$35, (%rsi,%r10)
	je	.L16
	movq	32(%rsp), %rbx
	movslq	%edi, %rsi
	addl	$1, %edi
	movq	%xmm0, (%rbx,%rsi,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r10
	movq	%rsi, %rbp
	leaq	(%rsi,%rsi,4), %rsi
	movq	%r10, %rbx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r10,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r11,4)
	.p2align 4,,10
	.p2align 3
.L16:
	movl	12(%rsp), %r10d
	addl	%ebx, %r10d
	js	.L17
	movl	24(%rsp), %esi
	movd	%r10d, %xmm0
	addl	%ebp, %esi
	cmpl	%ecx, %r10d
	movl	%esi, %r11d
	setge	%r12b
	movd	%esi, %xmm2
	shrl	$31, %r11d
	punpckldq	%xmm2, %xmm0
	orb	%r12b, %r11b
	jne	.L17
	cmpl	%esi, %r13d
	jle	.L17
	movslq	%esi, %rsi
	movslq	%r10d, %r10
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	salq	$2, %rsi
	leaq	(%rsi,%r10), %r11
	cmpl	$-1, 48(%rsp,%r11,4)
	jne	.L17
	leaq	map(%rip), %r8
	addq	%r8, %rsi
	cmpb	$35, (%rsi,%r10)
	je	.L17
	movq	32(%rsp), %rbx
	movslq	%edi, %rsi
	addl	$1, %edi
	movq	%xmm0, (%rbx,%rsi,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r10
	movq	%rsi, %rbp
	leaq	(%rsi,%rsi,4), %rsi
	movq	%r10, %rbx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r10,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r11,4)
	.p2align 4,,10
	.p2align 3
.L17:
	addl	%r9d, %ebx
	js	.L18
	addl	28(%rsp), %ebp
	cmpl	%ecx, %ebx
	movd	%ebx, %xmm0
	movl	%ebp, %esi
	setge	%r10b
	movd	%ebp, %xmm3
	shrl	$31, %esi
	punpckldq	%xmm3, %xmm0
	orb	%r10b, %sil
	jne	.L18
	cmpl	%ebp, %r13d
	jle	.L18
	movslq	%ebp, %rbp
	movslq	%ebx, %rbx
	leaq	0(%rbp,%rbp,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	salq	$2, %rsi
	leaq	(%rsi,%rbx), %r10
	cmpl	$-1, 48(%rsp,%r10,4)
	jne	.L18
	leaq	map(%rip), %r8
	addq	%r8, %rsi
	cmpb	$35, (%rsi,%rbx)
	je	.L18
	movq	32(%rsp), %rbx
	movslq	%edi, %rsi
	addl	$1, %edi
	movq	%xmm0, (%rbx,%rsi,8)
	movslq	4(%rax), %rsi
	movslq	(%rax), %r11
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r11,%rsi,4), %rsi
	movl	48(%rsp,%rsi,4), %esi
	addl	$1, %esi
	movl	%esi, 48(%rsp,%r10,4)
	.p2align 4,,10
	.p2align 3
.L18:
	movq	(%rsp), %rbx
	addl	$1, %edx
	movl	48(%rsp,%rbx,4), %r11d
	cmpl	$-1, %r11d
	jne	.L9
	addq	$8, %rax
	cmpl	%edi, %edx
	jne	.L25
.L9:
	movq	1640056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$1640072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r11d, %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
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	call	__isoc99_scanf@PLT
	movl	h(%rip), %edx
	testl	%edx, %edx
	jle	.L28
	leaq	map(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
.L29:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	h(%rip), %eax
	addq	$100, %rbp
	movl	%eax, 32(%rsp)
	cmpl	%ebx, %eax
	jg	.L29
	testl	%eax, %eax
	jle	.L28
	movslq	w(%rip), %rbx
	leaq	map(%rip), %rcx
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	movq	%rcx, 40(%rsp)
	movl	%ebx, 36(%rsp)
.L30:
	movq	40(%rsp), %rax
	xorl	%r13d, %r13d
	movq	%rax, 16(%rsp)
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	map(%rip), %rax
	xorl	%ebp, %ebp
	movq	%rax, 24(%rsp)
	movq	%rbx, %rax
	movl	%ebp, %ebx
	movq	%rax, %rbp
	.p2align 4,,10
	.p2align 3
.L34:
	cmpl	%ebx, %r14d
	sete	15(%rsp)
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%r12d, %edx
	cmpl	%r12d, %r13d
	jne	.L39
	cmpb	$0, 15(%rsp)
	jne	.L31
.L39:
	movq	16(%rsp), %rax
	cmpb	$35, (%rax)
	je	.L31
	movq	24(%rsp), %rax
	cmpb	$35, (%rax,%r12)
	je	.L31
	movl	%ebx, %ecx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	search
	cmpl	%eax, %r15d
	cmovl	%eax, %r15d
.L31:
	addq	$1, %r12
	cmpq	%r12, %rbp
	jne	.L33
	addq	$100, 24(%rsp)
	addl	$1, %ebx
	cmpl	%ebx, 32(%rsp)
	jne	.L34
	addq	$1, 16(%rsp)
	movq	%rbp, %rbx
	addl	$1, %r13d
	cmpl	%r13d, 36(%rsp)
	jne	.L37
.L35:
	addq	$100, 40(%rsp)
	addl	$1, %r14d
	cmpl	%r14d, 32(%rsp)
	jne	.L30
.L36:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L36
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	dy
	.data
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	0
	.long	-1
	.long	0
	.long	1
	.globl	dx
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
typedef long long int ll;
typedef unsigned long long int ull;
int asc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return -1;else if(x==y)return 0;else return 1;}
int desc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return 1;else if(x==y)return 0;else return -1;}

int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int h,w;
char map[100][100];


typedef struct{
	int x;
	int y;
}queue_t;

int max(int x,int y){return x>y?x:y;}
int search(int start_x,int start_y,int end_x,int end_y){
    int dist[100][100]={{}};
	int now_x=start_x,now_y=start_y;
	int flg=0;
	int ret;

	queue_t queue[200000];
	int front=0,back=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			dist[i][j]=-1;
		}
	}
	queue[back].x=start_x;
	queue[back++].y=start_y;
	dist[start_y][start_x]=0;
	while(front!=back){
		flg=0;
		for(int i=0;i<4;i++){
			now_x=queue[front].x+dx[i];
			now_y=queue[front].y+dy[i];
			if(now_x<0||w<=now_x||now_y<0||h<=now_y)continue;
			if(dist[now_y][now_x]!=-1||map[now_y][now_x]=='#')continue;
			queue[back].x=now_x;
			queue[back++].y=now_y;
			flg=1;
			dist[now_y][now_x]=dist[queue[front].y][queue[front].x]+1;
		}
		front++;
		if(!flg){
			//return -1;
		}
		if(dist[end_y][end_x]!=-1){
			//printf("==>%d\n",dist[end_y][end_x]);
			ret=dist[end_y][end_x];
			return ret;
		}
	}
}

int main(){
    scanf("%d %d",&h,&w);
    for(int i=0;i<h;i++)scanf("%s",map[i]);
    
    int cnt;
	int dist[200][200];
	int ans=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            for(int ii=0;ii<h;ii++){
                for(int jj=0;jj<w;jj++){
                    if(i==ii&&j==jj)continue;
					if(map[i][j]=='#'||map[ii][jj]=='#')continue;
					//printf("start x=%d y=%d end x=%d y=%d\n",j,i,jj,ii);
					cnt=search(j,i,jj,ii);
					//printf("=>%d\n",cnt);
					if(cnt>ans)ans=cnt;
                }	
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}
3 3
...
../
...
 0 5
...#.
.#.#.
.#...
 0 5
.#...
.#.#.
.#...
 0 5
.#...
.#.#.
.$...
 0 5
.#..-
.#.#.
.$...
 0 5
.#..-
.#.#.
.$..-
 -1 5
.#..-
.#.#.
.$..-
 0 6
.#..-
.#.#.
.$..-
 0 6
.#..-
.#.$.
.$..-
 0 6
.#..-
.#/$.
.$..-

4
 0
 0
 0
 0
 0
 0
 0
 0
 0

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

```c
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
typedef long long int ll;
typedef unsigned long long int ull;
int asc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return -1;else if(x==y)return 0;else return 1;}
int desc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return 1;else if(x==y)return 0;else return -1;}

int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int h,w;
char map[100][100];


typedef struct{
	int x;
	int y;
}queue_t;

int max(int x,int y){return x>y?x:y;}
int search(int start_x,int start_y,int end_x,int end_y){
    int dist[100][100]={{}};
	int now_x=start_x,now_y=start_y;
	int flg=0;
	int ret;

	queue_t queue[200000];
	int front=0,back=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			dist[i][j]=-1;
		}
	}
	queue[back].x=start_x;
	queue[back++].y=start_y;
	dist[start_y][start_x]=0;
	while(front!=back){
		flg=0;
		for(int i=0;i<4;i++){
			now_x=queue[front].x+dx[i];
			now_y=queue[front].y+dy[i];
			if(now_x<0||w<=now_x||now_y<0||h<=now_y)continue;
			if(dist[now_y][now_x]!=-1||map[now_y][now_x]=='#')continue;
			queue[back].x=now_x;
			queue[back++].y=now_y;
			flg=1;
			dist[now_y][now_x]=dist[queue[front].y][queue[front].x]+1;
		}
		front++;
		if(!flg){
			//return -1;
		}
		if(dist[end_y][end_x]!=-1){
			//printf("==>%d\n",dist[end_y][end_x]);
			ret=dist[end_y][end_x];
			return ret;
		}
	}
}

int main(){
    scanf("%d %d",&h,&w);
    for(int i=0;i<h;i++)scanf("%s",map[i]);
    
    int cnt;
	int dist[200][200];
	int ans=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            for(int ii=0;ii<h;ii++){
                for(int jj=0;jj<w;jj++){
                    if(i==ii&&j==jj)continue;
					if(map[i][j]=='#'||map[ii][jj]=='#')continue;
					//printf("start x=%d y=%d end x=%d y=%d\n",j,i,jj,ii);
					cnt=search(j,i,jj,ii);
					//printf("=>%d\n",cnt);
					if(cnt>ans)ans=cnt;
                }	
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	asc_cmp
	.type	asc_cmp, @function
asc_cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc_cmp, .-asc_cmp
	.globl	desc_cmp
	.type	desc_cmp, @function
desc_cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movl	$0, %eax
	jmp	.L7
.L8:
	movl	$-1, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	desc_cmp, .-desc_cmp
	.globl	dx
	.data
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	0
	.long	-1
	.long	0
	.long	1
	.globl	h
	.bss
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.text
	.globl	max
	.type	max, @function
max:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	max, .-max
	.globl	search
	.type	search, @function
search:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1638400(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1680, %rsp
	movl	%edi, -1640068(%rbp)
	movl	%esi, -1640072(%rbp)
	movl	%edx, -1640076(%rbp)
	movl	%ecx, -1640080(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1640016(%rbp), %rax
	movl	$40000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-1640068(%rbp), %eax
	movl	%eax, -1640032(%rbp)
	movl	-1640072(%rbp), %eax
	movl	%eax, -1640028(%rbp)
	movl	$0, -1640024(%rbp)
	movl	$0, -1640052(%rbp)
	movl	$0, -1640048(%rbp)
	movl	$0, -1640044(%rbp)
	jmp	.L12
.L15:
	movl	$0, -1640040(%rbp)
	jmp	.L13
.L14:
	movl	-1640040(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640044(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$-1, -1640016(%rbp,%rax,4)
	addl	$1, -1640040(%rbp)
.L13:
	movl	w(%rip), %eax
	cmpl	%eax, -1640040(%rbp)
	jl	.L14
	addl	$1, -1640044(%rbp)
.L12:
	movl	h(%rip), %eax
	cmpl	%eax, -1640044(%rbp)
	jl	.L15
	movl	-1640048(%rbp), %eax
	cltq
	movl	-1640068(%rbp), %edx
	movl	%edx, -1600016(%rbp,%rax,8)
	movl	-1640048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1640048(%rbp)
	cltq
	movl	-1640072(%rbp), %edx
	movl	%edx, -1600012(%rbp,%rax,8)
	movl	-1640068(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -1640016(%rbp,%rax,4)
	jmp	.L16
.L25:
	movl	$0, -1640024(%rbp)
	movl	$0, -1640036(%rbp)
	jmp	.L17
.L23:
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,8), %ecx
	movl	-1640036(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -1640032(%rbp)
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600012(%rbp,%rax,8), %ecx
	movl	-1640036(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -1640028(%rbp)
	cmpl	$0, -1640032(%rbp)
	js	.L27
	movl	w(%rip), %eax
	cmpl	%eax, -1640032(%rbp)
	jge	.L27
	cmpl	$0, -1640028(%rbp)
	js	.L27
	movl	h(%rip), %eax
	cmpl	%eax, -1640028(%rbp)
	jge	.L27
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L28
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L28
	movl	-1640048(%rbp), %eax
	cltq
	movl	-1640032(%rbp), %edx
	movl	%edx, -1600016(%rbp,%rax,8)
	movl	-1640048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1640048(%rbp)
	cltq
	movl	-1640028(%rbp), %edx
	movl	%edx, -1600012(%rbp,%rax,8)
	movl	$1, -1640024(%rbp)
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600012(%rbp,%rax,8), %edx
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,8), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	leal	1(%rax), %ecx
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rsi
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	%ecx, -1640016(%rbp,%rax,4)
	jmp	.L20
.L27:
	nop
	jmp	.L20
.L28:
	nop
.L20:
	addl	$1, -1640036(%rbp)
.L17:
	cmpl	$3, -1640036(%rbp)
	jle	.L23
	addl	$1, -1640052(%rbp)
	movl	-1640076(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640080(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L16
	movl	-1640076(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640080(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	movl	%eax, -1640020(%rbp)
	movl	-1640020(%rbp), %eax
	jmp	.L11
.L16:
	movl	-1640052(%rbp), %eax
	cmpl	-1640048(%rbp), %eax
	jne	.L25
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	subq	$304, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -160044(%rbp)
	jmp	.L30
.L31:
	movl	-160044(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	map(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -160044(%rbp)
.L30:
	movl	h(%rip), %eax
	cmpl	%eax, -160044(%rbp)
	jl	.L31
	movl	$0, -160040(%rbp)
	movl	$0, -160036(%rbp)
	jmp	.L32
.L43:
	movl	$0, -160032(%rbp)
	jmp	.L33
.L42:
	movl	$0, -160028(%rbp)
	jmp	.L34
.L41:
	movl	$0, -160024(%rbp)
	jmp	.L35
.L40:
	movl	-160036(%rbp), %eax
	cmpl	-160028(%rbp), %eax
	jne	.L36
	movl	-160032(%rbp), %eax
	cmpl	-160024(%rbp), %eax
	je	.L46
.L36:
	movl	-160032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-160036(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L47
	movl	-160024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-160028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L47
	movl	-160028(%rbp), %ecx
	movl	-160024(%rbp), %edx
	movl	-160036(%rbp), %esi
	movl	-160032(%rbp), %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -160020(%rbp)
	movl	-160020(%rbp), %eax
	cmpl	-160040(%rbp), %eax
	jle	.L37
	movl	-160020(%rbp), %eax
	movl	%eax, -160040(%rbp)
	jmp	.L37
.L46:
	nop
	jmp	.L37
.L47:
	nop
.L37:
	addl	$1, -160024(%rbp)
.L35:
	movl	w(%rip), %eax
	cmpl	%eax, -160024(%rbp)
	jl	.L40
	addl	$1, -160028(%rbp)
.L34:
	movl	h(%rip), %eax
	cmpl	%eax, -160028(%rbp)
	jl	.L41
	addl	$1, -160032(%rbp)
.L33:
	movl	w(%rip), %eax
	cmpl	%eax, -160032(%rbp)
	jl	.L42
	addl	$1, -160036(%rbp)
.L32:
	movl	h(%rip), %eax
	cmpl	%eax, -160036(%rbp)
	jl	.L43
	movl	-160040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	asc_cmp
	.type	asc_cmp, @function
asc_cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc_cmp, .-asc_cmp
	.globl	desc_cmp
	.type	desc_cmp, @function
desc_cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jne	.L8
	movl	$0, %eax
	jmp	.L7
.L8:
	movl	$-1, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	desc_cmp, .-desc_cmp
	.globl	dx
	.data
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	0
	.long	-1
	.long	0
	.long	1
	.globl	h
	.bss
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	map
	.align 32
	.type	map, @object
	.size	map, 10000
map:
	.zero	10000
	.text
	.globl	max
	.type	max, @function
max:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	max, .-max
	.globl	search
	.type	search, @function
search:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1638400(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1680, %rsp
	movl	%edi, -1640068(%rbp)
	movl	%esi, -1640072(%rbp)
	movl	%edx, -1640076(%rbp)
	movl	%ecx, -1640080(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1640016(%rbp), %rax
	movl	$40000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-1640068(%rbp), %eax
	movl	%eax, -1640032(%rbp)
	movl	-1640072(%rbp), %eax
	movl	%eax, -1640028(%rbp)
	movl	$0, -1640024(%rbp)
	movl	$0, -1640052(%rbp)
	movl	$0, -1640048(%rbp)
	movl	$0, -1640044(%rbp)
	jmp	.L12
.L15:
	movl	$0, -1640040(%rbp)
	jmp	.L13
.L14:
	movl	-1640040(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640044(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$-1, -1640016(%rbp,%rax,4)
	addl	$1, -1640040(%rbp)
.L13:
	movl	w(%rip), %eax
	cmpl	%eax, -1640040(%rbp)
	jl	.L14
	addl	$1, -1640044(%rbp)
.L12:
	movl	h(%rip), %eax
	cmpl	%eax, -1640044(%rbp)
	jl	.L15
	movl	-1640048(%rbp), %eax
	cltq
	movl	-1640068(%rbp), %edx
	movl	%edx, -1600016(%rbp,%rax,8)
	movl	-1640048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1640048(%rbp)
	cltq
	movl	-1640072(%rbp), %edx
	movl	%edx, -1600012(%rbp,%rax,8)
	movl	-1640068(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640072(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	$0, -1640016(%rbp,%rax,4)
	jmp	.L16
.L25:
	movl	$0, -1640024(%rbp)
	movl	$0, -1640036(%rbp)
	jmp	.L17
.L23:
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,8), %ecx
	movl	-1640036(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -1640032(%rbp)
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600012(%rbp,%rax,8), %ecx
	movl	-1640036(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -1640028(%rbp)
	cmpl	$0, -1640032(%rbp)
	js	.L27
	movl	w(%rip), %eax
	cmpl	%eax, -1640032(%rbp)
	jge	.L27
	cmpl	$0, -1640028(%rbp)
	js	.L27
	movl	h(%rip), %eax
	cmpl	%eax, -1640028(%rbp)
	jge	.L27
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L28
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L28
	movl	-1640048(%rbp), %eax
	cltq
	movl	-1640032(%rbp), %edx
	movl	%edx, -1600016(%rbp,%rax,8)
	movl	-1640048(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1640048(%rbp)
	cltq
	movl	-1640028(%rbp), %edx
	movl	%edx, -1600012(%rbp,%rax,8)
	movl	$1, -1640024(%rbp)
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600012(%rbp,%rax,8), %edx
	movl	-1640052(%rbp), %eax
	cltq
	movl	-1600016(%rbp,%rax,8), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	leal	1(%rax), %ecx
	movl	-1640032(%rbp), %eax
	movslq	%eax, %rsi
	movl	-1640028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	movl	%ecx, -1640016(%rbp,%rax,4)
	jmp	.L20
.L27:
	nop
	jmp	.L20
.L28:
	nop
.L20:
	addl	$1, -1640036(%rbp)
.L17:
	cmpl	$3, -1640036(%rbp)
	jle	.L23
	addl	$1, -1640052(%rbp)
	movl	-1640076(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640080(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L16
	movl	-1640076(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1640080(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movl	-1640016(%rbp,%rax,4), %eax
	movl	%eax, -1640020(%rbp)
	movl	-1640020(%rbp), %eax
	jmp	.L11
.L16:
	movl	-1640052(%rbp), %eax
	cmpl	-1640048(%rbp), %eax
	jne	.L25
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	subq	$304, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -160044(%rbp)
	jmp	.L30
.L31:
	movl	-160044(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	map(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -160044(%rbp)
.L30:
	movl	h(%rip), %eax
	cmpl	%eax, -160044(%rbp)
	jl	.L31
	movl	$0, -160040(%rbp)
	movl	$0, -160036(%rbp)
	jmp	.L32
.L43:
	movl	$0, -160032(%rbp)
	jmp	.L33
.L42:
	movl	$0, -160028(%rbp)
	jmp	.L34
.L41:
	movl	$0, -160024(%rbp)
	jmp	.L35
.L40:
	movl	-160036(%rbp), %eax
	cmpl	-160028(%rbp), %eax
	jne	.L36
	movl	-160032(%rbp), %eax
	cmpl	-160024(%rbp), %eax
	je	.L46
.L36:
	movl	-160032(%rbp), %eax
	movslq	%eax, %rcx
	movl	-160036(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L47
	movl	-160024(%rbp), %eax
	movslq	%eax, %rcx
	movl	-160028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	je	.L47
	movl	-160028(%rbp), %ecx
	movl	-160024(%rbp), %edx
	movl	-160036(%rbp), %esi
	movl	-160032(%rbp), %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -160020(%rbp)
	movl	-160020(%rbp), %eax
	cmpl	-160040(%rbp), %eax
	jle	.L37
	movl	-160020(%rbp), %eax
	movl	%eax, -160040(%rbp)
	jmp	.L37
.L46:
	nop
	jmp	.L37
.L47:
	nop
.L37:
	addl	$1, -160024(%rbp)
.L35:
	movl	w(%rip), %eax
	cmpl	%eax, -160024(%rbp)
	jl	.L40
	addl	$1, -160028(%rbp)
.L34:
	movl	h(%rip), %eax
	cmpl	%eax, -160028(%rbp)
	jl	.L41
	addl	$1, -160032(%rbp)
.L33:
	movl	w(%rip), %eax
	cmpl	%eax, -160032(%rbp)
	jl	.L42
	addl	$1, -160036(%rbp)
.L32:
	movl	h(%rip), %eax
	cmpl	%eax, -160036(%rbp)
	jl	.L43
	movl	-160040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L45
	call	__stack_chk_fail@PLT
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
