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 n,i,j,k,cnt,max;
    char b[255][255];

    while(scanf("%d",&n),n){
        for(i=0;i<n;i++)scanf("%s",b[i]);
        max=0;

        for(i=0;i<n;i++){
            for(cnt=0,j=0;j<n;j++){
                if(b[i][j]=='1')cnt++;
                else{
                    if(cnt>max)max=cnt;
                    cnt=0;
                }
            }
            if(cnt>max)max=cnt;
        }

        for(i=0;i<n;i++){
            for(cnt=0,j=0;j<n;j++){
                if(b[j][i]=='1')cnt++;
                else{
                    if(cnt>max)max=cnt;
                    cnt=0;
                }
            }
            if(cnt>max)max=cnt;
        }

        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(b[i][j]=='1'){
                    for(cnt=1,k=1;i+k<n&&j+k>=0;k++){
                        if(b[i+k][j+k]!='1')break;
                        cnt++;
                    }
                    if(cnt>max)max=cnt;
                }
            }
        }

        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(b[i][j]=='1'){
                    for(cnt=1,k=1;i+k<n&&j-k>=0;k++){
                        if(b[i+k][j-k]!='1')break;
                        cnt++;
                    }
                    if(cnt>max)max=cnt;
                }
            }
        }
        printf("%d\n",max);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%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	-61440(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3632, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L39:
	movl	$0, -65060(%rbp)
	jmp	.L3
.L4:
	leaq	-65040(%rbp), %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -65060(%rbp)
.L3:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L4
	movl	$0, -65044(%rbp)
	movl	$0, -65060(%rbp)
	jmp	.L5
.L12:
	movl	$0, -65048(%rbp)
	movl	$0, -65056(%rbp)
	jmp	.L6
.L10:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L7
	addl	$1, -65048(%rbp)
	jmp	.L8
.L7:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L9
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L9:
	movl	$0, -65048(%rbp)
.L8:
	addl	$1, -65056(%rbp)
.L6:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L10
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L11
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L11:
	addl	$1, -65060(%rbp)
.L5:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L12
	movl	$0, -65060(%rbp)
	jmp	.L13
.L20:
	movl	$0, -65048(%rbp)
	movl	$0, -65056(%rbp)
	jmp	.L14
.L18:
	movl	-65060(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65056(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L15
	addl	$1, -65048(%rbp)
	jmp	.L16
.L15:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L17
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L17:
	movl	$0, -65048(%rbp)
.L16:
	addl	$1, -65056(%rbp)
.L14:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L18
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L19
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L19:
	addl	$1, -65060(%rbp)
.L13:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L20
	movl	$0, -65060(%rbp)
	jmp	.L21
.L29:
	movl	$0, -65056(%rbp)
	jmp	.L22
.L28:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L23
	movl	$1, -65048(%rbp)
	movl	$1, -65052(%rbp)
	jmp	.L24
.L27:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%edx, %eax
	movl	-65056(%rbp), %ecx
	movl	-65052(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L42
	addl	$1, -65048(%rbp)
	addl	$1, -65052(%rbp)
.L24:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65064(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L26
	movl	-65056(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jns	.L27
	jmp	.L26
.L42:
	nop
.L26:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L23
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L23:
	addl	$1, -65056(%rbp)
.L22:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L28
	addl	$1, -65060(%rbp)
.L21:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L29
	movl	$0, -65060(%rbp)
	jmp	.L30
.L38:
	movl	$0, -65056(%rbp)
	jmp	.L31
.L37:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L32
	movl	$1, -65048(%rbp)
	movl	$1, -65052(%rbp)
	jmp	.L33
.L36:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65056(%rbp), %eax
	subl	-65052(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L43
	addl	$1, -65048(%rbp)
	addl	$1, -65052(%rbp)
.L33:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65064(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L35
	movl	-65056(%rbp), %eax
	subl	-65052(%rbp), %eax
	testl	%eax, %eax
	jns	.L36
	jmp	.L35
.L43:
	nop
.L35:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L32
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L32:
	addl	$1, -65056(%rbp)
.L31:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L37
	addl	$1, -65060(%rbp)
.L30:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L38
	movl	-65044(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-65064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-65064(%rbp), %eax
	testl	%eax, %eax
	jne	.L39
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	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	"%s"
.LC1:
	.string	"%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	-61440(%rsp), %r11
	.cfi_def_cfa 11, 61496
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3656, %rsp
	.cfi_def_cfa_offset 65152
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 65080(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	49(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	16(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L25
	movq	8(%rsp), %r13
	movl	$0, %ebp
	movq	%r13, %r12
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %edi
	addq	$255, %r13
	cmpl	%ebp, %edi
	jg	.L3
	testl	%edi, %edi
	jle	.L4
	movq	24(%rsp), %rax
	leal	-1(%rdi), %r9d
	movq	8(%rsp), %rdx
	leaq	(%rax,%r9), %rsi
	movq	%r9, %rax
	salq	$8, %rax
	leaq	256(%rdx,%rax), %r8
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rsi, %rax
	xorl	%ecx, %ecx
	subq	%r9, %rax
	subq	$1, %rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L49:
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$1, %rax
	xorl	%ecx, %ecx
	cmpq	%rsi, %rax
	je	.L48
.L7:
	cmpb	$49, (%rax)
	jne	.L49
	addq	$1, %rax
	addl	$1, %ecx
	cmpq	%rsi, %rax
	jne	.L7
.L48:
	cmpl	%ecx, %edx
	leaq	255(%rax), %rsi
	cmovl	%ecx, %edx
	cmpq	%r8, %rsi
	jne	.L8
	movq	8(%rsp), %rsi
	movq	%r9, %rax
	salq	$8, %rax
	subq	%r9, %rax
	leaq	255(%rsi), %r14
	movq	$-255, %r9
	leaq	(%r14,%rax), %rsi
	subq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%r9,%rsi), %rax
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L51:
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$255, %rax
	xorl	%ecx, %ecx
	cmpq	%rsi, %rax
	je	.L50
.L11:
	cmpb	$49, (%rax)
	jne	.L51
	addq	$255, %rax
	addl	$1, %ecx
	cmpq	%rsi, %rax
	jne	.L11
.L50:
	cmpl	%ecx, %edx
	leaq	1(%rax), %rsi
	cmovl	%ecx, %edx
	cmpq	%r8, %rsi
	jne	.L12
	movq	8(%rsp), %r10
	movl	$1, %ebp
	xorl	%r9d, %r9d
	movl	%edi, %r11d
	.p2align 4,,10
	.p2align 3
.L13:
	xorl	%ecx, %ecx
	leaq	256(%r10), %r13
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$1, %rcx
	cmpq	%r11, %rcx
	je	.L52
.L18:
	cmpb	$49, (%r10,%rcx)
	jne	.L14
	cmpl	%ebp, %edi
	jle	.L28
	leaq	0(%r13,%rcx), %rsi
	movl	$1, %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %eax
	addq	$256, %rsi
	leal	(%rax,%r9), %r8d
	cmpl	%r8d, %edi
	jle	.L15
.L16:
	cmpb	$49, (%rsi)
	je	.L17
.L15:
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L56:
	addq	$1, %rcx
	cmpq	%r11, %rcx
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %r9d
	addl	$1, %ebp
	addq	$255, %r10
	cmpl	%r9d, %edi
	jne	.L13
	movl	$1, %r13d
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$-1, %r10d
	xorl	%ecx, %ecx
	leaq	254(%r12), %r15
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rcx
	addl	$1, %r10d
	cmpq	%r11, %rcx
	je	.L53
.L23:
	cmpb	$49, (%r12,%rcx)
	movl	%ecx, %r9d
	jne	.L20
	cmpl	%r13d, %edi
	jle	.L31
	cmpl	$-1, %r10d
	je	.L31
	leaq	(%r15,%rcx), %rsi
	movl	$1, %eax
	addl	$1, %r9d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L54:
	addl	$1, %eax
	leal	(%rax,%rbp), %r8d
	cmpl	%r8d, %edi
	jle	.L21
	addq	$254, %rsi
	cmpl	%r9d, %eax
	je	.L21
.L22:
	cmpb	$49, (%rsi)
	je	.L54
.L21:
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L55:
	addq	$1, %rcx
	addl	$1, %r10d
	cmpq	%r11, %rcx
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L53:
	addl	$1, %ebp
	addl	$1, %r13d
	movq	%r14, %r12
	cmpl	%ebp, %edi
	je	.L24
	addq	$255, %r14
	jmp	.L19
.L4:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L31:
	movl	$1, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	jmp	.L55
.L28:
	movl	$1, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	jmp	.L56
.L25:
	movq	65080(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$65096, %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
.L57:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%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	-61440(%rsp), %r11
	.cfi_def_cfa 11, 61496
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3656, %rsp
	.cfi_def_cfa_offset 65152
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 65080(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	49(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	16(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L25
	movq	8(%rsp), %r13
	movl	$0, %ebp
	movq	%r13, %r12
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %edi
	addq	$255, %r13
	cmpl	%ebp, %edi
	jg	.L3
	testl	%edi, %edi
	jle	.L4
	movq	24(%rsp), %rax
	leal	-1(%rdi), %r9d
	movq	8(%rsp), %rdx
	leaq	(%rax,%r9), %rsi
	movq	%r9, %rax
	salq	$8, %rax
	leaq	256(%rdx,%rax), %r8
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rsi, %rax
	xorl	%ecx, %ecx
	subq	%r9, %rax
	subq	$1, %rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L49:
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$1, %rax
	xorl	%ecx, %ecx
	cmpq	%rsi, %rax
	je	.L48
.L7:
	cmpb	$49, (%rax)
	jne	.L49
	addq	$1, %rax
	addl	$1, %ecx
	cmpq	%rsi, %rax
	jne	.L7
.L48:
	cmpl	%ecx, %edx
	leaq	255(%rax), %rsi
	cmovl	%ecx, %edx
	cmpq	%r8, %rsi
	jne	.L8
	movq	8(%rsp), %rsi
	movq	%r9, %rax
	salq	$8, %rax
	subq	%r9, %rax
	leaq	255(%rsi), %r14
	movq	$-255, %r9
	leaq	(%r14,%rax), %rsi
	subq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	(%r9,%rsi), %rax
	xorl	%ecx, %ecx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L51:
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addq	$255, %rax
	xorl	%ecx, %ecx
	cmpq	%rsi, %rax
	je	.L50
.L11:
	cmpb	$49, (%rax)
	jne	.L51
	addq	$255, %rax
	addl	$1, %ecx
	cmpq	%rsi, %rax
	jne	.L11
.L50:
	cmpl	%ecx, %edx
	leaq	1(%rax), %rsi
	cmovl	%ecx, %edx
	cmpq	%r8, %rsi
	jne	.L12
	movq	8(%rsp), %r10
	movl	$1, %ebp
	xorl	%r9d, %r9d
	movl	%edi, %r11d
	.p2align 4,,10
	.p2align 3
.L13:
	xorl	%ecx, %ecx
	leaq	256(%r10), %r13
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$1, %rcx
	cmpq	%r11, %rcx
	je	.L52
.L18:
	cmpb	$49, (%r10,%rcx)
	jne	.L14
	cmpl	%ebp, %edi
	jle	.L28
	leaq	0(%r13,%rcx), %rsi
	movl	$1, %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %eax
	addq	$256, %rsi
	leal	(%rax,%r9), %r8d
	cmpl	%r8d, %edi
	jle	.L15
.L16:
	cmpb	$49, (%rsi)
	je	.L17
.L15:
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L56:
	addq	$1, %rcx
	cmpq	%r11, %rcx
	jne	.L18
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %r9d
	addl	$1, %ebp
	addq	$255, %r10
	cmpl	%r9d, %edi
	jne	.L13
	movl	$1, %r13d
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$-1, %r10d
	xorl	%ecx, %ecx
	leaq	254(%r12), %r15
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rcx
	addl	$1, %r10d
	cmpq	%r11, %rcx
	je	.L53
.L23:
	cmpb	$49, (%r12,%rcx)
	movl	%ecx, %r9d
	jne	.L20
	cmpl	%r13d, %edi
	jle	.L31
	cmpl	$-1, %r10d
	je	.L31
	leaq	(%r15,%rcx), %rsi
	movl	$1, %eax
	addl	$1, %r9d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L54:
	addl	$1, %eax
	leal	(%rax,%rbp), %r8d
	cmpl	%r8d, %edi
	jle	.L21
	addq	$254, %rsi
	cmpl	%r9d, %eax
	je	.L21
.L22:
	cmpb	$49, (%rsi)
	je	.L54
.L21:
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L55:
	addq	$1, %rcx
	addl	$1, %r10d
	cmpq	%r11, %rcx
	jne	.L23
	.p2align 4,,10
	.p2align 3
.L53:
	addl	$1, %ebp
	addl	$1, %r13d
	movq	%r14, %r12
	cmpl	%ebp, %edi
	je	.L24
	addq	$255, %r14
	jmp	.L19
.L4:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L24:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L31:
	movl	$1, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	jmp	.L55
.L28:
	movl	$1, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	jmp	.L56
.L25:
	movq	65080(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$65096, %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
.L57:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

int main(){
    int n,i,j,k,cnt,max;
    char b[255][255];

    while(scanf("%d",&n),n){
        for(i=0;i<n;i++)scanf("%s",b[i]);
        max=0;

        for(i=0;i<n;i++){
            for(cnt=0,j=0;j<n;j++){
                if(b[i][j]=='1')cnt++;
                else{
                    if(cnt>max)max=cnt;
                    cnt=0;
                }
            }
            if(cnt>max)max=cnt;
        }

        for(i=0;i<n;i++){
            for(cnt=0,j=0;j<n;j++){
                if(b[j][i]=='1')cnt++;
                else{
                    if(cnt>max)max=cnt;
                    cnt=0;
                }
            }
            if(cnt>max)max=cnt;
        }

        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(b[i][j]=='1'){
                    for(cnt=1,k=1;i+k<n&&j+k>=0;k++){
                        if(b[i+k][j+k]!='1')break;
                        cnt++;
                    }
                    if(cnt>max)max=cnt;
                }
            }
        }

        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(b[i][j]=='1'){
                    for(cnt=1,k=1;i+k<n&&j-k>=0;k++){
                        if(b[i+k][j-k]!='1')break;
                        cnt++;
                    }
                    if(cnt>max)max=cnt;
                }
            }
        }
        printf("%d\n",max);
    }
    return 0;
}
5
00011
00101
01000
10101
00010
8
11000001
10110111
01100111
01111010
11111111
01001010
10100010
10000001
2
01
00
3
000
000
000
0
 5
01011
00101
01000
10101
00010
8
11000001
10110111
01100111
01111010
11111111
01001010
10100000
10000001
0
01
00
3
000
000
000
0
 5
01011
00101
01100
10101
00010
8
11000001
10110111
01100111
10111010
10111111
01001010
10100000
10000000
0
01
00
3
001
100
000
0
 5
01011
00000
01000
10101
01010
8
11010001
10110111
01100011
01111010
11111111
01101000
10100010
10000101
0
0
1
6
000
100
000
0
 5
01011
10000
01000
10001
01010
8
11010001
10110111
01100011
01111010
11111111
01101000
10100010
10000101
0
0
1
6
000
100
000
0
 5
00011
00101
01000
10101
00010
8
11000001
10110111
01100111
01111010
11111111
01001010
10100010
10000001
2
01
00
3
000
010
000
0
 5
01011
00100
01000
10101
01010
8
11010001
10110111
01100111
01111010
11011111
01001010
10100000
10000001
0
0
1
3
000
000
000
0
 5
01011
00101
01000
10101
00010
8
11000001
10110111
01100111
01111010
11111111
01001010
10100010
10000001
2
01
00
3
000
011
000
0
 5
01011
00101
01000
10101
00010
8
11100001
10110111
01100111
01111010
11111111
01000010
10100000
10000001
2
01
00
0
000
000
000
0
 5
01010
00101
01000
10101
00010
8
10000001
10110111
01100011
01111010
11111110
01001010
10110000
10000001
0
0
00
1
000
010
100
0

4
8
1
0
 4
8
 4
6
 3
8
 2
8
 4
8
1
1
 4
5
 4
8
1
2
 4
8
1
 4
7

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 n,i,j,k,cnt,max;
    char b[255][255];

    while(scanf("%d",&n),n){
        for(i=0;i<n;i++)scanf("%s",b[i]);
        max=0;

        for(i=0;i<n;i++){
            for(cnt=0,j=0;j<n;j++){
                if(b[i][j]=='1')cnt++;
                else{
                    if(cnt>max)max=cnt;
                    cnt=0;
                }
            }
            if(cnt>max)max=cnt;
        }

        for(i=0;i<n;i++){
            for(cnt=0,j=0;j<n;j++){
                if(b[j][i]=='1')cnt++;
                else{
                    if(cnt>max)max=cnt;
                    cnt=0;
                }
            }
            if(cnt>max)max=cnt;
        }

        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(b[i][j]=='1'){
                    for(cnt=1,k=1;i+k<n&&j+k>=0;k++){
                        if(b[i+k][j+k]!='1')break;
                        cnt++;
                    }
                    if(cnt>max)max=cnt;
                }
            }
        }

        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if(b[i][j]=='1'){
                    for(cnt=1,k=1;i+k<n&&j-k>=0;k++){
                        if(b[i+k][j-k]!='1')break;
                        cnt++;
                    }
                    if(cnt>max)max=cnt;
                }
            }
        }
        printf("%d\n",max);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%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	-61440(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3632, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L39:
	movl	$0, -65060(%rbp)
	jmp	.L3
.L4:
	leaq	-65040(%rbp), %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -65060(%rbp)
.L3:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L4
	movl	$0, -65044(%rbp)
	movl	$0, -65060(%rbp)
	jmp	.L5
.L12:
	movl	$0, -65048(%rbp)
	movl	$0, -65056(%rbp)
	jmp	.L6
.L10:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L7
	addl	$1, -65048(%rbp)
	jmp	.L8
.L7:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L9
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L9:
	movl	$0, -65048(%rbp)
.L8:
	addl	$1, -65056(%rbp)
.L6:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L10
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L11
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L11:
	addl	$1, -65060(%rbp)
.L5:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L12
	movl	$0, -65060(%rbp)
	jmp	.L13
.L20:
	movl	$0, -65048(%rbp)
	movl	$0, -65056(%rbp)
	jmp	.L14
.L18:
	movl	-65060(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65056(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L15
	addl	$1, -65048(%rbp)
	jmp	.L16
.L15:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L17
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L17:
	movl	$0, -65048(%rbp)
.L16:
	addl	$1, -65056(%rbp)
.L14:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L18
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L19
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L19:
	addl	$1, -65060(%rbp)
.L13:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L20
	movl	$0, -65060(%rbp)
	jmp	.L21
.L29:
	movl	$0, -65056(%rbp)
	jmp	.L22
.L28:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L23
	movl	$1, -65048(%rbp)
	movl	$1, -65052(%rbp)
	jmp	.L24
.L27:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%edx, %eax
	movl	-65056(%rbp), %ecx
	movl	-65052(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L42
	addl	$1, -65048(%rbp)
	addl	$1, -65052(%rbp)
.L24:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65064(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L26
	movl	-65056(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jns	.L27
	jmp	.L26
.L42:
	nop
.L26:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L23
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L23:
	addl	$1, -65056(%rbp)
.L22:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L28
	addl	$1, -65060(%rbp)
.L21:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L29
	movl	$0, -65060(%rbp)
	jmp	.L30
.L38:
	movl	$0, -65056(%rbp)
	jmp	.L31
.L37:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L32
	movl	$1, -65048(%rbp)
	movl	$1, -65052(%rbp)
	jmp	.L33
.L36:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65056(%rbp), %eax
	subl	-65052(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L43
	addl	$1, -65048(%rbp)
	addl	$1, -65052(%rbp)
.L33:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65064(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L35
	movl	-65056(%rbp), %eax
	subl	-65052(%rbp), %eax
	testl	%eax, %eax
	jns	.L36
	jmp	.L35
.L43:
	nop
.L35:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L32
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L32:
	addl	$1, -65056(%rbp)
.L31:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L37
	addl	$1, -65060(%rbp)
.L30:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L38
	movl	-65044(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-65064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-65064(%rbp), %eax
	testl	%eax, %eax
	jne	.L39
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	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	"%s"
.LC1:
	.string	"%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	-61440(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3632, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L39:
	movl	$0, -65060(%rbp)
	jmp	.L3
.L4:
	leaq	-65040(%rbp), %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -65060(%rbp)
.L3:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L4
	movl	$0, -65044(%rbp)
	movl	$0, -65060(%rbp)
	jmp	.L5
.L12:
	movl	$0, -65048(%rbp)
	movl	$0, -65056(%rbp)
	jmp	.L6
.L10:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L7
	addl	$1, -65048(%rbp)
	jmp	.L8
.L7:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L9
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L9:
	movl	$0, -65048(%rbp)
.L8:
	addl	$1, -65056(%rbp)
.L6:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L10
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L11
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L11:
	addl	$1, -65060(%rbp)
.L5:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L12
	movl	$0, -65060(%rbp)
	jmp	.L13
.L20:
	movl	$0, -65048(%rbp)
	movl	$0, -65056(%rbp)
	jmp	.L14
.L18:
	movl	-65060(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65056(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L15
	addl	$1, -65048(%rbp)
	jmp	.L16
.L15:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L17
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L17:
	movl	$0, -65048(%rbp)
.L16:
	addl	$1, -65056(%rbp)
.L14:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L18
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L19
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L19:
	addl	$1, -65060(%rbp)
.L13:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L20
	movl	$0, -65060(%rbp)
	jmp	.L21
.L29:
	movl	$0, -65056(%rbp)
	jmp	.L22
.L28:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L23
	movl	$1, -65048(%rbp)
	movl	$1, -65052(%rbp)
	jmp	.L24
.L27:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%edx, %eax
	movl	-65056(%rbp), %ecx
	movl	-65052(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L42
	addl	$1, -65048(%rbp)
	addl	$1, -65052(%rbp)
.L24:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65064(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L26
	movl	-65056(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jns	.L27
	jmp	.L26
.L42:
	nop
.L26:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L23
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L23:
	addl	$1, -65056(%rbp)
.L22:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L28
	addl	$1, -65060(%rbp)
.L21:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L29
	movl	$0, -65060(%rbp)
	jmp	.L30
.L38:
	movl	$0, -65056(%rbp)
	jmp	.L31
.L37:
	movl	-65056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-65060(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L32
	movl	$1, -65048(%rbp)
	movl	$1, -65052(%rbp)
	jmp	.L33
.L36:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65056(%rbp), %eax
	subl	-65052(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$8, %rax
	subq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$65040, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L43
	addl	$1, -65048(%rbp)
	addl	$1, -65052(%rbp)
.L33:
	movl	-65060(%rbp), %edx
	movl	-65052(%rbp), %eax
	addl	%eax, %edx
	movl	-65064(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L35
	movl	-65056(%rbp), %eax
	subl	-65052(%rbp), %eax
	testl	%eax, %eax
	jns	.L36
	jmp	.L35
.L43:
	nop
.L35:
	movl	-65048(%rbp), %eax
	cmpl	-65044(%rbp), %eax
	jle	.L32
	movl	-65048(%rbp), %eax
	movl	%eax, -65044(%rbp)
.L32:
	addl	$1, -65056(%rbp)
.L31:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65056(%rbp)
	jl	.L37
	addl	$1, -65060(%rbp)
.L30:
	movl	-65064(%rbp), %eax
	cmpl	%eax, -65060(%rbp)
	jl	.L38
	movl	-65044(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-65064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-65064(%rbp), %eax
	testl	%eax, %eax
	jne	.L39
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	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:
