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

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long int

int main(void) {
    char s[11];
    scanf("%s", s);
    int n = (int)strlen(s);
    ll total = 0, a;
    int b;
    for(int i = 0; i < n; i++) {
        a = 0;
        for(int j = i; j < n; j++) {
            a = 10 * a + s[j] - '0';
            b = n - 1 - (j - i);
            if(i > 0) b--;
            if(j + 1 < n) b--;
            total += a << b;
        }
    }
    printf("%lld\n", total);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-19(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -44(%rbp)
	movq	$0, -40(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L7:
	movq	$0, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L3
.L6:
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movl	-48(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movsbq	%al, %rax
	addq	%rdx, %rax
	subq	$48, %rax
	movq	%rax, -32(%rbp)
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-48(%rbp), %eax
	subl	-52(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -56(%rbp)
	cmpl	$0, -52(%rbp)
	jle	.L4
	subl	$1, -56(%rbp)
.L4:
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -44(%rbp)
	jle	.L5
	subl	$1, -56(%rbp)
.L5:
	movl	-56(%rbp), %eax
	movq	-32(%rbp), %rdx
	movl	%eax, %ecx
	salq	%cl, %rdx
	movq	%rdx, %rax
	addq	%rax, -40(%rbp)
	addl	$1, -48(%rbp)
.L3:
	movl	-48(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L6
	addl	$1, -52(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L7
	movq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	45(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L10
	movl	$1, %esi
	movl	%eax, %edx
	leal	-1(%rax), %r15d
	movq	%rbx, %r9
	subl	%eax, %esi
	leal	-2(%rax), %r14d
	leal	-3(%rax), %eax
	movl	$4, %r13d
	movl	%eax, 4(%rsp)
	leal	-4(%rdx), %eax
	movl	$5, %edi
	xorl	%r8d, %r8d
	movl	%eax, 8(%rsp)
	leal	-8(%rdx), %eax
	movl	$3, %ebp
	xorl	%ebx, %ebx
	movl	%eax, 12(%rsp)
	leal	-9(%rdx), %eax
	movl	$2, %r11d
	movl	%eax, 16(%rsp)
	leal	-10(%rdx), %eax
	movl	%eax, 20(%rsp)
	leal	-11(%rdx), %eax
	movl	%eax, 28(%rsp)
	leal	-7(%rdx), %eax
	movl	%eax, 24(%rsp)
	movl	%r13d, (%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movsbq	(%r9), %rax
	movl	%edi, %r10d
	subq	$48, %rax
	subl	$5, %r10d
	je	.L34
	leal	-4(%rdi), %ecx
	cmpl	%ecx, %edx
	jle	.L35
	movzbl	4(%rsp), %ecx
	movq	%rax, %r12
	salq	%cl, %r12
	leaq	(%rax,%rax,4), %rcx
	movsbq	1(%r9), %rax
	addq	%r12, %r8
	leal	1(%rdi), %r12d
	leaq	-48(%rax,%rcx,2), %rax
	cmpl	%r11d, %edx
	jle	.L7
	movzbl	8(%rsp), %ecx
	movq	%rax, %r13
	salq	%cl, %r13
	leaq	(%rax,%rax,4), %rcx
	movsbq	2(%r9), %rax
	addq	%r13, %r8
	movl	%r15d, %r13d
	leaq	-48(%rax,%rcx,2), %rax
	movl	%r11d, %ecx
	subl	%r10d, %ecx
	subl	%ecx, %r13d
	cmpl	%ebp, %edx
	jle	.L7
	movl	%r13d, %ecx
	movq	%rax, %r13
	subl	$2, %ecx
	salq	%cl, %r13
	leaq	(%rax,%rax,4), %rcx
	movsbq	3(%r9), %rax
	addq	%r13, %r8
	movl	%r15d, %r13d
	leaq	-48(%rax,%rcx,2), %rax
	movl	%ebp, %ecx
	subl	%r10d, %ecx
	subl	%ecx, %r13d
	cmpl	(%rsp), %edx
	jle	.L7
	movl	%r13d, %ecx
	movq	%rax, %r13
	subl	$2, %ecx
	salq	%cl, %r13
	leaq	(%rax,%rax,4), %rcx
	movsbq	4(%r9), %rax
	addq	%r13, %r8
	movl	%r15d, %r13d
	leaq	-48(%rax,%rcx,2), %rax
	movl	(%rsp), %ecx
	subl	%r10d, %ecx
	subl	%ecx, %r13d
	cmpl	%edi, %edx
	jle	.L7
	movl	%r13d, %ecx
	movq	%rax, %r13
	subl	$2, %ecx
	imulq	$10, %rax, %rax
	salq	%cl, %r13
	movsbq	5(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	%r12d, %edx
	jle	.L7
	movzbl	12(%rsp), %ecx
	movq	%rax, %r13
	imulq	$10, %rax, %rax
	salq	%cl, %r13
	movsbq	6(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	leal	2(%rdi), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movzbl	16(%rsp), %ecx
	movq	%rax, %r13
	imulq	$10, %rax, %rax
	salq	%cl, %r13
	movsbq	7(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	leal	3(%rdi), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movzbl	20(%rsp), %ecx
	movq	%rax, %r13
	imulq	$10, %rax, %rax
	addl	$4, %edi
	salq	%cl, %r13
	movsbq	8(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	%edi, %edx
	jle	.L7
	movzbl	28(%rsp), %ecx
	movq	%rax, %rdi
	imulq	$10, %rax, %rax
	salq	%cl, %rdi
	movsbq	9(%r9), %rcx
	addq	%rdi, %r8
	leaq	-48(%rax,%rcx), %rax
	.p2align 4,,10
	.p2align 3
.L7:
	cmpl	%r10d, %edx
	movl	%ebx, %ecx
	cmovg	%esi, %ecx
	addl	%r14d, %ecx
.L6:
	salq	%cl, %rax
	addl	$1, %esi
	addl	$1, (%rsp)
	addq	$1, %r9
	addq	%rax, %r8
	addl	$1, %r11d
	addl	$1, %ebp
	movl	%r12d, %edi
	cmpl	$1, %esi
	jne	.L8
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$72, %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
.L34:
	.cfi_restore_state
	cmpl	$1, %edx
	je	.L4
	movq	%rax, %r10
	movl	%r14d, %ecx
	salq	%cl, %r10
	leaq	(%rax,%rax,4), %rcx
	movsbq	1(%r9), %rax
	addq	%r10, %r8
	leaq	-48(%rax,%rcx,2), %rax
	cmpl	%r11d, %edx
	jle	.L4
	movzbl	4(%rsp), %ecx
	movq	%rax, %r10
	salq	%cl, %r10
	leaq	(%rax,%rax,4), %rcx
	movsbq	2(%r9), %rax
	addq	%r10, %r8
	leaq	-48(%rax,%rcx,2), %rax
	movl	%r15d, %ecx
	subl	%r11d, %ecx
	cmpl	%ebp, %edx
	jle	.L4
	subl	$1, %ecx
	movq	%rax, %r10
	movl	(%rsp), %r12d
	salq	%cl, %r10
	leaq	(%rax,%rax,4), %rcx
	movsbq	3(%r9), %rax
	addq	%r10, %r8
	leaq	-48(%rax,%rcx,2), %rax
	movl	%r15d, %ecx
	subl	%ebp, %ecx
	cmpl	%r12d, %edx
	jle	.L4
	subl	$1, %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	4(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	movl	%r15d, %ecx
	subl	%r12d, %ecx
	cmpl	$5, %edx
	je	.L4
	subl	$1, %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	5(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$6, %edx
	je	.L4
	movzbl	24(%rsp), %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	6(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$7, %edx
	je	.L4
	movzbl	12(%rsp), %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	7(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$8, %edx
	je	.L4
	movzbl	16(%rsp), %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	8(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$10, %edx
	jne	.L4
	addq	%rax, %r8
	imulq	$10, %rax, %rax
	movsbq	9(%r9), %rcx
	leaq	-48(%rax,%rcx), %rax
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%edx, %edx
	movl	%ebx, %ecx
	leal	1(%rdi), %r12d
	cmovg	%esi, %ecx
	addl	%r15d, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L35:
	leal	1(%rdi), %r12d
	jmp	.L7
.L10:
	xorl	%r8d, %r8d
	jmp	.L2
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	45(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L10
	movl	$1, %esi
	movl	%eax, %edx
	leal	-1(%rax), %r15d
	movq	%rbx, %r9
	subl	%eax, %esi
	leal	-2(%rax), %r14d
	leal	-3(%rax), %eax
	movl	$4, %r13d
	movl	%eax, 4(%rsp)
	leal	-4(%rdx), %eax
	movl	$5, %edi
	xorl	%r8d, %r8d
	movl	%eax, 8(%rsp)
	leal	-8(%rdx), %eax
	movl	$3, %ebp
	xorl	%ebx, %ebx
	movl	%eax, 12(%rsp)
	leal	-9(%rdx), %eax
	movl	$2, %r11d
	movl	%eax, 16(%rsp)
	leal	-10(%rdx), %eax
	movl	%eax, 20(%rsp)
	leal	-11(%rdx), %eax
	movl	%eax, 28(%rsp)
	leal	-7(%rdx), %eax
	movl	%eax, 24(%rsp)
	movl	%r13d, (%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movsbq	(%r9), %rax
	movl	%edi, %r10d
	subq	$48, %rax
	subl	$5, %r10d
	je	.L34
	leal	-4(%rdi), %ecx
	cmpl	%ecx, %edx
	jle	.L35
	movzbl	4(%rsp), %ecx
	movq	%rax, %r12
	salq	%cl, %r12
	leaq	(%rax,%rax,4), %rcx
	movsbq	1(%r9), %rax
	addq	%r12, %r8
	leal	1(%rdi), %r12d
	leaq	-48(%rax,%rcx,2), %rax
	cmpl	%r11d, %edx
	jle	.L7
	movzbl	8(%rsp), %ecx
	movq	%rax, %r13
	salq	%cl, %r13
	leaq	(%rax,%rax,4), %rcx
	movsbq	2(%r9), %rax
	addq	%r13, %r8
	movl	%r15d, %r13d
	leaq	-48(%rax,%rcx,2), %rax
	movl	%r11d, %ecx
	subl	%r10d, %ecx
	subl	%ecx, %r13d
	cmpl	%ebp, %edx
	jle	.L7
	movl	%r13d, %ecx
	movq	%rax, %r13
	subl	$2, %ecx
	salq	%cl, %r13
	leaq	(%rax,%rax,4), %rcx
	movsbq	3(%r9), %rax
	addq	%r13, %r8
	movl	%r15d, %r13d
	leaq	-48(%rax,%rcx,2), %rax
	movl	%ebp, %ecx
	subl	%r10d, %ecx
	subl	%ecx, %r13d
	cmpl	(%rsp), %edx
	jle	.L7
	movl	%r13d, %ecx
	movq	%rax, %r13
	subl	$2, %ecx
	salq	%cl, %r13
	leaq	(%rax,%rax,4), %rcx
	movsbq	4(%r9), %rax
	addq	%r13, %r8
	movl	%r15d, %r13d
	leaq	-48(%rax,%rcx,2), %rax
	movl	(%rsp), %ecx
	subl	%r10d, %ecx
	subl	%ecx, %r13d
	cmpl	%edi, %edx
	jle	.L7
	movl	%r13d, %ecx
	movq	%rax, %r13
	subl	$2, %ecx
	imulq	$10, %rax, %rax
	salq	%cl, %r13
	movsbq	5(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	%r12d, %edx
	jle	.L7
	movzbl	12(%rsp), %ecx
	movq	%rax, %r13
	imulq	$10, %rax, %rax
	salq	%cl, %r13
	movsbq	6(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	leal	2(%rdi), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movzbl	16(%rsp), %ecx
	movq	%rax, %r13
	imulq	$10, %rax, %rax
	salq	%cl, %r13
	movsbq	7(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	leal	3(%rdi), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movzbl	20(%rsp), %ecx
	movq	%rax, %r13
	imulq	$10, %rax, %rax
	addl	$4, %edi
	salq	%cl, %r13
	movsbq	8(%r9), %rcx
	addq	%r13, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	%edi, %edx
	jle	.L7
	movzbl	28(%rsp), %ecx
	movq	%rax, %rdi
	imulq	$10, %rax, %rax
	salq	%cl, %rdi
	movsbq	9(%r9), %rcx
	addq	%rdi, %r8
	leaq	-48(%rax,%rcx), %rax
	.p2align 4,,10
	.p2align 3
.L7:
	cmpl	%r10d, %edx
	movl	%ebx, %ecx
	cmovg	%esi, %ecx
	addl	%r14d, %ecx
.L6:
	salq	%cl, %rax
	addl	$1, %esi
	addl	$1, (%rsp)
	addq	$1, %r9
	addq	%rax, %r8
	addl	$1, %r11d
	addl	$1, %ebp
	movl	%r12d, %edi
	cmpl	$1, %esi
	jne	.L8
.L2:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$72, %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
.L34:
	.cfi_restore_state
	cmpl	$1, %edx
	je	.L4
	movq	%rax, %r10
	movl	%r14d, %ecx
	salq	%cl, %r10
	leaq	(%rax,%rax,4), %rcx
	movsbq	1(%r9), %rax
	addq	%r10, %r8
	leaq	-48(%rax,%rcx,2), %rax
	cmpl	%r11d, %edx
	jle	.L4
	movzbl	4(%rsp), %ecx
	movq	%rax, %r10
	salq	%cl, %r10
	leaq	(%rax,%rax,4), %rcx
	movsbq	2(%r9), %rax
	addq	%r10, %r8
	leaq	-48(%rax,%rcx,2), %rax
	movl	%r15d, %ecx
	subl	%r11d, %ecx
	cmpl	%ebp, %edx
	jle	.L4
	subl	$1, %ecx
	movq	%rax, %r10
	movl	(%rsp), %r12d
	salq	%cl, %r10
	leaq	(%rax,%rax,4), %rcx
	movsbq	3(%r9), %rax
	addq	%r10, %r8
	leaq	-48(%rax,%rcx,2), %rax
	movl	%r15d, %ecx
	subl	%ebp, %ecx
	cmpl	%r12d, %edx
	jle	.L4
	subl	$1, %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	4(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	movl	%r15d, %ecx
	subl	%r12d, %ecx
	cmpl	$5, %edx
	je	.L4
	subl	$1, %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	5(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$6, %edx
	je	.L4
	movzbl	24(%rsp), %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	6(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$7, %edx
	je	.L4
	movzbl	12(%rsp), %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	7(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$8, %edx
	je	.L4
	movzbl	16(%rsp), %ecx
	movq	%rax, %r10
	imulq	$10, %rax, %rax
	salq	%cl, %r10
	movsbq	8(%r9), %rcx
	addq	%r10, %r8
	leaq	-48(%rax,%rcx), %rax
	cmpl	$10, %edx
	jne	.L4
	addq	%rax, %r8
	imulq	$10, %rax, %rax
	movsbq	9(%r9), %rcx
	leaq	-48(%rax,%rcx), %rax
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%edx, %edx
	movl	%ebx, %ecx
	leal	1(%rdi), %r12d
	cmovg	%esi, %ecx
	addl	%r15d, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L35:
	leal	1(%rdi), %r12d
	jmp	.L7
.L10:
	xorl	%r8d, %r8d
	jmp	.L2
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long int

int main(void) {
    char s[11];
    scanf("%s", s);
    int n = (int)strlen(s);
    ll total = 0, a;
    int b;
    for(int i = 0; i < n; i++) {
        a = 0;
        for(int j = i; j < n; j++) {
            a = 10 * a + s[j] - '0';
            b = n - 1 - (j - i);
            if(i > 0) b--;
            if(j + 1 < n) b--;
            total += a << b;
        }
    }
    printf("%lld\n", total);
    return 0;
}

88
 131
 189
 292
 348
 260
 11
 16
 0
 1

104
 182
 324
 430
 456
 356
 13
 23
 0
 1

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long int

int main(void) {
    char s[11];
    scanf("%s", s);
    int n = (int)strlen(s);
    ll total = 0, a;
    int b;
    for(int i = 0; i < n; i++) {
        a = 0;
        for(int j = i; j < n; j++) {
            a = 10 * a + s[j] - '0';
            b = n - 1 - (j - i);
            if(i > 0) b--;
            if(j + 1 < n) b--;
            total += a << b;
        }
    }
    printf("%lld\n", total);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-19(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -44(%rbp)
	movq	$0, -40(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L7:
	movq	$0, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L3
.L6:
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movl	-48(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movsbq	%al, %rax
	addq	%rdx, %rax
	subq	$48, %rax
	movq	%rax, -32(%rbp)
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-48(%rbp), %eax
	subl	-52(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -56(%rbp)
	cmpl	$0, -52(%rbp)
	jle	.L4
	subl	$1, -56(%rbp)
.L4:
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -44(%rbp)
	jle	.L5
	subl	$1, -56(%rbp)
.L5:
	movl	-56(%rbp), %eax
	movq	-32(%rbp), %rdx
	movl	%eax, %ecx
	salq	%cl, %rdx
	movq	%rdx, %rax
	addq	%rax, -40(%rbp)
	addl	$1, -48(%rbp)
.L3:
	movl	-48(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L6
	addl	$1, -52(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L7
	movq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-19(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -44(%rbp)
	movq	$0, -40(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L2
.L7:
	movq	$0, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L3
.L6:
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movl	-48(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movsbq	%al, %rax
	addq	%rdx, %rax
	subq	$48, %rax
	movq	%rax, -32(%rbp)
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-48(%rbp), %eax
	subl	-52(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -56(%rbp)
	cmpl	$0, -52(%rbp)
	jle	.L4
	subl	$1, -56(%rbp)
.L4:
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -44(%rbp)
	jle	.L5
	subl	$1, -56(%rbp)
.L5:
	movl	-56(%rbp), %eax
	movq	-32(%rbp), %rdx
	movl	%eax, %ecx
	salq	%cl, %rdx
	movq	%rdx, %rax
	addq	%rax, -40(%rbp)
	addl	$1, -48(%rbp)
.L3:
	movl	-48(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L6
	addl	$1, -52(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L7
	movq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
