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 h, w;
    scanf("%d %d", &h, &w);
    char a[10][10];
    int i, j;
    for (i = 0; i < h; i++)
        scanf("%s", a[i]);
    int x, y;
    x = y = 0;
    while (x < h && y < w)
    {
        if (x == h - 1 && y == w - 1)
        {
            if (a[x - 1][y] == '#' && a[x][y - 1] == '#')
            {
                printf("Impossible\n");
                return 0;
            }
            else
                break;
        }
        if (x == h - 1)
        {
            if (a[x][y + 1] == '#')
            {
                if (y > 0)
                {
                    if (a[x][y - 1] == '#' && a[x - 1][y] == '#')
                    {
                        printf("Impossible\n");
                        return 0;
                    }
                }
                y++;
                continue;
            }
            else
            {
                printf("Impossible\n");
                return 0;
            }
        }
        if (y == w - 1)
        {
            if (a[x + 1][y] == '#')
            {
                if (x > 0)
                {
                    if (a[x - 1][y] == '#' && a[x][y - 1] == '#')
                    {
                        printf("Impossible\n");
                        return 0;
                    }
                }
                x++;
                continue;
            }
            else
            {
                printf("Impossible\n");
                return 0;
            }
        }
        if (a[x][y + 1] == '#' && a[x + 1][y] == '#')
        {
            printf("Impossible\n");
            return 0;
        }
        if (a[x][y + 1] == '#')
        {
            y++;
            continue;
        }
        if (a[x + 1][y] == '#')
        {
            x++;
            continue;
        }
    }
    printf("Possible\n");
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"Impossible"
.LC3:
	.string	"Possible"
	.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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -124(%rbp)
	jmp	.L2
.L3:
	leaq	-112(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L2:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L3
	movl	$0, -116(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	jmp	.L4
.L16:
	movl	-132(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jne	.L5
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -116(%rbp)
	jne	.L5
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L6
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L5:
	movl	-132(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jne	.L8
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L9
	cmpl	$0, -116(%rbp)
	jle	.L10
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L10:
	addl	$1, -116(%rbp)
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L8:
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -116(%rbp)
	jne	.L11
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L12
	cmpl	$0, -120(%rbp)
	jle	.L13
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L13
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L13:
	addl	$1, -120(%rbp)
	jmp	.L4
.L12:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L11:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L14:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L15
	addl	$1, -116(%rbp)
	jmp	.L4
.L15:
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L4
	addl	$1, -120(%rbp)
	nop
.L4:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jge	.L6
	movl	-128(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L16
.L6:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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	"Possible"
.LC2:
	.string	"%s"
.LC3:
	.string	"Impossible"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$136, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ecx
	addq	$10, %rbp
	cmpl	%ebx, %ecx
	jg	.L4
	testl	%ecx, %ecx
	jle	.L5
	movl	12(%rsp), %r10d
	leal	-2(%rcx), %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	movslq	%esi, %rsi
	leal	-1(%rcx), %r9d
	leal	-2(%r10), %ebx
	leaq	(%rsi,%rsi,4), %rsi
	leal	-1(%r10), %r11d
	movslq	%ebx, %rbx
	leaq	128(%rsp,%rsi,2), %rbp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rdx), %edi
	movslq	%eax, %r8
	movslq	%edi, %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	128(%rsp,%rsi,2), %rsi
	movzbl	-112(%r8,%rsi), %esi
	cmpl	%eax, %r11d
	je	.L27
	movslq	%edx, %r8
	leal	1(%rax), %r12d
	leaq	(%r8,%r8,4), %r8
	movslq	%r12d, %r13
	leaq	128(%rsp,%r8,2), %r8
	cmpb	$35, -112(%r13,%r8)
	je	.L28
	cmpb	$35, %sil
	cmove	%edi, %edx
.L10:
	cmpl	%edx, %ecx
	jle	.L5
.L6:
	cmpl	%eax, %r10d
	jle	.L5
	cmpl	%edx, %r9d
	jne	.L7
	cmpl	%eax, %r11d
	je	.L29
	movslq	%r9d, %rsi
	leal	1(%rax), %edi
	leaq	(%rsi,%rsi,4), %rsi
	movslq	%edi, %r12
	leaq	128(%rsp,%rsi,2), %r8
	cmpb	$35, -112(%r12,%r8)
	jne	.L9
	testl	%eax, %eax
	jle	.L16
	leal	-1(%rax), %esi
	movslq	%esi, %rsi
	cmpb	$35, -112(%r8,%rsi)
	jne	.L16
	cmpb	$35, -112(%rax,%rbp)
	je	.L9
.L16:
	movslq	%edi, %rax
	cmpl	%edx, %ecx
	jg	.L6
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L27:
	cmpb	$35, %sil
	jne	.L9
	testl	%edx, %edx
	jle	.L18
	leal	-1(%rdx), %esi
	movslq	%esi, %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	128(%rsp,%rsi,2), %rsi
	cmpb	$35, -112(%r8,%rsi)
	jne	.L18
	movslq	%edx, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	128(%rsp,%rdx,2), %rdx
	cmpb	$35, -112(%rdx,%rbx)
	je	.L9
.L18:
	movl	%edi, %edx
	jmp	.L10
.L29:
	leal	-2(%rcx), %eax
	movslq	%r11d, %rdx
	cltq
	imulq	$10, %rax, %rax
	subq	$-128, %rax
	addq	%rsp, %rax
	cmpb	$35, -112(%rdx,%rax)
	jne	.L5
	movslq	%r9d, %rax
	leal	-1(%r11), %edx
	imulq	$10, %rax, %rax
	movslq	%edx, %rdx
	subq	$-128, %rax
	addq	%rsp, %rax
	cmpb	$35, -112(%rdx,%rax)
	jne	.L5
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L3:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$136, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	cmpb	$35, %sil
	je	.L9
	movslq	%r12d, %rax
	jmp	.L10
.L30:
	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	"Possible"
.LC2:
	.string	"%s"
.LC3:
	.string	"Impossible"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$136, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %ecx
	addq	$10, %rbp
	cmpl	%ebx, %ecx
	jg	.L4
	testl	%ecx, %ecx
	jle	.L5
	movl	12(%rsp), %r10d
	leal	-2(%rcx), %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	movslq	%esi, %rsi
	leal	-1(%rcx), %r9d
	leal	-2(%r10), %ebx
	leaq	(%rsi,%rsi,4), %rsi
	leal	-1(%r10), %r11d
	movslq	%ebx, %rbx
	leaq	128(%rsp,%rsi,2), %rbp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	leal	1(%rdx), %edi
	movslq	%eax, %r8
	movslq	%edi, %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	128(%rsp,%rsi,2), %rsi
	movzbl	-112(%r8,%rsi), %esi
	cmpl	%eax, %r11d
	je	.L27
	movslq	%edx, %r8
	leal	1(%rax), %r12d
	leaq	(%r8,%r8,4), %r8
	movslq	%r12d, %r13
	leaq	128(%rsp,%r8,2), %r8
	cmpb	$35, -112(%r13,%r8)
	je	.L28
	cmpb	$35, %sil
	cmove	%edi, %edx
.L10:
	cmpl	%edx, %ecx
	jle	.L5
.L6:
	cmpl	%eax, %r10d
	jle	.L5
	cmpl	%edx, %r9d
	jne	.L7
	cmpl	%eax, %r11d
	je	.L29
	movslq	%r9d, %rsi
	leal	1(%rax), %edi
	leaq	(%rsi,%rsi,4), %rsi
	movslq	%edi, %r12
	leaq	128(%rsp,%rsi,2), %r8
	cmpb	$35, -112(%r12,%r8)
	jne	.L9
	testl	%eax, %eax
	jle	.L16
	leal	-1(%rax), %esi
	movslq	%esi, %rsi
	cmpb	$35, -112(%r8,%rsi)
	jne	.L16
	cmpb	$35, -112(%rax,%rbp)
	je	.L9
.L16:
	movslq	%edi, %rax
	cmpl	%edx, %ecx
	jg	.L6
.L5:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L27:
	cmpb	$35, %sil
	jne	.L9
	testl	%edx, %edx
	jle	.L18
	leal	-1(%rdx), %esi
	movslq	%esi, %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	128(%rsp,%rsi,2), %rsi
	cmpb	$35, -112(%r8,%rsi)
	jne	.L18
	movslq	%edx, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	128(%rsp,%rdx,2), %rdx
	cmpb	$35, -112(%rdx,%rbx)
	je	.L9
.L18:
	movl	%edi, %edx
	jmp	.L10
.L29:
	leal	-2(%rcx), %eax
	movslq	%r11d, %rdx
	cltq
	imulq	$10, %rax, %rax
	subq	$-128, %rax
	addq	%rsp, %rax
	cmpb	$35, -112(%rdx,%rax)
	jne	.L5
	movslq	%r9d, %rax
	leal	-1(%r11), %edx
	imulq	$10, %rax, %rax
	movslq	%edx, %rdx
	subq	$-128, %rax
	addq	%rsp, %rax
	cmpb	$35, -112(%rdx,%rax)
	jne	.L5
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L3:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$136, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	cmpb	$35, %sil
	je	.L9
	movslq	%r12d, %rax
	jmp	.L10
.L30:
	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 h, w;
    scanf("%d %d", &h, &w);
    char a[10][10];
    int i, j;
    for (i = 0; i < h; i++)
        scanf("%s", a[i]);
    int x, y;
    x = y = 0;
    while (x < h && y < w)
    {
        if (x == h - 1 && y == w - 1)
        {
            if (a[x - 1][y] == '#' && a[x][y - 1] == '#')
            {
                printf("Impossible\n");
                return 0;
            }
            else
                break;
        }
        if (x == h - 1)
        {
            if (a[x][y + 1] == '#')
            {
                if (y > 0)
                {
                    if (a[x][y - 1] == '#' && a[x - 1][y] == '#')
                    {
                        printf("Impossible\n");
                        return 0;
                    }
                }
                y++;
                continue;
            }
            else
            {
                printf("Impossible\n");
                return 0;
            }
        }
        if (y == w - 1)
        {
            if (a[x + 1][y] == '#')
            {
                if (x > 0)
                {
                    if (a[x - 1][y] == '#' && a[x][y - 1] == '#')
                    {
                        printf("Impossible\n");
                        return 0;
                    }
                }
                x++;
                continue;
            }
            else
            {
                printf("Impossible\n");
                return 0;
            }
        }
        if (a[x][y + 1] == '#' && a[x + 1][y] == '#')
        {
            printf("Impossible\n");
            return 0;
        }
        if (a[x][y + 1] == '#')
        {
            y++;
            continue;
        }
        if (a[x + 1][y] == '#')
        {
            x++;
            continue;
        }
    }
    printf("Possible\n");
    return 0;
}
5 1

..#

..

Impossible

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 h, w;
    scanf("%d %d", &h, &w);
    char a[10][10];
    int i, j;
    for (i = 0; i < h; i++)
        scanf("%s", a[i]);
    int x, y;
    x = y = 0;
    while (x < h && y < w)
    {
        if (x == h - 1 && y == w - 1)
        {
            if (a[x - 1][y] == '#' && a[x][y - 1] == '#')
            {
                printf("Impossible\n");
                return 0;
            }
            else
                break;
        }
        if (x == h - 1)
        {
            if (a[x][y + 1] == '#')
            {
                if (y > 0)
                {
                    if (a[x][y - 1] == '#' && a[x - 1][y] == '#')
                    {
                        printf("Impossible\n");
                        return 0;
                    }
                }
                y++;
                continue;
            }
            else
            {
                printf("Impossible\n");
                return 0;
            }
        }
        if (y == w - 1)
        {
            if (a[x + 1][y] == '#')
            {
                if (x > 0)
                {
                    if (a[x - 1][y] == '#' && a[x][y - 1] == '#')
                    {
                        printf("Impossible\n");
                        return 0;
                    }
                }
                x++;
                continue;
            }
            else
            {
                printf("Impossible\n");
                return 0;
            }
        }
        if (a[x][y + 1] == '#' && a[x + 1][y] == '#')
        {
            printf("Impossible\n");
            return 0;
        }
        if (a[x][y + 1] == '#')
        {
            y++;
            continue;
        }
        if (a[x + 1][y] == '#')
        {
            x++;
            continue;
        }
    }
    printf("Possible\n");
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"Impossible"
.LC3:
	.string	"Possible"
	.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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -124(%rbp)
	jmp	.L2
.L3:
	leaq	-112(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L2:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L3
	movl	$0, -116(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	jmp	.L4
.L16:
	movl	-132(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jne	.L5
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -116(%rbp)
	jne	.L5
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L6
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L5:
	movl	-132(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jne	.L8
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L9
	cmpl	$0, -116(%rbp)
	jle	.L10
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L10:
	addl	$1, -116(%rbp)
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L8:
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -116(%rbp)
	jne	.L11
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L12
	cmpl	$0, -120(%rbp)
	jle	.L13
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L13
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L13:
	addl	$1, -120(%rbp)
	jmp	.L4
.L12:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L11:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L14:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L15
	addl	$1, -116(%rbp)
	jmp	.L4
.L15:
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L4
	addl	$1, -120(%rbp)
	nop
.L4:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jge	.L6
	movl	-128(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L16
.L6:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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	"%s"
.LC2:
	.string	"Impossible"
.LC3:
	.string	"Possible"
	.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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -124(%rbp)
	jmp	.L2
.L3:
	leaq	-112(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L2:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L3
	movl	$0, -116(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	jmp	.L4
.L16:
	movl	-132(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jne	.L5
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -116(%rbp)
	jne	.L5
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L6
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L6
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L5:
	movl	-132(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jne	.L8
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L9
	cmpl	$0, -116(%rbp)
	jle	.L10
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L10:
	addl	$1, -116(%rbp)
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L8:
	movl	-128(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -116(%rbp)
	jne	.L11
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L12
	cmpl	$0, -120(%rbp)
	jle	.L13
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L13
	movl	-116(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L13:
	addl	$1, -120(%rbp)
	jmp	.L4
.L12:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L11:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L14:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L15
	addl	$1, -116(%rbp)
	jmp	.L4
.L15:
	movl	-120(%rbp), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	cmpb	$35, %al
	jne	.L4
	addl	$1, -120(%rbp)
	nop
.L4:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jge	.L6
	movl	-128(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L16
.L6:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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:
