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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define min3(a,b,c) min(min(a,b),c)

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(char *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        int num;
        scanf("%d", &num);
        arr[i] = num;
    }
    return 0;
}

#define NUM_MAX 1400

struct rect {
    int height;
    int pos;
};
static struct rect stack[NUM_MAX+1];
static int idx = 0;

void init_stack(void) { idx=0; }
int is_empty(void) {
    return idx==0;
}

void push(struct rect r) {
    stack[idx++] = r;
}

struct rect pop(void) {
    return stack[--idx];
}

struct rect peek(void) {
    return stack[idx-1];
}

int main(void) {
    int height, width;
    get_int2(&height, &width);
    static char mat[NUM_MAX+1][NUM_MAX+1];
    int i, j;
    for(i = 1; i <= height; i++) {
        fget_array(&mat[i][1], width);
        // 0: dirty, 1: clean(usable)
        for(j = 1; j <= width; j++) mat[i][j] = 1-mat[i][j];
    }

    static int hist[NUM_MAX+2][NUM_MAX+2];
    for(i = 1; i <= height; i++) {
        for(j = 1; j <= width; j++) {
            if(!mat[i][j]) {
                hist[i][j] = 0;
            } else {
                hist[i][j] = hist[i-1][j] + 1;
            }
        }
        hist[i][width+1] = 0;
    }
#ifdef DEBUG
    for(i = 1; i <= height; i++) {
        for(j = 1; j <= width; j++) {
            printf(" %d", hist[i][j]);
        }
        putchar('\n');
    }
#endif

    int ans = 0;
    for(i = 1; i <= height; i++) {
        init_stack();
        for(j = 1; j <= width+1; j++) {
            struct rect cur = {hist[i][j], j};
            while(!is_empty()) {
                struct rect pr = peek();
                if(pr.height < cur.height) break;
#ifdef DEBUG
                printf("(%d, %d) height: %d, width: %d\n", i, j, pr.height, j-pr.pos);
#endif
                ans = max(ans, (j-pr.pos)*pr.height);
                cur.pos = pr.pos; // update smaller
                pop();
            }
            push(cur);
        }
    }
    printf("%d\n", ans);

    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.local	stack
	.comm	stack,11208,32
	.local	idx
	.comm	idx,4,4
	.globl	init_stack
	.type	init_stack, @function
init_stack:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, idx(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	init_stack, .-init_stack
	.globl	is_empty
	.type	is_empty, @function
is_empty:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	is_empty, .-is_empty
	.globl	push
	.type	push, @function
push:
.LFB10:
	.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	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	stack(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	subl	$1, %eax
	movl	%eax, idx(%rip)
	movl	idx(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	stack(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	pop, .-pop
	.globl	peek
	.type	peek, @function
peek:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	stack(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	peek, .-peek
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	$1, -36(%rbp)
	jmp	.L17
.L20:
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1401, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	mat.1(%rip), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	fget_array
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rdx
	leaq	mat.1(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movl	%eax, %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rcx
	leaq	mat.1(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -32(%rbp)
.L18:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	addl	$1, -36(%rbp)
.L17:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L20
	movl	$1, -36(%rbp)
	jmp	.L21
.L26:
	movl	$1, -32(%rbp)
	jmp	.L22
.L25:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rdx
	leaq	mat.1(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L23
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	$0, (%rdx,%rax)
	jmp	.L24
.L23:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L24:
	addl	$1, -32(%rbp)
.L22:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L25
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L21:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L26
	movl	$0, -28(%rbp)
	movl	$1, -36(%rbp)
	jmp	.L27
.L34:
	call	init_stack
	movl	$1, -32(%rbp)
	jmp	.L28
.L33:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L29
.L32:
	call	peek
	movq	%rax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L37
	movl	-12(%rbp), %ecx
	movl	-32(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	%edx, %eax
	movl	-28(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	call	pop
.L29:
	call	is_empty
	testl	%eax, %eax
	je	.L32
	jmp	.L31
.L37:
	nop
.L31:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	push
	addl	$1, -32(%rbp)
.L28:
	movl	-40(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jle	.L33
	addl	$1, -36(%rbp)
.L27:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L34
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	mat.1
	.comm	mat.1,1962801,32
	.local	hist.0
	.comm	hist.0,7862416,32
	.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"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.text
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	testl	%esi, %esi
	jle	.L5
	leal	-1(%rsi), %eax
	movq	%rdi, %rbx
	leaq	4(%rsp), %r12
	leaq	1(%rdi,%rax), %r13
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movb	%al, -1(%rbx)
	cmpq	%r13, %rbx
	jne	.L6
.L5:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.p2align 4
	.globl	init_stack
	.type	init_stack, @function
init_stack:
.LFB53:
	.cfi_startproc
	endbr64
	movl	$0, idx(%rip)
	ret
	.cfi_endproc
.LFE53:
	.size	init_stack, .-init_stack
	.p2align 4
	.globl	is_empty
	.type	is_empty, @function
is_empty:
.LFB54:
	.cfi_startproc
	endbr64
	movl	idx(%rip), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	sete	%al
	ret
	.cfi_endproc
.LFE54:
	.size	is_empty, .-is_empty
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB55:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	leaq	stack(%rip), %rdx
	movq	%rdi, (%rdx,%rax,8)
	ret
	.cfi_endproc
.LFE55:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB56:
	.cfi_startproc
	endbr64
	movl	idx(%rip), %eax
	leaq	stack(%rip), %rdx
	subl	$1, %eax
	movl	%eax, idx(%rip)
	cltq
	movq	(%rdx,%rax,8), %rax
	ret
	.cfi_endproc
.LFE56:
	.size	pop, .-pop
	.p2align 4
	.globl	peek
	.type	peek, @function
peek:
.LFB57:
	.cfi_startproc
	endbr64
	movl	idx(%rip), %eax
	leaq	stack(%rip), %rdx
	subl	$1, %eax
	cltq
	movq	(%rdx,%rax,8), %rax
	ret
	.cfi_endproc
.LFE57:
	.size	peek, .-peek
	.section	.rodata.str1.1
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.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	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L17
	leaq	1402+mat.1(%rip), %r13
	movl	32(%rsp), %r11d
	movl	$1, (%rsp)
	leaq	36(%rsp), %r12
	leaq	-1402(%r13), %r15
	movq	%r13, %rax
	leaq	.LC1(%rip), %rbp
	subq	%r15, %rax
	movq	%rax, 8(%rsp)
	testl	%r11d, %r11d
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L58:
	leal	-1(%r11), %eax
	movq	%r13, %r14
	leaq	1(%r13,%rax), %rbx
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r14
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movb	%al, -1(%r14)
	cmpq	%rbx, %r14
	jne	.L19
	movl	32(%rsp), %r11d
	movl	28(%rsp), %edx
	testl	%r11d, %r11d
	jle	.L20
	leal	-1(%r11), %eax
	cmpl	$14, %eax
	jbe	.L46
	movl	%r11d, %ecx
	movq	%r13, %rax
	shrl	$4, %ecx
	salq	$4, %rcx
	addq	%r13, %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movdqu	(%rax), %xmm3
	movdqa	.LC2(%rip), %xmm0
	addq	$16, %rax
	psubb	%xmm3, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L22
	movl	%r11d, %eax
	andl	$-16, %eax
	leal	1(%rax), %ecx
	cmpl	%eax, %r11d
	je	.L20
.L21:
	movl	%r11d, %esi
	subl	%eax, %esi
	leal	-1(%rsi), %edi
	cmpl	$6, %edi
	jbe	.L24
	movq	.LC3(%rip), %xmm0
	addq	8(%rsp), %rax
	addq	%r15, %rax
	movq	(%rax), %xmm1
	psubb	%xmm1, %xmm0
	movq	%xmm0, (%rax)
	movl	%esi, %eax
	andl	$-8, %eax
	addl	%eax, %ecx
	cmpl	%eax, %esi
	je	.L20
.L24:
	movslq	(%rsp), %rax
	movslq	%ecx, %rsi
	movl	$1, %edi
	movl	%edi, %r8d
	imulq	$1401, %rax, %rax
	addq	%r15, %rax
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	1(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	2(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	3(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	4(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	5(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addl	$6, %ecx
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	cmpl	%ecx, %r11d
	jl	.L20
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	subb	(%rax), %dil
	movb	%dil, (%rax)
.L20:
	addl	$1, (%rsp)
	movl	(%rsp), %eax
	cmpl	%eax, %edx
	jl	.L44
	addq	$1401, %r13
	movq	%r13, %rax
	subq	%r15, %rax
	movq	%rax, 8(%rsp)
	testl	%r11d, %r11d
	jg	.L58
.L18:
	cmpl	(%rsp), %edx
	jle	.L44
.L26:
	leal	-1(%rdx), %eax
	leaq	5608+hist.0(%rip), %r13
	imulq	$5608, %rax, %rax
	leaq	-5608(%r13), %r8
	movq	%r13, %rcx
	leaq	11216(%r8), %rdx
	leal	1(%r11), %r9d
	leal	-1(%r11), %edi
	leaq	1401+mat.1(%rip), %rsi
	movslq	%r9d, %r9
	leaq	(%rax,%rdx), %r10
	addq	$2, %rdi
	movq	%r10, (%rsp)
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$1, %eax
	testl	%r11d, %r11d
	jle	.L30
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$0, (%rsi,%rax)
	je	.L28
	movl	(%r8,%rax,4), %ebx
	leal	1(%rbx), %edx
	movl	%edx, (%rcx,%rax,4)
	addq	$1, %rax
	cmpq	%rax, %rdi
	jne	.L31
.L30:
	movl	$0, (%rcx,%r9,4)
	addq	$5608, %rcx
	addq	$5608, %r8
	addq	$1401, %rsi
	cmpq	%r10, %rcx
	jne	.L27
	leaq	stack(%rip), %r14
	leal	-1(%r11), %r15d
	xorl	%r8d, %r8d
	leaq	-8(%r14), %rbp
	addq	$3, %r15
	leaq	4(%rbp), %rbx
	.p2align 4,,10
	.p2align 3
.L32:
	xorl	%eax, %eax
	testl	%r11d, %r11d
	js	.L35
	movl	4(%r13), %eax
	movl	$2, %r12d
	movl	$1, 4+stack(%rip)
	movl	%eax, (%r14)
	movl	$1, %eax
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L38:
	movl	0(%r13,%r12,4), %esi
	movl	%r12d, %edi
	testl	%eax, %eax
	je	.L48
	cltq
	movl	%r12d, %ecx
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L60:
	movl	%edi, %edx
	subl	%ecx, %edx
	imull	%r10d, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	subq	$1, %rax
	movslq	%eax, %rdx
	testl	%eax, %eax
	je	.L59
.L37:
	movl	0(%rbp,%rax,8), %r10d
	movl	%ecx, %r9d
	movslq	%eax, %rdx
	movl	(%rbx,%rax,8), %ecx
	cmpl	%r10d, %esi
	jle	.L60
.L36:
	movd	%esi, %xmm0
	movd	%r9d, %xmm2
	leal	1(%rdx), %eax
	addq	$1, %r12
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, (%r14,%rdx,8)
	cmpq	%r15, %r12
	jne	.L38
.L35:
	addq	$5608, %r13
	cmpq	(%rsp), %r13
	jne	.L32
	movl	%eax, idx(%rip)
.L39:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	movl	$0, (%rcx,%rax,4)
	addq	$1, %rax
	cmpq	%rax, %rdi
	jne	.L31
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%ecx, %r9d
	jmp	.L36
.L46:
	xorl	%eax, %eax
	movl	$1, %ecx
	jmp	.L21
.L44:
	testl	%edx, %edx
	jg	.L26
.L17:
	xorl	%r8d, %r8d
	jmp	.L39
.L61:
	call	__stack_chk_fail@PLT
.L48:
	movl	%r12d, %r9d
	xorl	%edx, %edx
	jmp	.L36
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	hist.0
	.comm	hist.0,7862416,32
	.local	mat.1
	.comm	mat.1,1962801,32
	.local	idx
	.comm	idx,4,4
	.local	stack
	.comm	stack,11208,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.set	.LC3,.LC2
	.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"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.text
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	testl	%esi, %esi
	jle	.L5
	leal	-1(%rsi), %eax
	movq	%rdi, %rbx
	leaq	4(%rsp), %r12
	leaq	1(%rdi,%rax), %r13
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movb	%al, -1(%rbx)
	cmpq	%r13, %rbx
	jne	.L6
.L5:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.p2align 4
	.globl	init_stack
	.type	init_stack, @function
init_stack:
.LFB53:
	.cfi_startproc
	endbr64
	movl	$0, idx(%rip)
	ret
	.cfi_endproc
.LFE53:
	.size	init_stack, .-init_stack
	.p2align 4
	.globl	is_empty
	.type	is_empty, @function
is_empty:
.LFB54:
	.cfi_startproc
	endbr64
	movl	idx(%rip), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	sete	%al
	ret
	.cfi_endproc
.LFE54:
	.size	is_empty, .-is_empty
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB55:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	leaq	stack(%rip), %rdx
	movq	%rdi, (%rdx,%rax,8)
	ret
	.cfi_endproc
.LFE55:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB56:
	.cfi_startproc
	endbr64
	movl	idx(%rip), %eax
	leaq	stack(%rip), %rdx
	subl	$1, %eax
	movl	%eax, idx(%rip)
	cltq
	movq	(%rdx,%rax,8), %rax
	ret
	.cfi_endproc
.LFE56:
	.size	pop, .-pop
	.p2align 4
	.globl	peek
	.type	peek, @function
peek:
.LFB57:
	.cfi_startproc
	endbr64
	movl	idx(%rip), %eax
	leaq	stack(%rip), %rdx
	subl	$1, %eax
	cltq
	movq	(%rdx,%rax,8), %rax
	ret
	.cfi_endproc
.LFE57:
	.size	peek, .-peek
	.section	.rodata.str1.1
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.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	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %edx
	testl	%edx, %edx
	jle	.L17
	leaq	1402+mat.1(%rip), %r13
	movl	32(%rsp), %r11d
	movl	$1, (%rsp)
	leaq	36(%rsp), %r12
	leaq	-1402(%r13), %r15
	movq	%r13, %rax
	leaq	.LC1(%rip), %rbp
	subq	%r15, %rax
	movq	%rax, 8(%rsp)
	testl	%r11d, %r11d
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L58:
	leal	-1(%r11), %eax
	movq	%r13, %r14
	leaq	1(%r13,%rax), %rbx
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r14
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movb	%al, -1(%r14)
	cmpq	%rbx, %r14
	jne	.L19
	movl	32(%rsp), %r11d
	movl	28(%rsp), %edx
	testl	%r11d, %r11d
	jle	.L20
	leal	-1(%r11), %eax
	cmpl	$14, %eax
	jbe	.L46
	movl	%r11d, %ecx
	movq	%r13, %rax
	shrl	$4, %ecx
	salq	$4, %rcx
	addq	%r13, %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movdqu	(%rax), %xmm3
	movdqa	.LC2(%rip), %xmm0
	addq	$16, %rax
	psubb	%xmm3, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L22
	movl	%r11d, %eax
	andl	$-16, %eax
	leal	1(%rax), %ecx
	cmpl	%eax, %r11d
	je	.L20
.L21:
	movl	%r11d, %esi
	subl	%eax, %esi
	leal	-1(%rsi), %edi
	cmpl	$6, %edi
	jbe	.L24
	movq	.LC3(%rip), %xmm0
	addq	8(%rsp), %rax
	addq	%r15, %rax
	movq	(%rax), %xmm1
	psubb	%xmm1, %xmm0
	movq	%xmm0, (%rax)
	movl	%esi, %eax
	andl	$-8, %eax
	addl	%eax, %ecx
	cmpl	%eax, %esi
	je	.L20
.L24:
	movslq	(%rsp), %rax
	movslq	%ecx, %rsi
	movl	$1, %edi
	movl	%edi, %r8d
	imulq	$1401, %rax, %rax
	addq	%r15, %rax
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	1(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	2(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	3(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	4(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	leal	5(%rcx), %esi
	cmpl	%esi, %r11d
	jl	.L20
	movslq	%esi, %rsi
	movl	%edi, %r8d
	addl	$6, %ecx
	addq	%rax, %rsi
	subb	(%rsi), %r8b
	movb	%r8b, (%rsi)
	cmpl	%ecx, %r11d
	jl	.L20
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	subb	(%rax), %dil
	movb	%dil, (%rax)
.L20:
	addl	$1, (%rsp)
	movl	(%rsp), %eax
	cmpl	%eax, %edx
	jl	.L44
	addq	$1401, %r13
	movq	%r13, %rax
	subq	%r15, %rax
	movq	%rax, 8(%rsp)
	testl	%r11d, %r11d
	jg	.L58
.L18:
	cmpl	(%rsp), %edx
	jle	.L44
.L26:
	leal	-1(%rdx), %eax
	leaq	5608+hist.0(%rip), %r13
	imulq	$5608, %rax, %rax
	leaq	-5608(%r13), %r8
	movq	%r13, %rcx
	leaq	11216(%r8), %rdx
	leal	1(%r11), %r9d
	leal	-1(%r11), %edi
	leaq	1401+mat.1(%rip), %rsi
	movslq	%r9d, %r9
	leaq	(%rax,%rdx), %r10
	addq	$2, %rdi
	movq	%r10, (%rsp)
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$1, %eax
	testl	%r11d, %r11d
	jle	.L30
	.p2align 4,,10
	.p2align 3
.L31:
	cmpb	$0, (%rsi,%rax)
	je	.L28
	movl	(%r8,%rax,4), %ebx
	leal	1(%rbx), %edx
	movl	%edx, (%rcx,%rax,4)
	addq	$1, %rax
	cmpq	%rax, %rdi
	jne	.L31
.L30:
	movl	$0, (%rcx,%r9,4)
	addq	$5608, %rcx
	addq	$5608, %r8
	addq	$1401, %rsi
	cmpq	%r10, %rcx
	jne	.L27
	leaq	stack(%rip), %r14
	leal	-1(%r11), %r15d
	xorl	%r8d, %r8d
	leaq	-8(%r14), %rbp
	addq	$3, %r15
	leaq	4(%rbp), %rbx
	.p2align 4,,10
	.p2align 3
.L32:
	xorl	%eax, %eax
	testl	%r11d, %r11d
	js	.L35
	movl	4(%r13), %eax
	movl	$2, %r12d
	movl	$1, 4+stack(%rip)
	movl	%eax, (%r14)
	movl	$1, %eax
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L38:
	movl	0(%r13,%r12,4), %esi
	movl	%r12d, %edi
	testl	%eax, %eax
	je	.L48
	cltq
	movl	%r12d, %ecx
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L60:
	movl	%edi, %edx
	subl	%ecx, %edx
	imull	%r10d, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	subq	$1, %rax
	movslq	%eax, %rdx
	testl	%eax, %eax
	je	.L59
.L37:
	movl	0(%rbp,%rax,8), %r10d
	movl	%ecx, %r9d
	movslq	%eax, %rdx
	movl	(%rbx,%rax,8), %ecx
	cmpl	%r10d, %esi
	jle	.L60
.L36:
	movd	%esi, %xmm0
	movd	%r9d, %xmm2
	leal	1(%rdx), %eax
	addq	$1, %r12
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, (%r14,%rdx,8)
	cmpq	%r15, %r12
	jne	.L38
.L35:
	addq	$5608, %r13
	cmpq	(%rsp), %r13
	jne	.L32
	movl	%eax, idx(%rip)
.L39:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	movl	$0, (%rcx,%rax,4)
	addq	$1, %rax
	cmpq	%rax, %rdi
	jne	.L31
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%ecx, %r9d
	jmp	.L36
.L46:
	xorl	%eax, %eax
	movl	$1, %ecx
	jmp	.L21
.L44:
	testl	%edx, %edx
	jg	.L26
.L17:
	xorl	%r8d, %r8d
	jmp	.L39
.L61:
	call	__stack_chk_fail@PLT
.L48:
	movl	%r12d, %r9d
	xorl	%edx, %edx
	jmp	.L36
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	hist.0
	.comm	hist.0,7862416,32
	.local	mat.1
	.comm	mat.1,1962801,32
	.local	idx
	.comm	idx,4,4
	.local	stack
	.comm	stack,11208,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.set	.LC3,.LC2
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define min3(a,b,c) min(min(a,b),c)

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(char *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        int num;
        scanf("%d", &num);
        arr[i] = num;
    }
    return 0;
}

#define NUM_MAX 1400

struct rect {
    int height;
    int pos;
};
static struct rect stack[NUM_MAX+1];
static int idx = 0;

void init_stack(void) { idx=0; }
int is_empty(void) {
    return idx==0;
}

void push(struct rect r) {
    stack[idx++] = r;
}

struct rect pop(void) {
    return stack[--idx];
}

struct rect peek(void) {
    return stack[idx-1];
}

int main(void) {
    int height, width;
    get_int2(&height, &width);
    static char mat[NUM_MAX+1][NUM_MAX+1];
    int i, j;
    for(i = 1; i <= height; i++) {
        fget_array(&mat[i][1], width);
        // 0: dirty, 1: clean(usable)
        for(j = 1; j <= width; j++) mat[i][j] = 1-mat[i][j];
    }

    static int hist[NUM_MAX+2][NUM_MAX+2];
    for(i = 1; i <= height; i++) {
        for(j = 1; j <= width; j++) {
            if(!mat[i][j]) {
                hist[i][j] = 0;
            } else {
                hist[i][j] = hist[i-1][j] + 1;
            }
        }
        hist[i][width+1] = 0;
    }
#ifdef DEBUG
    for(i = 1; i <= height; i++) {
        for(j = 1; j <= width; j++) {
            printf(" %d", hist[i][j]);
        }
        putchar('\n');
    }
#endif

    int ans = 0;
    for(i = 1; i <= height; i++) {
        init_stack();
        for(j = 1; j <= width+1; j++) {
            struct rect cur = {hist[i][j], j};
            while(!is_empty()) {
                struct rect pr = peek();
                if(pr.height < cur.height) break;
#ifdef DEBUG
                printf("(%d, %d) height: %d, width: %d\n", i, j, pr.height, j-pr.pos);
#endif
                ans = max(ans, (j-pr.pos)*pr.height);
                cur.pos = pr.pos; // update smaller
                pop();
            }
            push(cur);
        }
    }
    printf("%d\n", ans);

    return 0;
}

4 5
0 0 1 0 0
1 0 0 0 0
0 0 0 0 0
0 0 0 1 0
 4 5
0 0 1 0 0
1 0 0 0 0
0 0 0 0 1
0 0 0 1 0
 1 5
0 0 1 0 0
1 0 0 0 1
0 0 0 1 0
0 0 0 1 0
 0 5
0 0 1 -1 0
1 0 0 0 0
0 0 0 0 0
0 0 0 1 0
 1 5
1 0 1 0 1
2 0 -1 0 1
0 -1 0 0 0
0 0 0 1 0
 4 5
1 0 1 1 0
1 0 0 0 0
0 0 1 0 0
0 0 0 1 0
 4 5
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 1 0
 4 5
0 0 0 0 0
1 1 0 0 0
0 0 0 0 0
0 0 0 1 0
 1 5
1 0 0 0 1
2 0 -1 0 1
0 0 0 0 0
0 1 1 1 0
 1 5
0 0 0 0 0
2 0 -1 -1 0
0 0 0 0 0
0 2 1 1 -1

8
 6
 2
 0
 1
 4
 10
 9
 3
 5

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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define min3(a,b,c) min(min(a,b),c)

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(char *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        int num;
        scanf("%d", &num);
        arr[i] = num;
    }
    return 0;
}

#define NUM_MAX 1400

struct rect {
    int height;
    int pos;
};
static struct rect stack[NUM_MAX+1];
static int idx = 0;

void init_stack(void) { idx=0; }
int is_empty(void) {
    return idx==0;
}

void push(struct rect r) {
    stack[idx++] = r;
}

struct rect pop(void) {
    return stack[--idx];
}

struct rect peek(void) {
    return stack[idx-1];
}

int main(void) {
    int height, width;
    get_int2(&height, &width);
    static char mat[NUM_MAX+1][NUM_MAX+1];
    int i, j;
    for(i = 1; i <= height; i++) {
        fget_array(&mat[i][1], width);
        // 0: dirty, 1: clean(usable)
        for(j = 1; j <= width; j++) mat[i][j] = 1-mat[i][j];
    }

    static int hist[NUM_MAX+2][NUM_MAX+2];
    for(i = 1; i <= height; i++) {
        for(j = 1; j <= width; j++) {
            if(!mat[i][j]) {
                hist[i][j] = 0;
            } else {
                hist[i][j] = hist[i-1][j] + 1;
            }
        }
        hist[i][width+1] = 0;
    }
#ifdef DEBUG
    for(i = 1; i <= height; i++) {
        for(j = 1; j <= width; j++) {
            printf(" %d", hist[i][j]);
        }
        putchar('\n');
    }
#endif

    int ans = 0;
    for(i = 1; i <= height; i++) {
        init_stack();
        for(j = 1; j <= width+1; j++) {
            struct rect cur = {hist[i][j], j};
            while(!is_empty()) {
                struct rect pr = peek();
                if(pr.height < cur.height) break;
#ifdef DEBUG
                printf("(%d, %d) height: %d, width: %d\n", i, j, pr.height, j-pr.pos);
#endif
                ans = max(ans, (j-pr.pos)*pr.height);
                cur.pos = pr.pos; // update smaller
                pop();
            }
            push(cur);
        }
    }
    printf("%d\n", ans);

    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.local	stack
	.comm	stack,11208,32
	.local	idx
	.comm	idx,4,4
	.globl	init_stack
	.type	init_stack, @function
init_stack:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, idx(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	init_stack, .-init_stack
	.globl	is_empty
	.type	is_empty, @function
is_empty:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	is_empty, .-is_empty
	.globl	push
	.type	push, @function
push:
.LFB10:
	.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	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	stack(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	subl	$1, %eax
	movl	%eax, idx(%rip)
	movl	idx(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	stack(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	pop, .-pop
	.globl	peek
	.type	peek, @function
peek:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	stack(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	peek, .-peek
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	$1, -36(%rbp)
	jmp	.L17
.L20:
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1401, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	mat.1(%rip), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	fget_array
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rdx
	leaq	mat.1(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movl	%eax, %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rcx
	leaq	mat.1(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -32(%rbp)
.L18:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	addl	$1, -36(%rbp)
.L17:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L20
	movl	$1, -36(%rbp)
	jmp	.L21
.L26:
	movl	$1, -32(%rbp)
	jmp	.L22
.L25:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rdx
	leaq	mat.1(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L23
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	$0, (%rdx,%rax)
	jmp	.L24
.L23:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L24:
	addl	$1, -32(%rbp)
.L22:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L25
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L21:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L26
	movl	$0, -28(%rbp)
	movl	$1, -36(%rbp)
	jmp	.L27
.L34:
	call	init_stack
	movl	$1, -32(%rbp)
	jmp	.L28
.L33:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L29
.L32:
	call	peek
	movq	%rax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L37
	movl	-12(%rbp), %ecx
	movl	-32(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	%edx, %eax
	movl	-28(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	call	pop
.L29:
	call	is_empty
	testl	%eax, %eax
	je	.L32
	jmp	.L31
.L37:
	nop
.L31:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	push
	addl	$1, -32(%rbp)
.L28:
	movl	-40(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jle	.L33
	addl	$1, -36(%rbp)
.L27:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L34
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	mat.1
	.comm	mat.1,1962801,32
	.local	hist.0
	.comm	hist.0,7862416,32
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L5
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.local	stack
	.comm	stack,11208,32
	.local	idx
	.comm	idx,4,4
	.globl	init_stack
	.type	init_stack, @function
init_stack:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, idx(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	init_stack, .-init_stack
	.globl	is_empty
	.type	is_empty, @function
is_empty:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	is_empty, .-is_empty
	.globl	push
	.type	push, @function
push:
.LFB10:
	.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	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	stack(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	subl	$1, %eax
	movl	%eax, idx(%rip)
	movl	idx(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	stack(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	pop, .-pop
	.globl	peek
	.type	peek, @function
peek:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	idx(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	stack(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	peek, .-peek
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	$1, -36(%rbp)
	jmp	.L17
.L20:
	movl	-40(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$1401, %rdx, %rdx
	leaq	1(%rdx), %rcx
	leaq	mat.1(%rip), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	fget_array
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rdx
	leaq	mat.1(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movl	%eax, %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rcx
	leaq	mat.1(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -32(%rbp)
.L18:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	addl	$1, -36(%rbp)
.L17:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L20
	movl	$1, -36(%rbp)
	jmp	.L21
.L26:
	movl	$1, -32(%rbp)
	jmp	.L22
.L25:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1401, %rax, %rax
	addq	%rax, %rdx
	leaq	mat.1(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L23
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	$0, (%rdx,%rax)
	jmp	.L24
.L23:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$1402, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L24:
	addl	$1, -32(%rbp)
.L22:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L25
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L21:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L26
	movl	$0, -28(%rbp)
	movl	$1, -36(%rbp)
	jmp	.L27
.L34:
	call	init_stack
	movl	$1, -32(%rbp)
	jmp	.L28
.L33:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-36(%rbp), %eax
	cltq
	imulq	$1402, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	hist.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L29
.L32:
	call	peek
	movq	%rax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L37
	movl	-12(%rbp), %ecx
	movl	-32(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	%edx, %eax
	movl	-28(%rbp), %edx
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	call	pop
.L29:
	call	is_empty
	testl	%eax, %eax
	je	.L32
	jmp	.L31
.L37:
	nop
.L31:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	push
	addl	$1, -32(%rbp)
.L28:
	movl	-40(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jle	.L33
	addl	$1, -36(%rbp)
.L27:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L34
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	mat.1
	.comm	mat.1,1962801,32
	.local	hist.0
	.comm	hist.0,7862416,32
	.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:
