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() - 'L') >= 0) x = x * 10 + k;
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[6] = {'0', '0', '0', '0', '0', '0'};
    if (!x) {
        putchar_unlocked('0');
        return;
    }
    while (x) {
        f[s++] += x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s]);
}

int array[100000];

int main() {
    int flag = 0, lastL = -1, lastR = 0, i = 0, c, diff;

    while ((c = getchar_unlocked() - 'L') >= 0) {
        if (c) {
            if (flag) {
                flag = 0;
                lastL = i - 1;
                diff = i - lastR;
                array[lastR] += (diff - 1) / 2;
                array[lastR + 1] += diff / 2;
            }
        } else {
            if (!flag) {
                flag = 1;
                lastR = i - 1;
                diff = i - lastL;
                array[i - 1] += diff / 2;
                array[i] += (diff - 1) / 2;
            }
        }
        i++;
    }

    diff = i - lastR;
    array[lastR + 1] += diff / 2;
    array[lastR] += (diff - 1) / 2;

    put_int(array[0]);
    for (c = 1; c < i; c++) {
        putchar_unlocked(' ');
        put_int(array[c]);
    }

    putchar_unlocked('\n');
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	movl	$808464432, -14(%rbp)
	movw	$12336, -10(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L4
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L1
.L5:
	movl	-20(%rbp), %edx
	leal	1(%rdx), %eax
	movl	%eax, -20(%rbp)
	movslq	%edx, %rax
	movzbl	-14(%rbp,%rax), %eax
	movl	%eax, %r8d
	movl	-36(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %edi
	sarl	$31, %edi
	subl	%edi, %eax
	movl	%eax, %esi
	movl	%esi, %eax
	sall	$2, %eax
	addl	%esi, %eax
	addl	%eax, %eax
	movl	%ecx, %esi
	subl	%eax, %esi
	movl	%esi, %eax
	addl	%r8d, %eax
	movl	%eax, %ecx
	movslq	%edx, %rax
	movb	%cl, -14(%rbp,%rax)
	movl	-36(%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, -36(%rbp)
.L4:
	cmpl	$0, -36(%rbp)
	jne	.L5
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	movzbl	-14(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L6:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jne	.L7
.L1:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_int, .-put_int
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 400000
array:
	.zero	400000
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	cmpl	$0, -8(%rbp)
	je	.L11
	cmpl	$0, -24(%rbp)
	je	.L12
	movl	$0, -24(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L12
.L11:
	cmpl	$0, -24(%rbp)
	jne	.L12
	movl	$1, -24(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L12:
	addl	$1, -12(%rbp)
.L10:
	call	getchar_unlocked@PLT
	subl	$76, %eax
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jns	.L13
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	array(%rip), %eax
	movl	%eax, %edi
	call	put_int
	movl	$1, -8(%rbp)
	jmp	.L14
.L15:
	movl	$32, %edi
	call	putchar_unlocked@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	put_int
	addl	$1, -8(%rbp)
.L14:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L15
	movl	$10, %edi
	call	putchar_unlocked@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.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
	.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
	xorl	%ecx, %ecx
	movl	$-1, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	array(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$-1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r14, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L104:
	testl	%ecx, %ecx
	je	.L4
	movl	%ebp, %ecx
	movslq	%r13d, %rdx
	movl	%r12d, %r15d
	subl	%r13d, %ecx
	leal	-1(%rcx), %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	addl	%eax, (%r14,%rdx,4)
	leal	1(%r13), %edx
	movl	%ecx, %eax
	shrl	$31, %eax
	movslq	%edx, %rdx
	addl	%ecx, %eax
	xorl	%ecx, %ecx
	sarl	%eax
	addl	%eax, (%r14,%rdx,4)
.L4:
	addq	$4, %rbx
	movl	%ebp, %r12d
.L2:
	movq	stdin(%rip), %rdi
	leal	1(%r12), %ebp
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L102
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L6:
	subl	$76, %eax
	js	.L103
	jne	.L104
	testl	%ecx, %ecx
	jne	.L4
	movl	%ebp, %eax
	movslq	%r12d, %r13
	movl	$1, %ecx
	subl	%r15d, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	subl	$1, %eax
	sarl	%edx
	addl	%edx, -4(%rbx)
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	%eax, (%rbx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L103:
	movl	%ebp, %eax
	leal	1(%r13), %ecx
	movq	stdout(%rip), %rdi
	movl	$808464432, 28(%rsp)
	subl	%r13d, %eax
	movslq	%ecx, %rcx
	movl	%eax, %edx
	movq	48(%rdi), %rsi
	shrl	$31, %edx
	addl	%eax, %edx
	subl	$1, %eax
	sarl	%edx
	addl	%edx, (%r14,%rcx,4)
	movl	%eax, %edx
	movq	40(%rdi), %rcx
	shrl	$31, %edx
	addl	%edx, %eax
	movl	$12336, %edx
	sarl	%eax
	addl	%eax, (%r14,%r13,4)
	movl	array(%rip), %eax
	movw	%dx, 32(%rsp)
	testl	%eax, %eax
	je	.L105
	movl	$10, %r8d
	cltd
	idivl	%r8d
	leal	48(%rdx), %r13d
	movl	%eax, %ebx
	movb	%r13b, 28(%rsp)
	testl	%eax, %eax
	je	.L14
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 29(%rsp)
	testl	%eax, %eax
	je	.L51
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 30(%rsp)
	testl	%eax, %eax
	je	.L52
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 31(%rsp)
	testl	%eax, %eax
	je	.L53
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 32(%rsp)
	testl	%eax, %eax
	je	.L54
	cltd
	movl	$5, %ebx
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 33(%rsp)
.L14:
	movslq	%ebx, %rax
	movzbl	28(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jnb	.L15
	leaq	1(%rcx), %rdx
	movq	%rdx, 40(%rdi)
	movb	%al, (%rcx)
.L16:
	leal	-1(%rbx), %r14d
	testl	%ebx, %ebx
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L18
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L19:
	leal	-2(%rbx), %r15d
	testl	%r14d, %r14d
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%r15d, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L20
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L21:
	leal	-3(%rbx), %r14d
	testl	%r15d, %r15d
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L22
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L23:
	subl	$4, %ebx
	testl	%r14d, %r14d
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%ebx, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L24
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L25:
	testl	%ebx, %ebx
	je	.L10
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L106
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%r13b, (%rax)
.L10:
	cmpl	$1, %ebp
	jle	.L48
	leaq	4+array(%rip), %rbp
	leal	-1(%r12), %edx
	leaq	4(%rbp), %rax
	leaq	(%rax,%rdx,4), %r12
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L30:
	movslq	%r13d, %rbx
	movl	%r13d, %eax
	imulq	$1717986919, %rbx, %rbx
	sarl	$31, %eax
	sarq	$34, %rbx
	subl	%eax, %ebx
	leal	(%rbx,%rbx,4), %eax
	addl	%eax, %eax
	subl	%eax, %r13d
	addl	$48, %r13d
	movb	%r13b, 34(%rsp)
	testl	%ebx, %ebx
	je	.L33
	movslq	%ebx, %rax
	movl	%ebx, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %ebx
	addl	$48, %ebx
	movb	%bl, 35(%rsp)
	testl	%eax, %eax
	je	.L55
	movslq	%eax, %rdx
	movl	%eax, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %eax
	addl	$48, %eax
	movb	%al, 36(%rsp)
	testl	%edx, %edx
	je	.L56
	movslq	%edx, %rax
	movl	%edx, %r8d
	imulq	$1717986919, %rax, %rax
	sarl	$31, %r8d
	sarq	$34, %rax
	subl	%r8d, %eax
	leal	(%rax,%rax,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %edx
	addl	$48, %edx
	movb	%dl, 37(%rsp)
	testl	%eax, %eax
	je	.L57
	movslq	%eax, %rdx
	movl	%eax, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %eax
	addl	$48, %eax
	movb	%al, 38(%rsp)
	testl	%edx, %edx
	je	.L58
	movslq	%edx, %rax
	movl	%edx, %r8d
	movl	$5, %ebx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %r8d
	sarq	$34, %rax
	subl	%r8d, %eax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %edx
	addl	$48, %edx
	movb	%dl, 39(%rsp)
.L33:
	movslq	%ebx, %rax
	movzbl	34(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jnb	.L34
.L112:
	leaq	1(%rcx), %rdx
	movq	%rdx, 40(%rdi)
	movb	%al, (%rcx)
.L35:
	leal	-1(%rbx), %r14d
	testl	%ebx, %ebx
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L37
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L38:
	leal	-2(%rbx), %r15d
	testl	%r14d, %r14d
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%r15d, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L39
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L40:
	leal	-3(%rbx), %r14d
	testl	%r15d, %r15d
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L41
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L42:
	subl	$4, %ebx
	testl	%r14d, %r14d
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%ebx, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L43
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L44:
	testl	%ebx, %ebx
	je	.L32
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L107
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%r13b, (%rax)
.L32:
	addq	$4, %rbp
	cmpq	%rbp, %r12
	je	.L48
.L47:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L108
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$32, (%rax)
.L29:
	movq	stdout(%rip), %rdi
	movl	0(%rbp), %r13d
	movl	$12336, %eax
	movl	$808464432, 34(%rsp)
	movw	%ax, 38(%rsp)
	movq	40(%rdi), %rcx
	movq	48(%rdi), %rsi
	testl	%r13d, %r13d
	jne	.L30
	cmpq	%rsi, %rcx
	jnb	.L109
	leaq	1(%rcx), %rax
	addq	$4, %rbp
	movq	%rax, 40(%rdi)
	movb	$48, (%rcx)
	cmpq	%rbp, %r12
	jne	.L47
.L48:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L110
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
.L49:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L111
	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
.L102:
	.cfi_restore_state
	movl	%ecx, 12(%rsp)
	call	__uflow@PLT
	movl	12(%rsp), %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L108:
	movl	$32, %esi
	call	__overflow@PLT
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L55:
	movl	$1, %ebx
	movslq	%ebx, %rax
	movzbl	34(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jb	.L112
.L34:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L35
.L56:
	movl	$2, %ebx
	jmp	.L33
.L57:
	movl	$3, %ebx
	jmp	.L33
.L37:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L38
.L58:
	movl	$4, %ebx
	jmp	.L33
.L39:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L40
.L105:
	cmpq	%rsi, %rcx
	jnb	.L113
	leaq	1(%rcx), %rax
	movq	%rax, 40(%rdi)
	movb	$48, (%rcx)
	jmp	.L10
.L41:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L42
.L43:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L44
.L109:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L32
.L107:
	movzbl	%r13b, %esi
	call	__overflow@PLT
	jmp	.L32
.L51:
	movl	$1, %ebx
	jmp	.L14
.L110:
	movl	$10, %esi
	call	__overflow@PLT
	jmp	.L49
.L52:
	movl	$2, %ebx
	jmp	.L14
.L15:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L16
.L53:
	movl	$3, %ebx
	jmp	.L14
.L18:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L19
.L54:
	movl	$4, %ebx
	jmp	.L14
.L20:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L21
.L22:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L23
.L24:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L25
.L113:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L10
.L106:
	movzbl	%r13b, %esi
	call	__overflow@PLT
	jmp	.L10
.L111:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 400000
array:
	.zero	400000
	.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	.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
	xorl	%ecx, %ecx
	movl	$-1, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	array(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$-1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r14, %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L104:
	testl	%ecx, %ecx
	je	.L4
	movl	%ebp, %ecx
	movslq	%r13d, %rdx
	movl	%r12d, %r15d
	subl	%r13d, %ecx
	leal	-1(%rcx), %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	addl	%eax, (%r14,%rdx,4)
	leal	1(%r13), %edx
	movl	%ecx, %eax
	shrl	$31, %eax
	movslq	%edx, %rdx
	addl	%ecx, %eax
	xorl	%ecx, %ecx
	sarl	%eax
	addl	%eax, (%r14,%rdx,4)
.L4:
	addq	$4, %rbx
	movl	%ebp, %r12d
.L2:
	movq	stdin(%rip), %rdi
	leal	1(%r12), %ebp
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L102
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L6:
	subl	$76, %eax
	js	.L103
	jne	.L104
	testl	%ecx, %ecx
	jne	.L4
	movl	%ebp, %eax
	movslq	%r12d, %r13
	movl	$1, %ecx
	subl	%r15d, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	subl	$1, %eax
	sarl	%edx
	addl	%edx, -4(%rbx)
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	%eax, (%rbx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L103:
	movl	%ebp, %eax
	leal	1(%r13), %ecx
	movq	stdout(%rip), %rdi
	movl	$808464432, 28(%rsp)
	subl	%r13d, %eax
	movslq	%ecx, %rcx
	movl	%eax, %edx
	movq	48(%rdi), %rsi
	shrl	$31, %edx
	addl	%eax, %edx
	subl	$1, %eax
	sarl	%edx
	addl	%edx, (%r14,%rcx,4)
	movl	%eax, %edx
	movq	40(%rdi), %rcx
	shrl	$31, %edx
	addl	%edx, %eax
	movl	$12336, %edx
	sarl	%eax
	addl	%eax, (%r14,%r13,4)
	movl	array(%rip), %eax
	movw	%dx, 32(%rsp)
	testl	%eax, %eax
	je	.L105
	movl	$10, %r8d
	cltd
	idivl	%r8d
	leal	48(%rdx), %r13d
	movl	%eax, %ebx
	movb	%r13b, 28(%rsp)
	testl	%eax, %eax
	je	.L14
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 29(%rsp)
	testl	%eax, %eax
	je	.L51
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 30(%rsp)
	testl	%eax, %eax
	je	.L52
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 31(%rsp)
	testl	%eax, %eax
	je	.L53
	cltd
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 32(%rsp)
	testl	%eax, %eax
	je	.L54
	cltd
	movl	$5, %ebx
	idivl	%r8d
	addl	$48, %edx
	movb	%dl, 33(%rsp)
.L14:
	movslq	%ebx, %rax
	movzbl	28(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jnb	.L15
	leaq	1(%rcx), %rdx
	movq	%rdx, 40(%rdi)
	movb	%al, (%rcx)
.L16:
	leal	-1(%rbx), %r14d
	testl	%ebx, %ebx
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L18
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L19:
	leal	-2(%rbx), %r15d
	testl	%r14d, %r14d
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%r15d, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L20
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L21:
	leal	-3(%rbx), %r14d
	testl	%r15d, %r15d
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L22
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L23:
	subl	$4, %ebx
	testl	%r14d, %r14d
	je	.L10
	movq	stdout(%rip), %rdi
	movslq	%ebx, %rax
	movzbl	28(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L24
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L25:
	testl	%ebx, %ebx
	je	.L10
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L106
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%r13b, (%rax)
.L10:
	cmpl	$1, %ebp
	jle	.L48
	leaq	4+array(%rip), %rbp
	leal	-1(%r12), %edx
	leaq	4(%rbp), %rax
	leaq	(%rax,%rdx,4), %r12
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L30:
	movslq	%r13d, %rbx
	movl	%r13d, %eax
	imulq	$1717986919, %rbx, %rbx
	sarl	$31, %eax
	sarq	$34, %rbx
	subl	%eax, %ebx
	leal	(%rbx,%rbx,4), %eax
	addl	%eax, %eax
	subl	%eax, %r13d
	addl	$48, %r13d
	movb	%r13b, 34(%rsp)
	testl	%ebx, %ebx
	je	.L33
	movslq	%ebx, %rax
	movl	%ebx, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %ebx
	addl	$48, %ebx
	movb	%bl, 35(%rsp)
	testl	%eax, %eax
	je	.L55
	movslq	%eax, %rdx
	movl	%eax, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %eax
	addl	$48, %eax
	movb	%al, 36(%rsp)
	testl	%edx, %edx
	je	.L56
	movslq	%edx, %rax
	movl	%edx, %r8d
	imulq	$1717986919, %rax, %rax
	sarl	$31, %r8d
	sarq	$34, %rax
	subl	%r8d, %eax
	leal	(%rax,%rax,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %edx
	addl	$48, %edx
	movb	%dl, 37(%rsp)
	testl	%eax, %eax
	je	.L57
	movslq	%eax, %rdx
	movl	%eax, %r8d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$34, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,4), %r8d
	addl	%r8d, %r8d
	subl	%r8d, %eax
	addl	$48, %eax
	movb	%al, 38(%rsp)
	testl	%edx, %edx
	je	.L58
	movslq	%edx, %rax
	movl	%edx, %r8d
	movl	$5, %ebx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %r8d
	sarq	$34, %rax
	subl	%r8d, %eax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %edx
	addl	$48, %edx
	movb	%dl, 39(%rsp)
.L33:
	movslq	%ebx, %rax
	movzbl	34(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jnb	.L34
.L112:
	leaq	1(%rcx), %rdx
	movq	%rdx, 40(%rdi)
	movb	%al, (%rcx)
.L35:
	leal	-1(%rbx), %r14d
	testl	%ebx, %ebx
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L37
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L38:
	leal	-2(%rbx), %r15d
	testl	%r14d, %r14d
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%r15d, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L39
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L40:
	leal	-3(%rbx), %r14d
	testl	%r15d, %r15d
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%r14d, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L41
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L42:
	subl	$4, %ebx
	testl	%r14d, %r14d
	je	.L32
	movq	stdout(%rip), %rdi
	movslq	%ebx, %rax
	movzbl	34(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L43
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L44:
	testl	%ebx, %ebx
	je	.L32
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L107
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%r13b, (%rax)
.L32:
	addq	$4, %rbp
	cmpq	%rbp, %r12
	je	.L48
.L47:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L108
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$32, (%rax)
.L29:
	movq	stdout(%rip), %rdi
	movl	0(%rbp), %r13d
	movl	$12336, %eax
	movl	$808464432, 34(%rsp)
	movw	%ax, 38(%rsp)
	movq	40(%rdi), %rcx
	movq	48(%rdi), %rsi
	testl	%r13d, %r13d
	jne	.L30
	cmpq	%rsi, %rcx
	jnb	.L109
	leaq	1(%rcx), %rax
	addq	$4, %rbp
	movq	%rax, 40(%rdi)
	movb	$48, (%rcx)
	cmpq	%rbp, %r12
	jne	.L47
.L48:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L110
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
.L49:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L111
	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
.L102:
	.cfi_restore_state
	movl	%ecx, 12(%rsp)
	call	__uflow@PLT
	movl	12(%rsp), %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L108:
	movl	$32, %esi
	call	__overflow@PLT
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L55:
	movl	$1, %ebx
	movslq	%ebx, %rax
	movzbl	34(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jb	.L112
.L34:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L35
.L56:
	movl	$2, %ebx
	jmp	.L33
.L57:
	movl	$3, %ebx
	jmp	.L33
.L37:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L38
.L58:
	movl	$4, %ebx
	jmp	.L33
.L39:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L40
.L105:
	cmpq	%rsi, %rcx
	jnb	.L113
	leaq	1(%rcx), %rax
	movq	%rax, 40(%rdi)
	movb	$48, (%rcx)
	jmp	.L10
.L41:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L42
.L43:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L44
.L109:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L32
.L107:
	movzbl	%r13b, %esi
	call	__overflow@PLT
	jmp	.L32
.L51:
	movl	$1, %ebx
	jmp	.L14
.L110:
	movl	$10, %esi
	call	__overflow@PLT
	jmp	.L49
.L52:
	movl	$2, %ebx
	jmp	.L14
.L15:
	movzbl	%al, %esi
	call	__overflow@PLT
	jmp	.L16
.L53:
	movl	$3, %ebx
	jmp	.L14
.L18:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L19
.L54:
	movl	$4, %ebx
	jmp	.L14
.L20:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L21
.L22:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L23
.L24:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L25
.L113:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L10
.L106:
	movzbl	%r13b, %esi
	call	__overflow@PLT
	jmp	.L10
.L111:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 400000
array:
	.zero	400000
	.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() - 'L') >= 0) x = x * 10 + k;
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[6] = {'0', '0', '0', '0', '0', '0'};
    if (!x) {
        putchar_unlocked('0');
        return;
    }
    while (x) {
        f[s++] += x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s]);
}

int array[100000];

int main() {
    int flag = 0, lastL = -1, lastR = 0, i = 0, c, diff;

    while ((c = getchar_unlocked() - 'L') >= 0) {
        if (c) {
            if (flag) {
                flag = 0;
                lastL = i - 1;
                diff = i - lastR;
                array[lastR] += (diff - 1) / 2;
                array[lastR + 1] += diff / 2;
            }
        } else {
            if (!flag) {
                flag = 1;
                lastR = i - 1;
                diff = i - lastL;
                array[i - 1] += diff / 2;
                array[i] += (diff - 1) / 2;
            }
        }
        i++;
    }

    diff = i - lastR;
    array[lastR + 1] += diff / 2;
    array[lastR] += (diff - 1) / 2;

    put_int(array[0]);
    for (c = 1; c < i; c++) {
        putchar_unlocked(' ');
        put_int(array[c]);
    }

    putchar_unlocked('\n');
}

RRLLRLRLLRLL
 RLRLLRLRRRRLLLLL
 RRLLLLRLRLRL
 RRRLLRLLRRLRLLLL
 RRLRLLRLLLRL
 RRLRLLRLLRLL
 RRLLLLRRLRLL
 RRRLLRLLLRRLLRLL
 RRLRRLLLLLRL
 RRRLLRLLRLRLLRLL

0 2 2 0 1 1 2 1 0 2 1 0
 1 1 2 1 0 1 1 0 0 0 4 5 0 0 0 0
 0 3 3 0 0 0 1 1 1 1 1 1
 0 0 3 2 0 2 1 0 0 1 2 3 2 0 0 0
 0 1 2 2 1 0 2 2 0 0 1 1
 0 1 2 2 1 0 2 1 0 2 1 0
 0 3 3 0 0 0 0 1 2 2 1 0
 0 0 3 2 0 2 2 0 0 0 2 2 0 2 1 0
 0 1 2 0 3 4 0 0 0 0 1 1
 0 0 3 2 0 2 1 0 1 1 2 1 0 2 1 0

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() - 'L') >= 0) x = x * 10 + k;
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[6] = {'0', '0', '0', '0', '0', '0'};
    if (!x) {
        putchar_unlocked('0');
        return;
    }
    while (x) {
        f[s++] += x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s]);
}

int array[100000];

int main() {
    int flag = 0, lastL = -1, lastR = 0, i = 0, c, diff;

    while ((c = getchar_unlocked() - 'L') >= 0) {
        if (c) {
            if (flag) {
                flag = 0;
                lastL = i - 1;
                diff = i - lastR;
                array[lastR] += (diff - 1) / 2;
                array[lastR + 1] += diff / 2;
            }
        } else {
            if (!flag) {
                flag = 1;
                lastR = i - 1;
                diff = i - lastL;
                array[i - 1] += diff / 2;
                array[i] += (diff - 1) / 2;
            }
        }
        i++;
    }

    diff = i - lastR;
    array[lastR + 1] += diff / 2;
    array[lastR] += (diff - 1) / 2;

    put_int(array[0]);
    for (c = 1; c < i; c++) {
        putchar_unlocked(' ');
        put_int(array[c]);
    }

    putchar_unlocked('\n');
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	movl	$808464432, -14(%rbp)
	movw	$12336, -10(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L4
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L1
.L5:
	movl	-20(%rbp), %edx
	leal	1(%rdx), %eax
	movl	%eax, -20(%rbp)
	movslq	%edx, %rax
	movzbl	-14(%rbp,%rax), %eax
	movl	%eax, %r8d
	movl	-36(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %edi
	sarl	$31, %edi
	subl	%edi, %eax
	movl	%eax, %esi
	movl	%esi, %eax
	sall	$2, %eax
	addl	%esi, %eax
	addl	%eax, %eax
	movl	%ecx, %esi
	subl	%eax, %esi
	movl	%esi, %eax
	addl	%r8d, %eax
	movl	%eax, %ecx
	movslq	%edx, %rax
	movb	%cl, -14(%rbp,%rax)
	movl	-36(%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, -36(%rbp)
.L4:
	cmpl	$0, -36(%rbp)
	jne	.L5
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	movzbl	-14(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L6:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jne	.L7
.L1:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_int, .-put_int
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 400000
array:
	.zero	400000
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	cmpl	$0, -8(%rbp)
	je	.L11
	cmpl	$0, -24(%rbp)
	je	.L12
	movl	$0, -24(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L12
.L11:
	cmpl	$0, -24(%rbp)
	jne	.L12
	movl	$1, -24(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L12:
	addl	$1, -12(%rbp)
.L10:
	call	getchar_unlocked@PLT
	subl	$76, %eax
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jns	.L13
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	array(%rip), %eax
	movl	%eax, %edi
	call	put_int
	movl	$1, -8(%rbp)
	jmp	.L14
.L15:
	movl	$32, %edi
	call	putchar_unlocked@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	put_int
	addl	$1, -8(%rbp)
.L14:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L15
	movl	$10, %edi
	call	putchar_unlocked@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.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
	.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	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	movl	$808464432, -14(%rbp)
	movw	$12336, -10(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L4
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L1
.L5:
	movl	-20(%rbp), %edx
	leal	1(%rdx), %eax
	movl	%eax, -20(%rbp)
	movslq	%edx, %rax
	movzbl	-14(%rbp,%rax), %eax
	movl	%eax, %r8d
	movl	-36(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %edi
	sarl	$31, %edi
	subl	%edi, %eax
	movl	%eax, %esi
	movl	%esi, %eax
	sall	$2, %eax
	addl	%esi, %eax
	addl	%eax, %eax
	movl	%ecx, %esi
	subl	%eax, %esi
	movl	%esi, %eax
	addl	%r8d, %eax
	movl	%eax, %ecx
	movslq	%edx, %rax
	movb	%cl, -14(%rbp,%rax)
	movl	-36(%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, -36(%rbp)
.L4:
	cmpl	$0, -36(%rbp)
	jne	.L5
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	movzbl	-14(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L6:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -20(%rbp)
	testl	%eax, %eax
	jne	.L7
.L1:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_int, .-put_int
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 400000
array:
	.zero	400000
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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
	movl	$0, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L10
.L13:
	cmpl	$0, -8(%rbp)
	je	.L11
	cmpl	$0, -24(%rbp)
	je	.L12
	movl	$0, -24(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L12
.L11:
	cmpl	$0, -24(%rbp)
	jne	.L12
	movl	$1, -24(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	subl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L12:
	addl	$1, -12(%rbp)
.L10:
	call	getchar_unlocked@PLT
	subl	$76, %eax
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jns	.L13
	movl	-12(%rbp), %eax
	subl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	array(%rip), %eax
	movl	%eax, %edi
	call	put_int
	movl	$1, -8(%rbp)
	jmp	.L14
.L15:
	movl	$32, %edi
	call	putchar_unlocked@PLT
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	put_int
	addl	$1, -8(%rbp)
.L14:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L15
	movl	$10, %edi
	call	putchar_unlocked@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.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:
