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

```c

#include <stdio.h>
#include <stdlib.h>
 
int top = 0 , stack[100];
void push (int);
int pop (void);
 
int main(){
  int x , y , flag =0 , ini ,suuji , res ;
  char c , t , input[100];
 
  while( scanf("%s", input) != EOF){
    if ( input[0]  == '+' ){
      x = pop();
      y =pop();
      res = x + y;
      push( res);
    } else if ( input[0]== '-' ){
     x = pop();
      y =pop();
      res = y -x;
      push( res);
    } else if ( input[0] == '*' ){
          x = pop();
      y =pop();
      res = x * y;
      push(res);

    }else{
              res = atoi(input);
      push (res);
    }
  }
  printf("%d\n", pop());
  return 0;
}
 
void push ( int in ){
  top++;
  stack[top] = in;
}
 
int pop (){
  int ret ;
  ret = stack[top];
  top--;
  return ret;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	stack(%rip), %rbx
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L11
	movzbl	(%rsp), %eax
	cmpb	$43, %al
	je	.L12
	cmpb	$45, %al
	je	.L13
	cmpb	$42, %al
	jne	.L6
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	imull	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	top(%rip), %rax
	leal	-1(%rax), %ecx
	movl	(%rbx,%rax,4), %eax
	movslq	%ecx, %rdx
	movl	%ecx, top(%rip)
	addl	%eax, (%rbx,%rdx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	subl	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%rax, %r8
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%r8d, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	top(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	%rdx, %rax
	movl	(%rbx,%rdx,4), %edx
	subl	$1, %eax
	movl	%eax, top(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$112, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB40:
	.cfi_startproc
	endbr64
	movl	top(%rip), %eax
	leaq	stack(%rip), %rdx
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%edi, (%rdx,%rax,4)
	ret
	.cfi_endproc
.LFE40:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	top(%rip), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rdx,%rcx,4), %r8d
	movq	%rcx, %rax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	pop, .-pop
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	stack(%rip), %rbx
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L11
	movzbl	(%rsp), %eax
	cmpb	$43, %al
	je	.L12
	cmpb	$45, %al
	je	.L13
	cmpb	$42, %al
	jne	.L6
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	imull	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	top(%rip), %rax
	leal	-1(%rax), %ecx
	movl	(%rbx,%rax,4), %eax
	movslq	%ecx, %rdx
	movl	%ecx, top(%rip)
	addl	%eax, (%rbx,%rdx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	subl	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%rax, %r8
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%r8d, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	top(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	%rdx, %rax
	movl	(%rbx,%rdx,4), %edx
	subl	$1, %eax
	movl	%eax, top(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$112, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB40:
	.cfi_startproc
	endbr64
	movl	top(%rip), %eax
	leaq	stack(%rip), %rdx
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%edi, (%rdx,%rax,4)
	ret
	.cfi_endproc
.LFE40:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	top(%rip), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rdx,%rcx,4), %r8d
	movq	%rcx, %rax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	pop, .-pop
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	stack(%rip), %rbx
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L11
	movzbl	(%rsp), %eax
	cmpb	$43, %al
	je	.L12
	cmpb	$45, %al
	je	.L13
	cmpb	$42, %al
	jne	.L6
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	imull	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	top(%rip), %rax
	leal	-1(%rax), %ecx
	movl	(%rbx,%rax,4), %eax
	movslq	%ecx, %rdx
	movl	%ecx, top(%rip)
	addl	%eax, (%rbx,%rdx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	subl	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%rax, %r8
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%r8d, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	top(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	%rdx, %rax
	movl	(%rbx,%rdx,4), %edx
	subl	$1, %eax
	movl	%eax, top(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$112, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB40:
	.cfi_startproc
	endbr64
	movl	top(%rip), %eax
	leaq	stack(%rip), %rdx
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%edi, (%rdx,%rax,4)
	ret
	.cfi_endproc
.LFE40:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	top(%rip), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rdx,%rcx,4), %r8d
	movq	%rcx, %rax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	pop, .-pop
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.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:
```
```c

#include <stdio.h>
#include <stdlib.h>
 
int top = 0 , stack[100];
void push (int);
int pop (void);
 
int main(){
  int x , y , flag =0 , ini ,suuji , res ;
  char c , t , input[100];
 
  while( scanf("%s", input) != EOF){
    if ( input[0]  == '+' ){
      x = pop();
      y =pop();
      res = x + y;
      push( res);
    } else if ( input[0]== '-' ){
     x = pop();
      y =pop();
      res = y -x;
      push( res);
    } else if ( input[0] == '*' ){
          x = pop();
      y =pop();
      res = x * y;
      push(res);

    }else{
              res = atoi(input);
      push (res);
    }
  }
  printf("%d\n", pop());
  return 0;
}
 
void push ( int in ){
  top++;
  stack[top] = in;
}
 
int pop (){
  int ret ;
  ret = stack[top];
  top--;
  return ret;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c

#include <stdio.h>
#include <stdlib.h>
 
int top = 0 , stack[100];
void push (int);
int pop (void);
 
int main(){
  int x , y , flag =0 , ini ,suuji , res ;
  char c , t , input[100];
 
  while( scanf("%s", input) != EOF){
    if ( input[0]  == '+' ){
      x = pop();
      y =pop();
      res = x + y;
      push( res);
    } else if ( input[0]== '-' ){
     x = pop();
      y =pop();
      res = y -x;
      push( res);
    } else if ( input[0] == '*' ){
          x = pop();
      y =pop();
      res = x * y;
      push(res);

    }else{
              res = atoi(input);
      push (res);
    }
  }
  printf("%d\n", pop());
  return 0;
}
 
void push ( int in ){
  top++;
  stack[top] = in;
}
 
int pop (){
  int ret ;
  ret = stack[top];
  top--;
  return ret;
}
```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c

#include <stdio.h>
#include <stdlib.h>
 
int top = 0 , stack[100];
void push (int);
int pop (void);
 
int main(){
  int x , y , flag =0 , ini ,suuji , res ;
  char c , t , input[100];
 
  while( scanf("%s", input) != EOF){
    if ( input[0]  == '+' ){
      x = pop();
      y =pop();
      res = x + y;
      push( res);
    } else if ( input[0]== '-' ){
     x = pop();
      y =pop();
      res = y -x;
      push( res);
    } else if ( input[0] == '*' ){
          x = pop();
      y =pop();
      res = x * y;
      push(res);

    }else{
              res = atoi(input);
      push (res);
    }
  }
  printf("%d\n", pop());
  return 0;
}
 
void push ( int in ){
  top++;
  stack[top] = in;
}
 
int pop (){
  int ret ;
  ret = stack[top];
  top--;
  return ret;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	stack(%rip), %rbx
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L11
	movzbl	(%rsp), %eax
	cmpb	$43, %al
	je	.L12
	cmpb	$45, %al
	je	.L13
	cmpb	$42, %al
	jne	.L6
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	imull	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	top(%rip), %rax
	leal	-1(%rax), %ecx
	movl	(%rbx,%rax,4), %eax
	movslq	%ecx, %rdx
	movl	%ecx, top(%rip)
	addl	%eax, (%rbx,%rdx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	subl	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%rax, %r8
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%r8d, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	top(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	%rdx, %rax
	movl	(%rbx,%rdx,4), %edx
	subl	$1, %eax
	movl	%eax, top(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$112, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB40:
	.cfi_startproc
	endbr64
	movl	top(%rip), %eax
	leaq	stack(%rip), %rdx
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%edi, (%rdx,%rax,4)
	ret
	.cfi_endproc
.LFE40:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	top(%rip), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rdx,%rcx,4), %r8d
	movq	%rcx, %rax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	pop, .-pop
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	stack(%rip), %rbx
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L11
	movzbl	(%rsp), %eax
	cmpb	$43, %al
	je	.L12
	cmpb	$45, %al
	je	.L13
	cmpb	$42, %al
	jne	.L6
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	imull	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	top(%rip), %rax
	leal	-1(%rax), %ecx
	movl	(%rbx,%rax,4), %eax
	movslq	%ecx, %rdx
	movl	%ecx, top(%rip)
	addl	%eax, (%rbx,%rdx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	top(%rip), %rax
	leal	-1(%rax), %esi
	movslq	%esi, %rcx
	movl	%esi, top(%rip)
	movl	(%rbx,%rcx,4), %edx
	subl	(%rbx,%rax,4), %edx
	movl	%edx, (%rbx,%rcx,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%rax, %r8
	movl	top(%rip), %eax
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%r8d, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	top(%rip), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	%rdx, %rax
	movl	(%rbx,%rdx,4), %edx
	subl	$1, %eax
	movl	%eax, top(%rip)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$112, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB40:
	.cfi_startproc
	endbr64
	movl	top(%rip), %eax
	leaq	stack(%rip), %rdx
	addl	$1, %eax
	movl	%eax, top(%rip)
	cltq
	movl	%edi, (%rdx,%rax,4)
	ret
	.cfi_endproc
.LFE40:
	.size	push, .-push
	.p2align 4
	.globl	pop
	.type	pop, @function
pop:
.LFB41:
	.cfi_startproc
	endbr64
	movslq	top(%rip), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rdx,%rcx,4), %r8d
	movq	%rcx, %rax
	subl	$1, %eax
	movl	%eax, top(%rip)
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	pop, .-pop
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.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:
```