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

```c
#include<stdio.h>

int main()
{
    int i,j,k,N,wmax,wmin,hmax,hmin;
    int d[200]={0},n[200]={0};
    int board[401][401];

    while(scanf("%d",&N),N){

        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                board[i][j]=-1;
            }
        }
        board[200][200]=0;

        for(i=1;i<N;i++){
            scanf("%d%d",&n[i],&d[i]);
        }

        for(k=1;k<N;k++){
            for(i=0;i<401;i++){
                for(j=0;j<401;j++){
                    if(board[i][j]==n[k]){
                        switch(d[k]){
                            case 0:
                                board[i][j-1]=k;
                                break;
                            case 1:
                                board[i+1][j]=k;
                                break;
                            case 2:
                                board[i][j+1]=k;
                                break;
                            case 3:
                                board[i-1][j]=k;
                                break;
                        }
                    }
                }
            }
        }

        wmax=0;
        wmin=401;
        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                if(board[i][j]>-1){
                    if(wmin>j) wmin=j;
                    break;
                }
            }
            for(k=400;k>=0;k--){
                if(board[i][k]>-1){
                    if(wmax<k) wmax=k;
                    break;
                }
            }
        }

        hmax=0;
        hmin=401;
        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                if(board[j][i]>-1){
                    if(hmin>j) hmin=j;
                    break;
                }
            }
            for(k=400;k>=0;k--){
                if(board[k][i]>-1){
                    if(hmax<k) hmax=k;
                    break;
                }
            }
        }
        printf("%d %d\n",wmax-wmin+1,hmax-hmin+1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d"
	.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
	leaq	-643072(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1776, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-644816(%rbp), %rdx
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-644016(%rbp), %rdx
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rdx, %rdi
	rep stosq
	jmp	.L2
.L44:
	movl	$0, -644844(%rbp)
	jmp	.L3
.L6:
	movl	$0, -644840(%rbp)
	jmp	.L4
.L5:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	$-1, -643216(%rbp,%rax,4)
	addl	$1, -644840(%rbp)
.L4:
	cmpl	$400, -644840(%rbp)
	jle	.L5
	addl	$1, -644844(%rbp)
.L3:
	cmpl	$400, -644844(%rbp)
	jle	.L6
	movl	$0, -321616(%rbp)
	movl	$1, -644844(%rbp)
	jmp	.L7
.L8:
	leaq	-644816(%rbp), %rdx
	movl	-644844(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-644016(%rbp), %rcx
	movl	-644844(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -644844(%rbp)
.L7:
	movl	-644848(%rbp), %eax
	cmpl	%eax, -644844(%rbp)
	jl	.L8
	movl	$1, -644836(%rbp)
	jmp	.L9
.L19:
	movl	$0, -644844(%rbp)
	jmp	.L10
.L18:
	movl	$0, -644840(%rbp)
	jmp	.L11
.L17:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %edx
	movl	-644836(%rbp), %eax
	cltq
	movl	-644016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-644836(%rbp), %eax
	cltq
	movl	-644816(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	je	.L13
	cmpl	$3, %eax
	jg	.L12
	cmpl	$2, %eax
	je	.L14
	cmpl	$2, %eax
	jg	.L12
	testl	%eax, %eax
	je	.L15
	cmpl	$1, %eax
	je	.L16
	jmp	.L12
.L15:
	movl	-644840(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rax, %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L16:
	movl	-644844(%rbp), %eax
	leal	1(%rax), %edx
	movl	-644840(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$401, %rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L14:
	movl	-644840(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rax, %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L13:
	movl	-644844(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-644840(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$401, %rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	nop
.L12:
	addl	$1, -644840(%rbp)
.L11:
	cmpl	$400, -644840(%rbp)
	jle	.L17
	addl	$1, -644844(%rbp)
.L10:
	cmpl	$400, -644844(%rbp)
	jle	.L18
	addl	$1, -644836(%rbp)
.L9:
	movl	-644848(%rbp), %eax
	cmpl	%eax, -644836(%rbp)
	jl	.L19
	movl	$0, -644832(%rbp)
	movl	$401, -644828(%rbp)
	movl	$0, -644844(%rbp)
	jmp	.L20
.L31:
	movl	$0, -644840(%rbp)
	jmp	.L21
.L25:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L22
	movl	-644828(%rbp), %eax
	cmpl	-644840(%rbp), %eax
	jle	.L47
	movl	-644840(%rbp), %eax
	movl	%eax, -644828(%rbp)
	jmp	.L47
.L22:
	addl	$1, -644840(%rbp)
.L21:
	cmpl	$400, -644840(%rbp)
	jle	.L25
	jmp	.L24
.L47:
	nop
.L24:
	movl	$400, -644836(%rbp)
	jmp	.L26
.L30:
	movl	-644836(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L27
	movl	-644832(%rbp), %eax
	cmpl	-644836(%rbp), %eax
	jge	.L48
	movl	-644836(%rbp), %eax
	movl	%eax, -644832(%rbp)
	jmp	.L48
.L27:
	subl	$1, -644836(%rbp)
.L26:
	cmpl	$0, -644836(%rbp)
	jns	.L30
	jmp	.L29
.L48:
	nop
.L29:
	addl	$1, -644844(%rbp)
.L20:
	cmpl	$400, -644844(%rbp)
	jle	.L31
	movl	$0, -644824(%rbp)
	movl	$401, -644820(%rbp)
	movl	$0, -644844(%rbp)
	jmp	.L32
.L43:
	movl	$0, -644840(%rbp)
	jmp	.L33
.L37:
	movl	-644844(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644840(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L34
	movl	-644820(%rbp), %eax
	cmpl	-644840(%rbp), %eax
	jle	.L49
	movl	-644840(%rbp), %eax
	movl	%eax, -644820(%rbp)
	jmp	.L49
.L34:
	addl	$1, -644840(%rbp)
.L33:
	cmpl	$400, -644840(%rbp)
	jle	.L37
	jmp	.L36
.L49:
	nop
.L36:
	movl	$400, -644836(%rbp)
	jmp	.L38
.L42:
	movl	-644844(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644836(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L39
	movl	-644824(%rbp), %eax
	cmpl	-644836(%rbp), %eax
	jge	.L50
	movl	-644836(%rbp), %eax
	movl	%eax, -644824(%rbp)
	jmp	.L50
.L39:
	subl	$1, -644836(%rbp)
.L38:
	cmpl	$0, -644836(%rbp)
	jns	.L42
	jmp	.L41
.L50:
	nop
.L41:
	addl	$1, -644844(%rbp)
.L32:
	cmpl	$400, -644844(%rbp)
	jle	.L43
	movl	-644824(%rbp), %eax
	subl	-644820(%rbp), %eax
	leal	1(%rax), %edx
	movl	-644832(%rbp), %eax
	subl	-644828(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-644848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-644848(%rbp), %eax
	testl	%eax, %eax
	jne	.L44
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-643072(%rsp), %r11
	.cfi_def_cfa 11, 643128
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1800, %rsp
	.cfi_def_cfa_offset 644928
	movl	$100, %ecx
	movq	$-1604, %r15
	movq	%fs:40, %rax
	movq	%rax, 644856(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rdi
	movq	%rdi, 24(%rsp)
	rep stosq
	leaq	848(%rsp), %rdi
	movl	$100, %ecx
	movq	%rdi, (%rsp)
	rep stosq
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
.L2:
	movq	16(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L30
	movl	$643204, %edx
	movl	$255, %esi
	movl	$4, %ebp
	movl	$1, %r12d
	leaq	1648(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	.LC0(%rip), %rcx
	movl	$0, 323248(%rsp)
	cmpl	$1, %r13d
	jle	.L4
.L3:
	movq	24(%rsp), %rax
	movq	%rcx, %rdi
	addl	$1, %r12d
	leaq	(%rax,%rbp), %rdx
	movq	(%rsp), %rax
	leaq	(%rax,%rbp), %rsi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movslq	44(%rsp), %r14
	leaq	.LC0(%rip), %rcx
	cmpl	%r12d, %r14d
	jg	.L3
	cmpl	$1, %r14d
	jle	.L4
	leaq	52(%rsp), %rdi
	leaq	3252(%rsp), %rax
	movl	$1, %r13d
	movl	$1604, %ebp
	movq	%rax, 8(%rsp)
	leaq	646456(%rsp), %r12
.L5:
	movq	(%rsp), %rax
	movq	8(%rsp), %rcx
	movl	%r13d, %r8d
	xorl	%r9d, %r9d
	movl	(%rax,%r13,4), %esi
.L14:
	movq	%r15, %r11
	movq	%rbp, %r10
	leaq	-1604(%rcx), %rax
	subq	%r9, %r11
	subq	%r9, %r10
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$4, %rax
	cmpq	%rcx, %rax
	je	.L45
.L12:
	cmpl	%esi, (%rax)
	jne	.L6
	movl	(%rdi), %edx
	cmpl	$2, %edx
	je	.L7
	jg	.L8
	testl	%edx, %edx
	je	.L9
	cmpl	$1, %edx
	jne	.L6
	leaq	(%rax,%r9), %rdx
	addq	$4, %rax
	movl	%r8d, (%rdx,%r10)
	cmpq	%rcx, %rax
	jne	.L12
.L45:
	leaq	1604(%rax), %rcx
	subq	$1604, %r9
	cmpq	%r12, %rcx
	jne	.L14
	addq	$1, %r13
	addq	$4, %rdi
	cmpq	%r14, %r13
	jne	.L5
.L4:
	movq	%rbx, %r8
	leaq	644852(%rsp), %r9
	movq	%rbx, %rdx
	xorl	%esi, %esi
	movl	$401, %edi
.L21:
	xorl	%eax, %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rax
	cmpq	$401, %rax
	je	.L16
.L17:
	movl	(%rdx,%rax,4), %r12d
	testl	%r12d, %r12d
	js	.L15
	cmpl	%eax, %edi
	cmovg	%eax, %edi
.L16:
	movl	$400, %eax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L18:
	subq	$1, %rax
	jb	.L19
.L20:
	movl	(%rdx,%rax,4), %ebp
	testl	%ebp, %ebp
	js	.L18
	cmpl	%eax, %esi
	cmovl	%eax, %esi
.L19:
	addq	$1604, %rdx
	cmpq	%r9, %rdx
	jne	.L21
	addq	$1604, %rbx
	movl	$401, %r9d
	xorl	%ecx, %ecx
.L22:
	movq	%r8, %rdx
	xorl	%eax, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %eax
	addq	$1604, %rdx
	cmpl	$401, %eax
	je	.L24
.L25:
	movl	(%rdx), %r11d
	testl	%r11d, %r11d
	js	.L23
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
.L24:
	movq	%r8, %rdx
	movl	$400, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L26:
	subl	$1, %eax
	subq	$1604, %rdx
	cmpl	$-1, %eax
	je	.L27
.L28:
	movl	641600(%rdx), %r10d
	testl	%r10d, %r10d
	js	.L26
	cmpl	%eax, %ecx
	cmovl	%eax, %ecx
.L27:
	addq	$4, %r8
	cmpq	%rbx, %r8
	jne	.L22
	subl	%edi, %esi
	subl	%r9d, %ecx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%esi, %edx
	addl	$1, %ecx
	leaq	.LC1(%rip), %rsi
	addl	$1, %edx
	call	__printf_chk@PLT
	jmp	.L2
.L30:
	movq	644856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$644872, %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
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	cmpl	$3, %edx
	jne	.L6
	leaq	(%rax,%r9), %rdx
	movl	%r8d, (%rdx,%r11)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%r8d, 4(%rax)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r8d, -4(%rax)
	jmp	.L6
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-643072(%rsp), %r11
	.cfi_def_cfa 11, 643128
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1800, %rsp
	.cfi_def_cfa_offset 644928
	movl	$100, %ecx
	movq	$-1604, %r15
	movq	%fs:40, %rax
	movq	%rax, 644856(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rdi
	movq	%rdi, 24(%rsp)
	rep stosq
	leaq	848(%rsp), %rdi
	movl	$100, %ecx
	movq	%rdi, (%rsp)
	rep stosq
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
.L2:
	movq	16(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L30
	movl	$643204, %edx
	movl	$255, %esi
	movl	$4, %ebp
	movl	$1, %r12d
	leaq	1648(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	.LC0(%rip), %rcx
	movl	$0, 323248(%rsp)
	cmpl	$1, %r13d
	jle	.L4
.L3:
	movq	24(%rsp), %rax
	movq	%rcx, %rdi
	addl	$1, %r12d
	leaq	(%rax,%rbp), %rdx
	movq	(%rsp), %rax
	leaq	(%rax,%rbp), %rsi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movslq	44(%rsp), %r14
	leaq	.LC0(%rip), %rcx
	cmpl	%r12d, %r14d
	jg	.L3
	cmpl	$1, %r14d
	jle	.L4
	leaq	52(%rsp), %rdi
	leaq	3252(%rsp), %rax
	movl	$1, %r13d
	movl	$1604, %ebp
	movq	%rax, 8(%rsp)
	leaq	646456(%rsp), %r12
.L5:
	movq	(%rsp), %rax
	movq	8(%rsp), %rcx
	movl	%r13d, %r8d
	xorl	%r9d, %r9d
	movl	(%rax,%r13,4), %esi
.L14:
	movq	%r15, %r11
	movq	%rbp, %r10
	leaq	-1604(%rcx), %rax
	subq	%r9, %r11
	subq	%r9, %r10
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$4, %rax
	cmpq	%rcx, %rax
	je	.L45
.L12:
	cmpl	%esi, (%rax)
	jne	.L6
	movl	(%rdi), %edx
	cmpl	$2, %edx
	je	.L7
	jg	.L8
	testl	%edx, %edx
	je	.L9
	cmpl	$1, %edx
	jne	.L6
	leaq	(%rax,%r9), %rdx
	addq	$4, %rax
	movl	%r8d, (%rdx,%r10)
	cmpq	%rcx, %rax
	jne	.L12
.L45:
	leaq	1604(%rax), %rcx
	subq	$1604, %r9
	cmpq	%r12, %rcx
	jne	.L14
	addq	$1, %r13
	addq	$4, %rdi
	cmpq	%r14, %r13
	jne	.L5
.L4:
	movq	%rbx, %r8
	leaq	644852(%rsp), %r9
	movq	%rbx, %rdx
	xorl	%esi, %esi
	movl	$401, %edi
.L21:
	xorl	%eax, %eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rax
	cmpq	$401, %rax
	je	.L16
.L17:
	movl	(%rdx,%rax,4), %r12d
	testl	%r12d, %r12d
	js	.L15
	cmpl	%eax, %edi
	cmovg	%eax, %edi
.L16:
	movl	$400, %eax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L18:
	subq	$1, %rax
	jb	.L19
.L20:
	movl	(%rdx,%rax,4), %ebp
	testl	%ebp, %ebp
	js	.L18
	cmpl	%eax, %esi
	cmovl	%eax, %esi
.L19:
	addq	$1604, %rdx
	cmpq	%r9, %rdx
	jne	.L21
	addq	$1604, %rbx
	movl	$401, %r9d
	xorl	%ecx, %ecx
.L22:
	movq	%r8, %rdx
	xorl	%eax, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %eax
	addq	$1604, %rdx
	cmpl	$401, %eax
	je	.L24
.L25:
	movl	(%rdx), %r11d
	testl	%r11d, %r11d
	js	.L23
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
.L24:
	movq	%r8, %rdx
	movl	$400, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L26:
	subl	$1, %eax
	subq	$1604, %rdx
	cmpl	$-1, %eax
	je	.L27
.L28:
	movl	641600(%rdx), %r10d
	testl	%r10d, %r10d
	js	.L26
	cmpl	%eax, %ecx
	cmovl	%eax, %ecx
.L27:
	addq	$4, %r8
	cmpq	%rbx, %r8
	jne	.L22
	subl	%edi, %esi
	subl	%r9d, %ecx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%esi, %edx
	addl	$1, %ecx
	leaq	.LC1(%rip), %rsi
	addl	$1, %edx
	call	__printf_chk@PLT
	jmp	.L2
.L30:
	movq	644856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$644872, %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
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	cmpl	$3, %edx
	jne	.L6
	leaq	(%rax,%r9), %rdx
	movl	%r8d, (%rdx,%r11)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%r8d, 4(%rax)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r8d, -4(%rax)
	jmp	.L6
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

int main()
{
    int i,j,k,N,wmax,wmin,hmax,hmin;
    int d[200]={0},n[200]={0};
    int board[401][401];

    while(scanf("%d",&N),N){

        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                board[i][j]=-1;
            }
        }
        board[200][200]=0;

        for(i=1;i<N;i++){
            scanf("%d%d",&n[i],&d[i]);
        }

        for(k=1;k<N;k++){
            for(i=0;i<401;i++){
                for(j=0;j<401;j++){
                    if(board[i][j]==n[k]){
                        switch(d[k]){
                            case 0:
                                board[i][j-1]=k;
                                break;
                            case 1:
                                board[i+1][j]=k;
                                break;
                            case 2:
                                board[i][j+1]=k;
                                break;
                            case 3:
                                board[i-1][j]=k;
                                break;
                        }
                    }
                }
            }
        }

        wmax=0;
        wmin=401;
        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                if(board[i][j]>-1){
                    if(wmin>j) wmin=j;
                    break;
                }
            }
            for(k=400;k>=0;k--){
                if(board[i][k]>-1){
                    if(wmax<k) wmax=k;
                    break;
                }
            }
        }

        hmax=0;
        hmin=401;
        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                if(board[j][i]>-1){
                    if(hmin>j) hmin=j;
                    break;
                }
            }
            for(k=400;k>=0;k--){
                if(board[k][i]>-1){
                    if(hmax<k) hmax=k;
                    break;
                }
            }
        }
        printf("%d %d\n",wmax-wmin+1,hmax-hmin+1);
    }
    return 0;
}
1
5
0 0
0 1
0 2
0 3
12
0 0
1 1
2 0
3 1
4 1
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 2
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0
 1
5
0 0
0 1
0 2
0 3
12
0 0
1 0
2 0
3 1
4 1
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 3
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0
 1
5
0 0
0 0
0 2
0 3
12
0 0
1 0
2 0
3 1
4 1
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 3
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0
 1
5
0 0
0 0
0 2
0 3
12
0 0
1 0
2 0
3 0
4 1
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 3
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0
 1
5
0 0
0 0
0 2
0 3
12
0 0
1 0
2 0
3 0
4 1
5 1
6 2
3 2
8 2
9 3
10 3
10
0 2
1 3
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0
 1
5
0 0
0 1
0 2
0 3
12
0 0
1 0
2 0
3 1
4 1
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 2
2 2
3 2
2 1
5 1
6 1
7 1
8 2
0
 1
5
0 0
0 1
0 2
0 3
12
0 0
1 0
2 0
3 1
4 2
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 3
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0
 1
5
0 0
0 1
0 2
0 3
12
0 0
1 0
2 0
3 1
4 1
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 2
2 1
3 2
2 1
5 1
6 1
7 1
8 2
0
 1
5
0 0
0 1
0 2
0 3
12
0 0
1 0
2 0
3 1
4 2
5 1
6 2
7 1
8 1
9 3
10 3
10
0 2
1 3
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0
 1
5
0 0
0 1
0 2
0 3
12
0 1
1 0
2 0
3 1
4 2
5 1
6 2
7 1
8 1
9 3
10 3
10
0 2
1 3
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0

1 1
3 3
4 5
5 6
 1 1
3 3
4 4
4 6
 1 1
3 2
4 4
4 6
 1 1
3 2
5 3
4 6
 1 1
3 2
5 5
4 6
 1 1
3 3
4 4
5 5
 1 1
3 3
5 3
4 6
 1 1
3 3
4 4
4 5
 1 1
3 3
4 5
4 6
 1 1
3 3
3 6
4 6

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

```c
#include<stdio.h>

int main()
{
    int i,j,k,N,wmax,wmin,hmax,hmin;
    int d[200]={0},n[200]={0};
    int board[401][401];

    while(scanf("%d",&N),N){

        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                board[i][j]=-1;
            }
        }
        board[200][200]=0;

        for(i=1;i<N;i++){
            scanf("%d%d",&n[i],&d[i]);
        }

        for(k=1;k<N;k++){
            for(i=0;i<401;i++){
                for(j=0;j<401;j++){
                    if(board[i][j]==n[k]){
                        switch(d[k]){
                            case 0:
                                board[i][j-1]=k;
                                break;
                            case 1:
                                board[i+1][j]=k;
                                break;
                            case 2:
                                board[i][j+1]=k;
                                break;
                            case 3:
                                board[i-1][j]=k;
                                break;
                        }
                    }
                }
            }
        }

        wmax=0;
        wmin=401;
        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                if(board[i][j]>-1){
                    if(wmin>j) wmin=j;
                    break;
                }
            }
            for(k=400;k>=0;k--){
                if(board[i][k]>-1){
                    if(wmax<k) wmax=k;
                    break;
                }
            }
        }

        hmax=0;
        hmin=401;
        for(i=0;i<401;i++){
            for(j=0;j<401;j++){
                if(board[j][i]>-1){
                    if(hmin>j) hmin=j;
                    break;
                }
            }
            for(k=400;k>=0;k--){
                if(board[k][i]>-1){
                    if(hmax<k) hmax=k;
                    break;
                }
            }
        }
        printf("%d %d\n",wmax-wmin+1,hmax-hmin+1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d"
	.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
	leaq	-643072(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1776, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-644816(%rbp), %rdx
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-644016(%rbp), %rdx
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rdx, %rdi
	rep stosq
	jmp	.L2
.L44:
	movl	$0, -644844(%rbp)
	jmp	.L3
.L6:
	movl	$0, -644840(%rbp)
	jmp	.L4
.L5:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	$-1, -643216(%rbp,%rax,4)
	addl	$1, -644840(%rbp)
.L4:
	cmpl	$400, -644840(%rbp)
	jle	.L5
	addl	$1, -644844(%rbp)
.L3:
	cmpl	$400, -644844(%rbp)
	jle	.L6
	movl	$0, -321616(%rbp)
	movl	$1, -644844(%rbp)
	jmp	.L7
.L8:
	leaq	-644816(%rbp), %rdx
	movl	-644844(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-644016(%rbp), %rcx
	movl	-644844(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -644844(%rbp)
.L7:
	movl	-644848(%rbp), %eax
	cmpl	%eax, -644844(%rbp)
	jl	.L8
	movl	$1, -644836(%rbp)
	jmp	.L9
.L19:
	movl	$0, -644844(%rbp)
	jmp	.L10
.L18:
	movl	$0, -644840(%rbp)
	jmp	.L11
.L17:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %edx
	movl	-644836(%rbp), %eax
	cltq
	movl	-644016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-644836(%rbp), %eax
	cltq
	movl	-644816(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	je	.L13
	cmpl	$3, %eax
	jg	.L12
	cmpl	$2, %eax
	je	.L14
	cmpl	$2, %eax
	jg	.L12
	testl	%eax, %eax
	je	.L15
	cmpl	$1, %eax
	je	.L16
	jmp	.L12
.L15:
	movl	-644840(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rax, %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L16:
	movl	-644844(%rbp), %eax
	leal	1(%rax), %edx
	movl	-644840(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$401, %rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L14:
	movl	-644840(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rax, %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L13:
	movl	-644844(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-644840(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$401, %rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	nop
.L12:
	addl	$1, -644840(%rbp)
.L11:
	cmpl	$400, -644840(%rbp)
	jle	.L17
	addl	$1, -644844(%rbp)
.L10:
	cmpl	$400, -644844(%rbp)
	jle	.L18
	addl	$1, -644836(%rbp)
.L9:
	movl	-644848(%rbp), %eax
	cmpl	%eax, -644836(%rbp)
	jl	.L19
	movl	$0, -644832(%rbp)
	movl	$401, -644828(%rbp)
	movl	$0, -644844(%rbp)
	jmp	.L20
.L31:
	movl	$0, -644840(%rbp)
	jmp	.L21
.L25:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L22
	movl	-644828(%rbp), %eax
	cmpl	-644840(%rbp), %eax
	jle	.L47
	movl	-644840(%rbp), %eax
	movl	%eax, -644828(%rbp)
	jmp	.L47
.L22:
	addl	$1, -644840(%rbp)
.L21:
	cmpl	$400, -644840(%rbp)
	jle	.L25
	jmp	.L24
.L47:
	nop
.L24:
	movl	$400, -644836(%rbp)
	jmp	.L26
.L30:
	movl	-644836(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L27
	movl	-644832(%rbp), %eax
	cmpl	-644836(%rbp), %eax
	jge	.L48
	movl	-644836(%rbp), %eax
	movl	%eax, -644832(%rbp)
	jmp	.L48
.L27:
	subl	$1, -644836(%rbp)
.L26:
	cmpl	$0, -644836(%rbp)
	jns	.L30
	jmp	.L29
.L48:
	nop
.L29:
	addl	$1, -644844(%rbp)
.L20:
	cmpl	$400, -644844(%rbp)
	jle	.L31
	movl	$0, -644824(%rbp)
	movl	$401, -644820(%rbp)
	movl	$0, -644844(%rbp)
	jmp	.L32
.L43:
	movl	$0, -644840(%rbp)
	jmp	.L33
.L37:
	movl	-644844(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644840(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L34
	movl	-644820(%rbp), %eax
	cmpl	-644840(%rbp), %eax
	jle	.L49
	movl	-644840(%rbp), %eax
	movl	%eax, -644820(%rbp)
	jmp	.L49
.L34:
	addl	$1, -644840(%rbp)
.L33:
	cmpl	$400, -644840(%rbp)
	jle	.L37
	jmp	.L36
.L49:
	nop
.L36:
	movl	$400, -644836(%rbp)
	jmp	.L38
.L42:
	movl	-644844(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644836(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L39
	movl	-644824(%rbp), %eax
	cmpl	-644836(%rbp), %eax
	jge	.L50
	movl	-644836(%rbp), %eax
	movl	%eax, -644824(%rbp)
	jmp	.L50
.L39:
	subl	$1, -644836(%rbp)
.L38:
	cmpl	$0, -644836(%rbp)
	jns	.L42
	jmp	.L41
.L50:
	nop
.L41:
	addl	$1, -644844(%rbp)
.L32:
	cmpl	$400, -644844(%rbp)
	jle	.L43
	movl	-644824(%rbp), %eax
	subl	-644820(%rbp), %eax
	leal	1(%rax), %edx
	movl	-644832(%rbp), %eax
	subl	-644828(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-644848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-644848(%rbp), %eax
	testl	%eax, %eax
	jne	.L44
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	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.
val
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d"
	.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
	leaq	-643072(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1776, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-644816(%rbp), %rdx
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-644016(%rbp), %rdx
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rdx, %rdi
	rep stosq
	jmp	.L2
.L44:
	movl	$0, -644844(%rbp)
	jmp	.L3
.L6:
	movl	$0, -644840(%rbp)
	jmp	.L4
.L5:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	$-1, -643216(%rbp,%rax,4)
	addl	$1, -644840(%rbp)
.L4:
	cmpl	$400, -644840(%rbp)
	jle	.L5
	addl	$1, -644844(%rbp)
.L3:
	cmpl	$400, -644844(%rbp)
	jle	.L6
	movl	$0, -321616(%rbp)
	movl	$1, -644844(%rbp)
	jmp	.L7
.L8:
	leaq	-644816(%rbp), %rdx
	movl	-644844(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-644016(%rbp), %rcx
	movl	-644844(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -644844(%rbp)
.L7:
	movl	-644848(%rbp), %eax
	cmpl	%eax, -644844(%rbp)
	jl	.L8
	movl	$1, -644836(%rbp)
	jmp	.L9
.L19:
	movl	$0, -644844(%rbp)
	jmp	.L10
.L18:
	movl	$0, -644840(%rbp)
	jmp	.L11
.L17:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %edx
	movl	-644836(%rbp), %eax
	cltq
	movl	-644016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-644836(%rbp), %eax
	cltq
	movl	-644816(%rbp,%rax,4), %eax
	cmpl	$3, %eax
	je	.L13
	cmpl	$3, %eax
	jg	.L12
	cmpl	$2, %eax
	je	.L14
	cmpl	$2, %eax
	jg	.L12
	testl	%eax, %eax
	je	.L15
	cmpl	$1, %eax
	je	.L16
	jmp	.L12
.L15:
	movl	-644840(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rax, %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L16:
	movl	-644844(%rbp), %eax
	leal	1(%rax), %edx
	movl	-644840(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$401, %rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L14:
	movl	-644840(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rax, %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	jmp	.L12
.L13:
	movl	-644844(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-644840(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$401, %rax, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-644836(%rbp), %eax
	movl	%eax, -643216(%rbp,%rdx,4)
	nop
.L12:
	addl	$1, -644840(%rbp)
.L11:
	cmpl	$400, -644840(%rbp)
	jle	.L17
	addl	$1, -644844(%rbp)
.L10:
	cmpl	$400, -644844(%rbp)
	jle	.L18
	addl	$1, -644836(%rbp)
.L9:
	movl	-644848(%rbp), %eax
	cmpl	%eax, -644836(%rbp)
	jl	.L19
	movl	$0, -644832(%rbp)
	movl	$401, -644828(%rbp)
	movl	$0, -644844(%rbp)
	jmp	.L20
.L31:
	movl	$0, -644840(%rbp)
	jmp	.L21
.L25:
	movl	-644840(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L22
	movl	-644828(%rbp), %eax
	cmpl	-644840(%rbp), %eax
	jle	.L47
	movl	-644840(%rbp), %eax
	movl	%eax, -644828(%rbp)
	jmp	.L47
.L22:
	addl	$1, -644840(%rbp)
.L21:
	cmpl	$400, -644840(%rbp)
	jle	.L25
	jmp	.L24
.L47:
	nop
.L24:
	movl	$400, -644836(%rbp)
	jmp	.L26
.L30:
	movl	-644836(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644844(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L27
	movl	-644832(%rbp), %eax
	cmpl	-644836(%rbp), %eax
	jge	.L48
	movl	-644836(%rbp), %eax
	movl	%eax, -644832(%rbp)
	jmp	.L48
.L27:
	subl	$1, -644836(%rbp)
.L26:
	cmpl	$0, -644836(%rbp)
	jns	.L30
	jmp	.L29
.L48:
	nop
.L29:
	addl	$1, -644844(%rbp)
.L20:
	cmpl	$400, -644844(%rbp)
	jle	.L31
	movl	$0, -644824(%rbp)
	movl	$401, -644820(%rbp)
	movl	$0, -644844(%rbp)
	jmp	.L32
.L43:
	movl	$0, -644840(%rbp)
	jmp	.L33
.L37:
	movl	-644844(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644840(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L34
	movl	-644820(%rbp), %eax
	cmpl	-644840(%rbp), %eax
	jle	.L49
	movl	-644840(%rbp), %eax
	movl	%eax, -644820(%rbp)
	jmp	.L49
.L34:
	addl	$1, -644840(%rbp)
.L33:
	cmpl	$400, -644840(%rbp)
	jle	.L37
	jmp	.L36
.L49:
	nop
.L36:
	movl	$400, -644836(%rbp)
	jmp	.L38
.L42:
	movl	-644844(%rbp), %eax
	movslq	%eax, %rdx
	movl	-644836(%rbp), %eax
	cltq
	imulq	$401, %rax, %rax
	addq	%rdx, %rax
	movl	-643216(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L39
	movl	-644824(%rbp), %eax
	cmpl	-644836(%rbp), %eax
	jge	.L50
	movl	-644836(%rbp), %eax
	movl	%eax, -644824(%rbp)
	jmp	.L50
.L39:
	subl	$1, -644836(%rbp)
.L38:
	cmpl	$0, -644836(%rbp)
	jns	.L42
	jmp	.L41
.L50:
	nop
.L41:
	addl	$1, -644844(%rbp)
.L32:
	cmpl	$400, -644844(%rbp)
	jle	.L43
	movl	-644824(%rbp), %eax
	subl	-644820(%rbp), %eax
	leal	1(%rax), %edx
	movl	-644832(%rbp), %eax
	subl	-644828(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-644848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-644848(%rbp), %eax
	testl	%eax, %eax
	jne	.L44
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	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:
