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

```c
#include <stdio.h>
#include <stdlib.h>

#define STACK_SIZE 100
struct StackStruct
{
	int top;
	int data[STACK_SIZE];
};
typedef struct StackStruct Stack;

void stack_clear(Stack *stack)
{
	stack->top = 0;
}

int stack_pop(Stack *stack)
{
	return stack->data[--stack->top];
}

void stack_push(Stack *stack, int value)
{
	stack->data[stack->top++] = value;
}

void stack_dump(Stack *stack)
{
	printf("[");
	for(int i = 0; i < stack->top; ++i)
	{
		printf(" %d", stack->data[i]);
	}
	printf(" ]\n");
}

int main()
{
	char token[8];
	Stack stack;
	stack_clear(&stack);

	while(scanf("%s", token) != EOF)
	{
		int valueL, valueR;
		//printf("token = '%s'\n", token);
		
		switch(token[0])
		{
			case '+':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL + valueR);
				break;
			
			case '-':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL - valueR);
				break;
			
			case '*':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL * valueR);
				break;
			
			case '/':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL / valueR);
				break;
			
			default:
				stack_push(&stack, atoi(token));
				break;
		}
		//stack_dump(&stack);
	}
	printf("%d\n", stack_pop(&stack));
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	stack_clear
	.type	stack_clear, @function
stack_clear:
.LFB6:
	.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	$0, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	stack_clear, .-stack_clear
	.globl	stack_pop
	.type	stack_pop, @function
stack_pop:
.LFB7:
	.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	(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,4), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	stack_pop, .-stack_pop
	.globl	stack_push
	.type	stack_push, @function
stack_push:
.LFB8:
	.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	(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, (%rdx)
	movq	-8(%rbp), %rdx
	cltq
	movl	-12(%rbp), %ecx
	movl	%ecx, 4(%rdx,%rax,4)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	stack_push, .-stack_push
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" ]"
	.text
	.globl	stack_dump
	.type	stack_dump, @function
stack_dump:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	$91, %edi
	call	putchar@PLT
	movl	$0, -4(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L6:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	stack_dump, .-stack_dump
	.section	.rodata
.LC2:
	.string	"%s"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_clear
	jmp	.L9
.L14:
	movzbl	-16(%rbp), %eax
	movsbl	%al, %eax
	cmpl	$47, %eax
	je	.L10
	cmpl	$47, %eax
	jg	.L11
	cmpl	$45, %eax
	je	.L12
	cmpl	$45, %eax
	jg	.L11
	cmpl	$42, %eax
	je	.L13
	cmpl	$43, %eax
	jne	.L11
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %edx
	movl	-440(%rbp), %eax
	addl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L12:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	subl	-440(%rbp), %eax
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L13:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	imull	-440(%rbp), %eax
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L10:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	cltd
	idivl	-440(%rbp)
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L11:
	leaq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	nop
.L9:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	stack_clear
	.type	stack_clear, @function
stack_clear:
.LFB39:
	.cfi_startproc
	endbr64
	movl	$0, (%rdi)
	ret
	.cfi_endproc
.LFE39:
	.size	stack_clear, .-stack_clear
	.p2align 4
	.globl	stack_pop
	.type	stack_pop, @function
stack_pop:
.LFB40:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	$1, %eax
	movl	%eax, (%rdi)
	cltq
	movl	4(%rdi,%rax,4), %eax
	ret
	.cfi_endproc
.LFE40:
	.size	stack_pop, .-stack_pop
	.p2align 4
	.globl	stack_push
	.type	stack_push, @function
stack_push:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rax
	leal	1(%rax), %edx
	movl	%edx, (%rdi)
	movl	%esi, 4(%rdi,%rax,4)
	ret
	.cfi_endproc
.LFE41:
	.size	stack_push, .-stack_push
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.LC1:
	.string	" ]"
	.text
	.p2align 4
	.globl	stack_dump
	.type	stack_dump, @function
stack_dump:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	movl	$91, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	putchar@PLT
	movl	0(%rbp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%ebx, %ebx
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	4(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 0(%rbp)
	jg	.L7
.L6:
	popq	%rbx
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	puts@PLT
	.cfi_endproc
.LFE42:
	.size	stack_dump, .-stack_dump
	.section	.rodata.str1.1
.LC2:
	.string	"%s"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$432, %rsp
	.cfi_def_cfa_offset 464
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	416(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movzbl	416(%rsp), %eax
	cmpb	$45, %al
	je	.L12
	jg	.L13
	cmpb	$42, %al
	je	.L14
	cmpb	$43, %al
	jne	.L16
	leal	-1(%rbx), %eax
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%eax, %rdx
	movl	4(%rsp,%rdx,4), %edx
	addl	%edx, 4(%rsp,%rbx,4)
	movl	%eax, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	$47, %al
	jne	.L16
	leal	-1(%rbx), %ecx
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%ecx, %rdi
	movl	4(%rsp,%rbx,4), %eax
	cltd
	idivl	4(%rsp,%rdi,4)
	movl	%eax, 4(%rsp,%rbx,4)
	movl	%ecx, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	leal	-1(%rbx), %edx
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%edx, %rcx
	movl	4(%rsp,%rbx,4), %eax
	subl	4(%rsp,%rcx,4), %eax
	movl	%eax, 4(%rsp,%rbx,4)
	movl	%edx, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%rax, %r8
	movslq	%ebx, %rax
	addl	$1, %ebx
	movl	%r8d, 4(%rsp,%rax,4)
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	leal	-1(%rbx), %edx
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%edx, %rcx
	movl	4(%rsp,%rbx,4), %eax
	imull	4(%rsp,%rcx,4), %eax
	movl	%eax, 4(%rsp,%rbx,4)
	movl	%edx, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L22:
	subl	$1, %ebx
	xorl	%eax, %eax
	movl	$1, %edi
	movslq	%ebx, %rbx
	leaq	.LC3(%rip), %rsi
	movl	4(%rsp,%rbx,4), %edx
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	stack_clear
	.type	stack_clear, @function
stack_clear:
.LFB39:
	.cfi_startproc
	endbr64
	movl	$0, (%rdi)
	ret
	.cfi_endproc
.LFE39:
	.size	stack_clear, .-stack_clear
	.p2align 4
	.globl	stack_pop
	.type	stack_pop, @function
stack_pop:
.LFB40:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	$1, %eax
	movl	%eax, (%rdi)
	cltq
	movl	4(%rdi,%rax,4), %eax
	ret
	.cfi_endproc
.LFE40:
	.size	stack_pop, .-stack_pop
	.p2align 4
	.globl	stack_push
	.type	stack_push, @function
stack_push:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rax
	leal	1(%rax), %edx
	movl	%edx, (%rdi)
	movl	%esi, 4(%rdi,%rax,4)
	ret
	.cfi_endproc
.LFE41:
	.size	stack_push, .-stack_push
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.LC1:
	.string	" ]"
	.text
	.p2align 4
	.globl	stack_dump
	.type	stack_dump, @function
stack_dump:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	movl	$91, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	putchar@PLT
	movl	0(%rbp), %eax
	testl	%eax, %eax
	jle	.L6
	xorl	%ebx, %ebx
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	4(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 0(%rbp)
	jg	.L7
.L6:
	popq	%rbx
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	puts@PLT
	.cfi_endproc
.LFE42:
	.size	stack_dump, .-stack_dump
	.section	.rodata.str1.1
.LC2:
	.string	"%s"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$432, %rsp
	.cfi_def_cfa_offset 464
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	416(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movzbl	416(%rsp), %eax
	cmpb	$45, %al
	je	.L12
	jg	.L13
	cmpb	$42, %al
	je	.L14
	cmpb	$43, %al
	jne	.L16
	leal	-1(%rbx), %eax
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%eax, %rdx
	movl	4(%rsp,%rdx,4), %edx
	addl	%edx, 4(%rsp,%rbx,4)
	movl	%eax, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	cmpb	$47, %al
	jne	.L16
	leal	-1(%rbx), %ecx
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%ecx, %rdi
	movl	4(%rsp,%rbx,4), %eax
	cltd
	idivl	4(%rsp,%rdi,4)
	movl	%eax, 4(%rsp,%rbx,4)
	movl	%ecx, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	leal	-1(%rbx), %edx
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%edx, %rcx
	movl	4(%rsp,%rbx,4), %eax
	subl	4(%rsp,%rcx,4), %eax
	movl	%eax, 4(%rsp,%rbx,4)
	movl	%edx, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%rax, %r8
	movslq	%ebx, %rax
	addl	$1, %ebx
	movl	%r8d, 4(%rsp,%rax,4)
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	leal	-1(%rbx), %edx
	subl	$2, %ebx
	movslq	%ebx, %rbx
	movslq	%edx, %rcx
	movl	4(%rsp,%rbx,4), %eax
	imull	4(%rsp,%rcx,4), %eax
	movl	%eax, 4(%rsp,%rbx,4)
	movl	%edx, %ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L22:
	subl	$1, %ebx
	xorl	%eax, %eax
	movl	$1, %edi
	movslq	%ebx, %rbx
	leaq	.LC3(%rip), %rsi
	movl	4(%rsp,%rbx,4), %edx
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.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:

#include <stdio.h>
#include <stdlib.h>

#define STACK_SIZE 100
struct StackStruct
{
	int top;
	int data[STACK_SIZE];
};
typedef struct StackStruct Stack;

void stack_clear(Stack *stack)
{
	stack->top = 0;
}

int stack_pop(Stack *stack)
{
	return stack->data[--stack->top];
}

void stack_push(Stack *stack, int value)
{
	stack->data[stack->top++] = value;
}

void stack_dump(Stack *stack)
{
	printf("[");
	for(int i = 0; i < stack->top; ++i)
	{
		printf(" %d", stack->data[i]);
	}
	printf(" ]\n");
}

int main()
{
	char token[8];
	Stack stack;
	stack_clear(&stack);

	while(scanf("%s", token) != EOF)
	{
		int valueL, valueR;
		//printf("token = '%s'\n", token);
		
		switch(token[0])
		{
			case '+':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL + valueR);
				break;
			
			case '-':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL - valueR);
				break;
			
			case '*':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL * valueR);
				break;
			
			case '/':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL / valueR);
				break;
			
			default:
				stack_push(&stack, atoi(token));
				break;
		}
		//stack_dump(&stack);
	}
	printf("%d\n", stack_pop(&stack));
}


1 4 + 3 4 - *
 1 3 +
 1 4 + 2 4 - *
 0 3 +
 1 1 + 2 4 - *
 0 3 *
 1 4 + 3 8 - *
 0 5 +
 1 1 + 3 4 - *
 1 4 * 3 1 - *

-5
 4
 -10
 3
 -4
 0
 -25
 5
 -2
 8

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

```c
#include <stdio.h>
#include <stdlib.h>

#define STACK_SIZE 100
struct StackStruct
{
	int top;
	int data[STACK_SIZE];
};
typedef struct StackStruct Stack;

void stack_clear(Stack *stack)
{
	stack->top = 0;
}

int stack_pop(Stack *stack)
{
	return stack->data[--stack->top];
}

void stack_push(Stack *stack, int value)
{
	stack->data[stack->top++] = value;
}

void stack_dump(Stack *stack)
{
	printf("[");
	for(int i = 0; i < stack->top; ++i)
	{
		printf(" %d", stack->data[i]);
	}
	printf(" ]\n");
}

int main()
{
	char token[8];
	Stack stack;
	stack_clear(&stack);

	while(scanf("%s", token) != EOF)
	{
		int valueL, valueR;
		//printf("token = '%s'\n", token);
		
		switch(token[0])
		{
			case '+':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL + valueR);
				break;
			
			case '-':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL - valueR);
				break;
			
			case '*':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL * valueR);
				break;
			
			case '/':
				valueR = stack_pop(&stack);
				valueL = stack_pop(&stack);
				stack_push(&stack, valueL / valueR);
				break;
			
			default:
				stack_push(&stack, atoi(token));
				break;
		}
		//stack_dump(&stack);
	}
	printf("%d\n", stack_pop(&stack));
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	stack_clear
	.type	stack_clear, @function
stack_clear:
.LFB6:
	.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	$0, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	stack_clear, .-stack_clear
	.globl	stack_pop
	.type	stack_pop, @function
stack_pop:
.LFB7:
	.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	(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,4), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	stack_pop, .-stack_pop
	.globl	stack_push
	.type	stack_push, @function
stack_push:
.LFB8:
	.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	(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, (%rdx)
	movq	-8(%rbp), %rdx
	cltq
	movl	-12(%rbp), %ecx
	movl	%ecx, 4(%rdx,%rax,4)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	stack_push, .-stack_push
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" ]"
	.text
	.globl	stack_dump
	.type	stack_dump, @function
stack_dump:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	$91, %edi
	call	putchar@PLT
	movl	$0, -4(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L6:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	stack_dump, .-stack_dump
	.section	.rodata
.LC2:
	.string	"%s"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_clear
	jmp	.L9
.L14:
	movzbl	-16(%rbp), %eax
	movsbl	%al, %eax
	cmpl	$47, %eax
	je	.L10
	cmpl	$47, %eax
	jg	.L11
	cmpl	$45, %eax
	je	.L12
	cmpl	$45, %eax
	jg	.L11
	cmpl	$42, %eax
	je	.L13
	cmpl	$43, %eax
	jne	.L11
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %edx
	movl	-440(%rbp), %eax
	addl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L12:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	subl	-440(%rbp), %eax
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L13:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	imull	-440(%rbp), %eax
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L10:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	cltd
	idivl	-440(%rbp)
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L11:
	leaq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	nop
.L9:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	stack_clear
	.type	stack_clear, @function
stack_clear:
.LFB6:
	.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	$0, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	stack_clear, .-stack_clear
	.globl	stack_pop
	.type	stack_pop, @function
stack_pop:
.LFB7:
	.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	(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,4), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	stack_pop, .-stack_pop
	.globl	stack_push
	.type	stack_push, @function
stack_push:
.LFB8:
	.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	(%rax), %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdx
	movl	%ecx, (%rdx)
	movq	-8(%rbp), %rdx
	cltq
	movl	-12(%rbp), %ecx
	movl	%ecx, 4(%rdx,%rax,4)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	stack_push, .-stack_push
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" ]"
	.text
	.globl	stack_dump
	.type	stack_dump, @function
stack_dump:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	$91, %edi
	call	putchar@PLT
	movl	$0, -4(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L6:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	stack_dump, .-stack_dump
	.section	.rodata
.LC2:
	.string	"%s"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_clear
	jmp	.L9
.L14:
	movzbl	-16(%rbp), %eax
	movsbl	%al, %eax
	cmpl	$47, %eax
	je	.L10
	cmpl	$47, %eax
	jg	.L11
	cmpl	$45, %eax
	je	.L12
	cmpl	$45, %eax
	jg	.L11
	cmpl	$42, %eax
	je	.L13
	cmpl	$43, %eax
	jne	.L11
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %edx
	movl	-440(%rbp), %eax
	addl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L12:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	subl	-440(%rbp), %eax
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L13:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	imull	-440(%rbp), %eax
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L10:
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -440(%rbp)
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, -436(%rbp)
	movl	-436(%rbp), %eax
	cltd
	idivl	-440(%rbp)
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	jmp	.L9
.L11:
	leaq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, %edx
	leaq	-432(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	stack_push
	nop
.L9:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	leaq	-432(%rbp), %rax
	movq	%rax, %rdi
	call	stack_pop
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
