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 <stdlib.h>
#include <string.h>

struct buf {
        int *p;
        int in;
        int out;
};

static void
set(struct buf *buf, int i, int j)
{
        *(buf->p + buf->in * 2) = i;
        *(buf->p + buf->in * 2 + 1) = j;
        buf->in++;
}

static int
get(struct buf *buf, int *i, int *j)
{
        if (buf->in == buf->out)
                return -1;

        *i = *(buf->p + buf->out * 2);
        *j = *(buf->p + buf->out * 2 + 1);
        buf->out++;

        return 0;
}

int
main(void)
{
        int H = 0;
        int W = 0;

        scanf("%d %d\n", &H, &W);

        int *A;
        size_t size;
        size = sizeof(int) * (H + 2) * (W + 2);
        A = malloc(size);
        memset(A, 0, size);
        for (int i = 0; i <= W + 1; i++) {
                A[i] = 1;
                A[(H + 1) * (W + 2) + i] = 1;
        }
        for (int i = 0; i <= H + 1; i++) {
                A[i * (W + 2)] = 1;
                A[i * (W + 2) + W + 1] = 1;
        }

        int white = 0;
        int black = 0;
        struct buf buf;
        size = sizeof(int) * (H) * (W) * 2;
        buf.p = malloc(size);
        buf.in = 0;
        buf.out = 0;
        memset(buf.p, 0, size);

        for (int i = 1; i <= H; i++) {
                for (int j = 1; j <= W; j++) {
                        char c;
                        scanf("%c", &c);
                        if (c == '#') {
                                A[i * (W + 2) + j] = 1;
                                set(&buf, i, j);
                                black++;
                        }
                }
                scanf("\n");
        }

        white = H * W - black;
        int count = 1;
        while(white > 0) {
                int tmp = black;
                black = 0;
                for (int cnt = tmp; cnt > 0; cnt--) {
                        int i;
                        int j;
                        get(&buf, &i, &j);
                        if (A[i * (W + 2) + j] == count) {
                                if (A[(i - 1) * (W + 2) + j] == 0) {
                                        A[(i - 1) * (W + 2) + j] = count + 1;
                                        set(&buf, i - 1, j);
                                        white--;
                                        black++;
                                }
                                if (A[(i + 1) * (W + 2) + j] == 0) {
                                        A[(i + 1) * (W + 2) + j] = count + 1;
                                        set(&buf, i + 1, j);
                                        white--;
                                        black++;
                                }
                                if (A[i * (W + 2) + (j - 1)] == 0) {
                                        A[i * (W + 2) + (j - 1)] = count + 1;
                                        set(&buf, i, j - 1);
                                        white--;
                                        black++;
                                }
                                if (A[i * (W + 2) + (j + 1)] == 0) {
                                        A[i * (W + 2) + (j + 1)] = count + 1;
                                        set(&buf, i, j + 1);
                                        white--;
                                        black++;
                                }
                        }
                }
                count++;
        }

        printf("%d", count - 1);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	set, @function
set:
.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, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 8(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	set, .-set
	.type	get, @function
get:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$-1, %eax
	jmp	.L4
.L3:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 12(%rax)
	movl	$0, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get, .-get
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	cltq
	imulq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -84(%rbp)
	jmp	.L6
.L7:
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-100(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	addl	$1, -84(%rbp)
.L6:
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jle	.L7
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-80(%rbp), %eax
	movl	%eax, %edx
	movl	-96(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	addl	$1, -80(%rbp)
.L8:
	movl	-100(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -80(%rbp)
	jle	.L9
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	movl	-96(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movq	-32(%rbp), %rax
	movq	-48(%rbp), %rdx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -68(%rbp)
	jmp	.L10
.L14:
	movl	$1, -64(%rbp)
	jmp	.L11
.L13:
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-88(%rbp), %eax
	cmpb	$35, %al
	jne	.L12
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-64(%rbp), %edx
	movl	-68(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	addl	$1, -72(%rbp)
.L12:
	addl	$1, -64(%rbp)
.L11:
	movl	-96(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jle	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -68(%rbp)
.L10:
	movl	-100(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jle	.L14
	movl	-100(%rbp), %edx
	movl	-96(%rbp), %eax
	imull	%edx, %eax
	subl	-72(%rbp), %eax
	movl	%eax, -76(%rbp)
	movl	$1, -60(%rbp)
	jmp	.L15
.L22:
	movl	-72(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	$0, -72(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -56(%rbp)
	jmp	.L16
.L21:
	leaq	-88(%rbp), %rdx
	leaq	-92(%rbp), %rcx
	leaq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -60(%rbp)
	jne	.L17
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L18
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %edx
	movl	-92(%rbp), %eax
	leal	-1(%rax), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L18:
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %edx
	movl	-92(%rbp), %eax
	leal	1(%rax), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L19:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-92(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L20:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %eax
	leal	1(%rax), %edx
	movl	-92(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L17:
	subl	$1, -56(%rbp)
.L16:
	cmpl	$0, -56(%rbp)
	jg	.L21
	addl	$1, -60(%rbp)
.L15:
	cmpl	$0, -76(%rbp)
	jg	.L22
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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\n"
.LC2:
	.string	"%c"
.LC3:
	.string	"\n"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	movl	$0, 32(%rsp)
	movl	$0, 36(%rsp)
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r10d
	movl	32(%rsp), %r12d
	movl	$1, %esi
	leal	2(%r10), %r13d
	leal	2(%r12), %edi
	movl	%r10d, (%rsp)
	movslq	%r13d, %rbp
	movslq	%edi, %rdi
	imulq	%rbp, %rdi
	salq	$2, %rdi
	call	calloc@PLT
	movl	(%rsp), %r10d
	leal	1(%r12), %esi
	movq	%rax, %r8
	movl	%r10d, %r9d
	addl	$1, %r9d
	js	.L6
	movl	%r13d, %edi
	imull	%esi, %edi
	movslq	%edi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	-4(%rcx), %rax
	cmpq	$8, %rax
	jbe	.L3
	cmpl	$3, %r9d
	jbe	.L3
	movl	%r13d, %edx
	movdqa	.LC1(%rip), %xmm0
	addq	%r8, %rcx
	xorl	%eax, %eax
	shrl	$2, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movups	%xmm0, (%r8,%rax)
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r13d, %eax
	andl	$-4, %eax
	andl	$3, %r13d
	je	.L6
	movslq	%eax, %rdx
	leal	1(%rax), %r9d
	movl	$1, (%r8,%rdx,4)
	leaq	0(,%rdx,4), %rcx
	leal	(%rdi,%rax), %edx
	movslq	%edx, %rdx
	movl	$1, (%r8,%rdx,4)
	cmpl	%eax, %r10d
	jl	.L6
	movl	$1, 4(%r8,%rcx)
	leal	(%rdi,%r9), %edx
	addl	$2, %eax
	movslq	%edx, %rdx
	movl	$1, (%r8,%rdx,4)
	cmpl	%r9d, %r10d
	jl	.L6
	movl	$1, 8(%r8,%rcx)
	addl	%edi, %eax
	cltq
	movl	$1, (%r8,%rax,4)
.L6:
	testl	%esi, %esi
	js	.L49
	leaq	0(,%rbp,4), %rsi
	movq	%r8, %rax
	xorl	%edx, %edx
	movslq	%r10d, %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edx, %ecx
	movl	$1, (%rax)
	addl	$1, %edx
	movl	$1, 4(%rax,%rdi,4)
	addq	%rsi, %rax
	cmpl	%ecx, %r12d
	jge	.L13
.L14:
	movslq	%r12d, %rax
	movl	$1, %esi
	movl	%r10d, 8(%rsp)
	xorl	%r14d, %r14d
	imulq	%rax, %rdi
	movq	%r8, (%rsp)
	salq	$3, %rdi
	call	calloc@PLT
	testl	%r12d, %r12d
	movq	(%rsp), %r8
	movl	8(%rsp), %r10d
	movq	%rax, %rbp
	movl	$1, %eax
	jle	.L12
	movl	%r15d, 8(%rsp)
	movq	%r8, %r15
	movl	%ebx, 12(%rsp)
	movl	%eax, %ebx
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$1, %r12d
	leaq	31(%rsp), %r13
	testl	%r10d, %r10d
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movd	%r12d, %xmm2
	movd	%ebx, %xmm1
	xorl	%eax, %eax
	movq	%r13, %rsi
	punpckldq	%xmm2, %xmm1
	leaq	.LC2(%rip), %rdi
	movq	%xmm1, (%rsp)
	call	__isoc99_scanf@PLT
	cmpb	$35, 31(%rsp)
	je	.L15
	addl	$1, %r12d
	cmpl	%r12d, 36(%rsp)
	jge	.L18
.L17:
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r12d
	cmpl	%ebx, %r12d
	jl	.L46
	movl	36(%rsp), %r10d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	movl	36(%rsp), %ecx
	movq	(%rsp), %rsi
	leal	2(%rcx), %eax
	imull	%ebx, %eax
	addl	%r12d, %eax
	addl	$1, %r12d
	cltq
	movl	$1, (%r15,%rax,4)
	leal	(%r14,%r14), %eax
	addl	$1, %r14d
	cltq
	movq	%rsi, 0(%rbp,%rax,4)
	cmpl	%r12d, %ecx
	jge	.L18
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L46:
	movq	%r15, %r8
	movl	12(%rsp), %ebx
	movl	8(%rsp), %r15d
.L12:
	movl	36(%rsp), %eax
	movl	%r12d, %r11d
	xorl	%r13d, %r13d
	imull	%eax, %r11d
	subl	%r14d, %r11d
	testl	%r11d, %r11d
	jle	.L20
	leal	2(%rax), %r12d
	movl	%r14d, %r10d
	movl	$1, %ecx
	xorl	%edx, %edx
	leal	(%r12,%r12), %r9d
	movl	%r9d, (%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%ecx, %r13d
	addl	$1, %ecx
	testl	%r14d, %r14d
	je	.L19
	movl	%r14d, %esi
	xorl	%r14d, %r14d
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L22:
	subl	$1, %esi
	je	.L50
.L26:
	cmpl	%edx, %r10d
	je	.L21
	leal	(%rdx,%rdx), %eax
	addl	$1, %edx
	cltq
	movl	0(%rbp,%rax,4), %r15d
	movl	4(%rbp,%rax,4), %ebx
.L21:
	movl	%r15d, %eax
	imull	%r12d, %eax
	leal	(%rax,%rbx), %edi
	movslq	%edi, %rdi
	cmpl	%r13d, (%r8,%rdi,4)
	jne	.L22
	leal	-1(%r15), %edi
	movd	%ebx, %xmm3
	movd	%edi, %xmm0
	movl	%eax, %edi
	subl	%r12d, %edi
	punpckldq	%xmm3, %xmm0
	leal	(%rdi,%rbx), %r9d
	movslq	%r9d, %r9
	leaq	(%r8,%r9,4), %r9
	cmpl	$0, (%r9)
	jne	.L23
	movl	%ecx, (%r9)
	leal	(%r10,%r10), %r9d
	subl	$1, %r11d
	addl	$1, %r10d
	movslq	%r9d, %r9
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%r9,4)
.L23:
	addl	(%rsp), %edi
	leal	1(%r15), %r9d
	movd	%ebx, %xmm4
	addl	%ebx, %edi
	movd	%r9d, %xmm0
	movslq	%edi, %rdi
	punpckldq	%xmm4, %xmm0
	leaq	(%r8,%rdi,4), %rdi
	movl	(%rdi), %r9d
	testl	%r9d, %r9d
	jne	.L24
	movl	%ecx, (%rdi)
	leal	(%r10,%r10), %edi
	subl	$1, %r11d
	addl	$1, %r10d
	movslq	%edi, %rdi
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%rdi,4)
.L24:
	leal	-1(%rbx), %edi
	movd	%r15d, %xmm0
	movd	%edi, %xmm5
	addl	%eax, %edi
	movslq	%edi, %rdi
	punpckldq	%xmm5, %xmm0
	leaq	(%r8,%rdi,4), %rdi
	movl	(%rdi), %r9d
	testl	%r9d, %r9d
	jne	.L25
	movl	%ecx, (%rdi)
	leal	(%r10,%r10), %edi
	subl	$1, %r11d
	addl	$1, %r10d
	movslq	%edi, %rdi
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%rdi,4)
.L25:
	leal	1(%rbx), %edi
	movd	%r15d, %xmm0
	addl	%edi, %eax
	movd	%edi, %xmm6
	cltq
	punpckldq	%xmm6, %xmm0
	leaq	(%r8,%rax,4), %rax
	movl	(%rax), %edi
	testl	%edi, %edi
	jne	.L22
	movl	%ecx, (%rax)
	leal	(%r10,%r10), %eax
	subl	$1, %r11d
	addl	$1, %r10d
	cltq
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%rax,4)
	subl	$1, %esi
	jne	.L26
	.p2align 4,,10
	.p2align 3
.L50:
	testl	%r11d, %r11d
	jg	.L19
.L20:
	xorl	%eax, %eax
	movl	%r13d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	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
.L3:
	.cfi_restore_state
	movl	%r9d, %r9d
	movq	%r8, %rax
	leaq	4(%r8,%r9,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$1, (%rax)
	movl	$1, (%rax,%rdx,4)
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L8
	jmp	.L6
.L49:
	movslq	%r10d, %rdi
	jmp	.L14
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC2:
	.string	"%c"
.LC3:
	.string	"\n"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	movl	$0, 32(%rsp)
	movl	$0, 36(%rsp)
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r10d
	movl	32(%rsp), %r12d
	movl	$1, %esi
	leal	2(%r10), %r13d
	leal	2(%r12), %edi
	movl	%r10d, (%rsp)
	movslq	%r13d, %rbp
	movslq	%edi, %rdi
	imulq	%rbp, %rdi
	salq	$2, %rdi
	call	calloc@PLT
	movl	(%rsp), %r10d
	leal	1(%r12), %esi
	movq	%rax, %r8
	movl	%r10d, %r9d
	addl	$1, %r9d
	js	.L6
	movl	%r13d, %edi
	imull	%esi, %edi
	movslq	%edi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	-4(%rcx), %rax
	cmpq	$8, %rax
	jbe	.L3
	cmpl	$3, %r9d
	jbe	.L3
	movl	%r13d, %edx
	movdqa	.LC1(%rip), %xmm0
	addq	%r8, %rcx
	xorl	%eax, %eax
	shrl	$2, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movups	%xmm0, (%r8,%rax)
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r13d, %eax
	andl	$-4, %eax
	andl	$3, %r13d
	je	.L6
	movslq	%eax, %rdx
	leal	1(%rax), %r9d
	movl	$1, (%r8,%rdx,4)
	leaq	0(,%rdx,4), %rcx
	leal	(%rdi,%rax), %edx
	movslq	%edx, %rdx
	movl	$1, (%r8,%rdx,4)
	cmpl	%eax, %r10d
	jl	.L6
	movl	$1, 4(%r8,%rcx)
	leal	(%rdi,%r9), %edx
	addl	$2, %eax
	movslq	%edx, %rdx
	movl	$1, (%r8,%rdx,4)
	cmpl	%r9d, %r10d
	jl	.L6
	movl	$1, 8(%r8,%rcx)
	addl	%edi, %eax
	cltq
	movl	$1, (%r8,%rax,4)
.L6:
	testl	%esi, %esi
	js	.L49
	leaq	0(,%rbp,4), %rsi
	movq	%r8, %rax
	xorl	%edx, %edx
	movslq	%r10d, %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edx, %ecx
	movl	$1, (%rax)
	addl	$1, %edx
	movl	$1, 4(%rax,%rdi,4)
	addq	%rsi, %rax
	cmpl	%ecx, %r12d
	jge	.L13
.L14:
	movslq	%r12d, %rax
	movl	$1, %esi
	movl	%r10d, 8(%rsp)
	xorl	%r14d, %r14d
	imulq	%rax, %rdi
	movq	%r8, (%rsp)
	salq	$3, %rdi
	call	calloc@PLT
	testl	%r12d, %r12d
	movq	(%rsp), %r8
	movl	8(%rsp), %r10d
	movq	%rax, %rbp
	movl	$1, %eax
	jle	.L12
	movl	%r15d, 8(%rsp)
	movq	%r8, %r15
	movl	%ebx, 12(%rsp)
	movl	%eax, %ebx
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$1, %r12d
	leaq	31(%rsp), %r13
	testl	%r10d, %r10d
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movd	%r12d, %xmm2
	movd	%ebx, %xmm1
	xorl	%eax, %eax
	movq	%r13, %rsi
	punpckldq	%xmm2, %xmm1
	leaq	.LC2(%rip), %rdi
	movq	%xmm1, (%rsp)
	call	__isoc99_scanf@PLT
	cmpb	$35, 31(%rsp)
	je	.L15
	addl	$1, %r12d
	cmpl	%r12d, 36(%rsp)
	jge	.L18
.L17:
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r12d
	cmpl	%ebx, %r12d
	jl	.L46
	movl	36(%rsp), %r10d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L15:
	movl	36(%rsp), %ecx
	movq	(%rsp), %rsi
	leal	2(%rcx), %eax
	imull	%ebx, %eax
	addl	%r12d, %eax
	addl	$1, %r12d
	cltq
	movl	$1, (%r15,%rax,4)
	leal	(%r14,%r14), %eax
	addl	$1, %r14d
	cltq
	movq	%rsi, 0(%rbp,%rax,4)
	cmpl	%r12d, %ecx
	jge	.L18
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L46:
	movq	%r15, %r8
	movl	12(%rsp), %ebx
	movl	8(%rsp), %r15d
.L12:
	movl	36(%rsp), %eax
	movl	%r12d, %r11d
	xorl	%r13d, %r13d
	imull	%eax, %r11d
	subl	%r14d, %r11d
	testl	%r11d, %r11d
	jle	.L20
	leal	2(%rax), %r12d
	movl	%r14d, %r10d
	movl	$1, %ecx
	xorl	%edx, %edx
	leal	(%r12,%r12), %r9d
	movl	%r9d, (%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%ecx, %r13d
	addl	$1, %ecx
	testl	%r14d, %r14d
	je	.L19
	movl	%r14d, %esi
	xorl	%r14d, %r14d
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L22:
	subl	$1, %esi
	je	.L50
.L26:
	cmpl	%edx, %r10d
	je	.L21
	leal	(%rdx,%rdx), %eax
	addl	$1, %edx
	cltq
	movl	0(%rbp,%rax,4), %r15d
	movl	4(%rbp,%rax,4), %ebx
.L21:
	movl	%r15d, %eax
	imull	%r12d, %eax
	leal	(%rax,%rbx), %edi
	movslq	%edi, %rdi
	cmpl	%r13d, (%r8,%rdi,4)
	jne	.L22
	leal	-1(%r15), %edi
	movd	%ebx, %xmm3
	movd	%edi, %xmm0
	movl	%eax, %edi
	subl	%r12d, %edi
	punpckldq	%xmm3, %xmm0
	leal	(%rdi,%rbx), %r9d
	movslq	%r9d, %r9
	leaq	(%r8,%r9,4), %r9
	cmpl	$0, (%r9)
	jne	.L23
	movl	%ecx, (%r9)
	leal	(%r10,%r10), %r9d
	subl	$1, %r11d
	addl	$1, %r10d
	movslq	%r9d, %r9
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%r9,4)
.L23:
	addl	(%rsp), %edi
	leal	1(%r15), %r9d
	movd	%ebx, %xmm4
	addl	%ebx, %edi
	movd	%r9d, %xmm0
	movslq	%edi, %rdi
	punpckldq	%xmm4, %xmm0
	leaq	(%r8,%rdi,4), %rdi
	movl	(%rdi), %r9d
	testl	%r9d, %r9d
	jne	.L24
	movl	%ecx, (%rdi)
	leal	(%r10,%r10), %edi
	subl	$1, %r11d
	addl	$1, %r10d
	movslq	%edi, %rdi
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%rdi,4)
.L24:
	leal	-1(%rbx), %edi
	movd	%r15d, %xmm0
	movd	%edi, %xmm5
	addl	%eax, %edi
	movslq	%edi, %rdi
	punpckldq	%xmm5, %xmm0
	leaq	(%r8,%rdi,4), %rdi
	movl	(%rdi), %r9d
	testl	%r9d, %r9d
	jne	.L25
	movl	%ecx, (%rdi)
	leal	(%r10,%r10), %edi
	subl	$1, %r11d
	addl	$1, %r10d
	movslq	%edi, %rdi
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%rdi,4)
.L25:
	leal	1(%rbx), %edi
	movd	%r15d, %xmm0
	addl	%edi, %eax
	movd	%edi, %xmm6
	cltq
	punpckldq	%xmm6, %xmm0
	leaq	(%r8,%rax,4), %rax
	movl	(%rax), %edi
	testl	%edi, %edi
	jne	.L22
	movl	%ecx, (%rax)
	leal	(%r10,%r10), %eax
	subl	$1, %r11d
	addl	$1, %r10d
	cltq
	addl	$1, %r14d
	movq	%xmm0, 0(%rbp,%rax,4)
	subl	$1, %esi
	jne	.L26
	.p2align 4,,10
	.p2align 3
.L50:
	testl	%r11d, %r11d
	jg	.L19
.L20:
	xorl	%eax, %eax
	movl	%r13d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	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
.L3:
	.cfi_restore_state
	movl	%r9d, %r9d
	movq	%r8, %rax
	leaq	4(%r8,%r9,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$1, (%rax)
	movl	$1, (%rax,%rdx,4)
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L8
	jmp	.L6
.L49:
	movslq	%r10d, %rdi
	jmp	.L14
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct buf {
        int *p;
        int in;
        int out;
};

static void
set(struct buf *buf, int i, int j)
{
        *(buf->p + buf->in * 2) = i;
        *(buf->p + buf->in * 2 + 1) = j;
        buf->in++;
}

static int
get(struct buf *buf, int *i, int *j)
{
        if (buf->in == buf->out)
                return -1;

        *i = *(buf->p + buf->out * 2);
        *j = *(buf->p + buf->out * 2 + 1);
        buf->out++;

        return 0;
}

int
main(void)
{
        int H = 0;
        int W = 0;

        scanf("%d %d\n", &H, &W);

        int *A;
        size_t size;
        size = sizeof(int) * (H + 2) * (W + 2);
        A = malloc(size);
        memset(A, 0, size);
        for (int i = 0; i <= W + 1; i++) {
                A[i] = 1;
                A[(H + 1) * (W + 2) + i] = 1;
        }
        for (int i = 0; i <= H + 1; i++) {
                A[i * (W + 2)] = 1;
                A[i * (W + 2) + W + 1] = 1;
        }

        int white = 0;
        int black = 0;
        struct buf buf;
        size = sizeof(int) * (H) * (W) * 2;
        buf.p = malloc(size);
        buf.in = 0;
        buf.out = 0;
        memset(buf.p, 0, size);

        for (int i = 1; i <= H; i++) {
                for (int j = 1; j <= W; j++) {
                        char c;
                        scanf("%c", &c);
                        if (c == '#') {
                                A[i * (W + 2) + j] = 1;
                                set(&buf, i, j);
                                black++;
                        }
                }
                scanf("\n");
        }

        white = H * W - black;
        int count = 1;
        while(white > 0) {
                int tmp = black;
                black = 0;
                for (int cnt = tmp; cnt > 0; cnt--) {
                        int i;
                        int j;
                        get(&buf, &i, &j);
                        if (A[i * (W + 2) + j] == count) {
                                if (A[(i - 1) * (W + 2) + j] == 0) {
                                        A[(i - 1) * (W + 2) + j] = count + 1;
                                        set(&buf, i - 1, j);
                                        white--;
                                        black++;
                                }
                                if (A[(i + 1) * (W + 2) + j] == 0) {
                                        A[(i + 1) * (W + 2) + j] = count + 1;
                                        set(&buf, i + 1, j);
                                        white--;
                                        black++;
                                }
                                if (A[i * (W + 2) + (j - 1)] == 0) {
                                        A[i * (W + 2) + (j - 1)] = count + 1;
                                        set(&buf, i, j - 1);
                                        white--;
                                        black++;
                                }
                                if (A[i * (W + 2) + (j + 1)] == 0) {
                                        A[i * (W + 2) + (j + 1)] = count + 1;
                                        set(&buf, i, j + 1);
                                        white--;
                                        black++;
                                }
                        }
                }
                count++;
        }

        printf("%d", count - 1);
}

2 3
...
.#.
...
 6 6
..#..#
......
..#..
......
.#....
-...#.
 2 6
#.#...
......
..#0.
......
.#.-..
--..#-
 2 3
...
.#.
..-
 2 3
/..
.#.
..-
 2 3
/..
.#.
..,
 3 3
...
/#.
...
 2 3
...
.#.
..,
 3 3
../
/#.
...
 3 3
-..
.#.
...

2 3 4 2 2 2 2 2 2 2
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 <stdlib.h>
#include <string.h>

struct buf {
        int *p;
        int in;
        int out;
};

static void
set(struct buf *buf, int i, int j)
{
        *(buf->p + buf->in * 2) = i;
        *(buf->p + buf->in * 2 + 1) = j;
        buf->in++;
}

static int
get(struct buf *buf, int *i, int *j)
{
        if (buf->in == buf->out)
                return -1;

        *i = *(buf->p + buf->out * 2);
        *j = *(buf->p + buf->out * 2 + 1);
        buf->out++;

        return 0;
}

int
main(void)
{
        int H = 0;
        int W = 0;

        scanf("%d %d\n", &H, &W);

        int *A;
        size_t size;
        size = sizeof(int) * (H + 2) * (W + 2);
        A = malloc(size);
        memset(A, 0, size);
        for (int i = 0; i <= W + 1; i++) {
                A[i] = 1;
                A[(H + 1) * (W + 2) + i] = 1;
        }
        for (int i = 0; i <= H + 1; i++) {
                A[i * (W + 2)] = 1;
                A[i * (W + 2) + W + 1] = 1;
        }

        int white = 0;
        int black = 0;
        struct buf buf;
        size = sizeof(int) * (H) * (W) * 2;
        buf.p = malloc(size);
        buf.in = 0;
        buf.out = 0;
        memset(buf.p, 0, size);

        for (int i = 1; i <= H; i++) {
                for (int j = 1; j <= W; j++) {
                        char c;
                        scanf("%c", &c);
                        if (c == '#') {
                                A[i * (W + 2) + j] = 1;
                                set(&buf, i, j);
                                black++;
                        }
                }
                scanf("\n");
        }

        white = H * W - black;
        int count = 1;
        while(white > 0) {
                int tmp = black;
                black = 0;
                for (int cnt = tmp; cnt > 0; cnt--) {
                        int i;
                        int j;
                        get(&buf, &i, &j);
                        if (A[i * (W + 2) + j] == count) {
                                if (A[(i - 1) * (W + 2) + j] == 0) {
                                        A[(i - 1) * (W + 2) + j] = count + 1;
                                        set(&buf, i - 1, j);
                                        white--;
                                        black++;
                                }
                                if (A[(i + 1) * (W + 2) + j] == 0) {
                                        A[(i + 1) * (W + 2) + j] = count + 1;
                                        set(&buf, i + 1, j);
                                        white--;
                                        black++;
                                }
                                if (A[i * (W + 2) + (j - 1)] == 0) {
                                        A[i * (W + 2) + (j - 1)] = count + 1;
                                        set(&buf, i, j - 1);
                                        white--;
                                        black++;
                                }
                                if (A[i * (W + 2) + (j + 1)] == 0) {
                                        A[i * (W + 2) + (j + 1)] = count + 1;
                                        set(&buf, i, j + 1);
                                        white--;
                                        black++;
                                }
                        }
                }
                count++;
        }

        printf("%d", count - 1);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	set, @function
set:
.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, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 8(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	set, .-set
	.type	get, @function
get:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$-1, %eax
	jmp	.L4
.L3:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 12(%rax)
	movl	$0, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get, .-get
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	cltq
	imulq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -84(%rbp)
	jmp	.L6
.L7:
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-100(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	addl	$1, -84(%rbp)
.L6:
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jle	.L7
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-80(%rbp), %eax
	movl	%eax, %edx
	movl	-96(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	addl	$1, -80(%rbp)
.L8:
	movl	-100(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -80(%rbp)
	jle	.L9
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	movl	-96(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movq	-32(%rbp), %rax
	movq	-48(%rbp), %rdx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -68(%rbp)
	jmp	.L10
.L14:
	movl	$1, -64(%rbp)
	jmp	.L11
.L13:
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-88(%rbp), %eax
	cmpb	$35, %al
	jne	.L12
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-64(%rbp), %edx
	movl	-68(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	addl	$1, -72(%rbp)
.L12:
	addl	$1, -64(%rbp)
.L11:
	movl	-96(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jle	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -68(%rbp)
.L10:
	movl	-100(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jle	.L14
	movl	-100(%rbp), %edx
	movl	-96(%rbp), %eax
	imull	%edx, %eax
	subl	-72(%rbp), %eax
	movl	%eax, -76(%rbp)
	movl	$1, -60(%rbp)
	jmp	.L15
.L22:
	movl	-72(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	$0, -72(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -56(%rbp)
	jmp	.L16
.L21:
	leaq	-88(%rbp), %rdx
	leaq	-92(%rbp), %rcx
	leaq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -60(%rbp)
	jne	.L17
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L18
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %edx
	movl	-92(%rbp), %eax
	leal	-1(%rax), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L18:
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %edx
	movl	-92(%rbp), %eax
	leal	1(%rax), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L19:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-92(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L20:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %eax
	leal	1(%rax), %edx
	movl	-92(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L17:
	subl	$1, -56(%rbp)
.L16:
	cmpl	$0, -56(%rbp)
	jg	.L21
	addl	$1, -60(%rbp)
.L15:
	cmpl	$0, -76(%rbp)
	jg	.L22
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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
	.type	set, @function
set:
.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, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 8(%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	set, .-set
	.type	get, @function
get:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-8(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	movl	$-1, %eax
	jmp	.L4
.L3:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	12(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 12(%rax)
	movl	$0, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get, .-get
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	cltq
	imulq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -84(%rbp)
	jmp	.L6
.L7:
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-100(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	addl	$1, -84(%rbp)
.L6:
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jle	.L7
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-80(%rbp), %eax
	movl	%eax, %edx
	movl	-96(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	addl	$1, -80(%rbp)
.L8:
	movl	-100(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -80(%rbp)
	jle	.L9
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	movl	-96(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movq	-32(%rbp), %rax
	movq	-48(%rbp), %rdx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -68(%rbp)
	jmp	.L10
.L14:
	movl	$1, -64(%rbp)
	jmp	.L11
.L13:
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-88(%rbp), %eax
	cmpb	$35, %al
	jne	.L12
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, (%rax)
	movl	-64(%rbp), %edx
	movl	-68(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	addl	$1, -72(%rbp)
.L12:
	addl	$1, -64(%rbp)
.L11:
	movl	-96(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jle	.L13
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -68(%rbp)
.L10:
	movl	-100(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jle	.L14
	movl	-100(%rbp), %edx
	movl	-96(%rbp), %eax
	imull	%edx, %eax
	subl	-72(%rbp), %eax
	movl	%eax, -76(%rbp)
	movl	$1, -60(%rbp)
	jmp	.L15
.L22:
	movl	-72(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	$0, -72(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -56(%rbp)
	jmp	.L16
.L21:
	leaq	-88(%rbp), %rdx
	leaq	-92(%rbp), %rcx
	leaq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -60(%rbp)
	jne	.L17
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L18
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %edx
	movl	-92(%rbp), %eax
	leal	-1(%rax), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L18:
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L19
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movl	-96(%rbp), %eax
	addl	$2, %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %edx
	movl	-92(%rbp), %eax
	leal	1(%rax), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L19:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L20
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-92(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L20:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L17
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movl	-92(%rbp), %eax
	imull	%eax, %edx
	movl	-88(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-60(%rbp), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-88(%rbp), %eax
	leal	1(%rax), %edx
	movl	-92(%rbp), %ecx
	leaq	-32(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	set
	subl	$1, -76(%rbp)
	addl	$1, -72(%rbp)
.L17:
	subl	$1, -56(%rbp)
.L16:
	cmpl	$0, -56(%rbp)
	jg	.L21
	addl	$1, -60(%rbp)
.L15:
	cmpl	$0, -76(%rbp)
	jg	.L22
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
