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>
#include <ctype.h>

/** テヲツ閉ーテ・ツシツ湘」ツつ、テ」ツδ?」ツδャテ」ツδシテ」ツつソ */
static const char *p;

static int expression ( );

static int
factor (
  void
  )
{
  int res = 0;

  if ( *p == '(' )
  {
    ++p;
    res = expression ( );
    ++p;
  }
  else while ( isdigit ( *p ) )
  {
    res = res * 10 + ( *( p++ ) - '0' );
  }

  return ( res );
}

static int
term (
  void
  )
{
  int res = factor ( );

  for ( ; ; )
  {
    switch ( *p )
    {
      case '*':
        ++p;
        res *= factor ( );
        break ;
      case '/':
        ++p;
        res /= factor ( );
        break ;
      default:
        return ( res );
    }
  }
}

static int
expression (
  void
  )
{
  int res = term ( );

  for ( ; ; )
  {
    switch ( *p )
    {
      case '+':
        ++p;
        res += term ( );
        break ;
      case '-':
        ++p;
        res -= term ( );
        break ;
      default:
        return ( res );
    }
  }
}

/** テヲツ閉ーテ・ツシツ銃xpr テ」ツつ津ィツィツ暗ァツョツ療」ツ?凖」ツつ凝ッツシツ?*/
static int
calculate (
  const char *expr
  )
{
  p = expr;

  return
  expression ( );
}

int
main (
  int   argc,
  char *argv[ ]
  )
{
  /** ティツィツ暗ァツョツ療・ツッツセティツアツ。テ」ツ?ョテヲツ閉ーテ・ツシツ?*/
  char expr[ 128 ];
  /** テ・ツ?・テ・ツ環崚」ツ?ョテ・ツ?凝ヲツ閉ー */
  int n;

  scanf ( "%d", &n );
  while ( n-- )
  {
    scanf ( " %s", expr );

    printf ( "%d\n", calculate ( expr ) );
  }

  return ( EXIT_SUCCESS );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	p
	.comm	p,8,8
	.type	factor, @function
factor:
.LFB6:
	.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	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$40, %al
	jne	.L4
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$0, %eax
	call	expression
	movl	%eax, -4(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	jmp	.L3
.L5:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L4:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	jne	.L5
.L3:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	factor, .-factor
	.type	term, @function
term:
.LFB7:
	.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
	call	factor
	movl	%eax, -4(%rbp)
.L13:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$42, %eax
	je	.L8
	cmpl	$47, %eax
	je	.L9
	jmp	.L14
.L8:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	factor
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L11
.L9:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	factor
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -4(%rbp)
	jmp	.L11
.L14:
	movl	-4(%rbp), %eax
	jmp	.L15
.L11:
	jmp	.L13
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	term, .-term
	.type	expression, @function
expression:
.LFB8:
	.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
	call	term
	movl	%eax, -4(%rbp)
.L22:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$43, %eax
	je	.L17
	cmpl	$45, %eax
	je	.L18
	jmp	.L23
.L17:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	term
	addl	%eax, -4(%rbp)
	jmp	.L20
.L18:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	term
	subl	%eax, -4(%rbp)
	jmp	.L20
.L23:
	movl	-4(%rbp), %eax
	jmp	.L24
.L20:
	jmp	.L22
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	expression, .-expression
	.type	calculate, @function
calculate:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, p(%rip)
	call	expression
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	calculate, .-calculate
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %s"
.LC2:
	.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	$176, %rsp
	movl	%edi, -164(%rbp)
	movq	%rsi, -176(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-148(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L28
.L29:
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-144(%rbp), %rax
	movq	%rax, %rdi
	call	calculate
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	movl	-148(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -148(%rbp)
	testl	%eax, %eax
	jne	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	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
	.type	term, @function
term:
.LFB42:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	p(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movsbl	(%r14), %ebx
	cmpb	$40, %bl
	je	.L2
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%r13d, %r13d
	movq	(%rax), %rcx
	leaq	1(%r14), %rax
	testb	$8, 1(%rcx,%rdx,2)
	je	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	leal	0(%r13,%r13,4), %edx
	movq	%rax, %r14
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %r13d
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rcx,%rdx,2)
	jne	.L11
	movq	%r14, p(%rip)
.L10:
	cmpb	$42, %bl
	je	.L13
.L50:
	cmpb	$47, %bl
	je	.L14
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r13d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movsbl	1(%r14), %ebx
	leaq	1(%r14), %r12
	movq	%r12, p(%rip)
	cmpb	$40, %bl
	je	.L26
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%ebp, %ebp
	movq	(%rax), %rcx
	leaq	2(%r14), %rax
	movq	%r12, %r14
	testb	$8, 1(%rcx,%rdx,2)
	je	.L34
	.p2align 4,,10
	.p2align 3
.L35:
	leal	0(%rbp,%rbp,4), %edx
	movq	%rax, %r14
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %ebp
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rcx,%rdx,2)
	jne	.L35
	movq	%r14, p(%rip)
.L34:
	movl	%r13d, %eax
	cltd
	idivl	%ebp
	movl	%eax, %r13d
	cmpb	$42, %bl
	jne	.L50
.L13:
	movsbl	1(%r14), %ebx
	leaq	1(%r14), %rbp
	movq	%rbp, p(%rip)
	cmpb	$40, %bl
	je	.L16
	call	__ctype_b_loc@PLT
	xorl	%r12d, %r12d
	movq	(%rax), %rdx
	movsbq	%bl, %rax
	testb	$8, 1(%rdx,%rax,2)
	je	.L48
	.p2align 4,,10
	.p2align 3
.L17:
	leal	(%r12,%r12,4), %eax
	addq	$1, %rbp
	leal	-48(%rbx,%rax,2), %r12d
	movsbl	0(%rbp), %ebx
	movsbq	%bl, %rax
	testb	$8, 1(%rdx,%rax,2)
	jne	.L17
	movq	%rbp, p(%rip)
.L48:
	movq	%rbp, %r14
.L24:
	imull	%r12d, %r13d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %r14
	movq	%r14, p(%rip)
	call	term
	movl	%eax, %r13d
.L5:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %r14
	cmpb	$43, %dl
	je	.L6
	cmpb	$45, %dl
	je	.L7
	movq	%r14, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	addq	$2, %r14
	movq	%r14, p(%rip)
	call	term
	movl	%eax, %r12d
.L19:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %r14
	cmpb	$43, %dl
	je	.L20
	cmpb	$45, %dl
	je	.L21
	movq	%r14, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$2, %r14
	movq	%r14, p(%rip)
	call	term
	movl	%eax, %ebp
.L29:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %r14
	cmpb	$43, %dl
	je	.L30
	cmpb	$45, %dl
	je	.L31
	movq	%r14, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r14, p(%rip)
	call	term
	subl	%eax, %r12d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r14, p(%rip)
	call	term
	addl	%eax, %r12d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, p(%rip)
	call	term
	subl	%eax, %r13d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, p(%rip)
	call	term
	addl	%eax, %r13d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r14, p(%rip)
	call	term
	subl	%eax, %ebp
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%r14, p(%rip)
	call	term
	addl	%eax, %ebp
	jmp	.L29
	.cfi_endproc
.LFE42:
	.size	term, .-term
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB45:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$184, %rsp
	.cfi_def_cfa_offset 240
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	leaq	32(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L52
	jmp	.L128
	.p2align 4,,10
	.p2align 3
.L157:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L128
.L52:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, p(%rip)
	call	term
	movq	p(%rip), %rbp
	movl	%eax, %r12d
	movzbl	0(%rbp), %ebx
.L53:
	cmpb	$43, %bl
	je	.L54
.L159:
	cmpb	$45, %bl
	jne	.L157
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %rdi
	movq	%rdi, p(%rip)
	movq	%rdi, 8(%rsp)
	cmpb	$40, %bl
	je	.L93
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%r14d, %r14d
	movq	8(%rsp), %rdi
	movq	(%rax), %rsi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rsi,%rdx,2)
	je	.L158
	.p2align 4,,10
	.p2align 3
.L102:
	leal	(%r14,%r14,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %r14d
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rsi,%rdx,2)
	jne	.L102
	movq	%rbp, p(%rip)
.L101:
	cmpb	$42, %bl
	je	.L104
.L162:
	cmpb	$47, %bl
	je	.L105
	subl	%r14d, %r12d
	cmpb	$43, %bl
	jne	.L159
.L54:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %rdi
	movq	%rdi, p(%rip)
	movq	%rdi, 8(%rsp)
	cmpb	$40, %bl
	je	.L57
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%r14d, %r14d
	movq	8(%rsp), %rdi
	movq	(%rax), %rsi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rsi,%rdx,2)
	je	.L160
	.p2align 4,,10
	.p2align 3
.L66:
	leal	(%r14,%r14,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %r14d
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rsi,%rdx,2)
	jne	.L66
	movq	%rbp, p(%rip)
.L65:
	cmpb	$42, %bl
	je	.L68
.L165:
	cmpb	$47, %bl
	je	.L69
	addl	%r14d, %r12d
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L105:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L118
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%esi, %esi
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rdx,2)
	je	.L161
	.p2align 4,,10
	.p2align 3
.L127:
	leal	(%rsi,%rsi,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %esi
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rdi,%rdx,2)
	jne	.L127
	movq	%rbp, p(%rip)
.L126:
	movl	%r14d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r14d
	cmpb	$42, %bl
	jne	.L162
.L104:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L107
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rsi
	xorl	%edx, %edx
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rsi,2)
	je	.L163
	.p2align 4,,10
	.p2align 3
.L116:
	leal	(%rdx,%rdx,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %edx
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rsi
	testb	$8, 1(%rdi,%rsi,2)
	jne	.L116
	movq	%rbp, p(%rip)
.L115:
	imull	%edx, %r14d
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L69:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L82
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%esi, %esi
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rdx,2)
	je	.L164
	.p2align 4,,10
	.p2align 3
.L91:
	leal	(%rsi,%rsi,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %esi
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rdi,%rdx,2)
	jne	.L91
	movq	%rbp, p(%rip)
.L90:
	movl	%r14d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r14d
	cmpb	$42, %bl
	jne	.L165
.L68:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L71
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rsi
	xorl	%edx, %edx
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rsi,2)
	je	.L166
	.p2align 4,,10
	.p2align 3
