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>

inline static int read_int() {
    int x = 0, k;
    while ((k = getchar_unlocked() - '0') >= 0) {
        x = x * 10 + k;
    }
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[4];
    while (x) {
        f[s++] = x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s] + '0');
    putchar_unlocked('\n');
}

int highest[2000], streak[2000];

#pragma GCC optimize ("O3")
int main() {
    int h = read_int(), w = read_int(), max = 0, height, width, lastWall, i, res;
    short len;

    for (height = 0; height < h; height++) {
        lastWall = -1;

        for (width = 0; width < w; width++) {
            if (getchar_unlocked() != '.') {
                if (lastWall != width - 1) {
                    len = width - lastWall - 1;
                    for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
                }

                res = highest[width] + streak[width];
                if (res > max) max = res;

                highest[width] = streak[width] = 0;
                lastWall = width;
            } else streak[width]++;
        }

        getchar_unlocked();

        if (lastWall != width - 1) {
            len = width - lastWall - 1;
            for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
        }
    }

    for (width = 0; width < w; width++) {
        if (streak[width] != 0) {
            res = highest[width] + streak[width];
            if (res > max) max = res;
        }
    }

    put_int(max - 1);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.type	read_int, @function
read_int:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
.L2:
	call	getchar_unlocked@PLT
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L3
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	read_int, .-read_int
	.p2align 4
	.type	put_int, @function
put_int:
.LFB1:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -12(%rbp,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
.L6:
	cmpl	$0, -20(%rbp)
	jne	.L7
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	movzbl	-12(%rbp,%rax), %eax
	movsbl	%al, %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L8:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L9
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_int, .-put_int
	.globl	highest
	.bss
	.align 32
	.type	highest, @object
	.size	highest, 8000
highest:
	.zero	8000
	.globl	streak
	.align 32
	.type	streak, @object
	.size	streak, 8000
streak:
	.zero	8000
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	call	read_int
	movl	%eax, 28(%rsp)
	movl	%eax, %r15d
	xorl	%eax, %eax
	call	read_int
	movl	$0, 16(%rsp)
	movl	%eax, 20(%rsp)
	testl	%r15d, %r15d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L43
	movl	20(%rsp), %eax
	leaq	streak(%rip), %r13
	xorl	%r14d, %r14d
	movl	$-1, %r15d
	leal	-1(%rax), %edx
	movq	%rax, 8(%rsp)
	movl	%edx, 24(%rsp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L45:
	leal	-1(%r14), %eax
	cmpl	%eax, %r15d
	jne	.L15
.L17:
	leaq	highest(%rip), %rsi
	movl	0(%r13), %eax
	movl	%r12d, %r15d
	movl	$0, 0(%r13)
	addl	(%rsi,%r14,4), %eax
	movl	$0, (%rsi,%r14,4)
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	addq	$1, %r14
	addq	$4, %r13
	cmpq	8(%rsp), %r14
	je	.L44
.L20:
	movl	%r14d, %r12d
	call	getchar_unlocked@PLT
	cmpl	$46, %eax
	jne	.L45
	addl	$1, 0(%r13)
	addq	$1, %r14
	addq	$4, %r13
	cmpq	8(%rsp), %r14
	jne	.L20
.L44:
	call	getchar_unlocked@PLT
	movl	24(%rsp), %eax
	cmpl	%eax, %r15d
	jne	.L46
.L21:
	addl	$1, 16(%rsp)
	movl	16(%rsp), %eax
	cmpl	%eax, 28(%rsp)
	jne	.L12
.L13:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L26
	movslq	%eax, %r15
	leaq	streak(%rip), %rcx
	xorl	%eax, %eax
	leaq	highest(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L28:
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	je	.L27
	addl	(%rsi,%rax,4), %edx
	cmpl	%edx, %ebx
	cmovl	%edx, %ebx
.L27:
	addq	$1, %rax
	cmpq	%rax, %r15
	jne	.L28
.L26:
	leal	-1(%rbx), %edi
	call	put_int
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.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
.L15:
	.cfi_restore_state
	leal	-1(%r14), %ecx
	leal	1(%r15), %eax
	subl	%r15d, %ecx
	cmpl	%r14d, %eax
	jge	.L17
	movl	%r14d, %r9d
	movslq	%r15d, %r8
	leaq	highest(%rip), %rax
	movswl	%cx, %ecx
	subl	%r15d, %r9d
	leaq	(%rax,%r8,4), %rax
	leal	-2(%r9), %edi
	addq	%r8, %rdi
	leaq	4+highest(%rip), %r8
	leaq	(%r8,%rdi,4), %rdi
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%ecx, 4(%rax)
	jge	.L18
	movl	%ecx, 4(%rax)
.L18:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L19
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L46:
	movl	20(%rsp), %edi
	movl	%edi, %edx
	subl	$1, %edx
	subl	%r15d, %edx
	cmpl	%eax, %r15d
	jge	.L21
	leal	-2(%rdi), %ecx
	movslq	%r15d, %rsi
	leaq	highest(%rip), %rax
	movswl	%dx, %edx
	subl	%r15d, %ecx
	leaq	(%rax,%rsi,4), %rax
	addq	%rsi, %rcx
	leaq	4+highest(%rip), %rsi
	leaq	(%rsi,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%edx, 4(%rax)
	jge	.L22
	movl	%edx, 4(%rax)
.L22:
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L23
	jmp	.L21
.L43:
	call	getchar_unlocked@PLT
	jmp	.L21
	.cfi_endproc
.LFE2:
	.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
	.p2align 4
	.type	read_int, @function
read_int:
.LFB23:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	subl	$48, %eax
	js	.L1
.L4:
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
.L2:
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L3
	call	__uflow@PLT
	subl	$48, %eax
	js	.L1
	movq	stdin(%rip), %rdi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	read_int, .-read_int
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	xorl	%r14d, %r14d
	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
	call	read_int
	movl	%eax, 28(%rsp)
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	read_int
	movl	$0, 8(%rsp)
	leaq	highest(%rip), %r9
	movl	%eax, 12(%rsp)
	testl	%ebx, %ebx
	jle	.L82
	.p2align 4,,10
	.p2align 3
.L10:
	movq	stdin(%rip), %rdi
	movl	12(%rsp), %edx
	movl	$-1, %ebp
	xorl	%ebx, %ebx
	movl	$-1, %r12d
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r10
	testl	%edx, %edx
	jle	.L29
	movl	12(%rsp), %r8d
	leaq	streak(%rip), %rbp
	xorl	%ebx, %ebx
	movl	$-1, %r12d
	leal	-1(%r8), %ecx
	movl	%ecx, 24(%rsp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L85:
	leal	-1(%r13), %eax
	cmpl	%eax, %r12d
	jne	.L15
.L17:
	addl	(%r9,%rbx,4), %ecx
	movl	$0, (%r9,%rbx,4)
	movl	%r15d, %r12d
	cmpl	%ecx, %r14d
	movl	$0, 0(%rbp)
	cmovl	%ecx, %r14d
	addq	$1, %rbx
	addq	$4, %rbp
	cmpq	%r8, %rbx
	je	.L83
.L20:
	movl	%ebx, %r13d
	movl	%ebx, %r15d
	cmpq	%r10, %rsi
	jnb	.L84
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
	movq	%rdx, %rsi
.L13:
	movl	0(%rbp), %ecx
	cmpl	$46, %eax
	jne	.L85
	addl	$1, %ecx
	addq	$1, %rbx
	addq	$4, %rbp
	movl	%ecx, -4(%rbp)
	cmpq	%r8, %rbx
	jne	.L20
.L83:
	movl	24(%rsp), %ebp
	movl	12(%rsp), %ebx
.L29:
	cmpq	%r10, %rsi
	jnb	.L86
	addq	$1, %rsi
	movq	%rsi, 8(%rdi)
.L22:
	cmpl	%ebp, %r12d
	jne	.L23
.L25:
	addl	$1, 8(%rsp)
	movl	8(%rsp), %eax
	cmpl	%eax, 28(%rsp)
	jne	.L10
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L30
.L47:
	movl	12(%rsp), %edi
	xorl	%eax, %eax
	leaq	streak(%rip), %rcx
	leaq	highest(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L32:
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	je	.L31
	addl	(%rsi,%rax,4), %edx
	cmpl	%edx, %r14d
	cmovl	%edx, %r14d
.L31:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L32
.L30:
	subl	$1, %r14d
	je	.L39
	movslq	%r14d, %rbx
	movl	%r14d, %eax
	imulq	$1717986919, %rbx, %rbx
	sarl	$31, %eax
	sarq	$34, %rbx
	subl	%eax, %ebx
	leal	(%rbx,%rbx,4), %eax
	addl	%eax, %eax
	subl	%eax, %r14d
	movb	%r14b, 36(%rsp)
	movl	%r14d, %ebp
	testl	%ebx, %ebx
	je	.L36
	movl	%ebx, %eax
	movl	$10, %ecx
	cltd
	idivl	%ecx
	movb	%dl, 37(%rsp)
	testl	%eax, %eax
	je	.L50
	cltd
	idivl	%ecx
	movb	%dl, 38(%rsp)
	testl	%eax, %eax
	je	.L51
	cltd
	movl	$3, %ebx
	idivl	%ecx
	movb	%dl, 39(%rsp)
.L36:
	movslq	%ebx, %rax
	movq	stdout(%rip), %rdi
	movsbl	36(%rsp,%rax), %eax
	movq	40(%rdi), %rdx
	addl	$48, %eax
	cmpq	%rdx, 48(%rdi)
	jbe	.L37
	leaq	1(%rdx), %rcx
	movq	%rcx, 40(%rdi)
	movb	%al, (%rdx)
.L38:
	leal	-1(%rbx), %r12d
	testl	%ebx, %ebx
	je	.L39
	movslq	%r12d, %rax
	movq	stdout(%rip), %rdi
	movsbl	36(%rsp,%rax), %eax
	movq	40(%rdi), %rdx
	addl	$48, %eax
	cmpq	%rdx, 48(%rdi)
	jbe	.L40
	leaq	1(%rdx), %rcx
	movq	%rcx, 40(%rdi)
	movb	%al, (%rdx)
.L41:
	subl	$2, %ebx
	testl	%r12d, %r12d
	je	.L39
	movslq	%ebx, %rax
	movq	stdout(%rip), %rdi
	movsbl	36(%rsp,%rax), %eax
	movq	40(%rdi), %rdx
	addl	$48, %eax
	cmpq	%rdx, 48(%rdi)
	jbe	.L42
	leaq	1(%rdx), %rcx
	movq	%rcx, 40(%rdi)
	movb	%al, (%rdx)
.L43:
	testl	%ebx, %ebx
	je	.L39
	movq	stdout(%rip), %rdi
	addl	$48, %ebp
	movsbl	%bpl, %esi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L87
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%bpl, (%rax)
.L39:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L88
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
.L46:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L89
	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
.L15:
	.cfi_restore_state
	leal	-1(%rbx), %edx
	leal	1(%r12), %eax
	subl	%r12d, %edx
	cmpl	%ebx, %eax
	jge	.L17
	subl	%r12d, %r13d
	movslq	%r12d, %r11
	movswl	%dx, %edx
	leal	-2(%r13), %r12d
	leaq	(%r9,%r11,4), %rax
	leaq	4+highest(%rip), %r13
	addq	%r12, %r11
	leaq	0(%r13,%r11,4), %r11
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%edx, 4(%rax)
	jge	.L18
	movl	%edx, 4(%rax)
.L18:
	addq	$4, %rax
	cmpq	%r11, %rax
	jne	.L19
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L84:
	movq	%r8, 16(%rsp)
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	16(%rsp), %r8
	leaq	highest(%rip), %r9
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-1(%rbx), %edx
	leal	1(%r12), %eax
	subl	%r12d, %edx
	cmpl	%ebx, %eax
	jge	.L25
	subl	$2, %ebx
	movslq	%r12d, %rcx
	leaq	4+highest(%rip), %rdi
	movswl	%dx, %edx
	subl	%r12d, %ebx
	leaq	(%r9,%rcx,4), %rax
	addq	%rbx, %rcx
	leaq	(%rdi,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%edx, 4(%rax)
	jge	.L26
	movl	%edx, 4(%rax)
.L26:
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L27
	jmp	.L25
.L86:
	call	__uflow@PLT
	leaq	highest(%rip), %r9
	jmp	.L22
.L51:
	movl	$2, %ebx
	jmp	.L36
.L42:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L43
.L50:
	movl	$1, %ebx
	jmp	.L36
.L82:
	cmpl	$0, 12(%rsp)
	jg	.L47
	movb	$-1, 36(%rsp)
	movl	$-1, %ebp
	xorl	%ebx, %ebx
	jmp	.L36
.L88:
	movl	$10, %esi
	call	__overflow@PLT
	jmp	.L46
.L37:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L38
.L40:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L41
.L87:
	call	__overflow@PLT
	jmp	.L39
.L89:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	streak
	.bss
	.align 32
	.type	streak, @object
	.size	streak, 8000
streak:
	.zero	8000
	.globl	highest
	.align 32
	.type	highest, @object
	.size	highest, 8000
highest:
	.zero	8000
	.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
	.p2align 4
	.type	read_int, @function
read_int:
.LFB23:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	subl	$48, %eax
	js	.L1
.L4:
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
.L2:
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L3
	call	__uflow@PLT
	subl	$48, %eax
	js	.L1
	movq	stdin(%rip), %rdi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	read_int, .-read_int
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	xorl	%r14d, %r14d
	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
	call	read_int
	movl	%eax, 28(%rsp)
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	read_int
	movl	$0, 8(%rsp)
	leaq	highest(%rip), %r9
	movl	%eax, 12(%rsp)
	testl	%ebx, %ebx
	jle	.L82
	.p2align 4,,10
	.p2align 3
.L10:
	movq	stdin(%rip), %rdi
	movl	12(%rsp), %edx
	movl	$-1, %ebp
	xorl	%ebx, %ebx
	movl	$-1, %r12d
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r10
	testl	%edx, %edx
	jle	.L29
	movl	12(%rsp), %r8d
	leaq	streak(%rip), %rbp
	xorl	%ebx, %ebx
	movl	$-1, %r12d
	leal	-1(%r8), %ecx
	movl	%ecx, 24(%rsp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L85:
	leal	-1(%r13), %eax
	cmpl	%eax, %r12d
	jne	.L15
.L17:
	addl	(%r9,%rbx,4), %ecx
	movl	$0, (%r9,%rbx,4)
	movl	%r15d, %r12d
	cmpl	%ecx, %r14d
	movl	$0, 0(%rbp)
	cmovl	%ecx, %r14d
	addq	$1, %rbx
	addq	$4, %rbp
	cmpq	%r8, %rbx
	je	.L83
.L20:
	movl	%ebx, %r13d
	movl	%ebx, %r15d
	cmpq	%r10, %rsi
	jnb	.L84
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
	movq	%rdx, %rsi
.L13:
	movl	0(%rbp), %ecx
	cmpl	$46, %eax
	jne	.L85
	addl	$1, %ecx
	addq	$1, %rbx
	addq	$4, %rbp
	movl	%ecx, -4(%rbp)
	cmpq	%r8, %rbx
	jne	.L20
.L83:
	movl	24(%rsp), %ebp
	movl	12(%rsp), %ebx
.L29:
	cmpq	%r10, %rsi
	jnb	.L86
	addq	$1, %rsi
	movq	%rsi, 8(%rdi)
.L22:
	cmpl	%ebp, %r12d
	jne	.L23
.L25:
	addl	$1, 8(%rsp)
	movl	8(%rsp), %eax
	cmpl	%eax, 28(%rsp)
	jne	.L10
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L30
.L47:
	movl	12(%rsp), %edi
	xorl	%eax, %eax
	leaq	streak(%rip), %rcx
	leaq	highest(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L32:
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	je	.L31
	addl	(%rsi,%rax,4), %edx
	cmpl	%edx, %r14d
	cmovl	%edx, %r14d
.L31:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L32
.L30:
	subl	$1, %r14d
	je	.L39
	movslq	%r14d, %rbx
	movl	%r14d, %eax
	imulq	$1717986919, %rbx, %rbx
	sarl	$31, %eax
	sarq	$34, %rbx
	subl	%eax, %ebx
	leal	(%rbx,%rbx,4), %eax
	addl	%eax, %eax
	subl	%eax, %r14d
	movb	%r14b, 36(%rsp)
	movl	%r14d, %ebp
	testl	%ebx, %ebx
	je	.L36
	movl	%ebx, %eax
	movl	$10, %ecx
	cltd
	idivl	%ecx
	movb	%dl, 37(%rsp)
	testl	%eax, %eax
	je	.L50
	cltd
	idivl	%ecx
	movb	%dl, 38(%rsp)
	testl	%eax, %eax
	je	.L51
	cltd
	movl	$3, %ebx
	idivl	%ecx
	movb	%dl, 39(%rsp)
.L36:
	movslq	%ebx, %rax
	movq	stdout(%rip), %rdi
	movsbl	36(%rsp,%rax), %eax
	movq	40(%rdi), %rdx
	addl	$48, %eax
	cmpq	%rdx, 48(%rdi)
	jbe	.L37
	leaq	1(%rdx), %rcx
	movq	%rcx, 40(%rdi)
	movb	%al, (%rdx)
.L38:
	leal	-1(%rbx), %r12d
	testl	%ebx, %ebx
	je	.L39
	movslq	%r12d, %rax
	movq	stdout(%rip), %rdi
	movsbl	36(%rsp,%rax), %eax
	movq	40(%rdi), %rdx
	addl	$48, %eax
	cmpq	%rdx, 48(%rdi)
	jbe	.L40
	leaq	1(%rdx), %rcx
	movq	%rcx, 40(%rdi)
	movb	%al, (%rdx)
.L41:
	subl	$2, %ebx
	testl	%r12d, %r12d
	je	.L39
	movslq	%ebx, %rax
	movq	stdout(%rip), %rdi
	movsbl	36(%rsp,%rax), %eax
	movq	40(%rdi), %rdx
	addl	$48, %eax
	cmpq	%rdx, 48(%rdi)
	jbe	.L42
	leaq	1(%rdx), %rcx
	movq	%rcx, 40(%rdi)
	movb	%al, (%rdx)
.L43:
	testl	%ebx, %ebx
	je	.L39
	movq	stdout(%rip), %rdi
	addl	$48, %ebp
	movsbl	%bpl, %esi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L87
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%bpl, (%rax)
.L39:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L88
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
.L46:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L89
	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
.L15:
	.cfi_restore_state
	leal	-1(%rbx), %edx
	leal	1(%r12), %eax
	subl	%r12d, %edx
	cmpl	%ebx, %eax
	jge	.L17
	subl	%r12d, %r13d
	movslq	%r12d, %r11
	movswl	%dx, %edx
	leal	-2(%r13), %r12d
	leaq	(%r9,%r11,4), %rax
	leaq	4+highest(%rip), %r13
	addq	%r12, %r11
	leaq	0(%r13,%r11,4), %r11
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%edx, 4(%rax)
	jge	.L18
	movl	%edx, 4(%rax)
.L18:
	addq	$4, %rax
	cmpq	%r11, %rax
	jne	.L19
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L84:
	movq	%r8, 16(%rsp)
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	16(%rsp), %r8
	leaq	highest(%rip), %r9
	movq	8(%rdi), %rsi
	movq	16(%rdi), %r10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-1(%rbx), %edx
	leal	1(%r12), %eax
	subl	%r12d, %edx
	cmpl	%ebx, %eax
	jge	.L25
	subl	$2, %ebx
	movslq	%r12d, %rcx
	leaq	4+highest(%rip), %rdi
	movswl	%dx, %edx
	subl	%r12d, %ebx
	leaq	(%r9,%rcx,4), %rax
	addq	%rbx, %rcx
	leaq	(%rdi,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%edx, 4(%rax)
	jge	.L26
	movl	%edx, 4(%rax)
.L26:
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L27
	jmp	.L25
.L86:
	call	__uflow@PLT
	leaq	highest(%rip), %r9
	jmp	.L22
.L51:
	movl	$2, %ebx
	jmp	.L36
.L42:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L43
.L50:
	movl	$1, %ebx
	jmp	.L36
.L82:
	cmpl	$0, 12(%rsp)
	jg	.L47
	movb	$-1, 36(%rsp)
	movl	$-1, %ebp
	xorl	%ebx, %ebx
	jmp	.L36
.L88:
	movl	$10, %esi
	call	__overflow@PLT
	jmp	.L46
.L37:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L38
.L40:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L41
.L87:
	call	__overflow@PLT
	jmp	.L39
.L89:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	streak
	.bss
	.align 32
	.type	streak, @object
	.size	streak, 8000
streak:
	.zero	8000
	.globl	highest
	.align 32
	.type	highest, @object
	.size	highest, 8000
highest:
	.zero	8000
	.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>

inline static int read_int() {
    int x = 0, k;
    while ((k = getchar_unlocked() - '0') >= 0) {
        x = x * 10 + k;
    }
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[4];
    while (x) {
        f[s++] = x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s] + '0');
    putchar_unlocked('\n');
}

int highest[2000], streak[2000];

#pragma GCC optimize ("O3")
int main() {
    int h = read_int(), w = read_int(), max = 0, height, width, lastWall, i, res;
    short len;

    for (height = 0; height < h; height++) {
        lastWall = -1;

        for (width = 0; width < w; width++) {
            if (getchar_unlocked() != '.') {
                if (lastWall != width - 1) {
                    len = width - lastWall - 1;
                    for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
                }

                res = highest[width] + streak[width];
                if (res > max) max = res;

                highest[width] = streak[width] = 0;
                lastWall = width;
            } else streak[width]++;
        }

        getchar_unlocked();

        if (lastWall != width - 1) {
            len = width - lastWall - 1;
            for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
        }
    }

    for (width = 0; width < w; width++) {
        if (streak[width] != 0) {
            res = highest[width] + streak[width];
            if (res > max) max = res;
        }
    }

    put_int(max - 1);
}

3 6
#..#..
.....#
....#.
#.#...
 8 8
..#...#.
....#...
......
..###..#
...#..#-
....#.
...#...
.#..#
 4 8
#..#..
.....#
....#.
#.#...
 2 6
..#..
.....#
....#.
.#...
 1 8
..#...#.
....#...
......
..###..#
...#..#.
....#.
...#...
#..#.
 4 1
..#..
#.....
./..#.
.#...
 2 8
..#...#.
....#...
......
..###..#
...#..#.
....#.
...#...
#..#.
 8 8
/#....#.
...#....
......
..###..#
...#..#.
....#.
...#..-
#..#.
 1 6
#....
.....#
.$....
.#.,.
 1 1
.#...#..
.../#...
0.....
..###..#
.#/.#...
....#.
...#...
#..#.

7
 11
 5
 5
 3
 1
 5
 9
 4
 1

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>

inline static int read_int() {
    int x = 0, k;
    while ((k = getchar_unlocked() - '0') >= 0) {
        x = x * 10 + k;
    }
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[4];
    while (x) {
        f[s++] = x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s] + '0');
    putchar_unlocked('\n');
}

int highest[2000], streak[2000];

#pragma GCC optimize ("O3")
int main() {
    int h = read_int(), w = read_int(), max = 0, height, width, lastWall, i, res;
    short len;

    for (height = 0; height < h; height++) {
        lastWall = -1;

        for (width = 0; width < w; width++) {
            if (getchar_unlocked() != '.') {
                if (lastWall != width - 1) {
                    len = width - lastWall - 1;
                    for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
                }

                res = highest[width] + streak[width];
                if (res > max) max = res;

                highest[width] = streak[width] = 0;
                lastWall = width;
            } else streak[width]++;
        }

        getchar_unlocked();

        if (lastWall != width - 1) {
            len = width - lastWall - 1;
            for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len;
        }
    }

    for (width = 0; width < w; width++) {
        if (streak[width] != 0) {
            res = highest[width] + streak[width];
            if (res > max) max = res;
        }
    }

    put_int(max - 1);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.type	read_int, @function
read_int:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
.L2:
	call	getchar_unlocked@PLT
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L3
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	read_int, .-read_int
	.p2align 4
	.type	put_int, @function
put_int:
.LFB1:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -12(%rbp,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
.L6:
	cmpl	$0, -20(%rbp)
	jne	.L7
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	movzbl	-12(%rbp,%rax), %eax
	movsbl	%al, %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L8:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L9
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_int, .-put_int
	.globl	highest
	.bss
	.align 32
	.type	highest, @object
	.size	highest, 8000
highest:
	.zero	8000
	.globl	streak
	.align 32
	.type	streak, @object
	.size	streak, 8000
streak:
	.zero	8000
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	call	read_int
	movl	%eax, 28(%rsp)
	movl	%eax, %r15d
	xorl	%eax, %eax
	call	read_int
	movl	$0, 16(%rsp)
	movl	%eax, 20(%rsp)
	testl	%r15d, %r15d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L43
	movl	20(%rsp), %eax
	leaq	streak(%rip), %r13
	xorl	%r14d, %r14d
	movl	$-1, %r15d
	leal	-1(%rax), %edx
	movq	%rax, 8(%rsp)
	movl	%edx, 24(%rsp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L45:
	leal	-1(%r14), %eax
	cmpl	%eax, %r15d
	jne	.L15
.L17:
	leaq	highest(%rip), %rsi
	movl	0(%r13), %eax
	movl	%r12d, %r15d
	movl	$0, 0(%r13)
	addl	(%rsi,%r14,4), %eax
	movl	$0, (%rsi,%r14,4)
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	addq	$1, %r14
	addq	$4, %r13
	cmpq	8(%rsp), %r14
	je	.L44
.L20:
	movl	%r14d, %r12d
	call	getchar_unlocked@PLT
	cmpl	$46, %eax
	jne	.L45
	addl	$1, 0(%r13)
	addq	$1, %r14
	addq	$4, %r13
	cmpq	8(%rsp), %r14
	jne	.L20
.L44:
	call	getchar_unlocked@PLT
	movl	24(%rsp), %eax
	cmpl	%eax, %r15d
	jne	.L46
.L21:
	addl	$1, 16(%rsp)
	movl	16(%rsp), %eax
	cmpl	%eax, 28(%rsp)
	jne	.L12
.L13:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L26
	movslq	%eax, %r15
	leaq	streak(%rip), %rcx
	xorl	%eax, %eax
	leaq	highest(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L28:
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	je	.L27
	addl	(%rsi,%rax,4), %edx
	cmpl	%edx, %ebx
	cmovl	%edx, %ebx
.L27:
	addq	$1, %rax
	cmpq	%rax, %r15
	jne	.L28
.L26:
	leal	-1(%rbx), %edi
	call	put_int
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.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
.L15:
	.cfi_restore_state
	leal	-1(%r14), %ecx
	leal	1(%r15), %eax
	subl	%r15d, %ecx
	cmpl	%r14d, %eax
	jge	.L17
	movl	%r14d, %r9d
	movslq	%r15d, %r8
	leaq	highest(%rip), %rax
	movswl	%cx, %ecx
	subl	%r15d, %r9d
	leaq	(%rax,%r8,4), %rax
	leal	-2(%r9), %edi
	addq	%r8, %rdi
	leaq	4+highest(%rip), %r8
	leaq	(%r8,%rdi,4), %rdi
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%ecx, 4(%rax)
	jge	.L18
	movl	%ecx, 4(%rax)
.L18:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L19
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L46:
	movl	20(%rsp), %edi
	movl	%edi, %edx
	subl	$1, %edx
	subl	%r15d, %edx
	cmpl	%eax, %r15d
	jge	.L21
	leal	-2(%rdi), %ecx
	movslq	%r15d, %rsi
	leaq	highest(%rip), %rax
	movswl	%dx, %edx
	subl	%r15d, %ecx
	leaq	(%rax,%rsi,4), %rax
	addq	%rsi, %rcx
	leaq	4+highest(%rip), %rsi
	leaq	(%rsi,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%edx, 4(%rax)
	jge	.L22
	movl	%edx, 4(%rax)
.L22:
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L23
	jmp	.L21
.L43:
	call	getchar_unlocked@PLT
	jmp	.L21
	.cfi_endproc
.LFE2:
	.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
	.p2align 4
	.type	read_int, @function
read_int:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
.L2:
	call	getchar_unlocked@PLT
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L3
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	read_int, .-read_int
	.p2align 4
	.type	put_int, @function
put_int:
.LFB1:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -12(%rbp,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
.L6:
	cmpl	$0, -20(%rbp)
	jne	.L7
	jmp	.L8
.L9:
	movl	-16(%rbp), %eax
	cltq
	movzbl	-12(%rbp,%rax), %eax
	movsbl	%al, %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L8:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L9
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_int, .-put_int
	.globl	highest
	.bss
	.align 32
	.type	highest, @object
	.size	highest, 8000
highest:
	.zero	8000
	.globl	streak
	.align 32
	.type	streak, @object
	.size	streak, 8000
streak:
	.zero	8000
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	call	read_int
	movl	%eax, 28(%rsp)
	movl	%eax, %r15d
	xorl	%eax, %eax
	call	read_int
	movl	$0, 16(%rsp)
	movl	%eax, 20(%rsp)
	testl	%r15d, %r15d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L43
	movl	20(%rsp), %eax
	leaq	streak(%rip), %r13
	xorl	%r14d, %r14d
	movl	$-1, %r15d
	leal	-1(%rax), %edx
	movq	%rax, 8(%rsp)
	movl	%edx, 24(%rsp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L45:
	leal	-1(%r14), %eax
	cmpl	%eax, %r15d
	jne	.L15
.L17:
	leaq	highest(%rip), %rsi
	movl	0(%r13), %eax
	movl	%r12d, %r15d
	movl	$0, 0(%r13)
	addl	(%rsi,%r14,4), %eax
	movl	$0, (%rsi,%r14,4)
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	addq	$1, %r14
	addq	$4, %r13
	cmpq	8(%rsp), %r14
	je	.L44
.L20:
	movl	%r14d, %r12d
	call	getchar_unlocked@PLT
	cmpl	$46, %eax
	jne	.L45
	addl	$1, 0(%r13)
	addq	$1, %r14
	addq	$4, %r13
	cmpq	8(%rsp), %r14
	jne	.L20
.L44:
	call	getchar_unlocked@PLT
	movl	24(%rsp), %eax
	cmpl	%eax, %r15d
	jne	.L46
.L21:
	addl	$1, 16(%rsp)
	movl	16(%rsp), %eax
	cmpl	%eax, 28(%rsp)
	jne	.L12
.L13:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L26
	movslq	%eax, %r15
	leaq	streak(%rip), %rcx
	xorl	%eax, %eax
	leaq	highest(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L28:
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	je	.L27
	addl	(%rsi,%rax,4), %edx
	cmpl	%edx, %ebx
	cmovl	%edx, %ebx
.L27:
	addq	$1, %rax
	cmpq	%rax, %r15
	jne	.L28
.L26:
	leal	-1(%rbx), %edi
	call	put_int
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.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
.L15:
	.cfi_restore_state
	leal	-1(%r14), %ecx
	leal	1(%r15), %eax
	subl	%r15d, %ecx
	cmpl	%r14d, %eax
	jge	.L17
	movl	%r14d, %r9d
	movslq	%r15d, %r8
	leaq	highest(%rip), %rax
	movswl	%cx, %ecx
	subl	%r15d, %r9d
	leaq	(%rax,%r8,4), %rax
	leal	-2(%r9), %edi
	addq	%r8, %rdi
	leaq	4+highest(%rip), %r8
	leaq	(%r8,%rdi,4), %rdi
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%ecx, 4(%rax)
	jge	.L18
	movl	%ecx, 4(%rax)
.L18:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L19
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L46:
	movl	20(%rsp), %edi
	movl	%edi, %edx
	subl	$1, %edx
	subl	%r15d, %edx
	cmpl	%eax, %r15d
	jge	.L21
	leal	-2(%rdi), %ecx
	movslq	%r15d, %rsi
	leaq	highest(%rip), %rax
	movswl	%dx, %edx
	subl	%r15d, %ecx
	leaq	(%rax,%rsi,4), %rax
	addq	%rsi, %rcx
	leaq	4+highest(%rip), %rsi
	leaq	(%rsi,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	%edx, 4(%rax)
	jge	.L22
	movl	%edx, 4(%rax)
.L22:
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L23
	jmp	.L21
.L43:
	call	getchar_unlocked@PLT
	jmp	.L21
	.cfi_endproc
.LFE2:
	.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:
