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 ll long long
ll int func(ll a,ll b,ll c){
     if(a/b==0){return a+c;} 
return func(a/b,10,c+a%b)+func(a,b*10,c);
}
int main(){
  ll int a;
  scanf("%lld",&a);
printf("%lld",func(a,10,0));
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	func
	.type	func, @function
func:
.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	testq	%rax, %rax
	jne	.L2
	movq	-24(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	-40(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rcx, %rdx
	movl	$10, %esi
	movq	%rax, %rdi
	call	func
	movq	%rax, %rbx
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	func
	addq	%rbx, %rax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%lld"
	.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	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-16(%rbp), %rax
	movl	$0, %edx
	movl	$10, %esi
	movq	%rax, %rdi
	call	func
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	func
	.type	func, @function
func:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %rax
	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
	movq	%rdx, 200(%rsp)
	cqto
	idivq	%rsi
	movq	%rdi, 136(%rsp)
	movq	%rsi, 144(%rsp)
	movq	$0, 184(%rsp)
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L4
	movabsq	$7378697629483820647, %r11
.L2:
	movq	136(%rsp), %rax
	movq	$0, 192(%rsp)
	movq	$10, 112(%rsp)
	cqto
	idivq	144(%rsp)
	movq	16(%rsp), %rax
	addq	200(%rsp), %rdx
	movq	%rdx, 152(%rsp)
	imulq	%r11
	sarq	$2, %rdx
	movq	%rdx, %rax
	movq	16(%rsp), %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, 24(%rsp)
	je	.L6
.L3:
	movq	16(%rsp), %rax
	cqto
	idivq	112(%rsp)
	movq	24(%rsp), %rax
	addq	152(%rsp), %rdx
	movq	%rdx, 160(%rsp)
	imulq	%r11
	sarq	$2, %rdx
	movq	%rdx, %rax
	movq	24(%rsp), %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, 80(%rsp)
	je	.L8
	movq	%rax, 32(%rsp)
	movq	$0, 80(%rsp)
	movq	$10, 120(%rsp)
.L5:
	movq	24(%rsp), %rax
	movq	$0, 176(%rsp)
	movq	$10, 128(%rsp)
	cqto
	idivq	120(%rsp)
	movq	32(%rsp), %rax
	addq	160(%rsp), %rdx
	movq	%rdx, 168(%rsp)
	imulq	%r11
	sarq	$2, %rdx
	movq	%rdx, %rax
	movq	32(%rsp), %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, %r14
	je	.L10
.L7:
	movq	32(%rsp), %rax
	movl	$10, %r9d
	movq	$0, 48(%rsp)
	cqto
	idivq	128(%rsp)
	movq	%r14, %rax
	addq	168(%rsp), %rdx
	movq	%rdx, 40(%rsp)
	imulq	%r11
	movq	%rdx, %rax
	movq	%r14, %rdx
	sarq	$2, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	je	.L12
	movq	%r14, 8(%rsp)
	movq	%rax, %r13
	movq	%r9, %r10
.L9:
	movq	8(%rsp), %rax
	xorl	%ebp, %ebp
	movl	$10, %r9d
	cqto
	idivq	%r10
	movq	%r13, %rax
	addq	40(%rsp), %rdx
	movq	%rdx, (%rsp)
	imulq	%r11
	movq	%r13, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	movq	%rdx, %r8
	je	.L14
	movq	%r10, 64(%rsp)
.L11:
	movq	$0, 104(%rsp)
	movq	%r13, %rax
	movq	$10, 96(%rsp)
	cqto
	idivq	%r9
	movq	%r8, %rax
	addq	(%rsp), %rdx
	movq	%rdx, 88(%rsp)
	imulq	%r11
	movq	%r8, %rax
	sarq	$63, %rax
	movq	%rdx, %r12
	sarq	$2, %r12
	subq	%rax, %r12
	je	.L16
	movq	%r9, 72(%rsp)
.L13:
	movq	%r8, %rax
	cqto
	idivq	96(%rsp)
	movq	%r12, %rax
	addq	88(%rsp), %rdx
	movq	%rdx, 56(%rsp)
	imulq	%r11
	movq	%r12, %rax
	sarq	$63, %rax
	movq	%rdx, %rcx
	sarq	$2, %rcx
	subq	%rax, %rcx
	je	.L18
	movq	%rcx, %rbx
	movl	$10, %r15d
	xorl	%ecx, %ecx
	movq	%r13, %r9
	movq	%rbp, %r10
.L15:
	movq	%r12, %rax
	xorl	%r13d, %r13d
	movl	$10, %ebp
	cqto
	idivq	%r15
	movq	56(%rsp), %rax
	leaq	(%rdx,%rax), %r14
	movq	%rbx, %rax
	imulq	%r11
	movq	%rbx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rdi
	subq	%rax, %rdi
	je	.L19
.L17:
	movq	%rbx, %rax
	movl	$10, %esi
	movq	%r8, 232(%rsp)
	cqto
	movq	%rcx, 224(%rsp)
	idivq	%rbp
	movq	%r10, 216(%rsp)
	movq	%r9, 208(%rsp)
	leaq	0(%rbp,%rbp,4), %rbp
	addq	%rbp, %rbp
	addq	%r14, %rdx
	call	func
	movq	208(%rsp), %r9
	movq	216(%rsp), %r10
	movabsq	$7378697629483820647, %r11
	addq	%rax, %r13
	movq	%rbx, %rax
	movq	224(%rsp), %rcx
	movq	232(%rsp), %r8
	cqto
	idivq	%rbp
	testq	%rax, %rax
	movq	%rax, %rdi
	jne	.L17
.L19:
	leaq	(%r14,%rbx), %rax
	leaq	(%r15,%r15,4), %r15
	addq	%r13, %rax
	addq	%r15, %r15
	addq	%rax, %rcx
	movq	%r12, %rax
	cqto
	idivq	%r15
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	.L15
	movq	%r9, %r13
	movq	%r10, %rbp
.L18:
	movq	96(%rsp), %rax
	addq	56(%rsp), %r12
	addq	%rcx, %r12
	addq	104(%rsp), %r12
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rsi
	movq	%r8, %rax
	cqto
	movq	%rsi, 96(%rsp)
	idivq	%rsi
	testq	%rax, %rax
	je	.L68
	movq	%r12, 104(%rsp)
	movq	%rax, %r12
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L68:
	movq	72(%rsp), %r9
.L16:
	movq	88(%rsp), %rax
	leaq	(%r9,%r9,4), %r9
	addq	%r9, %r9
	addq	%r8, %rax
	addq	%r12, %rax
	addq	%rax, %rbp
	movq	%r13, %rax
	cqto
	idivq	%r9
	movq	%rax, %r8
	testq	%rax, %rax
	jne	.L11
	movq	64(%rsp), %r10
.L14:
	leaq	(%r10,%r10,4), %rax
	leaq	(%rax,%rax), %r10
	movq	(%rsp), %rax
	addq	%r13, %rax
	addq	%rbp, %rax
	addq	%rax, 48(%rsp)
	movq	8(%rsp), %rax
	cqto
	idivq	%r10
	movq	%rax, %r13
	testq	%rax, %rax
	jne	.L9
	movq	8(%rsp), %r14
.L12:
	movq	128(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rbx
	movq	40(%rsp), %rax
	movq	%rbx, 128(%rsp)
	addq	%r14, %rax
	addq	48(%rsp), %rax
	addq	%rax, 176(%rsp)
	movq	32(%rsp), %rax
	cqto
	idivq	%rbx
	movq	%rax, %r14
	testq	%rax, %rax
	jne	.L7
.L10:
	movq	120(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rsi
	movq	168(%rsp), %rax
	addq	32(%rsp), %rax
	addq	176(%rsp), %rax
	addq	%rax, 80(%rsp)
	movq	24(%rsp), %rax
	movq	%rsi, 120(%rsp)
	cqto
	idivq	%rsi
	movq	%rax, 32(%rsp)
	testq	%rax, %rax
	jne	.L5
.L8:
	movq	112(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rcx
	movq	160(%rsp), %rax
	addq	24(%rsp), %rax
	addq	80(%rsp), %rax
	addq	192(%rsp), %rax
	movq	%rcx, 112(%rsp)
	movq	%rax, 24(%rsp)
	movq	%rax, %rsi
	movq	16(%rsp), %rax
	cqto
	idivq	%rcx
	testq	%rax, %rax
	je	.L6
	movq	%rsi, 192(%rsp)
	movq	%rax, 24(%rsp)
	jmp	.L3
.L6:
	movq	144(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rdi
	movq	152(%rsp), %rax
	addq	16(%rsp), %rax
	addq	24(%rsp), %rax
	addq	184(%rsp), %rax
	movq	%rdi, 144(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, %rsi
	movq	136(%rsp), %rax
	cqto
	idivq	%rdi
	testq	%rax, %rax
	je	.L4
	movq	%rsi, 184(%rsp)
	movq	%rax, 16(%rsp)
	jmp	.L2
.L4:
	movq	136(%rsp), %rax
	addq	200(%rsp), %rax
	addq	16(%rsp), %rax
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdi
	xorl	%edx, %edx
	movl	$10, %esi
	call	func
	movq	%rbp, %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L75
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L75:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %rax
	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
	movq	%rdx, 200(%rsp)
	cqto
	idivq	%rsi
	movq	%rdi, 136(%rsp)
	movq	%rsi, 144(%rsp)
	movq	$0, 184(%rsp)
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L4
	movabsq	$7378697629483820647, %r11
.L2:
	movq	136(%rsp), %rax
	movq	$0, 192(%rsp)
	movq	$10, 112(%rsp)
	cqto
	idivq	144(%rsp)
	movq	16(%rsp), %rax
	addq	200(%rsp), %rdx
	movq	%rdx, 152(%rsp)
	imulq	%r11
	sarq	$2, %rdx
	movq	%rdx, %rax
	movq	16(%rsp), %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, 24(%rsp)
	je	.L6
.L3:
	movq	16(%rsp), %rax
	cqto
	idivq	112(%rsp)
	movq	24(%rsp), %rax
	addq	152(%rsp), %rdx
	movq	%rdx, 160(%rsp)
	imulq	%r11
	sarq	$2, %rdx
	movq	%rdx, %rax
	movq	24(%rsp), %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, 80(%rsp)
	je	.L8
	movq	%rax, 32(%rsp)
	movq	$0, 80(%rsp)
	movq	$10, 120(%rsp)
.L5:
	movq	24(%rsp), %rax
	movq	$0, 176(%rsp)
	movq	$10, 128(%rsp)
	cqto
	idivq	120(%rsp)
	movq	32(%rsp), %rax
	addq	160(%rsp), %rdx
	movq	%rdx, 168(%rsp)
	imulq	%r11
	sarq	$2, %rdx
	movq	%rdx, %rax
	movq	32(%rsp), %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, %r14
	je	.L10
.L7:
	movq	32(%rsp), %rax
	movl	$10, %r9d
	movq	$0, 48(%rsp)
	cqto
	idivq	128(%rsp)
	movq	%r14, %rax
	addq	168(%rsp), %rdx
	movq	%rdx, 40(%rsp)
	imulq	%r11
	movq	%rdx, %rax
	movq	%r14, %rdx
	sarq	$2, %rax
	sarq	$63, %rdx
	subq	%rdx, %rax
	je	.L12
	movq	%r14, 8(%rsp)
	movq	%rax, %r13
	movq	%r9, %r10
.L9:
	movq	8(%rsp), %rax
	xorl	%ebp, %ebp
	movl	$10, %r9d
	cqto
	idivq	%r10
	movq	%r13, %rax
	addq	40(%rsp), %rdx
	movq	%rdx, (%rsp)
	imulq	%r11
	movq	%r13, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	movq	%rdx, %r8
	je	.L14
	movq	%r10, 64(%rsp)
.L11:
	movq	$0, 104(%rsp)
	movq	%r13, %rax
	movq	$10, 96(%rsp)
	cqto
	idivq	%r9
	movq	%r8, %rax
	addq	(%rsp), %rdx
	movq	%rdx, 88(%rsp)
	imulq	%r11
	movq	%r8, %rax
	sarq	$63, %rax
	movq	%rdx, %r12
	sarq	$2, %r12
	subq	%rax, %r12
	je	.L16
	movq	%r9, 72(%rsp)
.L13:
	movq	%r8, %rax
	cqto
	idivq	96(%rsp)
	movq	%r12, %rax
	addq	88(%rsp), %rdx
	movq	%rdx, 56(%rsp)
	imulq	%r11
	movq	%r12, %rax
	sarq	$63, %rax
	movq	%rdx, %rcx
	sarq	$2, %rcx
	subq	%rax, %rcx
	je	.L18
	movq	%rcx, %rbx
	movl	$10, %r15d
	xorl	%ecx, %ecx
	movq	%r13, %r9
	movq	%rbp, %r10
.L15:
	movq	%r12, %rax
	xorl	%r13d, %r13d
	movl	$10, %ebp
	cqto
	idivq	%r15
	movq	56(%rsp), %rax
	leaq	(%rdx,%rax), %r14
	movq	%rbx, %rax
	imulq	%r11
	movq	%rbx, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rdi
	subq	%rax, %rdi
	je	.L19
.L17:
	movq	%rbx, %rax
	movl	$10, %esi
	movq	%r8, 232(%rsp)
	cqto
	movq	%rcx, 224(%rsp)
	idivq	%rbp
	movq	%r10, 216(%rsp)
	movq	%r9, 208(%rsp)
	leaq	0(%rbp,%rbp,4), %rbp
	addq	%rbp, %rbp
	addq	%r14, %rdx
	call	func
	movq	208(%rsp), %r9
	movq	216(%rsp), %r10
	movabsq	$7378697629483820647, %r11
	addq	%rax, %r13
	movq	%rbx, %rax
	movq	224(%rsp), %rcx
	movq	232(%rsp), %r8
	cqto
	idivq	%rbp
	testq	%rax, %rax
	movq	%rax, %rdi
	jne	.L17
.L19:
	leaq	(%r14,%rbx), %rax
	leaq	(%r15,%r15,4), %r15
	addq	%r13, %rax
	addq	%r15, %r15
	addq	%rax, %rcx
	movq	%r12, %rax
	cqto
	idivq	%r15
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	.L15
	movq	%r9, %r13
	movq	%r10, %rbp
.L18:
	movq	96(%rsp), %rax
	addq	56(%rsp), %r12
	addq	%rcx, %r12
	addq	104(%rsp), %r12
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rsi
	movq	%r8, %rax
	cqto
	movq	%rsi, 96(%rsp)
	idivq	%rsi
	testq	%rax, %rax
	je	.L68
	movq	%r12, 104(%rsp)
	movq	%rax, %r12
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L68:
	movq	72(%rsp), %r9
.L16:
	movq	88(%rsp), %rax
	leaq	(%r9,%r9,4), %r9
	addq	%r9, %r9
	addq	%r8, %rax
	addq	%r12, %rax
	addq	%rax, %rbp
	movq	%r13, %rax
	cqto
	idivq	%r9
	movq	%rax, %r8
	testq	%rax, %rax
	jne	.L11
	movq	64(%rsp), %r10
.L14:
	leaq	(%r10,%r10,4), %rax
	leaq	(%rax,%rax), %r10
	movq	(%rsp), %rax
	addq	%r13, %rax
	addq	%rbp, %rax
	addq	%rax, 48(%rsp)
	movq	8(%rsp), %rax
	cqto
	idivq	%r10
	movq	%rax, %r13
	testq	%rax, %rax
	jne	.L9
	movq	8(%rsp), %r14
.L12:
	movq	128(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rbx
	movq	40(%rsp), %rax
	movq	%rbx, 128(%rsp)
	addq	%r14, %rax
	addq	48(%rsp), %rax
	addq	%rax, 176(%rsp)
	movq	32(%rsp), %rax
	cqto
	idivq	%rbx
	movq	%rax, %r14
	testq	%rax, %rax
	jne	.L7
.L10:
	movq	120(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rsi
	movq	168(%rsp), %rax
	addq	32(%rsp), %rax
	addq	176(%rsp), %rax
	addq	%rax, 80(%rsp)
	movq	24(%rsp), %rax
	movq	%rsi, 120(%rsp)
	cqto
	idivq	%rsi
	movq	%rax, 32(%rsp)
	testq	%rax, %rax
	jne	.L5
.L8:
	movq	112(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rcx
	movq	160(%rsp), %rax
	addq	24(%rsp), %rax
	addq	80(%rsp), %rax
	addq	192(%rsp), %rax
	movq	%rcx, 112(%rsp)
	movq	%rax, 24(%rsp)
	movq	%rax, %rsi
	movq	16(%rsp), %rax
	cqto
	idivq	%rcx
	testq	%rax, %rax
	je	.L6
	movq	%rsi, 192(%rsp)
	movq	%rax, 24(%rsp)
	jmp	.L3
.L6:
	movq	144(%rsp), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax), %rdi
	movq	152(%rsp), %rax
	addq	16(%rsp), %rax
	addq	24(%rsp), %rax
	addq	184(%rsp), %rax
	movq	%rdi, 144(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, %rsi
	movq	136(%rsp), %rax
	cqto
	idivq	%rdi
	testq	%rax, %rax
	je	.L4
	movq	%rsi, 184(%rsp)
	movq	%rax, 16(%rsp)
	jmp	.L2
.L4:
	movq	136(%rsp), %rax
	addq	200(%rsp), %rax
	addq	16(%rsp), %rax
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdi
	xorl	%edx, %edx
	movl	$10, %esi
	call	func
	movq	%rbp, %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L75
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L75:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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>
#define ll long long
ll int func(ll a,ll b,ll c){
     if(a/b==0){return a+c;} 
return func(a/b,10,c+a%b)+func(a,b*10,c);
}
int main(){
  ll int a;
  scanf("%lld",&a);
printf("%lld",func(a,10,0));
  return 0;
}
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>
#define ll long long
ll int func(ll a,ll b,ll c){
     if(a/b==0){return a+c;} 
return func(a/b,10,c+a%b)+func(a,b*10,c);
}
int main(){
  ll int a;
  scanf("%lld",&a);
printf("%lld",func(a,10,0));
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	func
	.type	func, @function
func:
.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	testq	%rax, %rax
	jne	.L2
	movq	-24(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	-40(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rcx, %rdx
	movl	$10, %esi
	movq	%rax, %rdi
	call	func
	movq	%rax, %rbx
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	func
	addq	%rbx, %rax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%lld"
	.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	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-16(%rbp), %rax
	movl	$0, %edx
	movl	$10, %esi
	movq	%rax, %rdi
	call	func
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	func
	.type	func, @function
func:
.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	testq	%rax, %rax
	jne	.L2
	movq	-24(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	-40(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-24(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rcx, %rdx
	movl	$10, %esi
	movq	%rax, %rdi
	call	func
	movq	%rax, %rbx
	movq	-32(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rcx
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	func
	addq	%rbx, %rax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%lld"
	.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	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-16(%rbp), %rax
	movl	$0, %edx
	movl	$10, %esi
	movq	%rax, %rdi
	call	func
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