.L80:
	leal	(%rdx,%rdx,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %edx
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rsi
	testb	$8, 1(%rdi,%rsi,2)
	jne	.L80
	movq	%rbp, p(%rip)
.L79:
	imull	%edx, %r14d
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L71:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %edx
.L74:
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	leaq	1(%rax), %rbp
	cmpb	$43, %sil
	je	.L75
	cmpb	$45, %sil
	je	.L76
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L93:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %r14d
.L96:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L97
	cmpb	$45, %dl
	je	.L98
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L76:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	subl	%eax, %edx
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L75:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	addl	%eax, %edx
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L98:
	movq	%rbp, p(%rip)
	call	term
	subl	%eax, %r14d
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L97:
	movq	%rbp, p(%rip)
	call	term
	addl	%eax, %r14d
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L82:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %esi
.L85:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L86
	cmpb	$45, %dl
	je	.L87
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L90
	.p2align 4,,10
	.p2align 3
.L107:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %edx
.L110:
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	leaq	1(%rax), %rbp
	cmpb	$43, %sil
	je	.L111
	cmpb	$45, %sil
	je	.L112
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L115
	.p2align 4,,10
	.p2align 3
.L118:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %esi
.L121:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L122
	cmpb	$45, %dl
	je	.L123
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L126
	.p2align 4,,10
	.p2align 3
.L87:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	subl	%eax, %esi
	jmp	.L85
	.p2align 4,,10
	.p2align 3
.L86:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	addl	%eax, %esi
	jmp	.L85
	.p2align 4,,10
	.p2align 3
.L57:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %r14d
.L60:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L61
	cmpb	$45, %dl
	je	.L62
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L112:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	subl	%eax, %edx
	jmp	.L110
	.p2align 4,,10
	.p2align 3
.L111:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	addl	%eax, %edx
	jmp	.L110
	.p2align 4,,10
	.p2align 3
.L62:
	movq	%rbp, p(%rip)
	call	term
	subl	%eax, %r14d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L61:
	movq	%rbp, p(%rip)
	call	term
	addl	%eax, %r14d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L123:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	subl	%eax, %esi
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L122:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	addl	%eax, %esi
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L128:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L167
	addq	$184, %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
.L158:
	.cfi_restore_state
	movq	%rdi, %rbp
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L164:
	movq	%r8, %rbp
	jmp	.L90
	.p2align 4,,10
	.p2align 3
.L166:
	movq	%r8, %rbp
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L163:
	movq	%r8, %rbp
	jmp	.L115
	.p2align 4,,10
	.p2align 3
.L160:
	movq	%rdi, %rbp
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L161:
	movq	%r8, %rbp
	jmp	.L126
.L167:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE45:
	.size	main, .-main
	.local	p
	.comm	p,8,8
	.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
	.type	term, @function
term:
.LFB42:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	p(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movsbl	(%r14), %ebx
	cmpb	$40, %bl
	je	.L2
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%r13d, %r13d
	movq	(%rax), %rcx
	leaq	1(%r14), %rax
	testb	$8, 1(%rcx,%rdx,2)
	je	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	leal	0(%r13,%r13,4), %edx
	movq	%rax, %r14
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %r13d
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rcx,%rdx,2)
	jne	.L11
	movq	%r14, p(%rip)
.L10:
	cmpb	$42, %bl
	je	.L13
.L50:
	cmpb	$47, %bl
	je	.L14
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r13d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movsbl	1(%r14), %ebx
	leaq	1(%r14), %r12
	movq	%r12, p(%rip)
	cmpb	$40, %bl
	je	.L26
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%ebp, %ebp
	movq	(%rax), %rcx
	leaq	2(%r14), %rax
	movq	%r12, %r14
	testb	$8, 1(%rcx,%rdx,2)
	je	.L34
	.p2align 4,,10
	.p2align 3
.L35:
	leal	0(%rbp,%rbp,4), %edx
	movq	%rax, %r14
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %ebp
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rcx,%rdx,2)
	jne	.L35
	movq	%r14, p(%rip)
.L34:
	movl	%r13d, %eax
	cltd
	idivl	%ebp
	movl	%eax, %r13d
	cmpb	$42, %bl
	jne	.L50
.L13:
	movsbl	1(%r14), %ebx
	leaq	1(%r14), %rbp
	movq	%rbp, p(%rip)
	cmpb	$40, %bl
	je	.L16
	call	__ctype_b_loc@PLT
	xorl	%r12d, %r12d
	movq	(%rax), %rdx
	movsbq	%bl, %rax
	testb	$8, 1(%rdx,%rax,2)
	je	.L48
	.p2align 4,,10
	.p2align 3
.L17:
	leal	(%r12,%r12,4), %eax
	addq	$1, %rbp
	leal	-48(%rbx,%rax,2), %r12d
	movsbl	0(%rbp), %ebx
	movsbq	%bl, %rax
	testb	$8, 1(%rdx,%rax,2)
	jne	.L17
	movq	%rbp, p(%rip)
.L48:
	movq	%rbp, %r14
.L24:
	imull	%r12d, %r13d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %r14
	movq	%r14, p(%rip)
	call	term
	movl	%eax, %r13d
.L5:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %r14
	cmpb	$43, %dl
	je	.L6
	cmpb	$45, %dl
	je	.L7
	movq	%r14, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	addq	$2, %r14
	movq	%r14, p(%rip)
	call	term
	movl	%eax, %r12d
.L19:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %r14
	cmpb	$43, %dl
	je	.L20
	cmpb	$45, %dl
	je	.L21
	movq	%r14, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$2, %r14
	movq	%r14, p(%rip)
	call	term
	movl	%eax, %ebp
.L29:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %r14
	cmpb	$43, %dl
	je	.L30
	cmpb	$45, %dl
	je	.L31
	movq	%r14, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r14, p(%rip)
	call	term
	subl	%eax, %r12d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r14, p(%rip)
	call	term
	addl	%eax, %r12d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, p(%rip)
	call	term
	subl	%eax, %r13d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, p(%rip)
	call	term
	addl	%eax, %r13d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r14, p(%rip)
	call	term
	subl	%eax, %ebp
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%r14, p(%rip)
	call	term
	addl	%eax, %ebp
	jmp	.L29
	.cfi_endproc
.LFE42:
	.size	term, .-term
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB45:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$184, %rsp
	.cfi_def_cfa_offset 240
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	leaq	32(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L52
	jmp	.L128
	.p2align 4,,10
	.p2align 3
.L157:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L128
.L52:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, p(%rip)
	call	term
	movq	p(%rip), %rbp
	movl	%eax, %r12d
	movzbl	0(%rbp), %ebx
.L53:
	cmpb	$43, %bl
	je	.L54
.L159:
	cmpb	$45, %bl
	jne	.L157
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %rdi
	movq	%rdi, p(%rip)
	movq	%rdi, 8(%rsp)
	cmpb	$40, %bl
	je	.L93
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%r14d, %r14d
	movq	8(%rsp), %rdi
	movq	(%rax), %rsi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rsi,%rdx,2)
	je	.L158
	.p2align 4,,10
	.p2align 3
.L102:
	leal	(%r14,%r14,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %r14d
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rsi,%rdx,2)
	jne	.L102
	movq	%rbp, p(%rip)
.L101:
	cmpb	$42, %bl
	je	.L104
.L162:
	cmpb	$47, %bl
	je	.L105
	subl	%r14d, %r12d
	cmpb	$43, %bl
	jne	.L159
.L54:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %rdi
	movq	%rdi, p(%rip)
	movq	%rdi, 8(%rsp)
	cmpb	$40, %bl
	je	.L57
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%r14d, %r14d
	movq	8(%rsp), %rdi
	movq	(%rax), %rsi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rsi,%rdx,2)
	je	.L160
	.p2align 4,,10
	.p2align 3
.L66:
	leal	(%r14,%r14,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %r14d
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rsi,%rdx,2)
	jne	.L66
	movq	%rbp, p(%rip)
.L65:
	cmpb	$42, %bl
	je	.L68
.L165:
	cmpb	$47, %bl
	je	.L69
	addl	%r14d, %r12d
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L105:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L118
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%esi, %esi
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rdx,2)
	je	.L161
	.p2align 4,,10
	.p2align 3
.L127:
	leal	(%rsi,%rsi,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %esi
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rdi,%rdx,2)
	jne	.L127
	movq	%rbp, p(%rip)
.L126:
	movl	%r14d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r14d
	cmpb	$42, %bl
	jne	.L162
.L104:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L107
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rsi
	xorl	%edx, %edx
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rsi,2)
	je	.L163
	.p2align 4,,10
	.p2align 3
.L116:
	leal	(%rdx,%rdx,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %edx
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rsi
	testb	$8, 1(%rdi,%rsi,2)
	jne	.L116
	movq	%rbp, p(%rip)
.L115:
	imull	%edx, %r14d
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L69:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L82
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rdx
	xorl	%esi, %esi
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rdx,2)
	je	.L164
	.p2align 4,,10
	.p2align 3
.L91:
	leal	(%rsi,%rsi,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %esi
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rdx
	testb	$8, 1(%rdi,%rdx,2)
	jne	.L91
	movq	%rbp, p(%rip)
.L90:
	movl	%r14d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r14d
	cmpb	$42, %bl
	jne	.L165
.L68:
	movsbl	1(%rbp), %ebx
	leaq	1(%rbp), %r8
	movq	%r8, p(%rip)
	movq	%r8, 8(%rsp)
	cmpb	$40, %bl
	je	.L71
	call	__ctype_b_loc@PLT
	movsbq	%bl, %rsi
	xorl	%edx, %edx
	movq	8(%rsp), %r8
	movq	(%rax), %rdi
	leaq	2(%rbp), %rax
	testb	$8, 1(%rdi,%rsi,2)
	je	.L166
	.p2align 4,,10
	.p2align 3
.L80:
	leal	(%rdx,%rdx,4), %edx
	movq	%rax, %rbp
	leaq	1(%rax), %rax
	leal	-48(%rbx,%rdx,2), %edx
	movsbl	-1(%rax), %ebx
	movsbq	%bl, %rsi
	testb	$8, 1(%rdi,%rsi,2)
	jne	.L80
	movq	%rbp, p(%rip)
.L79:
	imull	%edx, %r14d
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L71:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %edx
.L74:
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	leaq	1(%rax), %rbp
	cmpb	$43, %sil
	je	.L75
	cmpb	$45, %sil
	je	.L76
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L93:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %r14d
.L96:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L97
	cmpb	$45, %dl
	je	.L98
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L76:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	subl	%eax, %edx
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L75:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	addl	%eax, %edx
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L98:
	movq	%rbp, p(%rip)
	call	term
	subl	%eax, %r14d
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L97:
	movq	%rbp, p(%rip)
	call	term
	addl	%eax, %r14d
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L82:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %esi
.L85:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L86
	cmpb	$45, %dl
	je	.L87
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L90
	.p2align 4,,10
	.p2align 3
.L107:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %edx
.L110:
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	leaq	1(%rax), %rbp
	cmpb	$43, %sil
	je	.L111
	cmpb	$45, %sil
	je	.L112
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L115
	.p2align 4,,10
	.p2align 3
.L118:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %esi
.L121:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L122
	cmpb	$45, %dl
	je	.L123
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L126
	.p2align 4,,10
	.p2align 3
.L87:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	subl	%eax, %esi
	jmp	.L85
	.p2align 4,,10
	.p2align 3
.L86:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	addl	%eax, %esi
	jmp	.L85
	.p2align 4,,10
	.p2align 3
.L57:
	addq	$2, %rbp
	movq	%rbp, p(%rip)
	call	term
	movl	%eax, %r14d
.L60:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	leaq	1(%rax), %rbp
	cmpb	$43, %dl
	je	.L61
	cmpb	$45, %dl
	je	.L62
	movq	%rbp, p(%rip)
	movzbl	1(%rax), %ebx
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L112:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	subl	%eax, %edx
	jmp	.L110
	.p2align 4,,10
	.p2align 3
.L111:
	movl	%edx, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %edx
	addl	%eax, %edx
	jmp	.L110
	.p2align 4,,10
	.p2align 3
.L62:
	movq	%rbp, p(%rip)
	call	term
	subl	%eax, %r14d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L61:
	movq	%rbp, p(%rip)
	call	term
	addl	%eax, %r14d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L123:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	subl	%eax, %esi
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L122:
	movl	%esi, 8(%rsp)
	movq	%rbp, p(%rip)
	call	term
	movl	8(%rsp), %esi
	addl	%eax, %esi
	jmp	.L121
	.p2align 4,,10
	.p2align 3
.L128:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L167
	addq	$184, %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
.L158:
	.cfi_restore_state
	movq	%rdi, %rbp
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L164:
	movq	%r8, %rbp
	jmp	.L90
	.p2align 4,,10
	.p2align 3
.L166:
	movq	%r8, %rbp
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L163:
	movq	%r8, %rbp
	jmp	.L115
	.p2align 4,,10
	.p2align 3
.L160:
	movq	%rdi, %rbp
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L161:
	movq	%r8, %rbp
	jmp	.L126
.L167:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE45:
	.size	main, .-main
	.local	p
	.comm	p,8,8
	.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>
#include <ctype.h>

/** テヲツ閉ーテ・ツシツ湘」ツつ、テ」ツδ?」ツδャテ」ツδシテ」ツつソ */
static const char *p;

static int expression ( );

static int
factor (
  void
  )
{
  int res = 0;

  if ( *p == '(' )
  {
    ++p;
    res = expression ( );
    ++p;
  }
  else while ( isdigit ( *p ) )
  {
    res = res * 10 + ( *( p++ ) - '0' );
  }

  return ( res );
}

static int
term (
  void
  )
{
  int res = factor ( );

  for ( ; ; )
  {
    switch ( *p )
    {
      case '*':
        ++p;
        res *= factor ( );
        break ;
      case '/':
        ++p;
        res /= factor ( );
        break ;
      default:
        return ( res );
    }
  }
}

static int
expression (
  void
  )
{
  int res = term ( );

  for ( ; ; )
  {
    switch ( *p )
    {
      case '+':
        ++p;
        res += term ( );
        break ;
      case '-':
        ++p;
        res -= term ( );
        break ;
      default:
        return ( res );
    }
  }
}

/** テヲツ閉ーテ・ツシツ銃xpr テ」ツつ津ィツィツ暗ァツョツ療」ツ?凖」ツつ凝ッツシツ?*/
static int
calculate (
  const char *expr
  )
{
  p = expr;

  return
  expression ( );
}

int
main (
  int   argc,
  char *argv[ ]
  )
{
  /** ティツィツ暗ァツョツ療・ツッツセティツアツ。テ」ツ?ョテヲツ閉ーテ・ツシツ?*/
  char expr[ 128 ];
  /** テ・ツ?・テ・ツ環崚」ツ?ョテ・ツ?凝ヲツ閉ー */
  int n;

  scanf ( "%d", &n );
  while ( n-- )
  {
    scanf ( " %s", expr );

    printf ( "%d\n", calculate ( expr ) );
  }

  return ( EXIT_SUCCESS );
}
2
4-2*3=
8*(4+4+3)=
 2
4-2*3=
8*(4+4+2)=
 2
4-3*3=
4*(8+4+3)=
 2
4-1*3=
4*(8+4+3)=
 2
4-1+3=
4*(8+4+3)=
 2
4-2+3=
4*(8+4+3)=
 2
5-1+3=
4*(8+4+3)=
 2
3-1*3=
4*(8+4+3)=
 2
4-2+3=
4+(8+4*3)=
 2
4-2*3=
4+(8+4*3)=

-2
88
 -2
80
 -5
60
 1
60
 6
60
 5
60
 7
60
 0
60
 5
24
 -2
24

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>
#include <ctype.h>

/** テヲツ閉ーテ・ツシツ湘」ツつ、テ」ツδ?」ツδャテ」ツδシテ」ツつソ */
static const char *p;

static int expression ( );

static int
factor (
  void
  )
{
  int res = 0;

  if ( *p == '(' )
  {
    ++p;
    res = expression ( );
    ++p;
  }
  else while ( isdigit ( *p ) )
  {
    res = res * 10 + ( *( p++ ) - '0' );
  }

  return ( res );
}

static int
term (
  void
  )
{
  int res = factor ( );

  for ( ; ; )
  {
    switch ( *p )
    {
      case '*':
        ++p;
        res *= factor ( );
        break ;
      case '/':
        ++p;
        res /= factor ( );
        break ;
      default:
        return ( res );
    }
  }
}

static int
expression (
  void
  )
{
  int res = term ( );

  for ( ; ; )
  {
    switch ( *p )
    {
      case '+':
        ++p;
        res += term ( );
        break ;
      case '-':
        ++p;
        res -= term ( );
        break ;
      default:
        return ( res );
    }
  }
}

/** テヲツ閉ーテ・ツシツ銃xpr テ」ツつ津ィツィツ暗ァツョツ療」ツ?凖」ツつ凝ッツシツ?*/
static int
calculate (
  const char *expr
  )
{
  p = expr;

  return
  expression ( );
}

int
main (
  int   argc,
  char *argv[ ]
  )
{
  /** ティツィツ暗ァツョツ療・ツッツセティツアツ。テ」ツ?ョテヲツ閉ーテ・ツシツ?*/
  char expr[ 128 ];
  /** テ・ツ?・テ・ツ環崚」ツ?ョテ・ツ?凝ヲツ閉ー */
  int n;

  scanf ( "%d", &n );
  while ( n-- )
  {
    scanf ( " %s", expr );

    printf ( "%d\n", calculate ( expr ) );
  }

  return ( EXIT_SUCCESS );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	p
	.comm	p,8,8
	.type	factor, @function
factor:
.LFB6:
	.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	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$40, %al
	jne	.L4
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$0, %eax
	call	expression
	movl	%eax, -4(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	jmp	.L3
.L5:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L4:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	jne	.L5
.L3:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	factor, .-factor
	.type	term, @function
term:
.LFB7:
	.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
	call	factor
	movl	%eax, -4(%rbp)
.L13:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$42, %eax
	je	.L8
	cmpl	$47, %eax
	je	.L9
	jmp	.L14
.L8:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	factor
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L11
.L9:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	factor
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -4(%rbp)
	jmp	.L11
.L14:
	movl	-4(%rbp), %eax
	jmp	.L15
.L11:
	jmp	.L13
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	term, .-term
	.type	expression, @function
expression:
.LFB8:
	.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
	call	term
	movl	%eax, -4(%rbp)
.L22:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$43, %eax
	je	.L17
	cmpl	$45, %eax
	je	.L18
	jmp	.L23
.L17:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	term
	addl	%eax, -4(%rbp)
	jmp	.L20
.L18:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	term
	subl	%eax, -4(%rbp)
	jmp	.L20
.L23:
	movl	-4(%rbp), %eax
	jmp	.L24
.L20:
	jmp	.L22
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	expression, .-expression
	.type	calculate, @function
calculate:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, p(%rip)
	call	expression
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	calculate, .-calculate
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %s"
.LC2:
	.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	$176, %rsp
	movl	%edi, -164(%rbp)
	movq	%rsi, -176(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-148(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L28
.L29:
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-144(%rbp), %rax
	movq	%rax, %rdi
	call	calculate
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	movl	-148(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -148(%rbp)
	testl	%eax, %eax
	jne	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	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
	.local	p
	.comm	p,8,8
	.type	factor, @function
factor:
.LFB6:
	.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	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$40, %al
	jne	.L4
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$0, %eax
	call	expression
	movl	%eax, -4(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	jmp	.L3
.L5:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L4:
	call	__ctype_b_loc@PLT
	movq	(%rax), %rdx
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbq	%al, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movzwl	(%rax), %eax
	movzwl	%ax, %eax
	andl	$2048, %eax
	testl	%eax, %eax
	jne	.L5
.L3:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	factor, .-factor
	.type	term, @function
term:
.LFB7:
	.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
	call	factor
	movl	%eax, -4(%rbp)
.L13:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$42, %eax
	je	.L8
	cmpl	$47, %eax
	je	.L9
	jmp	.L14
.L8:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	factor
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L11
.L9:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	factor
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -4(%rbp)
	jmp	.L11
.L14:
	movl	-4(%rbp), %eax
	jmp	.L15
.L11:
	jmp	.L13
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	term, .-term
	.type	expression, @function
expression:
.LFB8:
	.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
	call	term
	movl	%eax, -4(%rbp)
.L22:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cmpl	$43, %eax
	je	.L17
	cmpl	$45, %eax
	je	.L18
	jmp	.L23
.L17:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	term
	addl	%eax, -4(%rbp)
	jmp	.L20
.L18:
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	call	term
	subl	%eax, -4(%rbp)
	jmp	.L20
.L23:
	movl	-4(%rbp), %eax
	jmp	.L24
.L20:
	jmp	.L22
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	expression, .-expression
	.type	calculate, @function
calculate:
.LFB9:
	.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
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, p(%rip)
	call	expression
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	calculate, .-calculate
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %s"
.LC2:
	.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	$176, %rsp
	movl	%edi, -164(%rbp)
	movq	%rsi, -176(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-148(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L28
.L29:
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-144(%rbp), %rax
	movq	%rax, %rdi
	call	calculate
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L28:
	movl	-148(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -148(%rbp)
	testl	%eax, %eax
	jne	.L29
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	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:
