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

```c
#include <stdio.h>
#include <string.h>
#include <math.h>

long calc(char *exp) {
    long tmp=0, ret=0;
    for (int i=0; i<strlen(exp); i++) {
        if (exp[i] != '+')
            tmp *= 10, tmp += exp[i]-'0';
        else 
            ret += tmp, tmp=0;
    }
    return ret+tmp;
}

int main() {
    char s[11] = {};
    scanf("%s", s);
    int len = strlen(s);
    long ans = 0;
    for (int i=0; i<powl(2, len-1); i++) {
        char dst[24]={};
        int k=0;
        for (int t=0 ; t<len; t++, k++) {
            if (i & (1 << (t-1)))
                dst[k++] = '+';
            dst[k] = s[t];
        }
        dst[k] = '\0';
        ans += calc(dst);
    }
    printf("%ld\n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	calc
	.type	calc, @function
calc:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -56(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L5:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$43, %al
	je	.L3
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rax, -32(%rbp)
	jmp	.L4
.L3:
	movq	-32(%rbp), %rax
	addq	%rax, -24(%rbp)
	movq	$0, -32(%rbp)
.L4:
	addl	$1, -36(%rbp)
.L2:
	movl	-36(%rbp), %eax
	movslq	%eax, %rbx
	movq	-56(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L5
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -43(%rbp)
	movw	$0, -35(%rbp)
	movb	$0, -33(%rbp)
	leaq	-43(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-43(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -60(%rbp)
	movq	$0, -56(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L8
.L12:
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L9
.L11:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	movl	-72(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L10
	movl	-68(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -68(%rbp)
	cltq
	movb	$43, -32(%rbp,%rax)
.L10:
	movl	-64(%rbp), %eax
	cltq
	movzbl	-43(%rbp,%rax), %edx
	movl	-68(%rbp), %eax
	cltq
	movb	%dl, -32(%rbp,%rax)
	addl	$1, -64(%rbp)
	addl	$1, -68(%rbp)
.L9:
	movl	-64(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jl	.L11
	movl	-68(%rbp), %eax
	cltq
	movb	$0, -32(%rbp,%rax)
	leaq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	calc
	addq	%rax, -56(%rbp)
	addl	$1, -72(%rbp)
.L8:
	fildl	-72(%rbp)
	fstpt	-96(%rbp)
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100(%rbp)
	fildl	-100(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	fldt	.LC1(%rip)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	powl@PLT
	addq	$32, %rsp
	fldt	-96(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	ja	.L12
	movq	-56(%rbp), %rax
	movq	%rax, %rsi
	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	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 16
.LC1:
	.long	0
	.long	-2147483648
	.long	16384
	.long	0
	.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	calc
	.type	calc, @function
calc:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	call	strlen@PLT
	testq	%rax, %rax
	je	.L6
	leaq	(%rbx,%rax), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	subl	$48, %edx
	leaq	(%rcx,%rcx,4), %rcx
	addq	$1, %rdi
	movslq	%edx, %rdx
	leaq	(%rdx,%rcx,2), %rcx
	cmpq	%rdi, %rsi
	je	.L2
.L5:
	movsbl	(%rdi), %edx
	cmpb	$43, %dl
	jne	.L10
	addq	$1, %rdi
	addq	%rcx, %rax
	xorl	%ecx, %ecx
	cmpq	%rdi, %rsi
	jne	.L5
.L2:
	addq	%rcx, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	popq	%rbx
	.cfi_def_cfa_offset 8
	addq	%rcx, %rax
	ret
	.cfi_endproc
.LFE35:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%edx, %edx
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$1, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	37(%rsp), %rbp
	movw	%dx, 45(%rsp)
	movq	%rbp, %rsi
	movb	$0, 47(%rsp)
	movq	$0, 37(%rsp)
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movl	$-1, %ecx
	movq	%rax, %rbp
	movl	%eax, %r15d
	subl	$1, %eax
	sall	%cl, %ebx
	movl	%eax, (%rsp)
	fildl	(%rsp)
	fstpt	16(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	flds	.LC1(%rip)
	pushq	24(%rsp)
	.cfi_def_cfa_offset 152
	pushq	24(%rsp)
	.cfi_def_cfa_offset 160
	fstpt	16(%rsp)
	movq	16(%rsp), %rax
	movl	24(%rsp), %edx
	pushq	%rdx
	.cfi_def_cfa_offset 168
	pushq	%rax
	.cfi_def_cfa_offset 176
	call	powl@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 144
	movl	%r14d, (%rsp)
	fildl	(%rsp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jbe	.L81
	movq	$0, 64(%rsp)
	pxor	%xmm0, %xmm0
	movaps	%xmm0, 48(%rsp)
	testq	%rbp, %rbp
	je	.L31
	movl	%r14d, %edx
	andl	%ebx, %edx
	je	.L14
	movb	$43, 48(%rsp)
	movl	$1, %edx
.L14:
	movzbl	37(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$1, %r15d
	je	.L13
	testb	$1, %r14b
	je	.L16
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L16:
	movzbl	38(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$2, %r15d
	je	.L35
	testb	$2, %r14b
	je	.L17
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L17:
	movzbl	39(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$3, %r15d
	je	.L13
	testb	$4, %r14b
	je	.L18
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L18:
	movzbl	40(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$4, %r15d
	je	.L35
	testb	$8, %r14b
	je	.L19
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L19:
	movzbl	41(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$5, %r15d
	je	.L13
	testb	$16, %r14b
	je	.L20
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L20:
	movzbl	42(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$6, %r15d
	je	.L35
	testb	$32, %r14b
	je	.L21
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L21:
	movzbl	43(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$7, %r15d
	je	.L13
	testb	$64, %r14b
	je	.L22
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L22:
	movzbl	44(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$8, %r15d
	je	.L35
	testb	$-128, %r14b
	je	.L23
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L23:
	movzbl	45(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$10, %r15d
	jne	.L13
	testl	$256, %r14d
	je	.L24
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L24:
	movzbl	46(%rsp), %ecx
	movslq	%eax, %rdx
	addl	$1, %eax
	movb	%cl, 48(%rsp,%rdx)
.L13:
	leaq	48(%rsp), %r13
	cltq
	movq	%r13, %rdi
	movb	$0, 48(%rsp,%rax)
	call	strlen@PLT
	testq	%rax, %rax
	je	.L36
	movq	%r13, %rcx
	addq	%r13, %rax
	xorl	%edi, %edi
	xorl	%esi, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L82:
	subl	$48, %edx
	leaq	(%rsi,%rsi,4), %rsi
	addq	$1, %rcx
	movslq	%edx, %rdx
	leaq	(%rdx,%rsi,2), %rsi
	cmpq	%rax, %rcx
	je	.L25
.L28:
	movsbl	(%rcx), %edx
	cmpb	$43, %dl
	jne	.L82
	addq	$1, %rcx
	addq	%rsi, %rdi
	xorl	%esi, %esi
	cmpq	%rax, %rcx
	jne	.L28
.L25:
	addq	%rsi, %rdi
	addl	$1, %r14d
	addq	%rdi, %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%edx, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L81:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	addq	$88, %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
.L36:
	.cfi_restore_state
	xorl	%edi, %edi
	xorl	%esi, %esi
	addl	$1, %r14d
	addq	%rsi, %rdi
	addq	%rdi, %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	xorl	%eax, %eax
	jmp	.L13
.L83:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1073741824
	.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	calc
	.type	calc, @function
calc:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	call	strlen@PLT
	testq	%rax, %rax
	je	.L6
	leaq	(%rbx,%rax), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	subl	$48, %edx
	leaq	(%rcx,%rcx,4), %rcx
	addq	$1, %rdi
	movslq	%edx, %rdx
	leaq	(%rdx,%rcx,2), %rcx
	cmpq	%rdi, %rsi
	je	.L2
.L5:
	movsbl	(%rdi), %edx
	cmpb	$43, %dl
	jne	.L10
	addq	$1, %rdi
	addq	%rcx, %rax
	xorl	%ecx, %ecx
	cmpq	%rdi, %rsi
	jne	.L5
.L2:
	addq	%rcx, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	popq	%rbx
	.cfi_def_cfa_offset 8
	addq	%rcx, %rax
	ret
	.cfi_endproc
.LFE35:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%edx, %edx
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$1, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	37(%rsp), %rbp
	movw	%dx, 45(%rsp)
	movq	%rbp, %rsi
	movb	$0, 47(%rsp)
	movq	$0, 37(%rsp)
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movl	$-1, %ecx
	movq	%rax, %rbp
	movl	%eax, %r15d
	subl	$1, %eax
	sall	%cl, %ebx
	movl	%eax, (%rsp)
	fildl	(%rsp)
	fstpt	16(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	flds	.LC1(%rip)
	pushq	24(%rsp)
	.cfi_def_cfa_offset 152
	pushq	24(%rsp)
	.cfi_def_cfa_offset 160
	fstpt	16(%rsp)
	movq	16(%rsp), %rax
	movl	24(%rsp), %edx
	pushq	%rdx
	.cfi_def_cfa_offset 168
	pushq	%rax
	.cfi_def_cfa_offset 176
	call	powl@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 144
	movl	%r14d, (%rsp)
	fildl	(%rsp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	jbe	.L81
	movq	$0, 64(%rsp)
	pxor	%xmm0, %xmm0
	movaps	%xmm0, 48(%rsp)
	testq	%rbp, %rbp
	je	.L31
	movl	%r14d, %edx
	andl	%ebx, %edx
	je	.L14
	movb	$43, 48(%rsp)
	movl	$1, %edx
.L14:
	movzbl	37(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$1, %r15d
	je	.L13
	testb	$1, %r14b
	je	.L16
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L16:
	movzbl	38(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$2, %r15d
	je	.L35
	testb	$2, %r14b
	je	.L17
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L17:
	movzbl	39(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$3, %r15d
	je	.L13
	testb	$4, %r14b
	je	.L18
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L18:
	movzbl	40(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$4, %r15d
	je	.L35
	testb	$8, %r14b
	je	.L19
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L19:
	movzbl	41(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$5, %r15d
	je	.L13
	testb	$16, %r14b
	je	.L20
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L20:
	movzbl	42(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$6, %r15d
	je	.L35
	testb	$32, %r14b
	je	.L21
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L21:
	movzbl	43(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$7, %r15d
	je	.L13
	testb	$64, %r14b
	je	.L22
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L22:
	movzbl	44(%rsp), %ecx
	movslq	%eax, %rdx
	movb	%cl, 48(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	$8, %r15d
	je	.L35
	testb	$-128, %r14b
	je	.L23
	movslq	%edx, %rdx
	movb	$43, 48(%rsp,%rdx)
	leal	2(%rax), %edx
.L23:
	movzbl	45(%rsp), %ecx
	movslq	%edx, %rax
	movb	%cl, 48(%rsp,%rax)
	leal	1(%rdx), %eax
	cmpl	$10, %r15d
	jne	.L13
	testl	$256, %r14d
	je	.L24
	cltq
	movb	$43, 48(%rsp,%rax)
	leal	2(%rdx), %eax
.L24:
	movzbl	46(%rsp), %ecx
	movslq	%eax, %rdx
	addl	$1, %eax
	movb	%cl, 48(%rsp,%rdx)
.L13:
	leaq	48(%rsp), %r13
	cltq
	movq	%r13, %rdi
	movb	$0, 48(%rsp,%rax)
	call	strlen@PLT
	testq	%rax, %rax
	je	.L36
	movq	%r13, %rcx
	addq	%r13, %rax
	xorl	%edi, %edi
	xorl	%esi, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L82:
	subl	$48, %edx
	leaq	(%rsi,%rsi,4), %rsi
	addq	$1, %rcx
	movslq	%edx, %rdx
	leaq	(%rdx,%rsi,2), %rsi
	cmpq	%rax, %rcx
	je	.L25
.L28:
	movsbl	(%rcx), %edx
	cmpb	$43, %dl
	jne	.L82
	addq	$1, %rcx
	addq	%rsi, %rdi
	xorl	%esi, %esi
	cmpq	%rax, %rcx
	jne	.L28
.L25:
	addq	%rsi, %rdi
	addl	$1, %r14d
	addq	%rdi, %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%edx, %eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L81:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	addq	$88, %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
.L36:
	.cfi_restore_state
	xorl	%edi, %edi
	xorl	%esi, %esi
	addl	$1, %r14d
	addq	%rsi, %rdi
	addq	%rdi, %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	xorl	%eax, %eax
	jmp	.L13
.L83:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1073741824
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
#include <math.h>

long calc(char *exp) {
    long tmp=0, ret=0;
    for (int i=0; i<strlen(exp); i++) {
        if (exp[i] != '+')
            tmp *= 10, tmp += exp[i]-'0';
        else 
            ret += tmp, tmp=0;
    }
    return ret+tmp;
}

int main() {
    char s[11] = {};
    scanf("%s", s);
    int len = strlen(s);
    long ans = 0;
    for (int i=0; i<powl(2, len-1); i++) {
        char dst[24]={};
        int k=0;
        for (int t=0 ; t<len; t++, k++) {
            if (i & (1 << (t-1)))
                dst[k++] = '+';
            dst[k] = s[t];
        }
        dst[k] = '\0';
        ans += calc(dst);
    }
    printf("%ld\n", ans);
}
125

176

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

```c
#include <stdio.h>
#include <string.h>
#include <math.h>

long calc(char *exp) {
    long tmp=0, ret=0;
    for (int i=0; i<strlen(exp); i++) {
        if (exp[i] != '+')
            tmp *= 10, tmp += exp[i]-'0';
        else 
            ret += tmp, tmp=0;
    }
    return ret+tmp;
}

int main() {
    char s[11] = {};
    scanf("%s", s);
    int len = strlen(s);
    long ans = 0;
    for (int i=0; i<powl(2, len-1); i++) {
        char dst[24]={};
        int k=0;
        for (int t=0 ; t<len; t++, k++) {
            if (i & (1 << (t-1)))
                dst[k++] = '+';
            dst[k] = s[t];
        }
        dst[k] = '\0';
        ans += calc(dst);
    }
    printf("%ld\n", ans);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	calc
	.type	calc, @function
calc:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -56(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L5:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$43, %al
	je	.L3
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rax, -32(%rbp)
	jmp	.L4
.L3:
	movq	-32(%rbp), %rax
	addq	%rax, -24(%rbp)
	movq	$0, -32(%rbp)
.L4:
	addl	$1, -36(%rbp)
.L2:
	movl	-36(%rbp), %eax
	movslq	%eax, %rbx
	movq	-56(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L5
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -43(%rbp)
	movw	$0, -35(%rbp)
	movb	$0, -33(%rbp)
	leaq	-43(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-43(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -60(%rbp)
	movq	$0, -56(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L8
.L12:
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L9
.L11:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	movl	-72(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L10
	movl	-68(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -68(%rbp)
	cltq
	movb	$43, -32(%rbp,%rax)
.L10:
	movl	-64(%rbp), %eax
	cltq
	movzbl	-43(%rbp,%rax), %edx
	movl	-68(%rbp), %eax
	cltq
	movb	%dl, -32(%rbp,%rax)
	addl	$1, -64(%rbp)
	addl	$1, -68(%rbp)
.L9:
	movl	-64(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jl	.L11
	movl	-68(%rbp), %eax
	cltq
	movb	$0, -32(%rbp,%rax)
	leaq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	calc
	addq	%rax, -56(%rbp)
	addl	$1, -72(%rbp)
.L8:
	fildl	-72(%rbp)
	fstpt	-96(%rbp)
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100(%rbp)
	fildl	-100(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	fldt	.LC1(%rip)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	powl@PLT
	addq	$32, %rsp
	fldt	-96(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	ja	.L12
	movq	-56(%rbp), %rax
	movq	%rax, %rsi
	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	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 16
.LC1:
	.long	0
	.long	-2147483648
	.long	16384
	.long	0
	.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	calc
	.type	calc, @function
calc:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -56(%rbp)
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L5:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$43, %al
	je	.L3
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cltq
	addq	%rax, -32(%rbp)
	jmp	.L4
.L3:
	movq	-32(%rbp), %rax
	addq	%rax, -24(%rbp)
	movq	$0, -32(%rbp)
.L4:
	addl	$1, -36(%rbp)
.L2:
	movl	-36(%rbp), %eax
	movslq	%eax, %rbx
	movq	-56(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L5
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -43(%rbp)
	movw	$0, -35(%rbp)
	movb	$0, -33(%rbp)
	leaq	-43(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-43(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -60(%rbp)
	movq	$0, -56(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L8
.L12:
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L9
.L11:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	movl	-72(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L10
	movl	-68(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -68(%rbp)
	cltq
	movb	$43, -32(%rbp,%rax)
.L10:
	movl	-64(%rbp), %eax
	cltq
	movzbl	-43(%rbp,%rax), %edx
	movl	-68(%rbp), %eax
	cltq
	movb	%dl, -32(%rbp,%rax)
	addl	$1, -64(%rbp)
	addl	$1, -68(%rbp)
.L9:
	movl	-64(%rbp), %eax
	cmpl	-60(%rbp), %eax
	jl	.L11
	movl	-68(%rbp), %eax
	cltq
	movb	$0, -32(%rbp,%rax)
	leaq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	calc
	addq	%rax, -56(%rbp)
	addl	$1, -72(%rbp)
.L8:
	fildl	-72(%rbp)
	fstpt	-96(%rbp)
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -100(%rbp)
	fildl	-100(%rbp)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	fldt	.LC1(%rip)
	leaq	-16(%rsp), %rsp
	fstpt	(%rsp)
	call	powl@PLT
	addq	$32, %rsp
	fldt	-96(%rbp)
	fxch	%st(1)
	fcomip	%st(1), %st
	fstp	%st(0)
	ja	.L12
	movq	-56(%rbp), %rax
	movq	%rax, %rsi
	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	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 16
.LC1:
	.long	0
	.long	-2147483648
	.long	16384
	.long	0
	.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:
