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

```c
#include <stdio.h>

#define NUM_LIMIT (1<<10)

#define OP_ADD   (-1)
#define OP_SUB   (-2)
#define OP_MUL   (-3)
#define OP_KAKKO (-4)

int stack_num;
int stack[100];
int rp_num;
int rp[100];

int rp_compile(const char* statement) {
	const char* now;
	int expectOperator=0;
	int nownumber;
	stack_num=0;
	rp_num=0;
	for(now=statement;*now;now++) {
		switch(*now) {
			case '+':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_ADD;
				expectOperator=0;
				break;
			case '-':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_SUB;
				expectOperator=0;
				break;
			case '*':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]==OP_MUL) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_MUL;
				expectOperator=0;
				break;
			case '(':
				if(expectOperator)return 0;
				stack[stack_num++]=OP_KAKKO;
				expectOperator=0;
				break;
			case ')':
				if(!expectOperator)return 0;
				if(stack_num<=0 || stack[stack_num-1]==OP_KAKKO)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				if(stack_num>0)stack_num--; else return 0;
				expectOperator=1;
				break;
			case '0':
			case '1':
				if(expectOperator)return 0;
				nownumber=0;
				for(;*now=='0' || *now=='1';now++) {
					nownumber=nownumber*2+(*now)-'0';
					if(nownumber>=NUM_LIMIT)return 0;
				}
				now--;
				expectOperator=1;
				rp[rp_num++]=nownumber;
				break;
		}
	}
	while(stack_num>0) {
		stack_num--;
		if(stack[stack_num]==OP_KAKKO)return 0;
		rp[rp_num++]=stack[stack_num];
	}
	return 1;
}

int rp_calc(void) {
	int i;
	stack_num=0;
	for(i=0;i<rp_num;i++) {
		switch(rp[i]) {
			case OP_ADD:
				if(stack_num<2)return -1;
				stack[stack_num-2]+=stack[stack_num-1];
				if(stack[stack_num-2]>=NUM_LIMIT)return -1;
				stack_num--;
				break;
			case OP_SUB:
				if(stack_num<2)return -1;
				stack[stack_num-2]-=stack[stack_num-1];
				if(stack[stack_num-2]<0)return -1;
				stack_num--;
				break;
			case OP_MUL:
				if(stack_num<2)return -1;
				stack[stack_num-2]*=stack[stack_num-1];
				if(stack[stack_num-2]>=NUM_LIMIT)return -1;
				stack_num--;
				break;
			default:
				stack[stack_num++]=rp[i];
				break;
		}
	}
	if(stack_num!=1)return -1;
	return stack[0];
}

int main(void) {
	char input[200];
	const char* mozi="01+-*()";
	int pos[5]={150,150,150,150,150};
	int i,j;
	int posnum;
	int search_max;
	int result;
	scanf("%s",input);
	posnum=0;
	search_max=1;
	for(i=0;input[i];i++) {
		if(input[i]=='.') {
			pos[posnum++]=i;
			search_max*=7;
		}
	}
	result=-1;
	for(i=0;i<search_max;i++) {
		int temp=i;
		for(j=0;j<posnum;j++) {
			input[pos[j]]=mozi[temp%7];
			temp/=7;
		}
		if(!rp_compile(input))continue;
		temp=rp_calc();
		if(temp>result)result=temp;
	}
	printf("%d\n",result);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	stack_num
	.bss
	.align 4
	.type	stack_num, @object
	.size	stack_num, 4
stack_num:
	.zero	4
	.globl	stack
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.globl	rp_num
	.align 4
	.type	rp_num, @object
	.size	rp_num, 4
rp_num:
	.zero	4
	.globl	rp
	.align 32
	.type	rp, @object
	.size	rp, 400
rp:
	.zero	400
	.text
	.globl	rp_compile
	.type	rp_compile, @function
rp_compile:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, stack_num(%rip)
	movl	$0, rp_num(%rip)
	movq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L37:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$40, %eax
	cmpl	$9, %eax
	ja	.L3
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L5(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L5(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L5:
	.long	.L10-.L5
	.long	.L9-.L5
	.long	.L8-.L5
	.long	.L7-.L5
	.long	.L3-.L5
	.long	.L6-.L5
	.long	.L3-.L5
	.long	.L3-.L5
	.long	.L4-.L5
	.long	.L4-.L5
	.text
.L7:
	cmpl	$0, -16(%rbp)
	jne	.L13
	movl	$0, %eax
	jmp	.L12
.L15:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L13:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L15
.L14:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L6:
	cmpl	$0, -16(%rbp)
	jne	.L17
	movl	$0, %eax
	jmp	.L12
.L19:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L17:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L18
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L19
.L18:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-2, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L8:
	cmpl	$0, -16(%rbp)
	jne	.L21
	movl	$0, %eax
	jmp	.L12
.L23:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L21:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L22
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-3, %eax
	je	.L23
.L22:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-3, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L10:
	cmpl	$0, -16(%rbp)
	je	.L24
	movl	$0, %eax
	jmp	.L12
.L24:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-4, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L9:
	cmpl	$0, -16(%rbp)
	jne	.L25
	movl	$0, %eax
	jmp	.L12
.L25:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L26
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L28
.L26:
	movl	$0, %eax
	jmp	.L12
.L30:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L28:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L29
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L30
.L29:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L31
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	$1, -16(%rbp)
	jmp	.L3
.L31:
	movl	$0, %eax
	jmp	.L12
.L4:
	cmpl	$0, -16(%rbp)
	je	.L33
	movl	$0, %eax
	jmp	.L12
.L33:
	movl	$0, -12(%rbp)
	jmp	.L34
.L36:
	movl	-12(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -12(%rbp)
	cmpl	$1023, -12(%rbp)
	jle	.L35
	movl	$0, %eax
	jmp	.L12
.L35:
	addq	$1, -8(%rbp)
.L34:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L36
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	je	.L36
	subq	$1, -8(%rbp)
	movl	$1, -16(%rbp)
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
.L3:
	addq	$1, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L37
	jmp	.L38
.L40:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L39
	movl	$0, %eax
	jmp	.L12
.L39:
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L38:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jg	.L40
	movl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	rp_compile, .-rp_compile
	.globl	rp_calc
	.type	rp_calc, @function
rp_calc:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, stack_num(%rip)
	movl	$0, -4(%rbp)
	jmp	.L42
.L55:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L43
	testl	%eax, %eax
	jns	.L44
	cmpl	$-3, %eax
	je	.L45
	cmpl	$-2, %eax
	je	.L46
	jmp	.L44
.L43:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L47
	movl	$-1, %eax
	jmp	.L48
.L47:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1023, %eax
	jle	.L49
	movl	$-1, %eax
	jmp	.L48
.L49:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L46:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L51
	movl	$-1, %eax
	jmp	.L48
.L51:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	stack_num(%rip), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %esi
	movl	stack_num(%rip), %edx
	subl	$2, %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L52
	movl	$-1, %eax
	jmp	.L48
.L52:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L45:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L53
	movl	$-1, %eax
	jmp	.L48
.L53:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	stack(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	stack_num(%rip), %ecx
	subl	$2, %ecx
	imull	%edx, %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1023, %eax
	jle	.L54
	movl	$-1, %eax
	jmp	.L48
.L54:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L44:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	rp(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	stack(%rip), %rax
	movl	%edx, (%rcx,%rax)
	nop
.L50:
	addl	$1, -4(%rbp)
.L42:
	movl	rp_num(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L55
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	je	.L56
	movl	$-1, %eax
	jmp	.L48
.L56:
	movl	stack(%rip), %eax
.L48:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	rp_calc, .-rp_calc
	.section	.rodata
.LC0:
	.string	"01+-*()"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -248(%rbp)
	movl	$150, -240(%rbp)
	movl	$150, -236(%rbp)
	movl	$150, -232(%rbp)
	movl	$150, -228(%rbp)
	movl	$150, -224(%rbp)
	leaq	-208(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -264(%rbp)
	movl	$1, -260(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L58
.L60:
	movl	-272(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$46, %al
	jne	.L59
	movl	-264(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -264(%rbp)
	cltq
	movl	-272(%rbp), %edx
	movl	%edx, -240(%rbp,%rax,4)
	movl	-260(%rbp), %edx
	movl	%edx, %eax
	sall	$3, %eax
	subl	%edx, %eax
	movl	%eax, -260(%rbp)
.L59:
	addl	$1, -272(%rbp)
.L58:
	movl	-272(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L60
	movl	$-1, -256(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L61
.L66:
	movl	-272(%rbp), %eax
	movl	%eax, -252(%rbp)
	movl	$0, -268(%rbp)
	jmp	.L62
.L63:
	movl	-252(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1840700269, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$2, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, %ecx
	sall	$3, %ecx
	subl	%edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rdx
	movq	-248(%rbp), %rax
	addq	%rax, %rdx
	movl	-268(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	movzbl	(%rdx), %edx
	cltq
	movb	%dl, -208(%rbp,%rax)
	movl	-252(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1840700269, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -252(%rbp)
	addl	$1, -268(%rbp)
.L62:
	movl	-268(%rbp), %eax
	cmpl	-264(%rbp), %eax
	jl	.L63
	leaq	-208(%rbp), %rax
	movq	%rax, %rdi
	call	rp_compile
	testl	%eax, %eax
	je	.L69
	call	rp_calc
	movl	%eax, -252(%rbp)
	movl	-252(%rbp), %eax
	cmpl	-256(%rbp), %eax
	jle	.L65
	movl	-252(%rbp), %eax
	movl	%eax, -256(%rbp)
	jmp	.L65
.L69:
	nop
.L65:
	addl	$1, -272(%rbp)
.L61:
	movl	-272(%rbp), %eax
	cmpl	-260(%rbp), %eax
	jl	.L66
	movl	-256(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	rp_compile
	.type	rp_compile, @function
rp_compile:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$0, stack_num(%rip)
	movl	$0, rp_num(%rip)
	movzbl	(%rdi), %edx
	testb	%dl, %dl
	je	.L80
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	rp(%rip), %rsi
	movq	%rdi, %rax
	xorl	%ecx, %ecx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.L6(%rip), %rdi
	leaq	stack(%rip), %r8
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-4(%rsi), %r9
	.p2align 4,,10
	.p2align 3
.L2:
	subl	$40, %edx
	cmpb	$9, %dl
	ja	.L77
	movzbl	%dl, %edx
	movslq	(%rdi,%rdx,4), %rdx
	addq	%rdi, %rdx
	notrack jmp	*%rdx
	.section	.rodata
	.align 4
	.align 4
.L6:
	.long	.L11-.L6
	.long	.L10-.L6
	.long	.L9-.L6
	.long	.L8-.L6
	.long	.L77-.L6
	.long	.L7-.L6
	.long	.L77-.L6
	.long	.L77-.L6
	.long	.L5-.L6
	.long	.L5-.L6
	.text
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%ecx, %ecx
	jne	.L13
	movzbl	(%rax), %ebx
	leaq	-1(%rax), %r10
	leal	-48(%rbx), %edx
	cmpb	$1, %dl
	ja	.L33
	movsbl	%dl, %ecx
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L35:
	leal	-48(%rdx,%rcx,2), %ecx
	cmpl	$1023, %ecx
	jg	.L13
.L34:
	movq	%rax, %r10
	movsbl	1(%rax), %edx
	addq	$1, %rax
	leal	-48(%rdx), %r11d
	cmpb	$1, %r11b
	jbe	.L35
.L33:
	movslq	rp_num(%rip), %rdx
	leal	1(%rdx), %r11d
	movl	%ecx, (%rsi,%rdx,4)
	movl	$1, %ecx
	movl	%r11d, rp_num(%rip)
	movzbl	1(%r10), %edx
	testb	%dl, %dl
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L82:
	movl	stack_num(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L78
	leal	-1(%rcx), %edi
	movslq	%ecx, %rsi
	movslq	rp_num(%rip), %rdx
	leaq	stack(%rip), %r8
	movslq	%edi, %rax
	subq	$2, %rsi
	leaq	rp(%rip), %r10
	movl	%edi, %edi
	subq	%rdi, %rsi
	xorl	%edi, %edi
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L37:
	subq	$1, %rax
	movl	%ecx, (%r10,%rdx,4)
	leal	1(%rdx), %r11d
	movl	$1, %edi
	addq	$1, %rdx
	cmpq	%rsi, %rax
	je	.L81
.L38:
	movl	(%r8,%rax,4), %ecx
	movl	%eax, %r9d
	cmpl	$-4, %ecx
	jne	.L37
	movl	%eax, stack_num(%rip)
	testb	%dil, %dil
	je	.L13
	movl	%edx, rp_num(%rip)
.L13:
	xorl	%r10d, %r10d
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%r10d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	testl	%ecx, %ecx
	jne	.L13
	movslq	stack_num(%rip), %rdx
	leal	1(%rdx), %r10d
	movl	$-4, (%r8,%rdx,4)
	movl	%r10d, stack_num(%rip)
.L77:
	movq	%rax, %r10
	addq	$1, %rax
.L12:
	movzbl	1(%r10), %edx
	testb	%dl, %dl
	jne	.L2
	jmp	.L82
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%ecx, %ecx
	je	.L13
	movl	stack_num(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L83
	movslq	%r10d, %r11
	movslq	rp_num(%rip), %rdx
	xorl	%r12d, %r12d
	leaq	(%r8,%r11,4), %r11
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%ebx, (%rsi,%rdx,4)
	leal	1(%rdx), %ebp
	subq	$4, %r11
	addq	$1, %rdx
	movl	$1, %r12d
	testl	%r10d, %r10d
	je	.L84
.L21:
	movl	-4(%r11), %ebx
	movslq	%r10d, %rbp
	leal	-1(%rbp), %r10d
	cmpl	$-4, %ebx
	jne	.L22
	testb	%r12b, %r12b
	je	.L23
	movl	%edx, rp_num(%rip)
.L23:
	leal	1(%rbp), %ecx
.L20:
	movl	%ecx, stack_num(%rip)
	movq	%rax, %r10
	xorl	%ecx, %ecx
	addq	$1, %rax
	movl	$-2, (%r8,%rbp,4)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%ecx, %ecx
	je	.L13
	movl	stack_num(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L85
	movslq	%r10d, %r11
	movslq	rp_num(%rip), %rdx
	xorl	%r12d, %r12d
	leaq	(%r8,%r11,4), %r11
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, (%rsi,%rdx,4)
	leal	1(%rdx), %ebp
	subq	$4, %r11
	addq	$1, %rdx
	movl	$1, %r12d
	testl	%r10d, %r10d
	je	.L86
.L16:
	movl	-4(%r11), %ebx
	movslq	%r10d, %rbp
	leal	-1(%rbp), %r10d
	cmpl	$-4, %ebx
	jne	.L17
	testb	%r12b, %r12b
	je	.L18
	movl	%edx, rp_num(%rip)
.L18:
	leal	1(%rbp), %ecx
.L15:
	movl	%ecx, stack_num(%rip)
	movq	%rax, %r10
	xorl	%ecx, %ecx
	addq	$1, %rax
	movl	$-1, (%r8,%rbp,4)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%ecx, %ecx
	je	.L13
	movl	stack_num(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L87
	movslq	%r10d, %r11
	movslq	rp_num(%rip), %rdx
	xorl	%ebp, %ebp
	leaq	(%r8,%r11,4), %r11
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$-3, (%rsi,%rdx,4)
	leal	1(%rdx), %ebx
	subq	$4, %r11
	addq	$1, %rdx
	movl	$1, %ebp
	testl	%r10d, %r10d
	je	.L88
.L26:
	movslq	%r10d, %rbx
	cmpl	$-3, -4(%r11)
	leal	-1(%rbx), %r10d
	je	.L27
	testb	%bpl, %bpl
	je	.L28
	movl	%edx, rp_num(%rip)
.L28:
	leal	1(%rbx), %ecx
.L25:
	movl	%ecx, stack_num(%rip)
	movq	%rax, %r10
	xorl	%ecx, %ecx
	addq	$1, %rax
	movl	$-3, (%r8,%rbx,4)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	testl	%ecx, %ecx
	je	.L13
	movslq	stack_num(%rip), %rbx
	testl	%ebx, %ebx
	jle	.L13
	leal	-1(%rbx), %r10d
	movslq	%r10d, %rdx
	movl	(%r8,%rdx,4), %r11d
	cmpl	$-4, %r11d
	je	.L13
	movl	rp_num(%rip), %edx
	leaq	-8(%r8,%rbx,4), %rbx
	addl	$1, %edx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%r11d, (%r9,%rdx,4)
	movl	%edx, %ebp
	testl	%r10d, %r10d
	je	.L89
	movl	(%rbx), %r11d
	subl	$1, %r10d
	addq	$1, %rdx
	subq	$4, %rbx
	cmpl	$-4, %r11d
	jne	.L30
	movl	%r10d, stack_num(%rip)
	movq	%rax, %r10
	addq	$1, %rax
	movl	%ebp, rp_num(%rip)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%ebx, rp_num(%rip)
	xorl	%ebx, %ebx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L86:
	movl	%ebp, rp_num(%rip)
	xorl	%ebp, %ebp
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%ebp, rp_num(%rip)
	xorl	%ebp, %ebp
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L89:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r10d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%edx, rp_num(%rip)
	movl	$0, stack_num(%rip)
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L81:
	.cfi_restore_state
	movl	%r9d, stack_num(%rip)
	movl	%r11d, rp_num(%rip)
.L78:
	movl	$1, %r10d
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%r10d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L83:
	.cfi_restore_state
	leal	1(%r10), %ecx
	movslq	%r10d, %rbp
	jmp	.L20
.L85:
	leal	1(%r10), %ecx
	movslq	%r10d, %rbp
	jmp	.L15
.L87:
	leal	1(%r10), %ecx
	movslq	%r10d, %rbx
	jmp	.L25
.L80:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	rp_compile, .-rp_compile
	.p2align 4
	.globl	rp_calc
	.type	rp_calc, @function
rp_calc:
.LFB24:
	.cfi_startproc
	endbr64
	movl	$0, stack_num(%rip)
	movl	rp_num(%rip), %eax
	testl	%eax, %eax
	jle	.L91
	leaq	rp(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%r8d, %r8d
	leaq	4(%rdx), %rax
	leaq	stack(%rip), %rsi
	leaq	(%rax,%rcx,4), %r9
	xorl	%ecx, %ecx
	jmp	.L103
	.p2align 4,,10
	.p2align 3
.L129:
	cmpl	$-3, %eax
	je	.L127
	movslq	%ecx, %rdi
	addq	$4, %rdx
	addl	$1, %ecx
	movl	$1, %r8d
	movl	%eax, (%rsi,%rdi,4)
	cmpq	%r9, %rdx
	je	.L128
.L103:
	movl	(%rdx), %eax
	cmpl	$-2, %eax
	je	.L92
	cmpl	$-1, %eax
	jne	.L129
	cmpl	$1, %ecx
	jle	.L126
	leal	-2(%rcx), %edi
	leal	-1(%rcx), %r10d
	movslq	%edi, %rdi
	movslq	%r10d, %rax
	movl	(%rsi,%rax,4), %eax
	addl	(%rsi,%rdi,4), %eax
	movl	%eax, (%rsi,%rdi,4)
	cmpl	$1023, %eax
	jg	.L126
.L106:
	addq	$4, %rdx
	movl	%r10d, %ecx
	movl	$1, %r8d
	cmpq	%r9, %rdx
	jne	.L103
.L128:
	movl	%ecx, stack_num(%rip)
	cmpl	$1, %ecx
	jne	.L91
	movl	stack(%rip), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L92:
	cmpl	$1, %ecx
	jle	.L126
	leal	-2(%rcx), %edi
	leal	-1(%rcx), %r10d
	movslq	%edi, %rdi
	movslq	%r10d, %r11
	movl	(%rsi,%rdi,4), %eax
	subl	(%rsi,%r11,4), %eax
	movl	%eax, (%rsi,%rdi,4)
	jns	.L106
	.p2align 4,,10
	.p2align 3
.L126:
	testb	%r8b, %r8b
	je	.L91
	movl	%ecx, stack_num(%rip)
.L91:
	movl	$-1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L127:
	cmpl	$1, %ecx
	jle	.L126
	leal	-2(%rcx), %edi
	leal	-1(%rcx), %r10d
	movslq	%edi, %rdi
	movslq	%r10d, %r11
	movl	(%rsi,%rdi,4), %eax
	imull	(%rsi,%r11,4), %eax
	movl	%eax, (%rsi,%rdi,4)
	cmpl	$1023, %eax
	jle	.L106
	jmp	.L126
	.cfi_endproc
.LFE24:
	.size	rp_calc, .-rp_calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%s"
.LC2:
	.string	"01+-*()"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	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	$248, %rsp
	.cfi_def_cfa_offset 304
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbx
	movl	$150, 16(%rsp)
	movq	%rbx, %rsi
	movaps	%xmm0, (%rsp)
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %edx
	testb	%dl, %dl
	je	.L141
	xorl	%eax, %eax
	movl	$1, %ebp
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L134:
	cmpb	$46, %dl
	je	.L162
	addq	$1, %rax
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	jne	.L134
.L131:
	movl	$-1, %r12d
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L135:
	testl	%r14d, %r14d
	je	.L136
	movl	%r13d, %edx
	movl	%r13d, %eax
	movslq	(%rsp), %rcx
	imulq	$613566757, %rdx, %rdx
	shrq	$32, %rdx
	subl	%edx, %eax
	shrl	%eax
	addl	%edx, %eax
	movl	%r13d, %edx
	shrl	$2, %eax
	leal	0(,%rax,8), %esi
	subl	%eax, %esi
	subl	%esi, %edx
	movslq	%edx, %rdx
	movzbl	(%r15,%rdx), %edx
	movb	%dl, 32(%rsp,%rcx)
	cmpl	$1, %r14d
	je	.L136
	movl	%eax, %ecx
	movl	%eax, %edx
	movslq	4(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %edx
	shrl	%edx
	addl	%ecx, %edx
	shrl	$2, %edx
	leal	0(,%rdx,8), %ecx
	subl	%edx, %ecx
	subl	%ecx, %eax
	cltq
	movzbl	(%r15,%rax), %eax
	movb	%al, 32(%rsp,%rsi)
	cmpl	$2, %r14d
	je	.L136
	movl	%edx, %ecx
	movl	%edx, %eax
	movslq	8(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %eax
	shrl	%eax
	addl	%ecx, %eax
	shrl	$2, %eax
	leal	0(,%rax,8), %ecx
	subl	%eax, %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	movzbl	(%r15,%rdx), %edx
	movb	%dl, 32(%rsp,%rsi)
	cmpl	$3, %r14d
	je	.L136
	movl	%eax, %ecx
	movl	%eax, %edx
	movslq	12(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %edx
	shrl	%edx
	addl	%ecx, %edx
	shrl	$2, %edx
	leal	0(,%rdx,8), %ecx
	subl	%edx, %ecx
	subl	%ecx, %eax
	cltq
	movzbl	(%r15,%rax), %eax
	movb	%al, 32(%rsp,%rsi)
	cmpl	$4, %r14d
	je	.L136
	movl	%edx, %ecx
	movl	%edx, %eax
	movslq	16(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %eax
	shrl	%eax
	addl	%ecx, %eax
	shrl	$2, %eax
	leal	0(,%rax,8), %ecx
	subl	%eax, %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	movzbl	(%r15,%rdx), %eax
	movb	%al, 32(%rsp,%rsi)
.L136:
	movq	%rbx, %rdi
	call	rp_compile
	testl	%eax, %eax
	je	.L137
	call	rp_calc
	cmpl	%eax, %r12d
	cmovl	%eax, %r12d
.L137:
	addl	$1, %r13d
	cmpl	%ebp, %r13d
	jne	.L135
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L163
	addq	$248, %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
.L162:
	.cfi_restore_state
	leal	0(,%rbp,8), %edx
	movl	%eax, (%rsp,%r14,4)
	addq	$1, %rax
	leal	1(%r14), %ecx
	subl	%ebp, %edx
	movl	%edx, %ebp
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	je	.L164
	movslq	%ecx, %r14
	jmp	.L134
.L164:
	movl	%ecx, %r14d
	jmp	.L131
.L141:
	movl	$1, %ebp
	xorl	%r14d, %r14d
	jmp	.L131
.L163:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	rp
	.bss
	.align 32
	.type	rp, @object
	.size	rp, 400
rp:
	.zero	400
	.globl	rp_num
	.align 4
	.type	rp_num, @object
	.size	rp_num, 4
rp_num:
	.zero	4
	.globl	stack
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.globl	stack_num
	.align 4
	.type	stack_num, @object
	.size	stack_num, 4
stack_num:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	150
	.long	150
	.long	150
	.long	150
	.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	rp_compile
	.type	rp_compile, @function
rp_compile:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$0, stack_num(%rip)
	movl	$0, rp_num(%rip)
	movzbl	(%rdi), %edx
	testb	%dl, %dl
	je	.L80
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	rp(%rip), %rsi
	movq	%rdi, %rax
	xorl	%ecx, %ecx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.L6(%rip), %rdi
	leaq	stack(%rip), %r8
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-4(%rsi), %r9
	.p2align 4,,10
	.p2align 3
.L2:
	subl	$40, %edx
	cmpb	$9, %dl
	ja	.L77
	movzbl	%dl, %edx
	movslq	(%rdi,%rdx,4), %rdx
	addq	%rdi, %rdx
	notrack jmp	*%rdx
	.section	.rodata
	.align 4
	.align 4
.L6:
	.long	.L11-.L6
	.long	.L10-.L6
	.long	.L9-.L6
	.long	.L8-.L6
	.long	.L77-.L6
	.long	.L7-.L6
	.long	.L77-.L6
	.long	.L77-.L6
	.long	.L5-.L6
	.long	.L5-.L6
	.text
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%ecx, %ecx
	jne	.L13
	movzbl	(%rax), %ebx
	leaq	-1(%rax), %r10
	leal	-48(%rbx), %edx
	cmpb	$1, %dl
	ja	.L33
	movsbl	%dl, %ecx
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L35:
	leal	-48(%rdx,%rcx,2), %ecx
	cmpl	$1023, %ecx
	jg	.L13
.L34:
	movq	%rax, %r10
	movsbl	1(%rax), %edx
	addq	$1, %rax
	leal	-48(%rdx), %r11d
	cmpb	$1, %r11b
	jbe	.L35
.L33:
	movslq	rp_num(%rip), %rdx
	leal	1(%rdx), %r11d
	movl	%ecx, (%rsi,%rdx,4)
	movl	$1, %ecx
	movl	%r11d, rp_num(%rip)
	movzbl	1(%r10), %edx
	testb	%dl, %dl
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L82:
	movl	stack_num(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L78
	leal	-1(%rcx), %edi
	movslq	%ecx, %rsi
	movslq	rp_num(%rip), %rdx
	leaq	stack(%rip), %r8
	movslq	%edi, %rax
	subq	$2, %rsi
	leaq	rp(%rip), %r10
	movl	%edi, %edi
	subq	%rdi, %rsi
	xorl	%edi, %edi
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L37:
	subq	$1, %rax
	movl	%ecx, (%r10,%rdx,4)
	leal	1(%rdx), %r11d
	movl	$1, %edi
	addq	$1, %rdx
	cmpq	%rsi, %rax
	je	.L81
.L38:
	movl	(%r8,%rax,4), %ecx
	movl	%eax, %r9d
	cmpl	$-4, %ecx
	jne	.L37
	movl	%eax, stack_num(%rip)
	testb	%dil, %dil
	je	.L13
	movl	%edx, rp_num(%rip)
.L13:
	xorl	%r10d, %r10d
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%r10d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	testl	%ecx, %ecx
	jne	.L13
	movslq	stack_num(%rip), %rdx
	leal	1(%rdx), %r10d
	movl	$-4, (%r8,%rdx,4)
	movl	%r10d, stack_num(%rip)
.L77:
	movq	%rax, %r10
	addq	$1, %rax
.L12:
	movzbl	1(%r10), %edx
	testb	%dl, %dl
	jne	.L2
	jmp	.L82
	.p2align 4,,10
	.p2align 3
.L7:
	testl	%ecx, %ecx
	je	.L13
	movl	stack_num(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L83
	movslq	%r10d, %r11
	movslq	rp_num(%rip), %rdx
	xorl	%r12d, %r12d
	leaq	(%r8,%r11,4), %r11
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%ebx, (%rsi,%rdx,4)
	leal	1(%rdx), %ebp
	subq	$4, %r11
	addq	$1, %rdx
	movl	$1, %r12d
	testl	%r10d, %r10d
	je	.L84
.L21:
	movl	-4(%r11), %ebx
	movslq	%r10d, %rbp
	leal	-1(%rbp), %r10d
	cmpl	$-4, %ebx
	jne	.L22
	testb	%r12b, %r12b
	je	.L23
	movl	%edx, rp_num(%rip)
.L23:
	leal	1(%rbp), %ecx
.L20:
	movl	%ecx, stack_num(%rip)
	movq	%rax, %r10
	xorl	%ecx, %ecx
	addq	$1, %rax
	movl	$-2, (%r8,%rbp,4)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%ecx, %ecx
	je	.L13
	movl	stack_num(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L85
	movslq	%r10d, %r11
	movslq	rp_num(%rip), %rdx
	xorl	%r12d, %r12d
	leaq	(%r8,%r11,4), %r11
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, (%rsi,%rdx,4)
	leal	1(%rdx), %ebp
	subq	$4, %r11
	addq	$1, %rdx
	movl	$1, %r12d
	testl	%r10d, %r10d
	je	.L86
.L16:
	movl	-4(%r11), %ebx
	movslq	%r10d, %rbp
	leal	-1(%rbp), %r10d
	cmpl	$-4, %ebx
	jne	.L17
	testb	%r12b, %r12b
	je	.L18
	movl	%edx, rp_num(%rip)
.L18:
	leal	1(%rbp), %ecx
.L15:
	movl	%ecx, stack_num(%rip)
	movq	%rax, %r10
	xorl	%ecx, %ecx
	addq	$1, %rax
	movl	$-1, (%r8,%rbp,4)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%ecx, %ecx
	je	.L13
	movl	stack_num(%rip), %r10d
	testl	%r10d, %r10d
	jle	.L87
	movslq	%r10d, %r11
	movslq	rp_num(%rip), %rdx
	xorl	%ebp, %ebp
	leaq	(%r8,%r11,4), %r11
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$-3, (%rsi,%rdx,4)
	leal	1(%rdx), %ebx
	subq	$4, %r11
	addq	$1, %rdx
	movl	$1, %ebp
	testl	%r10d, %r10d
	je	.L88
.L26:
	movslq	%r10d, %rbx
	cmpl	$-3, -4(%r11)
	leal	-1(%rbx), %r10d
	je	.L27
	testb	%bpl, %bpl
	je	.L28
	movl	%edx, rp_num(%rip)
.L28:
	leal	1(%rbx), %ecx
.L25:
	movl	%ecx, stack_num(%rip)
	movq	%rax, %r10
	xorl	%ecx, %ecx
	addq	$1, %rax
	movl	$-3, (%r8,%rbx,4)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	testl	%ecx, %ecx
	je	.L13
	movslq	stack_num(%rip), %rbx
	testl	%ebx, %ebx
	jle	.L13
	leal	-1(%rbx), %r10d
	movslq	%r10d, %rdx
	movl	(%r8,%rdx,4), %r11d
	cmpl	$-4, %r11d
	je	.L13
	movl	rp_num(%rip), %edx
	leaq	-8(%r8,%rbx,4), %rbx
	addl	$1, %edx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%r11d, (%r9,%rdx,4)
	movl	%edx, %ebp
	testl	%r10d, %r10d
	je	.L89
	movl	(%rbx), %r11d
	subl	$1, %r10d
	addq	$1, %rdx
	subq	$4, %rbx
	cmpl	$-4, %r11d
	jne	.L30
	movl	%r10d, stack_num(%rip)
	movq	%rax, %r10
	addq	$1, %rax
	movl	%ebp, rp_num(%rip)
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%ebx, rp_num(%rip)
	xorl	%ebx, %ebx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L86:
	movl	%ebp, rp_num(%rip)
	xorl	%ebp, %ebp
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%ebp, rp_num(%rip)
	xorl	%ebp, %ebp
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L89:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r10d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%edx, rp_num(%rip)
	movl	$0, stack_num(%rip)
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L81:
	.cfi_restore_state
	movl	%r9d, stack_num(%rip)
	movl	%r11d, rp_num(%rip)
.L78:
	movl	$1, %r10d
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%r10d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L83:
	.cfi_restore_state
	leal	1(%r10), %ecx
	movslq	%r10d, %rbp
	jmp	.L20
.L85:
	leal	1(%r10), %ecx
	movslq	%r10d, %rbp
	jmp	.L15
.L87:
	leal	1(%r10), %ecx
	movslq	%r10d, %rbx
	jmp	.L25
.L80:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	rp_compile, .-rp_compile
	.p2align 4
	.globl	rp_calc
	.type	rp_calc, @function
rp_calc:
.LFB24:
	.cfi_startproc
	endbr64
	movl	$0, stack_num(%rip)
	movl	rp_num(%rip), %eax
	testl	%eax, %eax
	jle	.L91
	leaq	rp(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%r8d, %r8d
	leaq	4(%rdx), %rax
	leaq	stack(%rip), %rsi
	leaq	(%rax,%rcx,4), %r9
	xorl	%ecx, %ecx
	jmp	.L103
	.p2align 4,,10
	.p2align 3
.L129:
	cmpl	$-3, %eax
	je	.L127
	movslq	%ecx, %rdi
	addq	$4, %rdx
	addl	$1, %ecx
	movl	$1, %r8d
	movl	%eax, (%rsi,%rdi,4)
	cmpq	%r9, %rdx
	je	.L128
.L103:
	movl	(%rdx), %eax
	cmpl	$-2, %eax
	je	.L92
	cmpl	$-1, %eax
	jne	.L129
	cmpl	$1, %ecx
	jle	.L126
	leal	-2(%rcx), %edi
	leal	-1(%rcx), %r10d
	movslq	%edi, %rdi
	movslq	%r10d, %rax
	movl	(%rsi,%rax,4), %eax
	addl	(%rsi,%rdi,4), %eax
	movl	%eax, (%rsi,%rdi,4)
	cmpl	$1023, %eax
	jg	.L126
.L106:
	addq	$4, %rdx
	movl	%r10d, %ecx
	movl	$1, %r8d
	cmpq	%r9, %rdx
	jne	.L103
.L128:
	movl	%ecx, stack_num(%rip)
	cmpl	$1, %ecx
	jne	.L91
	movl	stack(%rip), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L92:
	cmpl	$1, %ecx
	jle	.L126
	leal	-2(%rcx), %edi
	leal	-1(%rcx), %r10d
	movslq	%edi, %rdi
	movslq	%r10d, %r11
	movl	(%rsi,%rdi,4), %eax
	subl	(%rsi,%r11,4), %eax
	movl	%eax, (%rsi,%rdi,4)
	jns	.L106
	.p2align 4,,10
	.p2align 3
.L126:
	testb	%r8b, %r8b
	je	.L91
	movl	%ecx, stack_num(%rip)
.L91:
	movl	$-1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L127:
	cmpl	$1, %ecx
	jle	.L126
	leal	-2(%rcx), %edi
	leal	-1(%rcx), %r10d
	movslq	%edi, %rdi
	movslq	%r10d, %r11
	movl	(%rsi,%rdi,4), %eax
	imull	(%rsi,%r11,4), %eax
	movl	%eax, (%rsi,%rdi,4)
	cmpl	$1023, %eax
	jle	.L106
	jmp	.L126
	.cfi_endproc
.LFE24:
	.size	rp_calc, .-rp_calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%s"
.LC2:
	.string	"01+-*()"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	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	$248, %rsp
	.cfi_def_cfa_offset 304
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbx
	movl	$150, 16(%rsp)
	movq	%rbx, %rsi
	movaps	%xmm0, (%rsp)
	call	__isoc99_scanf@PLT
	movzbl	32(%rsp), %edx
	testb	%dl, %dl
	je	.L141
	xorl	%eax, %eax
	movl	$1, %ebp
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L134:
	cmpb	$46, %dl
	je	.L162
	addq	$1, %rax
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	jne	.L134
.L131:
	movl	$-1, %r12d
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L135:
	testl	%r14d, %r14d
	je	.L136
	movl	%r13d, %edx
	movl	%r13d, %eax
	movslq	(%rsp), %rcx
	imulq	$613566757, %rdx, %rdx
	shrq	$32, %rdx
	subl	%edx, %eax
	shrl	%eax
	addl	%edx, %eax
	movl	%r13d, %edx
	shrl	$2, %eax
	leal	0(,%rax,8), %esi
	subl	%eax, %esi
	subl	%esi, %edx
	movslq	%edx, %rdx
	movzbl	(%r15,%rdx), %edx
	movb	%dl, 32(%rsp,%rcx)
	cmpl	$1, %r14d
	je	.L136
	movl	%eax, %ecx
	movl	%eax, %edx
	movslq	4(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %edx
	shrl	%edx
	addl	%ecx, %edx
	shrl	$2, %edx
	leal	0(,%rdx,8), %ecx
	subl	%edx, %ecx
	subl	%ecx, %eax
	cltq
	movzbl	(%r15,%rax), %eax
	movb	%al, 32(%rsp,%rsi)
	cmpl	$2, %r14d
	je	.L136
	movl	%edx, %ecx
	movl	%edx, %eax
	movslq	8(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %eax
	shrl	%eax
	addl	%ecx, %eax
	shrl	$2, %eax
	leal	0(,%rax,8), %ecx
	subl	%eax, %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	movzbl	(%r15,%rdx), %edx
	movb	%dl, 32(%rsp,%rsi)
	cmpl	$3, %r14d
	je	.L136
	movl	%eax, %ecx
	movl	%eax, %edx
	movslq	12(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %edx
	shrl	%edx
	addl	%ecx, %edx
	shrl	$2, %edx
	leal	0(,%rdx,8), %ecx
	subl	%edx, %ecx
	subl	%ecx, %eax
	cltq
	movzbl	(%r15,%rax), %eax
	movb	%al, 32(%rsp,%rsi)
	cmpl	$4, %r14d
	je	.L136
	movl	%edx, %ecx
	movl	%edx, %eax
	movslq	16(%rsp), %rsi
	imulq	$613566757, %rcx, %rcx
	shrq	$32, %rcx
	subl	%ecx, %eax
	shrl	%eax
	addl	%ecx, %eax
	shrl	$2, %eax
	leal	0(,%rax,8), %ecx
	subl	%eax, %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	movzbl	(%r15,%rdx), %eax
	movb	%al, 32(%rsp,%rsi)
.L136:
	movq	%rbx, %rdi
	call	rp_compile
	testl	%eax, %eax
	je	.L137
	call	rp_calc
	cmpl	%eax, %r12d
	cmovl	%eax, %r12d
.L137:
	addl	$1, %r13d
	cmpl	%ebp, %r13d
	jne	.L135
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L163
	addq	$248, %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
.L162:
	.cfi_restore_state
	leal	0(,%rbp,8), %edx
	movl	%eax, (%rsp,%r14,4)
	addq	$1, %rax
	leal	1(%r14), %ecx
	subl	%ebp, %edx
	movl	%edx, %ebp
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	je	.L164
	movslq	%ecx, %r14
	jmp	.L134
.L164:
	movl	%ecx, %r14d
	jmp	.L131
.L141:
	movl	$1, %ebp
	xorl	%r14d, %r14d
	jmp	.L131
.L163:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	rp
	.bss
	.align 32
	.type	rp, @object
	.size	rp, 400
rp:
	.zero	400
	.globl	rp_num
	.align 4
	.type	rp_num, @object
	.size	rp_num, 4
rp_num:
	.zero	4
	.globl	stack
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.globl	stack_num
	.align 4
	.type	stack_num, @object
	.size	stack_num, 4
stack_num:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	150
	.long	150
	.long	150
	.long	150
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>

#define NUM_LIMIT (1<<10)

#define OP_ADD   (-1)
#define OP_SUB   (-2)
#define OP_MUL   (-3)
#define OP_KAKKO (-4)

int stack_num;
int stack[100];
int rp_num;
int rp[100];

int rp_compile(const char* statement) {
	const char* now;
	int expectOperator=0;
	int nownumber;
	stack_num=0;
	rp_num=0;
	for(now=statement;*now;now++) {
		switch(*now) {
			case '+':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_ADD;
				expectOperator=0;
				break;
			case '-':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_SUB;
				expectOperator=0;
				break;
			case '*':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]==OP_MUL) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_MUL;
				expectOperator=0;
				break;
			case '(':
				if(expectOperator)return 0;
				stack[stack_num++]=OP_KAKKO;
				expectOperator=0;
				break;
			case ')':
				if(!expectOperator)return 0;
				if(stack_num<=0 || stack[stack_num-1]==OP_KAKKO)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				if(stack_num>0)stack_num--; else return 0;
				expectOperator=1;
				break;
			case '0':
			case '1':
				if(expectOperator)return 0;
				nownumber=0;
				for(;*now=='0' || *now=='1';now++) {
					nownumber=nownumber*2+(*now)-'0';
					if(nownumber>=NUM_LIMIT)return 0;
				}
				now--;
				expectOperator=1;
				rp[rp_num++]=nownumber;
				break;
		}
	}
	while(stack_num>0) {
		stack_num--;
		if(stack[stack_num]==OP_KAKKO)return 0;
		rp[rp_num++]=stack[stack_num];
	}
	return 1;
}

int rp_calc(void) {
	int i;
	stack_num=0;
	for(i=0;i<rp_num;i++) {
		switch(rp[i]) {
			case OP_ADD:
				if(stack_num<2)return -1;
				stack[stack_num-2]+=stack[stack_num-1];
				if(stack[stack_num-2]>=NUM_LIMIT)return -1;
				stack_num--;
				break;
			case OP_SUB:
				if(stack_num<2)return -1;
				stack[stack_num-2]-=stack[stack_num-1];
				if(stack[stack_num-2]<0)return -1;
				stack_num--;
				break;
			case OP_MUL:
				if(stack_num<2)return -1;
				stack[stack_num-2]*=stack[stack_num-1];
				if(stack[stack_num-2]>=NUM_LIMIT)return -1;
				stack_num--;
				break;
			default:
				stack[stack_num++]=rp[i];
				break;
		}
	}
	if(stack_num!=1)return -1;
	return stack[0];
}

int main(void) {
	char input[200];
	const char* mozi="01+-*()";
	int pos[5]={150,150,150,150,150};
	int i,j;
	int posnum;
	int search_max;
	int result;
	scanf("%s",input);
	posnum=0;
	search_max=1;
	for(i=0;input[i];i++) {
		if(input[i]=='.') {
			pos[posnum++]=i;
			search_max*=7;
		}
	}
	result=-1;
	for(i=0;i<search_max;i++) {
		int temp=i;
		for(j=0;j<posnum;j++) {
			input[pos[j]]=mozi[temp%7];
			temp/=7;
		}
		if(!rp_compile(input))continue;
		temp=rp_calc();
		if(temp>result)result=temp;
	}
	printf("%d\n",result);
	return 0;
}
0.010621136904092388
 0.1.
 100
 .01.
 101
 .10.
 010
 .00.
 110
 011

-1
 7
 4
 11
 5
 13
 2
 9
 6
 3

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

```c
#include <stdio.h>

#define NUM_LIMIT (1<<10)

#define OP_ADD   (-1)
#define OP_SUB   (-2)
#define OP_MUL   (-3)
#define OP_KAKKO (-4)

int stack_num;
int stack[100];
int rp_num;
int rp[100];

int rp_compile(const char* statement) {
	const char* now;
	int expectOperator=0;
	int nownumber;
	stack_num=0;
	rp_num=0;
	for(now=statement;*now;now++) {
		switch(*now) {
			case '+':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_ADD;
				expectOperator=0;
				break;
			case '-':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_SUB;
				expectOperator=0;
				break;
			case '*':
				if(!expectOperator)return 0;
				while(stack_num>0 && stack[stack_num-1]==OP_MUL) {
					rp[rp_num++]=stack[--stack_num];
				}
				stack[stack_num++]=OP_MUL;
				expectOperator=0;
				break;
			case '(':
				if(expectOperator)return 0;
				stack[stack_num++]=OP_KAKKO;
				expectOperator=0;
				break;
			case ')':
				if(!expectOperator)return 0;
				if(stack_num<=0 || stack[stack_num-1]==OP_KAKKO)return 0;
				while(stack_num>0 && stack[stack_num-1]!=OP_KAKKO) {
					rp[rp_num++]=stack[--stack_num];
				}
				if(stack_num>0)stack_num--; else return 0;
				expectOperator=1;
				break;
			case '0':
			case '1':
				if(expectOperator)return 0;
				nownumber=0;
				for(;*now=='0' || *now=='1';now++) {
					nownumber=nownumber*2+(*now)-'0';
					if(nownumber>=NUM_LIMIT)return 0;
				}
				now--;
				expectOperator=1;
				rp[rp_num++]=nownumber;
				break;
		}
	}
	while(stack_num>0) {
		stack_num--;
		if(stack[stack_num]==OP_KAKKO)return 0;
		rp[rp_num++]=stack[stack_num];
	}
	return 1;
}

int rp_calc(void) {
	int i;
	stack_num=0;
	for(i=0;i<rp_num;i++) {
		switch(rp[i]) {
			case OP_ADD:
				if(stack_num<2)return -1;
				stack[stack_num-2]+=stack[stack_num-1];
				if(stack[stack_num-2]>=NUM_LIMIT)return -1;
				stack_num--;
				break;
			case OP_SUB:
				if(stack_num<2)return -1;
				stack[stack_num-2]-=stack[stack_num-1];
				if(stack[stack_num-2]<0)return -1;
				stack_num--;
				break;
			case OP_MUL:
				if(stack_num<2)return -1;
				stack[stack_num-2]*=stack[stack_num-1];
				if(stack[stack_num-2]>=NUM_LIMIT)return -1;
				stack_num--;
				break;
			default:
				stack[stack_num++]=rp[i];
				break;
		}
	}
	if(stack_num!=1)return -1;
	return stack[0];
}

int main(void) {
	char input[200];
	const char* mozi="01+-*()";
	int pos[5]={150,150,150,150,150};
	int i,j;
	int posnum;
	int search_max;
	int result;
	scanf("%s",input);
	posnum=0;
	search_max=1;
	for(i=0;input[i];i++) {
		if(input[i]=='.') {
			pos[posnum++]=i;
			search_max*=7;
		}
	}
	result=-1;
	for(i=0;i<search_max;i++) {
		int temp=i;
		for(j=0;j<posnum;j++) {
			input[pos[j]]=mozi[temp%7];
			temp/=7;
		}
		if(!rp_compile(input))continue;
		temp=rp_calc();
		if(temp>result)result=temp;
	}
	printf("%d\n",result);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	stack_num
	.bss
	.align 4
	.type	stack_num, @object
	.size	stack_num, 4
stack_num:
	.zero	4
	.globl	stack
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.globl	rp_num
	.align 4
	.type	rp_num, @object
	.size	rp_num, 4
rp_num:
	.zero	4
	.globl	rp
	.align 32
	.type	rp, @object
	.size	rp, 400
rp:
	.zero	400
	.text
	.globl	rp_compile
	.type	rp_compile, @function
rp_compile:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, stack_num(%rip)
	movl	$0, rp_num(%rip)
	movq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L37:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$40, %eax
	cmpl	$9, %eax
	ja	.L3
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L5(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L5(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L5:
	.long	.L10-.L5
	.long	.L9-.L5
	.long	.L8-.L5
	.long	.L7-.L5
	.long	.L3-.L5
	.long	.L6-.L5
	.long	.L3-.L5
	.long	.L3-.L5
	.long	.L4-.L5
	.long	.L4-.L5
	.text
.L7:
	cmpl	$0, -16(%rbp)
	jne	.L13
	movl	$0, %eax
	jmp	.L12
.L15:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L13:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L15
.L14:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L6:
	cmpl	$0, -16(%rbp)
	jne	.L17
	movl	$0, %eax
	jmp	.L12
.L19:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L17:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L18
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L19
.L18:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-2, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L8:
	cmpl	$0, -16(%rbp)
	jne	.L21
	movl	$0, %eax
	jmp	.L12
.L23:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L21:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L22
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-3, %eax
	je	.L23
.L22:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-3, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L10:
	cmpl	$0, -16(%rbp)
	je	.L24
	movl	$0, %eax
	jmp	.L12
.L24:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-4, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L9:
	cmpl	$0, -16(%rbp)
	jne	.L25
	movl	$0, %eax
	jmp	.L12
.L25:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L26
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L28
.L26:
	movl	$0, %eax
	jmp	.L12
.L30:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L28:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L29
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L30
.L29:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L31
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	$1, -16(%rbp)
	jmp	.L3
.L31:
	movl	$0, %eax
	jmp	.L12
.L4:
	cmpl	$0, -16(%rbp)
	je	.L33
	movl	$0, %eax
	jmp	.L12
.L33:
	movl	$0, -12(%rbp)
	jmp	.L34
.L36:
	movl	-12(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -12(%rbp)
	cmpl	$1023, -12(%rbp)
	jle	.L35
	movl	$0, %eax
	jmp	.L12
.L35:
	addq	$1, -8(%rbp)
.L34:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L36
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	je	.L36
	subq	$1, -8(%rbp)
	movl	$1, -16(%rbp)
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
.L3:
	addq	$1, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L37
	jmp	.L38
.L40:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L39
	movl	$0, %eax
	jmp	.L12
.L39:
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L38:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jg	.L40
	movl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	rp_compile, .-rp_compile
	.globl	rp_calc
	.type	rp_calc, @function
rp_calc:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, stack_num(%rip)
	movl	$0, -4(%rbp)
	jmp	.L42
.L55:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L43
	testl	%eax, %eax
	jns	.L44
	cmpl	$-3, %eax
	je	.L45
	cmpl	$-2, %eax
	je	.L46
	jmp	.L44
.L43:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L47
	movl	$-1, %eax
	jmp	.L48
.L47:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1023, %eax
	jle	.L49
	movl	$-1, %eax
	jmp	.L48
.L49:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L46:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L51
	movl	$-1, %eax
	jmp	.L48
.L51:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	stack_num(%rip), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %esi
	movl	stack_num(%rip), %edx
	subl	$2, %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L52
	movl	$-1, %eax
	jmp	.L48
.L52:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L45:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L53
	movl	$-1, %eax
	jmp	.L48
.L53:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	stack(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	stack_num(%rip), %ecx
	subl	$2, %ecx
	imull	%edx, %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1023, %eax
	jle	.L54
	movl	$-1, %eax
	jmp	.L48
.L54:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L44:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	rp(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	stack(%rip), %rax
	movl	%edx, (%rcx,%rax)
	nop
.L50:
	addl	$1, -4(%rbp)
.L42:
	movl	rp_num(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L55
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	je	.L56
	movl	$-1, %eax
	jmp	.L48
.L56:
	movl	stack(%rip), %eax
.L48:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	rp_calc, .-rp_calc
	.section	.rodata
.LC0:
	.string	"01+-*()"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -248(%rbp)
	movl	$150, -240(%rbp)
	movl	$150, -236(%rbp)
	movl	$150, -232(%rbp)
	movl	$150, -228(%rbp)
	movl	$150, -224(%rbp)
	leaq	-208(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -264(%rbp)
	movl	$1, -260(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L58
.L60:
	movl	-272(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$46, %al
	jne	.L59
	movl	-264(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -264(%rbp)
	cltq
	movl	-272(%rbp), %edx
	movl	%edx, -240(%rbp,%rax,4)
	movl	-260(%rbp), %edx
	movl	%edx, %eax
	sall	$3, %eax
	subl	%edx, %eax
	movl	%eax, -260(%rbp)
.L59:
	addl	$1, -272(%rbp)
.L58:
	movl	-272(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L60
	movl	$-1, -256(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L61
.L66:
	movl	-272(%rbp), %eax
	movl	%eax, -252(%rbp)
	movl	$0, -268(%rbp)
	jmp	.L62
.L63:
	movl	-252(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1840700269, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$2, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, %ecx
	sall	$3, %ecx
	subl	%edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rdx
	movq	-248(%rbp), %rax
	addq	%rax, %rdx
	movl	-268(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	movzbl	(%rdx), %edx
	cltq
	movb	%dl, -208(%rbp,%rax)
	movl	-252(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1840700269, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -252(%rbp)
	addl	$1, -268(%rbp)
.L62:
	movl	-268(%rbp), %eax
	cmpl	-264(%rbp), %eax
	jl	.L63
	leaq	-208(%rbp), %rax
	movq	%rax, %rdi
	call	rp_compile
	testl	%eax, %eax
	je	.L69
	call	rp_calc
	movl	%eax, -252(%rbp)
	movl	-252(%rbp), %eax
	cmpl	-256(%rbp), %eax
	jle	.L65
	movl	-252(%rbp), %eax
	movl	%eax, -256(%rbp)
	jmp	.L65
.L69:
	nop
.L65:
	addl	$1, -272(%rbp)
.L61:
	movl	-272(%rbp), %eax
	cmpl	-260(%rbp), %eax
	jl	.L66
	movl	-256(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	stack_num
	.bss
	.align 4
	.type	stack_num, @object
	.size	stack_num, 4
stack_num:
	.zero	4
	.globl	stack
	.align 32
	.type	stack, @object
	.size	stack, 400
stack:
	.zero	400
	.globl	rp_num
	.align 4
	.type	rp_num, @object
	.size	rp_num, 4
rp_num:
	.zero	4
	.globl	rp
	.align 32
	.type	rp, @object
	.size	rp, 400
rp:
	.zero	400
	.text
	.globl	rp_compile
	.type	rp_compile, @function
rp_compile:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, stack_num(%rip)
	movl	$0, rp_num(%rip)
	movq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L37:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$40, %eax
	cmpl	$9, %eax
	ja	.L3
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L5(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L5(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L5:
	.long	.L10-.L5
	.long	.L9-.L5
	.long	.L8-.L5
	.long	.L7-.L5
	.long	.L3-.L5
	.long	.L6-.L5
	.long	.L3-.L5
	.long	.L3-.L5
	.long	.L4-.L5
	.long	.L4-.L5
	.text
.L7:
	cmpl	$0, -16(%rbp)
	jne	.L13
	movl	$0, %eax
	jmp	.L12
.L15:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L13:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L15
.L14:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L6:
	cmpl	$0, -16(%rbp)
	jne	.L17
	movl	$0, %eax
	jmp	.L12
.L19:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L17:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L18
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L19
.L18:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-2, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L8:
	cmpl	$0, -16(%rbp)
	jne	.L21
	movl	$0, %eax
	jmp	.L12
.L23:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L21:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L22
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-3, %eax
	je	.L23
.L22:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-3, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L10:
	cmpl	$0, -16(%rbp)
	je	.L24
	movl	$0, %eax
	jmp	.L12
.L24:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	$-4, (%rdx,%rax)
	movl	$0, -16(%rbp)
	jmp	.L3
.L9:
	cmpl	$0, -16(%rbp)
	jne	.L25
	movl	$0, %eax
	jmp	.L12
.L25:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L26
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L28
.L26:
	movl	$0, %eax
	jmp	.L12
.L30:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L28:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L29
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L30
.L29:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jle	.L31
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	$1, -16(%rbp)
	jmp	.L3
.L31:
	movl	$0, %eax
	jmp	.L12
.L4:
	cmpl	$0, -16(%rbp)
	je	.L33
	movl	$0, %eax
	jmp	.L12
.L33:
	movl	$0, -12(%rbp)
	jmp	.L34
.L36:
	movl	-12(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -12(%rbp)
	cmpl	$1023, -12(%rbp)
	jle	.L35
	movl	$0, %eax
	jmp	.L12
.L35:
	addq	$1, -8(%rbp)
.L34:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	je	.L36
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	je	.L36
	subq	$1, -8(%rbp)
	movl	$1, -16(%rbp)
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
.L3:
	addq	$1, -8(%rbp)
.L2:
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L37
	jmp	.L38
.L40:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	movl	stack_num(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-4, %eax
	jne	.L39
	movl	$0, %eax
	jmp	.L12
.L39:
	movl	stack_num(%rip), %ecx
	movl	rp_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, rp_num(%rip)
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rp(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L38:
	movl	stack_num(%rip), %eax
	testl	%eax, %eax
	jg	.L40
	movl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	rp_compile, .-rp_compile
	.globl	rp_calc
	.type	rp_calc, @function
rp_calc:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, stack_num(%rip)
	movl	$0, -4(%rbp)
	jmp	.L42
.L55:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L43
	testl	%eax, %eax
	jns	.L44
	cmpl	$-3, %eax
	je	.L45
	cmpl	$-2, %eax
	je	.L46
	jmp	.L44
.L43:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L47
	movl	$-1, %eax
	jmp	.L48
.L47:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1023, %eax
	jle	.L49
	movl	$-1, %eax
	jmp	.L48
.L49:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L46:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L51
	movl	$-1, %eax
	jmp	.L48
.L51:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	stack_num(%rip), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	(%rcx,%rdx), %esi
	movl	stack_num(%rip), %edx
	subl	$2, %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L52
	movl	$-1, %eax
	jmp	.L48
.L52:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L45:
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	jg	.L53
	movl	$-1, %eax
	jmp	.L48
.L53:
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	stack(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	stack_num(%rip), %ecx
	subl	$2, %ecx
	imull	%edx, %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	stack(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	stack_num(%rip), %eax
	subl	$2, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stack(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1023, %eax
	jle	.L54
	movl	$-1, %eax
	jmp	.L48
.L54:
	movl	stack_num(%rip), %eax
	subl	$1, %eax
	movl	%eax, stack_num(%rip)
	jmp	.L50
.L44:
	movl	stack_num(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, stack_num(%rip)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	rp(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	stack(%rip), %rax
	movl	%edx, (%rcx,%rax)
	nop
.L50:
	addl	$1, -4(%rbp)
.L42:
	movl	rp_num(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L55
	movl	stack_num(%rip), %eax
	cmpl	$1, %eax
	je	.L56
	movl	$-1, %eax
	jmp	.L48
.L56:
	movl	stack(%rip), %eax
.L48:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	rp_calc, .-rp_calc
	.section	.rodata
.LC0:
	.string	"01+-*()"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -248(%rbp)
	movl	$150, -240(%rbp)
	movl	$150, -236(%rbp)
	movl	$150, -232(%rbp)
	movl	$150, -228(%rbp)
	movl	$150, -224(%rbp)
	leaq	-208(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -264(%rbp)
	movl	$1, -260(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L58
.L60:
	movl	-272(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$46, %al
	jne	.L59
	movl	-264(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -264(%rbp)
	cltq
	movl	-272(%rbp), %edx
	movl	%edx, -240(%rbp,%rax,4)
	movl	-260(%rbp), %edx
	movl	%edx, %eax
	sall	$3, %eax
	subl	%edx, %eax
	movl	%eax, -260(%rbp)
.L59:
	addl	$1, -272(%rbp)
.L58:
	movl	-272(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L60
	movl	$-1, -256(%rbp)
	movl	$0, -272(%rbp)
	jmp	.L61
.L66:
	movl	-272(%rbp), %eax
	movl	%eax, -252(%rbp)
	movl	$0, -268(%rbp)
	jmp	.L62
.L63:
	movl	-252(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1840700269, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$2, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, %ecx
	sall	$3, %ecx
	subl	%edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movslq	%edx, %rdx
	movq	-248(%rbp), %rax
	addq	%rax, %rdx
	movl	-268(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	movzbl	(%rdx), %edx
	cltq
	movb	%dl, -208(%rbp,%rax)
	movl	-252(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1840700269, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -252(%rbp)
	addl	$1, -268(%rbp)
.L62:
	movl	-268(%rbp), %eax
	cmpl	-264(%rbp), %eax
	jl	.L63
	leaq	-208(%rbp), %rax
	movq	%rax, %rdi
	call	rp_compile
	testl	%eax, %eax
	je	.L69
	call	rp_calc
	movl	%eax, -252(%rbp)
	movl	-252(%rbp), %eax
	cmpl	-256(%rbp), %eax
	jle	.L65
	movl	-252(%rbp), %eax
	movl	%eax, -256(%rbp)
	jmp	.L65
.L69:
	nop
.L65:
	addl	$1, -272(%rbp)
.L61:
	movl	-272(%rbp), %eax
	cmpl	-260(%rbp), %eax
	jl	.L66
	movl	-256(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
