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>

#define DSIZE 20000
#define PSIZE 10000

int top = 0, dipth[DSIZE] = {0};

typedef struct {
  int posi;
  int area;
} puddle_t;

puddle_t p[PSIZE];

int isEmpty(){
  return top == 0;
}
 
int isFull(){
  return DSIZE - 1 <= top;
}
 
int push(int posi){
  if (isFull())
    puts("over flow");
  top++;
  dipth[top] = posi;
  return 0;
}
 
int pop(){
  if (isEmpty())
    puts("under flow");
  top--;
  return dipth[top + 1];
}

int calculate(int width){
  if (width == 2)
    // triangle
    return width * 1 / 2;
  else
    // trapezoid
    return (width + width - 2) * 1 / 2;
}

int main(void){
  char c;
  int allArea = 0, posi = 0, i = 0, x, j;

  while ((c = fgetc(stdin)) != '\n') {
    switch (c) {
    case '\\':
      push(posi);
      break;
    case '/':
      if (isEmpty())
	break;
      x = pop();
      p[i].posi = x;
      p[i].area = calculate(posi + 1 - x);
      if (i == 0 || p[i - 1].posi < x)
	i++;
      else {
	for (; x < p[i - 1].posi; i--)
	  p[i - 1].area += p[i].area;
	i++;
      }
      break;
    case '_':
      break;
    default:
      puts("Non definition symbol!");
      break;
    }
    posi++;
  }
  
  // output
  for (j = 0; j < i; j++)
    allArea += p[j].area;
  printf("%d\n", allArea);

  printf("%d", i);
  for (j = 0; j < i; j++)
    printf(" %d", p[j].area);
  puts("");
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	top
	.bss
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 80000
dipth:
	.zero	80000
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 80000
p:
	.zero	80000
	.text
	.globl	isEmpty
	.type	isEmpty, @function
isEmpty:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	top(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isEmpty, .-isEmpty
	.globl	isFull
	.type	isFull, @function
isFull:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	top(%rip), %eax
	cmpl	$19998, %eax
	setg	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	isFull, .-isFull
	.section	.rodata
.LC0:
	.string	"over flow"
	.text
	.globl	push
	.type	push, @function
push:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	$0, %eax
	call	isFull
	testl	%eax, %eax
	je	.L6
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dipth(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	push, .-push
	.section	.rodata
.LC1:
	.string	"under flow"
	.text
	.globl	pop
	.type	pop, @function
pop:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	isEmpty
	testl	%eax, %eax
	je	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	movl	top(%rip), %eax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dipth(%rip), %rax
	movl	(%rdx,%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	pop, .-pop
	.globl	calculate
	.type	calculate, @function
calculate:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$2, -4(%rbp)
	jne	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L13
.L12:
	movl	-4(%rbp), %eax
	subl	$1, %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	calculate, .-calculate
	.section	.rodata
.LC2:
	.string	"Non definition symbol!"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d"
.LC5:
	.string	" %d"
.LC6:
	.string	""
	.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	$32, %rsp
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L15
.L26:
	movsbl	-21(%rbp), %eax
	cmpl	$95, %eax
	je	.L32
	cmpl	$95, %eax
	jg	.L17
	cmpl	$47, %eax
	je	.L18
	cmpl	$92, %eax
	jne	.L17
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	push
	jmp	.L19
.L18:
	movl	$0, %eax
	call	isEmpty
	testl	%eax, %eax
	jne	.L33
	movl	$0, %eax
	call	pop
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edi
	call	calculate
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	cmpl	$0, -12(%rbp)
	je	.L21
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L24
.L21:
	addl	$1, -12(%rbp)
	jmp	.L19
.L25:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	subl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L25
	addl	$1, -12(%rbp)
	jmp	.L19
.L17:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L19
.L32:
	nop
	jmp	.L19
.L33:
	nop
.L19:
	addl	$1, -16(%rbp)
.L15:
	movq	stdin(%rip), %rax
	movq	%rax, %rdi
	call	fgetc@PLT
	movb	%al, -21(%rbp)
	cmpb	$10, -21(%rbp)
	jne	.L26
	movl	$0, -8(%rbp)
	jmp	.L27
.L28:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L27:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L28
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -8(%rbp)
	jmp	.L29
.L30:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8(%rbp)
.L29:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L30
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@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	isEmpty
	.type	isEmpty, @function
isEmpty:
.LFB23:
	.cfi_startproc
	endbr64
	movl	top(%rip), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	sete	%al
	ret
	.cfi_endproc
.LFE23:
	.size	isEmpty, .-isEmpty
	.p2align 4
	.globl	isFull
	.type	isFull, @function
isFull:
.LFB24:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpl	$19998, top(%rip)
	setg	%al
	ret
	.cfi_endproc
.LFE24:
	.size	isFull, .-isFull
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"over flow"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB25:
	.cfi_startproc
	endbr64
	movl	top(%rip), %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	cmpl	$19998, %eax
	jg	.L7
.L5:
	addl	$1, %eax
	leaq	dipth(%rip), %rdx
	movl	%eax, top(%rip)
	cltq
	movl	%ebx, (%rdx,%rax,4)
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	movl	top(%rip), %eax
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	push, .-push
	.section	.rodata.str1.1
.LC1:
	.string	"under flow"
	.text
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB26:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movslq	top(%rip), %rax
	testl	%eax, %eax
	je	.L11
.L9:
	leal	-1(%rax), %edx
	movl	%edx, top(%rip)
	leaq	dipth(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movslq	top(%rip), %rax
	jmp	.L9
	.cfi_endproc
.LFE26:
	.size	pop, .-pop
	.p2align 4
	.globl	calculate
	.type	calculate, @function
calculate:
.LFB27:
	.cfi_startproc
	endbr64
	leal	-1(%rdi), %eax
	cmpl	$2, %edi
	movl	$1, %edx
	cmove	%edx, %eax
	ret
	.cfi_endproc
.LFE27:
	.size	calculate, .-calculate
	.section	.rodata.str1.1
.LC2:
	.string	"Non definition symbol!"
.LC3:
	.string	" %d"
.LC4:
	.string	""
.LC5:
	.string	"%d\n"
.LC6:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.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
	leaq	p(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	dipth(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rbp, %rdi
	call	puts@PLT
.L18:
	movl	%r15d, %ebx
.L16:
	movq	stdin(%rip), %rdi
	call	fgetc@PLT
	cmpb	$10, %al
	je	.L45
	leal	1(%rbx), %r15d
	cmpb	$92, %al
	je	.L17
	cmpb	$95, %al
	je	.L18
	cmpb	$47, %al
	jne	.L42
	movl	top(%rip), %eax
	testl	%eax, %eax
	je	.L18
	xorl	%eax, %eax
	call	pop
	movl	%r15d, %esi
	movslq	%r12d, %r8
	subl	%eax, %esi
	movl	%eax, (%r14,%r8,8)
	leal	-1(%rsi), %ecx
	cmpl	$2, %esi
	movl	$1, %esi
	cmove	%esi, %ecx
	movl	%ecx, 4(%r14,%r8,8)
	testl	%r12d, %r12d
	jne	.L46
.L25:
	addl	$1, %r12d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L17:
	movl	top(%rip), %eax
	cmpl	$19998, %eax
	jg	.L47
.L21:
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%ebx, 0(%r13,%rax,4)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L45:
	testl	%r12d, %r12d
	jle	.L28
	leal	-1(%r12), %ebp
	cmpl	$3, %ebp
	jbe	.L35
	movl	%ebp, %edx
	leaq	4+p(%rip), %rbx
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	32(%rbx), %rcx
	movq	%rbx, %rax
	subl	$1, %edx
	salq	$5, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L30:
	movdqu	(%rax), %xmm1
	movdqu	16(%rax), %xmm2
	addq	$32, %rax
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L30
	movdqa	%xmm0, %xmm1
	movl	%ebp, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
.L29:
	movslq	%eax, %rcx
	leaq	p(%rip), %rsi
	addl	4(%rsi,%rcx,8), %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L31
	movslq	%ecx, %rcx
	addl	4(%rsi,%rcx,8), %edx
	leal	2(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L31
	movslq	%ecx, %rcx
	addl	$3, %eax
	addl	4(%rsi,%rcx,8), %edx
	cmpl	%eax, %r12d
	jle	.L31
	cltq
	addl	4(%rsi,%rax,8), %edx
.L31:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r12d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	leaq	12+p(%rip), %rax
	leaq	(%rax,%rbp,8), %r12
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L32:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$8, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L32
.L33:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	addq	$8, %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
.L47:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	movl	top(%rip), %eax
	jmp	.L21
.L46:
	leal	-1(%r12), %esi
	movslq	%esi, %rsi
	cmpl	%eax, (%r14,%rsi,8)
	jl	.L25
	jle	.L25
	leaq	4+p(%rip), %rbx
	leaq	(%r14,%r8,8), %rcx
	movl	(%rbx,%r8,8), %edi
	.p2align 4,,10
	.p2align 3
.L26:
	addl	-4(%rcx), %edi
	movq	%rcx, %r8
	movl	%esi, %r12d
	subq	$8, %rcx
	movl	%edi, 4(%rcx)
	subq	$1, %rsi
	cmpl	%eax, -16(%r8)
	jg	.L26
	jmp	.L25
.L28:
	xorl	%edx, %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r12d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L33
.L35:
	xorl	%eax, %eax
	xorl	%edx, %edx
	leaq	4+p(%rip), %rbx
	jmp	.L29
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 80000
p:
	.zero	80000
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 80000
dipth:
	.zero	80000
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.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	isEmpty
	.type	isEmpty, @function
isEmpty:
.LFB23:
	.cfi_startproc
	endbr64
	movl	top(%rip), %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	sete	%al
	ret
	.cfi_endproc
.LFE23:
	.size	isEmpty, .-isEmpty
	.p2align 4
	.globl	isFull
	.type	isFull, @function
isFull:
.LFB24:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpl	$19998, top(%rip)
	setg	%al
	ret
	.cfi_endproc
.LFE24:
	.size	isFull, .-isFull
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"over flow"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB25:
	.cfi_startproc
	endbr64
	movl	top(%rip), %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	cmpl	$19998, %eax
	jg	.L7
.L5:
	addl	$1, %eax
	leaq	dipth(%rip), %rdx
	movl	%eax, top(%rip)
	cltq
	movl	%ebx, (%rdx,%rax,4)
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	movl	top(%rip), %eax
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	push, .-push
	.section	.rodata.str1.1
.LC1:
	.string	"under flow"
	.text
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB26:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movslq	top(%rip), %rax
	testl	%eax, %eax
	je	.L11
.L9:
	leal	-1(%rax), %edx
	movl	%edx, top(%rip)
	leaq	dipth(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movslq	top(%rip), %rax
	jmp	.L9
	.cfi_endproc
.LFE26:
	.size	pop, .-pop
	.p2align 4
	.globl	calculate
	.type	calculate, @function
calculate:
.LFB27:
	.cfi_startproc
	endbr64
	leal	-1(%rdi), %eax
	cmpl	$2, %edi
	movl	$1, %edx
	cmove	%edx, %eax
	ret
	.cfi_endproc
.LFE27:
	.size	calculate, .-calculate
	.section	.rodata.str1.1
.LC2:
	.string	"Non definition symbol!"
.LC3:
	.string	" %d"
.LC4:
	.string	""
.LC5:
	.string	"%d\n"
.LC6:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.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
	leaq	p(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	dipth(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rbp, %rdi
	call	puts@PLT
.L18:
	movl	%r15d, %ebx
.L16:
	movq	stdin(%rip), %rdi
	call	fgetc@PLT
	cmpb	$10, %al
	je	.L45
	leal	1(%rbx), %r15d
	cmpb	$92, %al
	je	.L17
	cmpb	$95, %al
	je	.L18
	cmpb	$47, %al
	jne	.L42
	movl	top(%rip), %eax
	testl	%eax, %eax
	je	.L18
	xorl	%eax, %eax
	call	pop
	movl	%r15d, %esi
	movslq	%r12d, %r8
	subl	%eax, %esi
	movl	%eax, (%r14,%r8,8)
	leal	-1(%rsi), %ecx
	cmpl	$2, %esi
	movl	$1, %esi
	cmove	%esi, %ecx
	movl	%ecx, 4(%r14,%r8,8)
	testl	%r12d, %r12d
	jne	.L46
.L25:
	addl	$1, %r12d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L17:
	movl	top(%rip), %eax
	cmpl	$19998, %eax
	jg	.L47
.L21:
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%ebx, 0(%r13,%rax,4)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L45:
	testl	%r12d, %r12d
	jle	.L28
	leal	-1(%r12), %ebp
	cmpl	$3, %ebp
	jbe	.L35
	movl	%ebp, %edx
	leaq	4+p(%rip), %rbx
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	32(%rbx), %rcx
	movq	%rbx, %rax
	subl	$1, %edx
	salq	$5, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L30:
	movdqu	(%rax), %xmm1
	movdqu	16(%rax), %xmm2
	addq	$32, %rax
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rdx, %rax
	jne	.L30
	movdqa	%xmm0, %xmm1
	movl	%ebp, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
.L29:
	movslq	%eax, %rcx
	leaq	p(%rip), %rsi
	addl	4(%rsi,%rcx,8), %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L31
	movslq	%ecx, %rcx
	addl	4(%rsi,%rcx,8), %edx
	leal	2(%rax), %ecx
	cmpl	%ecx, %r12d
	jle	.L31
	movslq	%ecx, %rcx
	addl	$3, %eax
	addl	4(%rsi,%rcx,8), %edx
	cmpl	%eax, %r12d
	jle	.L31
	cltq
	addl	4(%rsi,%rax,8), %edx
.L31:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r12d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	leaq	12+p(%rip), %rax
	leaq	(%rax,%rbp,8), %r12
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L32:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$8, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L32
.L33:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	addq	$8, %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
.L47:
	.cfi_restore_state
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	movl	top(%rip), %eax
	jmp	.L21
.L46:
	leal	-1(%r12), %esi
	movslq	%esi, %rsi
	cmpl	%eax, (%r14,%rsi,8)
	jl	.L25
	jle	.L25
	leaq	4+p(%rip), %rbx
	leaq	(%r14,%r8,8), %rcx
	movl	(%rbx,%r8,8), %edi
	.p2align 4,,10
	.p2align 3
.L26:
	addl	-4(%rcx), %edi
	movq	%rcx, %r8
	movl	%esi, %r12d
	subq	$8, %rcx
	movl	%edi, 4(%rcx)
	subq	$1, %rsi
	cmpl	%eax, -16(%r8)
	jg	.L26
	jmp	.L25
.L28:
	xorl	%edx, %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%r12d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L33
.L35:
	xorl	%eax, %eax
	xorl	%edx, %edx
	leaq	4+p(%rip), %rbx
	jmp	.L29
	.cfi_endproc
.LFE28:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 80000
p:
	.zero	80000
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 80000
dipth:
	.zero	80000
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.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>

#define DSIZE 20000
#define PSIZE 10000

int top = 0, dipth[DSIZE] = {0};

typedef struct {
  int posi;
  int area;
} puddle_t;

puddle_t p[PSIZE];

int isEmpty(){
  return top == 0;
}
 
int isFull(){
  return DSIZE - 1 <= top;
}
 
int push(int posi){
  if (isFull())
    puts("over flow");
  top++;
  dipth[top] = posi;
  return 0;
}
 
int pop(){
  if (isEmpty())
    puts("under flow");
  top--;
  return dipth[top + 1];
}

int calculate(int width){
  if (width == 2)
    // triangle
    return width * 1 / 2;
  else
    // trapezoid
    return (width + width - 2) * 1 / 2;
}

int main(void){
  char c;
  int allArea = 0, posi = 0, i = 0, x, j;

  while ((c = fgetc(stdin)) != '\n') {
    switch (c) {
    case '\\':
      push(posi);
      break;
    case '/':
      if (isEmpty())
	break;
      x = pop();
      p[i].posi = x;
      p[i].area = calculate(posi + 1 - x);
      if (i == 0 || p[i - 1].posi < x)
	i++;
      else {
	for (; x < p[i - 1].posi; i--)
	  p[i - 1].area += p[i].area;
	i++;
      }
      break;
    case '_':
      break;
    default:
      puts("Non definition symbol!");
      break;
    }
    posi++;
  }
  
  // output
  for (j = 0; j < i; j++)
    allArea += p[j].area;
  printf("%d\n", allArea);

  printf("%d", i);
  for (j = 0; j < i; j++)
    printf(" %d", p[j].area);
  puts("");
  return 0;
}
\/_/\_/\\_\\\__///\\/_/\\\\/\/_\///\\
 ]\//
 \/_/\_/\\_/\\__///\\/_/\\\\/\/_\/\/\\
 \/_/\_/\\_/\\__///\\/_/\[\\0\/_\/\/\\
 -/\]
 \/_/\_/\\_/\\__///\\/_0\[\\0\/_\/\/\\
 \/_/\_/\\_/\\__///\\/_0/[\\0\/_\/\\\\
 \/_/\_/\\_0\\__///\\/_0/[\\0\/_\/\\\\
 \/__\_/\\/0\\__///\\/_0/[\\0\/_\/\\\\
 \\\\/\_/\0\\[/0`/\\///__\\0/\\/_\__/\

44
5 1 2 15 5 21
 Non definition symbol!
1
1 1
 32
8 1 2 20 5 1 1 1 1
 Non definition symbol!
Non definition symbol!
31
7 1 2 20 5 1 1 1
 Non definition symbol!
Non definition symbol!
0
0
 Non definition symbol!
Non definition symbol!
Non definition symbol!
27
7 1 2 20 1 1 1 1
 Non definition symbol!
Non definition symbol!
Non definition symbol!
31
6 1 2 20 6 1 1
 Non definition symbol!
Non definition symbol!
Non definition symbol!
Non definition symbol!
28
6 1 2 17 6 1 1
 Non definition symbol!
Non definition symbol!
Non definition symbol!
Non definition symbol!
30
6 1 2 19 6 1 1
 Non definition symbol!
Non definition symbol!
Non definition symbol!
Non definition symbol!
Non definition symbol!
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
#include <stdio.h>

#define DSIZE 20000
#define PSIZE 10000

int top = 0, dipth[DSIZE] = {0};

typedef struct {
  int posi;
  int area;
} puddle_t;

puddle_t p[PSIZE];

int isEmpty(){
  return top == 0;
}
 
int isFull(){
  return DSIZE - 1 <= top;
}
 
int push(int posi){
  if (isFull())
    puts("over flow");
  top++;
  dipth[top] = posi;
  return 0;
}
 
int pop(){
  if (isEmpty())
    puts("under flow");
  top--;
  return dipth[top + 1];
}

int calculate(int width){
  if (width == 2)
    // triangle
    return width * 1 / 2;
  else
    // trapezoid
    return (width + width - 2) * 1 / 2;
}

int main(void){
  char c;
  int allArea = 0, posi = 0, i = 0, x, j;

  while ((c = fgetc(stdin)) != '\n') {
    switch (c) {
    case '\\':
      push(posi);
      break;
    case '/':
      if (isEmpty())
	break;
      x = pop();
      p[i].posi = x;
      p[i].area = calculate(posi + 1 - x);
      if (i == 0 || p[i - 1].posi < x)
	i++;
      else {
	for (; x < p[i - 1].posi; i--)
	  p[i - 1].area += p[i].area;
	i++;
      }
      break;
    case '_':
      break;
    default:
      puts("Non definition symbol!");
      break;
    }
    posi++;
  }
  
  // output
  for (j = 0; j < i; j++)
    allArea += p[j].area;
  printf("%d\n", allArea);

  printf("%d", i);
  for (j = 0; j < i; j++)
    printf(" %d", p[j].area);
  puts("");
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	top
	.bss
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 80000
dipth:
	.zero	80000
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 80000
p:
	.zero	80000
	.text
	.globl	isEmpty
	.type	isEmpty, @function
isEmpty:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	top(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isEmpty, .-isEmpty
	.globl	isFull
	.type	isFull, @function
isFull:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	top(%rip), %eax
	cmpl	$19998, %eax
	setg	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	isFull, .-isFull
	.section	.rodata
.LC0:
	.string	"over flow"
	.text
	.globl	push
	.type	push, @function
push:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	$0, %eax
	call	isFull
	testl	%eax, %eax
	je	.L6
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dipth(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	push, .-push
	.section	.rodata
.LC1:
	.string	"under flow"
	.text
	.globl	pop
	.type	pop, @function
pop:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	isEmpty
	testl	%eax, %eax
	je	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	movl	top(%rip), %eax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dipth(%rip), %rax
	movl	(%rdx,%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	pop, .-pop
	.globl	calculate
	.type	calculate, @function
calculate:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$2, -4(%rbp)
	jne	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L13
.L12:
	movl	-4(%rbp), %eax
	subl	$1, %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	calculate, .-calculate
	.section	.rodata
.LC2:
	.string	"Non definition symbol!"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d"
.LC5:
	.string	" %d"
.LC6:
	.string	""
	.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	$32, %rsp
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L15
.L26:
	movsbl	-21(%rbp), %eax
	cmpl	$95, %eax
	je	.L32
	cmpl	$95, %eax
	jg	.L17
	cmpl	$47, %eax
	je	.L18
	cmpl	$92, %eax
	jne	.L17
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	push
	jmp	.L19
.L18:
	movl	$0, %eax
	call	isEmpty
	testl	%eax, %eax
	jne	.L33
	movl	$0, %eax
	call	pop
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edi
	call	calculate
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	cmpl	$0, -12(%rbp)
	je	.L21
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L24
.L21:
	addl	$1, -12(%rbp)
	jmp	.L19
.L25:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	subl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L25
	addl	$1, -12(%rbp)
	jmp	.L19
.L17:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L19
.L32:
	nop
	jmp	.L19
.L33:
	nop
.L19:
	addl	$1, -16(%rbp)
.L15:
	movq	stdin(%rip), %rax
	movq	%rax, %rdi
	call	fgetc@PLT
	movb	%al, -21(%rbp)
	cmpb	$10, -21(%rbp)
	jne	.L26
	movl	$0, -8(%rbp)
	jmp	.L27
.L28:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L27:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L28
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -8(%rbp)
	jmp	.L29
.L30:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8(%rbp)
.L29:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L30
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@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	top
	.bss
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	dipth
	.align 32
	.type	dipth, @object
	.size	dipth, 80000
dipth:
	.zero	80000
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 80000
p:
	.zero	80000
	.text
	.globl	isEmpty
	.type	isEmpty, @function
isEmpty:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	top(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isEmpty, .-isEmpty
	.globl	isFull
	.type	isFull, @function
isFull:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	top(%rip), %eax
	cmpl	$19998, %eax
	setg	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	isFull, .-isFull
	.section	.rodata
.LC0:
	.string	"over flow"
	.text
	.globl	push
	.type	push, @function
push:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	$0, %eax
	call	isFull
	testl	%eax, %eax
	je	.L6
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dipth(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	push, .-push
	.section	.rodata
.LC1:
	.string	"under flow"
	.text
	.globl	pop
	.type	pop, @function
pop:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	isEmpty
	testl	%eax, %eax
	je	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	movl	top(%rip), %eax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	top(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dipth(%rip), %rax
	movl	(%rdx,%rax), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	pop, .-pop
	.globl	calculate
	.type	calculate, @function
calculate:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$2, -4(%rbp)
	jne	.L12
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L13
.L12:
	movl	-4(%rbp), %eax
	subl	$1, %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	calculate, .-calculate
	.section	.rodata
.LC2:
	.string	"Non definition symbol!"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%d"
.LC5:
	.string	" %d"
.LC6:
	.string	""
	.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	$32, %rsp
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L15
.L26:
	movsbl	-21(%rbp), %eax
	cmpl	$95, %eax
	je	.L32
	cmpl	$95, %eax
	jg	.L17
	cmpl	$47, %eax
	je	.L18
	cmpl	$92, %eax
	jne	.L17
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	push
	jmp	.L19
.L18:
	movl	$0, %eax
	call	isEmpty
	testl	%eax, %eax
	jne	.L33
	movl	$0, %eax
	call	pop
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	addl	$1, %eax
	subl	-4(%rbp), %eax
	movl	%eax, %edi
	call	calculate
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	cmpl	$0, -12(%rbp)
	je	.L21
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L24
.L21:
	addl	$1, -12(%rbp)
	jmp	.L19
.L25:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	subl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L25
	addl	$1, -12(%rbp)
	jmp	.L19
.L17:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L19
.L32:
	nop
	jmp	.L19
.L33:
	nop
.L19:
	addl	$1, -16(%rbp)
.L15:
	movq	stdin(%rip), %rax
	movq	%rax, %rdi
	call	fgetc@PLT
	movb	%al, -21(%rbp)
	cmpb	$10, -21(%rbp)
	jne	.L26
	movl	$0, -8(%rbp)
	jmp	.L27
.L28:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L27:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L28
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -8(%rbp)
	jmp	.L29
.L30:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8(%rbp)
.L29:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L30
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@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:
