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

```c
#include <stdio.h>
int main()
 {

	unsigned long long n,a,b,sum1,sum2=0,i,vagfol,rem;;
	scanf("%llu%llu%llu",&n,&a,&b);
	for(i=a;i<=n;i++)
        {
            vagfol=i;
            sum1=0;
    while(vagfol!=0)
    {
           rem=vagfol%10;
        vagfol=vagfol/10;
        sum1+=rem;
    }
    if(sum1<=b&&sum1>=a){sum2+=i;}
	}
	printf("%llu",sum2);

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%llu%llu%llu"
.LC1:
	.string	"%llu"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-56(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L2
.L6:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L3
.L4:
	movq	-24(%rbp), %rcx
	movabsq	$-3689348814741910323, %rdx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$3, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	%rdx, -16(%rbp)
	movq	-24(%rbp), %rax
	movabsq	$-3689348814741910323, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$3, %rax
	movq	%rax, -24(%rbp)
	movq	-16(%rbp), %rax
	addq	%rax, -48(%rbp)
.L3:
	cmpq	$0, -24(%rbp)
	jne	.L4
	movq	-56(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	ja	.L5
	movq	-64(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	jb	.L5
	movq	-32(%rbp), %rax
	addq	%rax, -40(%rbp)
.L5:
	addq	$1, -32(%rbp)
.L2:
	movq	-72(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jbe	.L6
	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	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"%llu%llu%llu"
.LC1:
	.string	"%llu"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %r11
	movq	(%rsp), %rbx
	cmpq	%rbx, %r11
	ja	.L8
	movq	16(%rsp), %rbp
	movq	%r11, %r9
	xorl	%r10d, %r10d
	movabsq	$-3689348814741910323, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r9, %rcx
	xorl	%edi, %edi
	movl	$1, %eax
	testq	%r9, %r9
	je	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rcx, %rax
	mulq	%r8
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rsi
	movq	%rdx, %rax
	movq	%rcx, %rdx
	addq	%rsi, %rsi
	subq	%rsi, %rdx
	movq	%rcx, %rsi
	movq	%rax, %rcx
	addq	%rdx, %rdi
	cmpq	$9, %rsi
	ja	.L4
	cmpq	%rdi, %rbp
	setnb	%al
.L6:
	cmpq	%rdi, %r11
	ja	.L5
	leaq	(%r10,%r9), %rdx
	testb	%al, %al
	cmovne	%rdx, %r10
.L5:
	addq	$1, %r9
	cmpq	%rbx, %r9
	jbe	.L3
.L2:
	xorl	%eax, %eax
	movq	%r10, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L2
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%llu%llu%llu"
.LC1:
	.string	"%llu"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %r11
	movq	(%rsp), %rbx
	cmpq	%rbx, %r11
	ja	.L8
	movq	16(%rsp), %rbp
	movq	%r11, %r9
	xorl	%r10d, %r10d
	movabsq	$-3689348814741910323, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r9, %rcx
	xorl	%edi, %edi
	movl	$1, %eax
	testq	%r9, %r9
	je	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rcx, %rax
	mulq	%r8
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rsi
	movq	%rdx, %rax
	movq	%rcx, %rdx
	addq	%rsi, %rsi
	subq	%rsi, %rdx
	movq	%rcx, %rsi
	movq	%rax, %rcx
	addq	%rdx, %rdi
	cmpq	$9, %rsi
	ja	.L4
	cmpq	%rdi, %rbp
	setnb	%al
.L6:
	cmpq	%rdi, %r11
	ja	.L5
	leaq	(%r10,%r9), %rdx
	testb	%al, %al
	cmovne	%rdx, %r10
.L5:
	addq	$1, %r9
	cmpq	%rbx, %r9
	jbe	.L3
.L2:
	xorl	%eax, %eax
	movq	%r10, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L2
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
int main()
 {

	unsigned long long n,a,b,sum1,sum2=0,i,vagfol,rem;;
	scanf("%llu%llu%llu",&n,&a,&b);
	for(i=a;i<=n;i++)
        {
            vagfol=i;
            sum1=0;
    while(vagfol!=0)
    {
           rem=vagfol%10;
        vagfol=vagfol/10;
        sum1+=rem;
    }
    if(sum1<=b&&sum1>=a){sum2+=i;}
	}
	printf("%llu",sum2);

}

10 1 0
 20 2 6
 100 4 12
 20 3 6
 100 5 12
 20 1 6
 37 2 6
 101 3 12
 37 1 6
 37 1 9

0 105 3146 72 3036 116 321 3212 332 590
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main()
 {

	unsigned long long n,a,b,sum1,sum2=0,i,vagfol,rem;;
	scanf("%llu%llu%llu",&n,&a,&b);
	for(i=a;i<=n;i++)
        {
            vagfol=i;
            sum1=0;
    while(vagfol!=0)
    {
           rem=vagfol%10;
        vagfol=vagfol/10;
        sum1+=rem;
    }
    if(sum1<=b&&sum1>=a){sum2+=i;}
	}
	printf("%llu",sum2);

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%llu%llu%llu"
.LC1:
	.string	"%llu"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-56(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L2
.L6:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L3
.L4:
	movq	-24(%rbp), %rcx
	movabsq	$-3689348814741910323, %rdx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$3, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	%rdx, -16(%rbp)
	movq	-24(%rbp), %rax
	movabsq	$-3689348814741910323, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$3, %rax
	movq	%rax, -24(%rbp)
	movq	-16(%rbp), %rax
	addq	%rax, -48(%rbp)
.L3:
	cmpq	$0, -24(%rbp)
	jne	.L4
	movq	-56(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	ja	.L5
	movq	-64(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	jb	.L5
	movq	-32(%rbp), %rax
	addq	%rax, -40(%rbp)
.L5:
	addq	$1, -32(%rbp)
.L2:
	movq	-72(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jbe	.L6
	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	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"%llu%llu%llu"
.LC1:
	.string	"%llu"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -40(%rbp)
	leaq	-56(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L2
.L6:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L3
.L4:
	movq	-24(%rbp), %rcx
	movabsq	$-3689348814741910323, %rdx
	movq	%rcx, %rax
	mulq	%rdx
	shrq	$3, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movq	%rdx, -16(%rbp)
	movq	-24(%rbp), %rax
	movabsq	$-3689348814741910323, %rdx
	mulq	%rdx
	movq	%rdx, %rax
	shrq	$3, %rax
	movq	%rax, -24(%rbp)
	movq	-16(%rbp), %rax
	addq	%rax, -48(%rbp)
.L3:
	cmpq	$0, -24(%rbp)
	jne	.L4
	movq	-56(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	ja	.L5
	movq	-64(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	jb	.L5
	movq	-32(%rbp), %rax
	addq	%rax, -40(%rbp)
.L5:
	addq	$1, -32(%rbp)
.L2:
	movq	-72(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jbe	.L6
	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	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
