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

```c
#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
typedef long long ll;
const int MYINF = 1e9+7;

#define STKSZ 20480

typedef struct {
	int stk[STKSZ];
	int idx;
} stack_t;

void push(stack_t *s, int x) {
	s->stk[s->idx++] = x;
}

int pop(stack_t *s) {
	if (s->idx == 0) return -1;
	return s->stk[--s->idx];
}

int peek(stack_t *s) {
	if (s->idx == 0) return -1;
	return s->stk[s->idx - 1];
}

int empty(stack_t *s) {
	return s->idx == 0;
}

stack_t slope_stk;
stack_t lakes_left_stk;
stack_t lakes_capa_stk;
stack_t *slope = &slope_stk;
stack_t *lleft = &lakes_left_stk;
stack_t *lcapa = &lakes_capa_stk;

void merge(int newleft, int adding) {
	int l, c, sum;
	sum = adding;
	while (!empty(lleft)) {
		l = peek(lleft);
		c = peek(lcapa);
		if (newleft < l) {
			sum += c;
			pop(lleft);
			pop(lcapa);
		} else break;
	}
	push(lleft, newleft);
	push(lcapa, sum);
}

int main(int argc, char **argv)
{
	int c, xpos, left, potion, k, sum;

	xpos = 0;
	while ((c = getchar()) != EOF) {
		if (c == '\\') {
			push(slope, xpos);
		} else if (c == '/') {
			left = pop(slope);
			if (left == -1) continue;
			potion = xpos - left;
			merge(left, potion);
		}
		xpos++;
	}

	while (!empty(lleft)) pop(lleft); // for reuse
	sum = k = 0;
	while (!empty(lcapa)) {
		k++;
		c = pop(lcapa);
		sum += c;
		push(lleft, c);
	}
	printf("%d\n%d", sum, k);
	while (!empty(lleft)) {
		printf(" %d", pop(lleft));
	}
	putchar('\n');

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MYINF
	.section	.rodata
	.align 4
	.type	MYINF, @object
	.size	MYINF, 4
MYINF:
	.long	1000000007
	.text
	.globl	push
	.type	push, @function
push:
.LFB0:
	.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	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, 81920(%rdx)
	movq	-8(%rbp), %rdx
	cltq
	movl	-12(%rbp), %ecx
	movl	%ecx, (%rdx,%rax,4)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB1:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$-1, %eax
	jmp	.L4
.L3:
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 81920(%rax)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pop, .-pop
	.globl	peek
	.type	peek, @function
peek:
.LFB2:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$-1, %eax
	jmp	.L7
.L6:
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	peek, .-peek
	.globl	empty
	.type	empty, @function
empty:
.LFB3:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	empty, .-empty
	.globl	slope_stk
	.bss
	.align 32
	.type	slope_stk, @object
	.size	slope_stk, 81924
slope_stk:
	.zero	81924
	.globl	lakes_left_stk
	.align 32
	.type	lakes_left_stk, @object
	.size	lakes_left_stk, 81924
lakes_left_stk:
	.zero	81924
	.globl	lakes_capa_stk
	.align 32
	.type	lakes_capa_stk, @object
	.size	lakes_capa_stk, 81924
lakes_capa_stk:
	.zero	81924
	.globl	slope
	.section	.data.rel.local,"aw"
	.align 8
	.type	slope, @object
	.size	slope, 8
slope:
	.quad	slope_stk
	.globl	lleft
	.align 8
	.type	lleft, @object
	.size	lleft, 8
lleft:
	.quad	lakes_left_stk
	.globl	lcapa
	.align 8
	.type	lcapa, @object
	.size	lcapa, 8
lcapa:
	.quad	lakes_capa_stk
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L11
.L14:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	peek
	movl	%eax, -8(%rbp)
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	peek
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L15
	movl	-4(%rbp), %eax
	addl	%eax, -12(%rbp)
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	pop
.L11:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L14
	jmp	.L13
.L15:
	nop
.L13:
	movq	lleft(%rip), %rax
	movl	-20(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	movq	lcapa(%rip), %rax
	movl	-12(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	merge, .-merge
	.section	.rodata
.LC0:
	.string	"%d\n%d"
.LC1:
	.string	" %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L17
.L21:
	cmpl	$92, -12(%rbp)
	jne	.L18
	movq	slope(%rip), %rax
	movl	-24(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	jmp	.L19
.L18:
	cmpl	$47, -12(%rbp)
	jne	.L19
	movq	slope(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, -8(%rbp)
	cmpl	$-1, -8(%rbp)
	jne	.L20
	jmp	.L17
.L20:
	movl	-24(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	merge
.L19:
	addl	$1, -24(%rbp)
.L17:
	call	getchar@PLT
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	jne	.L21
	jmp	.L22
.L23:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
.L22:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L23
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L24
.L25:
	addl	$1, -20(%rbp)
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	addl	%eax, -16(%rbp)
	movq	lleft(%rip), %rax
	movl	-12(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
.L24:
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L25
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L27:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L27
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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
	.globl	push
	.type	push, @function
push:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	81920(%rdi), %rax
	leal	1(%rax), %edx
	movl	%edx, 81920(%rdi)
	movl	%esi, (%rdi,%rax,4)
	ret
	.cfi_endproc
.LFE23:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB24:
	.cfi_startproc
	endbr64
	movl	81920(%rdi), %eax
	testl	%eax, %eax
	je	.L5
	subl	$1, %eax
	movl	%eax, 81920(%rdi)
	cltq
	movl	(%rdi,%rax,4), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	pop, .-pop
	.p2align 4
	.globl	peek
	.type	peek, @function
peek:
.LFB25:
	.cfi_startproc
	endbr64
	movl	81920(%rdi), %eax
	testl	%eax, %eax
	je	.L8
	subl	$1, %eax
	cltq
	movl	(%rdi,%rax,4), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	peek, .-peek
	.p2align 4
	.globl	empty
	.type	empty, @function
empty:
.LFB26:
	.cfi_startproc
	endbr64
	movl	81920(%rdi), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	sete	%al
	ret
	.cfi_endproc
.LFE26:
	.size	empty, .-empty
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB27:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	movq	lleft(%rip), %rsi
	movq	lcapa(%rip), %rcx
	movl	%edi, %r10d
	movslq	81920(%rsi), %rdx
	testl	%edx, %edx
	je	.L21
	movl	81920(%rcx), %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, 81920(%rsi)
	addl	%eax, %r8d
	movl	81920(%rcx), %eax
	testl	%eax, %eax
	je	.L14
	subl	$1, %eax
	movl	%eax, 81920(%rcx)
	movslq	81920(%rsi), %rdx
	testl	%edx, %edx
	je	.L21
.L15:
	leal	-1(%rdx), %edi
	movslq	%edi, %r9
	movl	(%rsi,%r9,4), %r9d
	testl	%eax, %eax
	je	.L18
	subl	$1, %eax
	cltq
	movl	(%rcx,%rax,4), %eax
.L16:
	cmpl	%r9d, %r10d
	jl	.L13
	leal	1(%rdx), %eax
	jmp	.L11
.L19:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, %eax
.L11:
	movl	%eax, 81920(%rsi)
	movslq	81920(%rcx), %rax
	movl	%r10d, (%rsi,%rdx,4)
	leal	1(%rax), %edx
	movl	%edx, 81920(%rcx)
	movl	%r8d, (%rcx,%rax,4)
	ret
.L14:
	testl	%edi, %edi
	je	.L19
	leal	-1(%rdi), %eax
	movslq	%eax, %rdx
	movl	(%rsi,%rdx,4), %r9d
	movslq	%edi, %rdx
	movl	%eax, %edi
	movl	$-1, %eax
	jmp	.L16
.L18:
	movl	$-1, %eax
	jmp	.L16
	.cfi_endproc
.LFE27:
	.size	merge, .-merge
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n%d"
.LC1:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%ebx, %ebx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	cmpl	$47, %eax
	je	.L46
.L25:
	addl	$1, %ebx
.L23:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$-1, %eax
	je	.L47
	cmpl	$92, %eax
	jne	.L24
	movq	slope(%rip), %rdx
	movslq	81920(%rdx), %rax
	leal	1(%rax), %ecx
	movl	%ecx, 81920(%rdx)
	movl	%ebx, (%rdx,%rax,4)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L46:
	movq	slope(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	je	.L23
	subl	$1, %eax
	movl	%eax, 81920(%rdx)
	cltq
	movl	(%rdx,%rax,4), %edi
	cmpl	$-1, %edi
	je	.L23
	movl	%ebx, %esi
	subl	%edi, %esi
	call	merge
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L47:
	movq	lleft(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, 81920(%rdx)
.L28:
	movq	lcapa(%rip), %rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	movl	81920(%rcx), %eax
	testl	%eax, %eax
	je	.L29
	.p2align 4,,10
	.p2align 3
.L30:
	subl	$1, %eax
	addl	$1, %r9d
	movl	%eax, 81920(%rcx)
	cltq
	movl	(%rcx,%rax,4), %esi
	movslq	81920(%rdx), %rax
	leal	1(%rax), %edi
	addl	%esi, %r8d
	movl	%edi, 81920(%rdx)
	movl	%esi, (%rdx,%rax,4)
	movl	81920(%rcx), %eax
	testl	%eax, %eax
	jne	.L30
.L29:
	movl	%r8d, %edx
	movl	%r9d, %ecx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rbx
	call	__printf_chk@PLT
	movq	lleft(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	je	.L32
	.p2align 4,,10
	.p2align 3
.L31:
	subl	$1, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	%eax, 81920(%rdx)
	cltq
	movl	(%rdx,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	lleft(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	jne	.L31
.L32:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	lcapa
	.section	.data.rel.local,"aw"
	.align 8
	.type	lcapa, @object
	.size	lcapa, 8
lcapa:
	.quad	lakes_capa_stk
	.globl	lleft
	.align 8
	.type	lleft, @object
	.size	lleft, 8
lleft:
	.quad	lakes_left_stk
	.globl	slope
	.align 8
	.type	slope, @object
	.size	slope, 8
slope:
	.quad	slope_stk
	.globl	lakes_capa_stk
	.bss
	.align 32
	.type	lakes_capa_stk, @object
	.size	lakes_capa_stk, 81924
lakes_capa_stk:
	.zero	81924
	.globl	lakes_left_stk
	.align 32
	.type	lakes_left_stk, @object
	.size	lakes_left_stk, 81924
lakes_left_stk:
	.zero	81924
	.globl	slope_stk
	.align 32
	.type	slope_stk, @object
	.size	slope_stk, 81924
slope_stk:
	.zero	81924
	.globl	MYINF
	.section	.rodata
	.align 4
	.type	MYINF, @object
	.size	MYINF, 4
MYINF:
	.long	1000000007
	.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
	.globl	push
	.type	push, @function
push:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	81920(%rdi), %rax
	leal	1(%rax), %edx
	movl	%edx, 81920(%rdi)
	movl	%esi, (%rdi,%rax,4)
	ret
	.cfi_endproc
.LFE23:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB24:
	.cfi_startproc
	endbr64
	movl	81920(%rdi), %eax
	testl	%eax, %eax
	je	.L5
	subl	$1, %eax
	movl	%eax, 81920(%rdi)
	cltq
	movl	(%rdi,%rax,4), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	pop, .-pop
	.p2align 4
	.globl	peek
	.type	peek, @function
peek:
.LFB25:
	.cfi_startproc
	endbr64
	movl	81920(%rdi), %eax
	testl	%eax, %eax
	je	.L8
	subl	$1, %eax
	cltq
	movl	(%rdi,%rax,4), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	peek, .-peek
	.p2align 4
	.globl	empty
	.type	empty, @function
empty:
.LFB26:
	.cfi_startproc
	endbr64
	movl	81920(%rdi), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	sete	%al
	ret
	.cfi_endproc
.LFE26:
	.size	empty, .-empty
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB27:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	movq	lleft(%rip), %rsi
	movq	lcapa(%rip), %rcx
	movl	%edi, %r10d
	movslq	81920(%rsi), %rdx
	testl	%edx, %edx
	je	.L21
	movl	81920(%rcx), %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, 81920(%rsi)
	addl	%eax, %r8d
	movl	81920(%rcx), %eax
	testl	%eax, %eax
	je	.L14
	subl	$1, %eax
	movl	%eax, 81920(%rcx)
	movslq	81920(%rsi), %rdx
	testl	%edx, %edx
	je	.L21
.L15:
	leal	-1(%rdx), %edi
	movslq	%edi, %r9
	movl	(%rsi,%r9,4), %r9d
	testl	%eax, %eax
	je	.L18
	subl	$1, %eax
	cltq
	movl	(%rcx,%rax,4), %eax
.L16:
	cmpl	%r9d, %r10d
	jl	.L13
	leal	1(%rdx), %eax
	jmp	.L11
.L19:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, %eax
.L11:
	movl	%eax, 81920(%rsi)
	movslq	81920(%rcx), %rax
	movl	%r10d, (%rsi,%rdx,4)
	leal	1(%rax), %edx
	movl	%edx, 81920(%rcx)
	movl	%r8d, (%rcx,%rax,4)
	ret
.L14:
	testl	%edi, %edi
	je	.L19
	leal	-1(%rdi), %eax
	movslq	%eax, %rdx
	movl	(%rsi,%rdx,4), %r9d
	movslq	%edi, %rdx
	movl	%eax, %edi
	movl	$-1, %eax
	jmp	.L16
.L18:
	movl	$-1, %eax
	jmp	.L16
	.cfi_endproc
.LFE27:
	.size	merge, .-merge
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n%d"
.LC1:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%ebx, %ebx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	cmpl	$47, %eax
	je	.L46
.L25:
	addl	$1, %ebx
.L23:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$-1, %eax
	je	.L47
	cmpl	$92, %eax
	jne	.L24
	movq	slope(%rip), %rdx
	movslq	81920(%rdx), %rax
	leal	1(%rax), %ecx
	movl	%ecx, 81920(%rdx)
	movl	%ebx, (%rdx,%rax,4)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L46:
	movq	slope(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	je	.L23
	subl	$1, %eax
	movl	%eax, 81920(%rdx)
	cltq
	movl	(%rdx,%rax,4), %edi
	cmpl	$-1, %edi
	je	.L23
	movl	%ebx, %esi
	subl	%edi, %esi
	call	merge
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L47:
	movq	lleft(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, 81920(%rdx)
.L28:
	movq	lcapa(%rip), %rcx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	movl	81920(%rcx), %eax
	testl	%eax, %eax
	je	.L29
	.p2align 4,,10
	.p2align 3
.L30:
	subl	$1, %eax
	addl	$1, %r9d
	movl	%eax, 81920(%rcx)
	cltq
	movl	(%rcx,%rax,4), %esi
	movslq	81920(%rdx), %rax
	leal	1(%rax), %edi
	addl	%esi, %r8d
	movl	%edi, 81920(%rdx)
	movl	%esi, (%rdx,%rax,4)
	movl	81920(%rcx), %eax
	testl	%eax, %eax
	jne	.L30
.L29:
	movl	%r8d, %edx
	movl	%r9d, %ecx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rbx
	call	__printf_chk@PLT
	movq	lleft(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	je	.L32
	.p2align 4,,10
	.p2align 3
.L31:
	subl	$1, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	%eax, 81920(%rdx)
	cltq
	movl	(%rdx,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	lleft(%rip), %rdx
	movl	81920(%rdx), %eax
	testl	%eax, %eax
	jne	.L31
.L32:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	lcapa
	.section	.data.rel.local,"aw"
	.align 8
	.type	lcapa, @object
	.size	lcapa, 8
lcapa:
	.quad	lakes_capa_stk
	.globl	lleft
	.align 8
	.type	lleft, @object
	.size	lleft, 8
lleft:
	.quad	lakes_left_stk
	.globl	slope
	.align 8
	.type	slope, @object
	.size	slope, 8
slope:
	.quad	slope_stk
	.globl	lakes_capa_stk
	.bss
	.align 32
	.type	lakes_capa_stk, @object
	.size	lakes_capa_stk, 81924
lakes_capa_stk:
	.zero	81924
	.globl	lakes_left_stk
	.align 32
	.type	lakes_left_stk, @object
	.size	lakes_left_stk, 81924
lakes_left_stk:
	.zero	81924
	.globl	slope_stk
	.align 32
	.type	slope_stk, @object
	.size	slope_stk, 81924
slope_stk:
	.zero	81924
	.globl	MYINF
	.section	.rodata
	.align 4
	.type	MYINF, @object
	.size	MYINF, 4
MYINF:
	.long	1000000007
	.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:

#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
typedef long long ll;
const int MYINF = 1e9+7;

#define STKSZ 20480

typedef struct {
	int stk[STKSZ];
	int idx;
} stack_t;

void push(stack_t *s, int x) {
	s->stk[s->idx++] = x;
}

int pop(stack_t *s) {
	if (s->idx == 0) return -1;
	return s->stk[--s->idx];
}

int peek(stack_t *s) {
	if (s->idx == 0) return -1;
	return s->stk[s->idx - 1];
}

int empty(stack_t *s) {
	return s->idx == 0;
}

stack_t slope_stk;
stack_t lakes_left_stk;
stack_t lakes_capa_stk;
stack_t *slope = &slope_stk;
stack_t *lleft = &lakes_left_stk;
stack_t *lcapa = &lakes_capa_stk;

void merge(int newleft, int adding) {
	int l, c, sum;
	sum = adding;
	while (!empty(lleft)) {
		l = peek(lleft);
		c = peek(lcapa);
		if (newleft < l) {
			sum += c;
			pop(lleft);
			pop(lcapa);
		} else break;
	}
	push(lleft, newleft);
	push(lcapa, sum);
}

int main(int argc, char **argv)
{
	int c, xpos, left, potion, k, sum;

	xpos = 0;
	while ((c = getchar()) != EOF) {
		if (c == '\\') {
			push(slope, xpos);
		} else if (c == '/') {
			left = pop(slope);
			if (left == -1) continue;
			potion = xpos - left;
			merge(left, potion);
		}
		xpos++;
	}

	while (!empty(lleft)) pop(lleft); // for reuse
	sum = k = 0;
	while (!empty(lcapa)) {
		k++;
		c = pop(lcapa);
		sum += c;
		push(lleft, c);
	}
	printf("%d\n%d", sum, k);
	while (!empty(lleft)) {
		printf(" %d", pop(lleft));
	}
	putchar('\n');

	return 0;
}
\/_/\_/\\_\\\__///\\/_/\\\\/\/_\///\\
 ]\//
 \/_/\_/\\_/\\__///\\/_/\\\\/\/_\/\/\\
 \/_/\_/\\_/\\__///\\/_/\[\\0\/_\/\/\\
 -/\]
 \/_/\_/\\_/\\__///\\/_0\[\\0\/_\/\/\\
 \/_/\_/\\_/\\__///\\/_0/[\\0\/_\/\\\\
 \/_/\_/\\_0\\__///\\/_0/[\\0\/_\/\\\\
 \/__\_/\\/0\\__///\\/_0/[\\0\/_\/\\\\
 \\\\/\_/\0\\[/0`/\\///__\\0/\\/_\__/\

44
5 1 2 15 5 21
 1
1 1
 32
8 1 2 20 5 1 1 1 1
 31
7 1 2 20 5 1 1 1
 0
0
 27
7 1 2 20 1 1 1 1
 31
6 1 2 20 6 1 1
 28
6 1 2 17 6 1 1
 30
6 1 2 19 6 1 1
 34
6 1 2 25 2 1 3

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

```c
#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
typedef long long ll;
const int MYINF = 1e9+7;

#define STKSZ 20480

typedef struct {
	int stk[STKSZ];
	int idx;
} stack_t;

void push(stack_t *s, int x) {
	s->stk[s->idx++] = x;
}

int pop(stack_t *s) {
	if (s->idx == 0) return -1;
	return s->stk[--s->idx];
}

int peek(stack_t *s) {
	if (s->idx == 0) return -1;
	return s->stk[s->idx - 1];
}

int empty(stack_t *s) {
	return s->idx == 0;
}

stack_t slope_stk;
stack_t lakes_left_stk;
stack_t lakes_capa_stk;
stack_t *slope = &slope_stk;
stack_t *lleft = &lakes_left_stk;
stack_t *lcapa = &lakes_capa_stk;

void merge(int newleft, int adding) {
	int l, c, sum;
	sum = adding;
	while (!empty(lleft)) {
		l = peek(lleft);
		c = peek(lcapa);
		if (newleft < l) {
			sum += c;
			pop(lleft);
			pop(lcapa);
		} else break;
	}
	push(lleft, newleft);
	push(lcapa, sum);
}

int main(int argc, char **argv)
{
	int c, xpos, left, potion, k, sum;

	xpos = 0;
	while ((c = getchar()) != EOF) {
		if (c == '\\') {
			push(slope, xpos);
		} else if (c == '/') {
			left = pop(slope);
			if (left == -1) continue;
			potion = xpos - left;
			merge(left, potion);
		}
		xpos++;
	}

	while (!empty(lleft)) pop(lleft); // for reuse
	sum = k = 0;
	while (!empty(lcapa)) {
		k++;
		c = pop(lcapa);
		sum += c;
		push(lleft, c);
	}
	printf("%d\n%d", sum, k);
	while (!empty(lleft)) {
		printf(" %d", pop(lleft));
	}
	putchar('\n');

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MYINF
	.section	.rodata
	.align 4
	.type	MYINF, @object
	.size	MYINF, 4
MYINF:
	.long	1000000007
	.text
	.globl	push
	.type	push, @function
push:
.LFB0:
	.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	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, 81920(%rdx)
	movq	-8(%rbp), %rdx
	cltq
	movl	-12(%rbp), %ecx
	movl	%ecx, (%rdx,%rax,4)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB1:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$-1, %eax
	jmp	.L4
.L3:
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 81920(%rax)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pop, .-pop
	.globl	peek
	.type	peek, @function
peek:
.LFB2:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$-1, %eax
	jmp	.L7
.L6:
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	peek, .-peek
	.globl	empty
	.type	empty, @function
empty:
.LFB3:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	empty, .-empty
	.globl	slope_stk
	.bss
	.align 32
	.type	slope_stk, @object
	.size	slope_stk, 81924
slope_stk:
	.zero	81924
	.globl	lakes_left_stk
	.align 32
	.type	lakes_left_stk, @object
	.size	lakes_left_stk, 81924
lakes_left_stk:
	.zero	81924
	.globl	lakes_capa_stk
	.align 32
	.type	lakes_capa_stk, @object
	.size	lakes_capa_stk, 81924
lakes_capa_stk:
	.zero	81924
	.globl	slope
	.section	.data.rel.local,"aw"
	.align 8
	.type	slope, @object
	.size	slope, 8
slope:
	.quad	slope_stk
	.globl	lleft
	.align 8
	.type	lleft, @object
	.size	lleft, 8
lleft:
	.quad	lakes_left_stk
	.globl	lcapa
	.align 8
	.type	lcapa, @object
	.size	lcapa, 8
lcapa:
	.quad	lakes_capa_stk
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L11
.L14:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	peek
	movl	%eax, -8(%rbp)
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	peek
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L15
	movl	-4(%rbp), %eax
	addl	%eax, -12(%rbp)
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	pop
.L11:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L14
	jmp	.L13
.L15:
	nop
.L13:
	movq	lleft(%rip), %rax
	movl	-20(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	movq	lcapa(%rip), %rax
	movl	-12(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	merge, .-merge
	.section	.rodata
.LC0:
	.string	"%d\n%d"
.LC1:
	.string	" %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L17
.L21:
	cmpl	$92, -12(%rbp)
	jne	.L18
	movq	slope(%rip), %rax
	movl	-24(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	jmp	.L19
.L18:
	cmpl	$47, -12(%rbp)
	jne	.L19
	movq	slope(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, -8(%rbp)
	cmpl	$-1, -8(%rbp)
	jne	.L20
	jmp	.L17
.L20:
	movl	-24(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	merge
.L19:
	addl	$1, -24(%rbp)
.L17:
	call	getchar@PLT
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	jne	.L21
	jmp	.L22
.L23:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
.L22:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L23
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L24
.L25:
	addl	$1, -20(%rbp)
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	addl	%eax, -16(%rbp)
	movq	lleft(%rip), %rax
	movl	-12(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
.L24:
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L25
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L27:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L27
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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
	.globl	MYINF
	.section	.rodata
	.align 4
	.type	MYINF, @object
	.size	MYINF, 4
MYINF:
	.long	1000000007
	.text
	.globl	push
	.type	push, @function
push:
.LFB0:
	.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	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, 81920(%rdx)
	movq	-8(%rbp), %rdx
	cltq
	movl	-12(%rbp), %ecx
	movl	%ecx, (%rdx,%rax,4)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.LFB1:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$-1, %eax
	jmp	.L4
.L3:
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 81920(%rax)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pop, .-pop
	.globl	peek
	.type	peek, @function
peek:
.LFB2:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$-1, %eax
	jmp	.L7
.L6:
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	peek, .-peek
	.globl	empty
	.type	empty, @function
empty:
.LFB3:
	.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)
	movq	-8(%rbp), %rax
	movl	81920(%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	empty, .-empty
	.globl	slope_stk
	.bss
	.align 32
	.type	slope_stk, @object
	.size	slope_stk, 81924
slope_stk:
	.zero	81924
	.globl	lakes_left_stk
	.align 32
	.type	lakes_left_stk, @object
	.size	lakes_left_stk, 81924
lakes_left_stk:
	.zero	81924
	.globl	lakes_capa_stk
	.align 32
	.type	lakes_capa_stk, @object
	.size	lakes_capa_stk, 81924
lakes_capa_stk:
	.zero	81924
	.globl	slope
	.section	.data.rel.local,"aw"
	.align 8
	.type	slope, @object
	.size	slope, 8
slope:
	.quad	slope_stk
	.globl	lleft
	.align 8
	.type	lleft, @object
	.size	lleft, 8
lleft:
	.quad	lakes_left_stk
	.globl	lcapa
	.align 8
	.type	lcapa, @object
	.size	lcapa, 8
lcapa:
	.quad	lakes_capa_stk
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L11
.L14:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	peek
	movl	%eax, -8(%rbp)
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	peek
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L15
	movl	-4(%rbp), %eax
	addl	%eax, -12(%rbp)
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	pop
.L11:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L14
	jmp	.L13
.L15:
	nop
.L13:
	movq	lleft(%rip), %rax
	movl	-20(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	movq	lcapa(%rip), %rax
	movl	-12(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	merge, .-merge
	.section	.rodata
.LC0:
	.string	"%d\n%d"
.LC1:
	.string	" %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L17
.L21:
	cmpl	$92, -12(%rbp)
	jne	.L18
	movq	slope(%rip), %rax
	movl	-24(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	jmp	.L19
.L18:
	cmpl	$47, -12(%rbp)
	jne	.L19
	movq	slope(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, -8(%rbp)
	cmpl	$-1, -8(%rbp)
	jne	.L20
	jmp	.L17
.L20:
	movl	-24(%rbp), %eax
	subl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	merge
.L19:
	addl	$1, -24(%rbp)
.L17:
	call	getchar@PLT
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	jne	.L21
	jmp	.L22
.L23:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
.L22:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L23
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L24
.L25:
	addl	$1, -20(%rbp)
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	addl	%eax, -16(%rbp)
	movq	lleft(%rip), %rax
	movl	-12(%rbp), %edx
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
.L24:
	movq	lcapa(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L25
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L27:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	pop
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movq	lleft(%rip), %rax
	movq	%rax, %rdi
	call	empty
	testl	%eax, %eax
	je	.L27
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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:
