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>

int expr();
int term();
int fact();
int number();

char s[200] = {};
int idx = 0;

int main(){

  int dSetNum = 0;
  int i = 0;

  scanf("%d", &dSetNum);
  int answer[dSetNum + 1];
  int answerNum = 0;

  for(i = 0; i < dSetNum; i++){
    idx = 0;
    scanf("%s", &s);
    printf("%d\n", expr());
    // answer[answerNum] = expr();
  }

  for(i = 0; i < answerNum; i++){
    printf("%d\n", answer[i]);
  }
  return 0;
}

int expr(){
  int res = term();
  while(s[idx] == '+' || s[idx] == '-'){
    char op = s[idx++];
    int tmp = term();
    if(op == '+')res += tmp;
    else res -= tmp;
  }

  return res;
}

int term(){
  int res = fact();
   while(s[idx] == '*' || s[idx] == '/'){
    char op = s[idx++];
     int tmp = fact();
     if(op == '*') res *= tmp;
     else res /= tmp;
   }
   return res;
}

int fact(){
  int res;
  if(s[idx] == '('){
    idx++; res = expr();
    //assert( s[idx] == ')' );
    idx++;
  }
  else{
    res = number();
  }
  return res;
}

int number(){
  int res = 0;
  while('0' <= s[idx] && s[idx] <= '9'){
    res = res * 10 + s[idx] - '0';
    idx++;
  }
  return res;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 200
s:
	.zero	200
	.globl	idx
	.align 4
	.type	idx, @object
	.size	idx, 4
idx:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -76(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L5
.L6:
	movl	$0, idx(%rip)
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	expr
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -80(%rbp)
.L5:
	movl	-84(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L6
	movl	$0, -80(%rbp)
	jmp	.L7
.L8:
	movq	-64(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -80(%rbp)
.L7:
	movl	-80(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jl	.L8
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	expr
	.type	expr, @function
expr:
.LFB1:
	.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, %eax
	call	term
	movl	%eax, -8(%rbp)
	jmp	.L12
.L14:
	movl	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -9(%rbp)
	movl	$0, %eax
	call	term
	movl	%eax, -4(%rbp)
	cmpb	$43, -9(%rbp)
	jne	.L13
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	subl	%eax, -8(%rbp)
.L12:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$43, %al
	je	.L14
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$45, %al
	je	.L14
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	expr, .-expr
	.globl	term
	.type	term, @function
term:
.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	$0, %eax
	call	fact
	movl	%eax, -8(%rbp)
	jmp	.L17
.L19:
	movl	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -9(%rbp)
	movl	$0, %eax
	call	fact
	movl	%eax, -4(%rbp)
	cmpb	$42, -9(%rbp)
	jne	.L18
	movl	-8(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %eax
	cltd
	idivl	-4(%rbp)
	movl	%eax, -8(%rbp)
.L17:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$42, %al
	je	.L19
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	je	.L19
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	term, .-term
	.globl	fact
	.type	fact, @function
fact:
.LFB3:
	.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	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$40, %al
	jne	.L22
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
	movl	$0, %eax
	call	expr
	movl	%eax, -4(%rbp)
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
	jmp	.L23
.L22:
	movl	$0, %eax
	call	number
	movl	%eax, -4(%rbp)
.L23:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	fact, .-fact
	.globl	number
	.type	number, @function
number:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L26
.L28:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	%ecx, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
.L26:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L27
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jle	.L28
.L27:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	number, .-number
	.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	term
	.type	term, @function
term:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rax, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	s(%rip), %rbp
	movsbl	0(%rbp,%rax), %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	cmpb	$40, %r12b
	je	.L2
	leal	1(%rax), %eax
	leal	-48(%r12), %edx
	xorl	%r13d, %r13d
	cltq
	cmpb	$9, %dl
	ja	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	leal	0(%r13,%r13,4), %edx
	movl	%eax, %esi
	leal	-48(%r12,%rdx,2), %r13d
	movsbl	0(%rbp,%rax), %r12d
	addq	$1, %rax
	leal	-48(%r12), %edx
	cmpb	$9, %dl
	jbe	.L11
	movl	%esi, idx(%rip)
.L4:
	cmpb	$47, %r12b
	je	.L31
	cmpb	$42, %r12b
	jne	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	leal	1(%rsi), %edx
	movslq	%edx, %rax
	movl	%edx, idx(%rip)
	movsbl	0(%rbp,%rax), %ecx
	cmpb	$40, %cl
	je	.L12
	leal	2(%rsi), %eax
	leal	-48(%rcx), %edi
	xorl	%ebx, %ebx
	movl	%edx, %esi
	cltq
	cmpb	$9, %dil
	ja	.L14
	.p2align 4,,10
	.p2align 3
.L19:
	leal	(%rbx,%rbx,4), %edx
	movl	%eax, %esi
	leal	-48(%rcx,%rdx,2), %ebx
	movsbl	0(%rbp,%rax), %ecx
	addq	$1, %rax
	leal	-48(%rcx), %edx
	cmpb	$9, %dl
	jbe	.L19
	movl	%esi, idx(%rip)
.L14:
	cmpb	$42, %r12b
	je	.L36
	movl	%r13d, %eax
	cltd
	idivl	%ebx
	movl	%eax, %r13d
.L21:
	cmpb	$42, %cl
	je	.L22
	cmpb	$47, %cl
	jne	.L1
.L22:
	movl	%ecx, %r12d
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L1:
	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
.L36:
	.cfi_restore_state
	imull	%ebx, %r13d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$2, %esi
	xorl	%eax, %eax
	movl	%esi, idx(%rip)
	call	term
	movl	%eax, %ebx
.L34:
	movslq	idx(%rip), %rax
	movzbl	0(%rbp,%rax), %r14d
	movq	%rax, %rsi
	addl	$1, %esi
	leal	-43(%r14), %eax
	movl	%esi, idx(%rip)
	testb	$-3, %al
	jne	.L15
	xorl	%eax, %eax
	call	term
	leal	(%rbx,%rax), %edx
	subl	%eax, %ebx
	cmpb	$43, %r14b
	cmove	%edx, %ebx
	jmp	.L34
.L15:
	movslq	%esi, %rax
	movzbl	0(%rbp,%rax), %ecx
	jmp	.L14
.L2:
	addl	$1, %esi
	xorl	%eax, %eax
	movl	%esi, idx(%rip)
	call	term
	movl	%eax, %r13d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L37:
	xorl	%eax, %eax
	call	term
	leal	0(%r13,%rax), %edx
	subl	%eax, %r13d
	cmpb	$43, %bl
	cmove	%edx, %r13d
.L33:
	movslq	idx(%rip), %rax
	movzbl	0(%rbp,%rax), %ebx
	movq	%rax, %rsi
	addl	$1, %esi
	leal	-43(%rbx), %eax
	movl	%esi, idx(%rip)
	testb	$-3, %al
	je	.L37
	movslq	%esi, %rax
	movzbl	0(%rbp,%rax), %r12d
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	term, .-term
	.p2align 4
	.globl	expr
	.type	expr, @function
expr:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	leaq	s(%rip), %r10
	call	term
	movslq	idx(%rip), %rdx
	movl	%eax, %r8d
	movzbl	(%r10,%rdx), %r9d
	movq	%rdx, %rax
	leal	-43(%r9), %edx
	andl	$253, %edx
	jne	.L38
	.p2align 4,,10
	.p2align 3
.L42:
	addl	$1, %eax
	movl	%eax, idx(%rip)
	xorl	%eax, %eax
	call	term
	leal	(%r8,%rax), %edx
	subl	%eax, %r8d
	cmpb	$43, %r9b
	cmove	%edx, %r8d
	movslq	idx(%rip), %rdx
	movzbl	(%r10,%rdx), %r9d
	movq	%rdx, %rax
	leal	-43(%r9), %edx
	andl	$253, %edx
	je	.L42
.L38:
	movl	%r8d, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	expr, .-expr
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	s(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movl	$0, 4(%rsp)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L64
.L47:
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$0, idx(%rip)
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	call	term
	movl	%eax, %r11d
	movslq	idx(%rip), %rax
	movzbl	(%r14,%rax), %r13d
	movq	%rax, %rdi
	leal	-43(%r13), %eax
	testb	$-3, %al
	jne	.L48
	.p2align 4,,10
	.p2align 3
.L63:
	leal	1(%rdi), %edx
	movslq	%edx, %rax
	movl	%edx, idx(%rip)
	movzbl	(%r14,%rax), %ebp
	cmpb	$40, %bpl
	je	.L49
	leal	2(%rdi), %eax
	leal	-48(%rbp), %ecx
	xorl	%r15d, %r15d
	movl	%edx, %edi
	cltq
	cmpb	$9, %cl
	ja	.L51
	.p2align 4,,10
	.p2align 3
.L54:
	movsbl	%bpl, %r8d
	movzbl	(%r14,%rax), %ebp
	leal	(%r15,%r15,4), %edx
	movl	%eax, %edi
	leal	-48(%r8,%rdx,2), %r15d
	addq	$1, %rax
	leal	-48(%rbp), %edx
	cmpb	$9, %dl
	jbe	.L54
	movl	%edi, idx(%rip)
.L51:
	cmpb	$42, %bpl
	je	.L75
	movl	%ebp, %ecx
	cmpb	$47, %bpl
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L75:
	leal	1(%rdi), %edx
	movslq	%edx, %rax
	movl	%edx, idx(%rip)
	movsbl	(%r14,%rax), %ecx
	cmpb	$40, %cl
	je	.L55
	leal	2(%rdi), %eax
	leal	-48(%rcx), %r9d
	xorl	%esi, %esi
	movl	%edx, %edi
	cltq
	cmpb	$9, %r9b
	ja	.L57
	.p2align 4,,10
	.p2align 3
.L58:
	leal	(%rsi,%rsi,4), %edx
	movl	%eax, %edi
	leal	-48(%rcx,%rdx,2), %esi
	movsbl	(%r14,%rax), %ecx
	addq	$1, %rax
	leal	-48(%rcx), %edx
	cmpb	$9, %dl
	jbe	.L58
	movl	%edi, idx(%rip)
.L57:
	cmpb	$42, %bpl
	je	.L79
	movl	%r15d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r15d
.L60:
	cmpb	$42, %cl
	je	.L67
	cmpb	$47, %cl
	jne	.L53
.L67:
	movl	%ecx, %ebp
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L53:
	leal	(%r11,%r15), %eax
	subl	%r15d, %r11d
	cmpb	$43, %r13b
	cmove	%eax, %r11d
	leal	-43(%rcx), %eax
	testb	$-3, %al
	jne	.L48
	movl	%ecx, %r13d
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L79:
	imull	%esi, %r15d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L55:
	addl	$2, %edi
	xorl	%eax, %eax
	movl	%edi, idx(%rip)
	call	expr
	movl	%eax, %esi
	movl	idx(%rip), %eax
	leal	1(%rax), %edi
	movslq	%edi, %rax
	movl	%edi, idx(%rip)
	movzbl	(%r14,%rax), %ecx
	jmp	.L57
.L49:
	addl	$2, %edi
	xorl	%eax, %eax
	movl	%edi, idx(%rip)
	call	expr
	movl	%eax, %r15d
	movl	idx(%rip), %eax
	leal	1(%rax), %edi
	movslq	%edi, %rax
	movl	%edi, idx(%rip)
	movzbl	(%r14,%rax), %ebp
	jmp	.L51
.L48:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L47
.L64:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L80
	addq	$24, %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
.L80:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	fact
	.type	fact, @function
fact:
.LFB26:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	leaq	s(%rip), %r9
	movq	%rax, %rdx
	movsbl	(%r9,%rax), %eax
	cmpb	$40, %al
	je	.L82
	addl	$1, %edx
	leal	-48(%rax), %ecx
	xorl	%r8d, %r8d
	movslq	%edx, %rdx
	cmpb	$9, %cl
	ja	.L95
	.p2align 4,,10
	.p2align 3
.L89:
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %esi
	leal	-48(%rax,%rcx,2), %r8d
	movsbl	(%r9,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	jbe	.L89
	movl	%esi, idx(%rip)
.L95:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L82:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	addl	$1, %edx
	xorl	%eax, %eax
	movl	%edx, idx(%rip)
	call	term
	movl	%eax, %r8d
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L98:
	xorl	%eax, %eax
	call	term
	leal	(%r8,%rax), %edx
	subl	%eax, %r8d
	cmpb	$43, %r10b
	cmove	%edx, %r8d
.L97:
	movslq	idx(%rip), %rdx
	movzbl	(%r9,%rdx), %r10d
	movq	%rdx, %rax
	addl	$1, %eax
	leal	-43(%r10), %edx
	movl	%eax, idx(%rip)
	andl	$253, %edx
	je	.L98
	movl	%r8d, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	fact, .-fact
	.p2align 4
	.globl	number
	.type	number, @function
number:
.LFB27:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	leaq	s(%rip), %rsi
	movq	%rax, %rdx
	movsbl	(%rsi,%rax), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L102
	addl	$1, %edx
	xorl	%r8d, %r8d
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L101:
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %edi
	leal	-48(%rax,%rcx,2), %r8d
	movsbl	(%rsi,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	jbe	.L101
	movl	%edi, idx(%rip)
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L102:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE27:
	.size	number, .-number
	.globl	idx
	.bss
	.align 4
	.type	idx, @object
	.size	idx, 4
idx:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 200
s:
	.zero	200
	.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	term
	.type	term, @function
term:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rax, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	s(%rip), %rbp
	movsbl	0(%rbp,%rax), %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	cmpb	$40, %r12b
	je	.L2
	leal	1(%rax), %eax
	leal	-48(%r12), %edx
	xorl	%r13d, %r13d
	cltq
	cmpb	$9, %dl
	ja	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	leal	0(%r13,%r13,4), %edx
	movl	%eax, %esi
	leal	-48(%r12,%rdx,2), %r13d
	movsbl	0(%rbp,%rax), %r12d
	addq	$1, %rax
	leal	-48(%r12), %edx
	cmpb	$9, %dl
	jbe	.L11
	movl	%esi, idx(%rip)
.L4:
	cmpb	$47, %r12b
	je	.L31
	cmpb	$42, %r12b
	jne	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	leal	1(%rsi), %edx
	movslq	%edx, %rax
	movl	%edx, idx(%rip)
	movsbl	0(%rbp,%rax), %ecx
	cmpb	$40, %cl
	je	.L12
	leal	2(%rsi), %eax
	leal	-48(%rcx), %edi
	xorl	%ebx, %ebx
	movl	%edx, %esi
	cltq
	cmpb	$9, %dil
	ja	.L14
	.p2align 4,,10
	.p2align 3
.L19:
	leal	(%rbx,%rbx,4), %edx
	movl	%eax, %esi
	leal	-48(%rcx,%rdx,2), %ebx
	movsbl	0(%rbp,%rax), %ecx
	addq	$1, %rax
	leal	-48(%rcx), %edx
	cmpb	$9, %dl
	jbe	.L19
	movl	%esi, idx(%rip)
.L14:
	cmpb	$42, %r12b
	je	.L36
	movl	%r13d, %eax
	cltd
	idivl	%ebx
	movl	%eax, %r13d
.L21:
	cmpb	$42, %cl
	je	.L22
	cmpb	$47, %cl
	jne	.L1
.L22:
	movl	%ecx, %r12d
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L1:
	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
.L36:
	.cfi_restore_state
	imull	%ebx, %r13d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$2, %esi
	xorl	%eax, %eax
	movl	%esi, idx(%rip)
	call	term
	movl	%eax, %ebx
.L34:
	movslq	idx(%rip), %rax
	movzbl	0(%rbp,%rax), %r14d
	movq	%rax, %rsi
	addl	$1, %esi
	leal	-43(%r14), %eax
	movl	%esi, idx(%rip)
	testb	$-3, %al
	jne	.L15
	xorl	%eax, %eax
	call	term
	leal	(%rbx,%rax), %edx
	subl	%eax, %ebx
	cmpb	$43, %r14b
	cmove	%edx, %ebx
	jmp	.L34
.L15:
	movslq	%esi, %rax
	movzbl	0(%rbp,%rax), %ecx
	jmp	.L14
.L2:
	addl	$1, %esi
	xorl	%eax, %eax
	movl	%esi, idx(%rip)
	call	term
	movl	%eax, %r13d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L37:
	xorl	%eax, %eax
	call	term
	leal	0(%r13,%rax), %edx
	subl	%eax, %r13d
	cmpb	$43, %bl
	cmove	%edx, %r13d
.L33:
	movslq	idx(%rip), %rax
	movzbl	0(%rbp,%rax), %ebx
	movq	%rax, %rsi
	addl	$1, %esi
	leal	-43(%rbx), %eax
	movl	%esi, idx(%rip)
	testb	$-3, %al
	je	.L37
	movslq	%esi, %rax
	movzbl	0(%rbp,%rax), %r12d
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	term, .-term
	.p2align 4
	.globl	expr
	.type	expr, @function
expr:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	leaq	s(%rip), %r10
	call	term
	movslq	idx(%rip), %rdx
	movl	%eax, %r8d
	movzbl	(%r10,%rdx), %r9d
	movq	%rdx, %rax
	leal	-43(%r9), %edx
	andl	$253, %edx
	jne	.L38
	.p2align 4,,10
	.p2align 3
.L42:
	addl	$1, %eax
	movl	%eax, idx(%rip)
	xorl	%eax, %eax
	call	term
	leal	(%r8,%rax), %edx
	subl	%eax, %r8d
	cmpb	$43, %r9b
	cmove	%edx, %r8d
	movslq	idx(%rip), %rdx
	movzbl	(%r10,%rdx), %r9d
	movq	%rdx, %rax
	leal	-43(%r9), %edx
	andl	$253, %edx
	je	.L42
.L38:
	movl	%r8d, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	expr, .-expr
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	s(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movl	$0, 4(%rsp)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L64
.L47:
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	movl	$0, idx(%rip)
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	call	term
	movl	%eax, %r11d
	movslq	idx(%rip), %rax
	movzbl	(%r14,%rax), %r13d
	movq	%rax, %rdi
	leal	-43(%r13), %eax
	testb	$-3, %al
	jne	.L48
	.p2align 4,,10
	.p2align 3
.L63:
	leal	1(%rdi), %edx
	movslq	%edx, %rax
	movl	%edx, idx(%rip)
	movzbl	(%r14,%rax), %ebp
	cmpb	$40, %bpl
	je	.L49
	leal	2(%rdi), %eax
	leal	-48(%rbp), %ecx
	xorl	%r15d, %r15d
	movl	%edx, %edi
	cltq
	cmpb	$9, %cl
	ja	.L51
	.p2align 4,,10
	.p2align 3
.L54:
	movsbl	%bpl, %r8d
	movzbl	(%r14,%rax), %ebp
	leal	(%r15,%r15,4), %edx
	movl	%eax, %edi
	leal	-48(%r8,%rdx,2), %r15d
	addq	$1, %rax
	leal	-48(%rbp), %edx
	cmpb	$9, %dl
	jbe	.L54
	movl	%edi, idx(%rip)
.L51:
	cmpb	$42, %bpl
	je	.L75
	movl	%ebp, %ecx
	cmpb	$47, %bpl
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L75:
	leal	1(%rdi), %edx
	movslq	%edx, %rax
	movl	%edx, idx(%rip)
	movsbl	(%r14,%rax), %ecx
	cmpb	$40, %cl
	je	.L55
	leal	2(%rdi), %eax
	leal	-48(%rcx), %r9d
	xorl	%esi, %esi
	movl	%edx, %edi
	cltq
	cmpb	$9, %r9b
	ja	.L57
	.p2align 4,,10
	.p2align 3
.L58:
	leal	(%rsi,%rsi,4), %edx
	movl	%eax, %edi
	leal	-48(%rcx,%rdx,2), %esi
	movsbl	(%r14,%rax), %ecx
	addq	$1, %rax
	leal	-48(%rcx), %edx
	cmpb	$9, %dl
	jbe	.L58
	movl	%edi, idx(%rip)
.L57:
	cmpb	$42, %bpl
	je	.L79
	movl	%r15d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r15d
.L60:
	cmpb	$42, %cl
	je	.L67
	cmpb	$47, %cl
	jne	.L53
.L67:
	movl	%ecx, %ebp
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L53:
	leal	(%r11,%r15), %eax
	subl	%r15d, %r11d
	cmpb	$43, %r13b
	cmove	%eax, %r11d
	leal	-43(%rcx), %eax
	testb	$-3, %al
	jne	.L48
	movl	%ecx, %r13d
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L79:
	imull	%esi, %r15d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L55:
	addl	$2, %edi
	xorl	%eax, %eax
	movl	%edi, idx(%rip)
	call	expr
	movl	%eax, %esi
	movl	idx(%rip), %eax
	leal	1(%rax), %edi
	movslq	%edi, %rax
	movl	%edi, idx(%rip)
	movzbl	(%r14,%rax), %ecx
	jmp	.L57
.L49:
	addl	$2, %edi
	xorl	%eax, %eax
	movl	%edi, idx(%rip)
	call	expr
	movl	%eax, %r15d
	movl	idx(%rip), %eax
	leal	1(%rax), %edi
	movslq	%edi, %rax
	movl	%edi, idx(%rip)
	movzbl	(%r14,%rax), %ebp
	jmp	.L51
.L48:
	movl	%r11d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L47
.L64:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L80
	addq	$24, %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
.L80:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	fact
	.type	fact, @function
fact:
.LFB26:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	leaq	s(%rip), %r9
	movq	%rax, %rdx
	movsbl	(%r9,%rax), %eax
	cmpb	$40, %al
	je	.L82
	addl	$1, %edx
	leal	-48(%rax), %ecx
	xorl	%r8d, %r8d
	movslq	%edx, %rdx
	cmpb	$9, %cl
	ja	.L95
	.p2align 4,,10
	.p2align 3
.L89:
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %esi
	leal	-48(%rax,%rcx,2), %r8d
	movsbl	(%r9,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	jbe	.L89
	movl	%esi, idx(%rip)
.L95:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L82:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	addl	$1, %edx
	xorl	%eax, %eax
	movl	%edx, idx(%rip)
	call	term
	movl	%eax, %r8d
	jmp	.L97
	.p2align 4,,10
	.p2align 3
.L98:
	xorl	%eax, %eax
	call	term
	leal	(%r8,%rax), %edx
	subl	%eax, %r8d
	cmpb	$43, %r10b
	cmove	%edx, %r8d
.L97:
	movslq	idx(%rip), %rdx
	movzbl	(%r9,%rdx), %r10d
	movq	%rdx, %rax
	addl	$1, %eax
	leal	-43(%r10), %edx
	movl	%eax, idx(%rip)
	andl	$253, %edx
	je	.L98
	movl	%r8d, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	fact, .-fact
	.p2align 4
	.globl	number
	.type	number, @function
number:
.LFB27:
	.cfi_startproc
	endbr64
	movslq	idx(%rip), %rax
	leaq	s(%rip), %rsi
	movq	%rax, %rdx
	movsbl	(%rsi,%rax), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L102
	addl	$1, %edx
	xorl	%r8d, %r8d
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L101:
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %edi
	leal	-48(%rax,%rcx,2), %r8d
	movsbl	(%rsi,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	jbe	.L101
	movl	%edi, idx(%rip)
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L102:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE27:
	.size	number, .-number
	.globl	idx
	.bss
	.align 4
	.type	idx, @object
	.size	idx, 4
idx:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 200
s:
	.zero	200
	.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>

int expr();
int term();
int fact();
int number();

char s[200] = {};
int idx = 0;

int main(){

  int dSetNum = 0;
  int i = 0;

  scanf("%d", &dSetNum);
  int answer[dSetNum + 1];
  int answerNum = 0;

  for(i = 0; i < dSetNum; i++){
    idx = 0;
    scanf("%s", &s);
    printf("%d\n", expr());
    // answer[answerNum] = expr();
  }

  for(i = 0; i < answerNum; i++){
    printf("%d\n", answer[i]);
  }
  return 0;
}

int expr(){
  int res = term();
  while(s[idx] == '+' || s[idx] == '-'){
    char op = s[idx++];
    int tmp = term();
    if(op == '+')res += tmp;
    else res -= tmp;
  }

  return res;
}

int term(){
  int res = fact();
   while(s[idx] == '*' || s[idx] == '/'){
    char op = s[idx++];
     int tmp = fact();
     if(op == '*') res *= tmp;
     else res /= tmp;
   }
   return res;
}

int fact(){
  int res;
  if(s[idx] == '('){
    idx++; res = expr();
    //assert( s[idx] == ')' );
    idx++;
  }
  else{
    res = number();
  }
  return res;
}

int number(){
  int res = 0;
  while('0' <= s[idx] && s[idx] <= '9'){
    res = res * 10 + s[idx] - '0';
    idx++;
  }
  return res;
}
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>

int expr();
int term();
int fact();
int number();

char s[200] = {};
int idx = 0;

int main(){

  int dSetNum = 0;
  int i = 0;

  scanf("%d", &dSetNum);
  int answer[dSetNum + 1];
  int answerNum = 0;

  for(i = 0; i < dSetNum; i++){
    idx = 0;
    scanf("%s", &s);
    printf("%d\n", expr());
    // answer[answerNum] = expr();
  }

  for(i = 0; i < answerNum; i++){
    printf("%d\n", answer[i]);
  }
  return 0;
}

int expr(){
  int res = term();
  while(s[idx] == '+' || s[idx] == '-'){
    char op = s[idx++];
    int tmp = term();
    if(op == '+')res += tmp;
    else res -= tmp;
  }

  return res;
}

int term(){
  int res = fact();
   while(s[idx] == '*' || s[idx] == '/'){
    char op = s[idx++];
     int tmp = fact();
     if(op == '*') res *= tmp;
     else res /= tmp;
   }
   return res;
}

int fact(){
  int res;
  if(s[idx] == '('){
    idx++; res = expr();
    //assert( s[idx] == ')' );
    idx++;
  }
  else{
    res = number();
  }
  return res;
}

int number(){
  int res = 0;
  while('0' <= s[idx] && s[idx] <= '9'){
    res = res * 10 + s[idx] - '0';
    idx++;
  }
  return res;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 200
s:
	.zero	200
	.globl	idx
	.align 4
	.type	idx, @object
	.size	idx, 4
idx:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -76(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L5
.L6:
	movl	$0, idx(%rip)
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	expr
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -80(%rbp)
.L5:
	movl	-84(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L6
	movl	$0, -80(%rbp)
	jmp	.L7
.L8:
	movq	-64(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -80(%rbp)
.L7:
	movl	-80(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jl	.L8
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	expr
	.type	expr, @function
expr:
.LFB1:
	.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, %eax
	call	term
	movl	%eax, -8(%rbp)
	jmp	.L12
.L14:
	movl	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -9(%rbp)
	movl	$0, %eax
	call	term
	movl	%eax, -4(%rbp)
	cmpb	$43, -9(%rbp)
	jne	.L13
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	subl	%eax, -8(%rbp)
.L12:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$43, %al
	je	.L14
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$45, %al
	je	.L14
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	expr, .-expr
	.globl	term
	.type	term, @function
term:
.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	$0, %eax
	call	fact
	movl	%eax, -8(%rbp)
	jmp	.L17
.L19:
	movl	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -9(%rbp)
	movl	$0, %eax
	call	fact
	movl	%eax, -4(%rbp)
	cmpb	$42, -9(%rbp)
	jne	.L18
	movl	-8(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %eax
	cltd
	idivl	-4(%rbp)
	movl	%eax, -8(%rbp)
.L17:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$42, %al
	je	.L19
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	je	.L19
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	term, .-term
	.globl	fact
	.type	fact, @function
fact:
.LFB3:
	.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	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$40, %al
	jne	.L22
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
	movl	$0, %eax
	call	expr
	movl	%eax, -4(%rbp)
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
	jmp	.L23
.L22:
	movl	$0, %eax
	call	number
	movl	%eax, -4(%rbp)
.L23:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	fact, .-fact
	.globl	number
	.type	number, @function
number:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L26
.L28:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	%ecx, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
.L26:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L27
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jle	.L28
.L27:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	number, .-number
	.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	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 200
s:
	.zero	200
	.globl	idx
	.align 4
	.type	idx, @object
	.size	idx, 4
idx:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -76(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L5
.L6:
	movl	$0, idx(%rip)
	leaq	s(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	expr
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -80(%rbp)
.L5:
	movl	-84(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L6
	movl	$0, -80(%rbp)
	jmp	.L7
.L8:
	movq	-64(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -80(%rbp)
.L7:
	movl	-80(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jl	.L8
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	expr
	.type	expr, @function
expr:
.LFB1:
	.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, %eax
	call	term
	movl	%eax, -8(%rbp)
	jmp	.L12
.L14:
	movl	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -9(%rbp)
	movl	$0, %eax
	call	term
	movl	%eax, -4(%rbp)
	cmpb	$43, -9(%rbp)
	jne	.L13
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	subl	%eax, -8(%rbp)
.L12:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$43, %al
	je	.L14
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$45, %al
	je	.L14
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	expr, .-expr
	.globl	term
	.type	term, @function
term:
.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	$0, %eax
	call	fact
	movl	%eax, -8(%rbp)
	jmp	.L17
.L19:
	movl	idx(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, idx(%rip)
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -9(%rbp)
	movl	$0, %eax
	call	fact
	movl	%eax, -4(%rbp)
	cmpb	$42, -9(%rbp)
	jne	.L18
	movl	-8(%rbp), %eax
	imull	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %eax
	cltd
	idivl	-4(%rbp)
	movl	%eax, -8(%rbp)
.L17:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$42, %al
	je	.L19
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	je	.L19
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	term, .-term
	.globl	fact
	.type	fact, @function
fact:
.LFB3:
	.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	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$40, %al
	jne	.L22
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
	movl	$0, %eax
	call	expr
	movl	%eax, -4(%rbp)
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
	jmp	.L23
.L22:
	movl	$0, %eax
	call	number
	movl	%eax, -4(%rbp)
.L23:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	fact, .-fact
	.globl	number
	.type	number, @function
number:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L26
.L28:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	addl	%ecx, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	movl	idx(%rip), %eax
	addl	$1, %eax
	movl	%eax, idx(%rip)
.L26:
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L27
	movl	idx(%rip), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jle	.L28
.L27:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	number, .-number
	.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:
